apeiros changed the topic of #ruby to: Ruby 2.2.1; 2.1.5; 2.0.0-p643: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || this channel is logged at http://irclog.whitequark.org, other public logging is prohibited
n80 has quit [Quit: n80]
GnuYawk has quit [Quit: WeeChat 1.0]
GnuYawk has joined #ruby
juanpablo_ has joined #ruby
allcentury has quit [Ping timeout: 246 seconds]
plashchynski has quit [Quit: plashchynski]
bklane has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
bklane has joined #ruby
Soda has quit [Remote host closed the connection]
dfinninger has quit [Remote host closed the connection]
FooMunki_ has joined #ruby
Zai00 has quit [Quit: Zai00]
Azure has joined #ruby
baweaver has joined #ruby
dfinninger has joined #ruby
sevvie has quit [Ping timeout: 256 seconds]
zachrab has joined #ruby
sevvie has joined #ruby
ghostpl_ has joined #ruby
alem0lars has joined #ruby
juanpablo_ has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby
yqt has quit [Ping timeout: 252 seconds]
dfinninger has quit [Ping timeout: 244 seconds]
plashchynski has joined #ruby
kaiZen has joined #ruby
jespada has quit [Ping timeout: 252 seconds]
OrbitalKitten has quit [Quit: Textual IRC Client: www.textualapp.com]
rbennacer has joined #ruby
dandaman has quit [Quit: Leaving.]
Sawbones has joined #ruby
ghr has quit [Ping timeout: 264 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ismaelga has joined #ruby
jespada has joined #ruby
spider-mario has quit [Ping timeout: 252 seconds]
IrishGringo has joined #ruby
rbennacer has quit [Ping timeout: 240 seconds]
scripore has quit [Quit: This computer has gone to sleep]
DrShoggoth has joined #ruby
adriancb has joined #ruby
dandaman has joined #ruby
Takle has quit [Ping timeout: 256 seconds]
<mwlang> I want to replace a library’s method with my own, do my thing as if that method was called, then call the original method. How do I do this? In Pascal parlance, it was called method chaining and you simply saved the pointer to the original method somewhere and set the pointer to your own method and that allowed your method to get called instead of the original. In ruby parlance, “method chaining” means calling one method after anothe
<mwlang> tandem, so I have the wrong terminology for sure.
mikeric has quit [Read error: Connection reset by peer]
scripore has joined #ruby
Sawbones has quit [Remote host closed the connection]
dstarh has joined #ruby
jenrzzz has joined #ruby
delianides has joined #ruby
apxm has joined #ruby
<jhass> mwlang: why is there no alternative design and which ruby versions do you need to support
workmad3 has quit [Ping timeout: 256 seconds]
Takle has joined #ruby
roolo_ has quit [Remote host closed the connection]
n80 has joined #ruby
delianides has quit [Remote host closed the connection]
roolo has joined #ruby
IrishGringo_ has joined #ruby
havenwood has quit [Remote host closed the connection]
roolo has quit [Remote host closed the connection]
delianides has joined #ruby
<mwlang> jhass: I’m basically going to stub the call to my LDAP server so that I capture the server’s actual response when the “cassette” doesn’t exist yet. If the cassette exists, I just return the contents of the cassette, otherwise, I pass-thru to the original method
scripore has quit [Client Quit]
tier has joined #ruby
IrishGringo has quit [Ping timeout: 256 seconds]
<jhass> seems brittle, but given what I've seen from that app, it makes no diff anymore I guess. Second question?
adriancb has quit [Remote host closed the connection]
Wolland has joined #ruby
<mwlang> jhass: Ruby 2.1+
<jhass> implement your method in a module and prepend (not include) it into the class
sevenseacat has joined #ruby
<jhass> then you can just call super in your implementation
roolo has joined #ruby
<mwlang> jhass: only brittle if LDAP 2.0 standards are going to change any time soon.
* mwlang goes to look up “prepend ruby”
bklane has quit [Remote host closed the connection]
ismaelga has quit [Remote host closed the connection]
martin_work has joined #ruby
<jhass> I'm talking in terms of code maintenance and quality
IrishGringo_ has quit [Client Quit]
Azure has quit [Read error: Connection reset by peer]
IrishGringo has joined #ruby
<jhass> >> module B; def foo; super.upcase; end; end; class A; prepend B; def foo "original"; end; end; A.new.foo
<eval-in_> jhass => /tmp/execpad-da1da4edd042/source-da1da4edd042:2: syntax error, unexpected tSTRING_BEG, expecting ';' or '\n' ... (https://eval.in/297950)
<jhass> >> module B; def foo; super.upcase; end; end; class A; prepend B; def foo; "original"; end; end; A.new.foo
<eval-in_> jhass => "ORIGINAL" (https://eval.in/297951)
wallerdev has quit [Quit: wallerdev]
Azure has joined #ruby
scripore has joined #ruby
scripore has quit [Client Quit]
mistermocha has quit [Read error: Connection reset by peer]
<mwlang> ah….”memoization” is what I’m chasing.
mistermocha has joined #ruby
bklane has joined #ruby
roolo has quit [Ping timeout: 245 seconds]
<mwlang> jhass: its a test-suite hack. If you got a better pattern for implementing, I’m all ears.
doodlehaus has joined #ruby
Mon_Ouie has quit [Ping timeout: 252 seconds]
martin_work has quit [Client Quit]
<jhass> abstracting the library calls into an adapter and making the actual adapter used a parameter of your actual code, then you could just implement a variant for the test
<jhass> some call that dependency injection I guess
justin_pdx has quit [Quit: justin_pdx]
n80 has quit [Quit: n80]
bklane has quit [Remote host closed the connection]
<mwlang> jhass: yeah, that’s a little more than I need here. the prepend approach will work nicely and its readable.
mistermocha has quit [Ping timeout: 244 seconds]
karmatr0n has quit [Read error: Connection reset by peer]
karmatr0n has joined #ruby
Mon_Ouie has joined #ruby
tkuchiki has joined #ruby
tubuliferous has quit [Read error: Connection reset by peer]
spider-mario has joined #ruby
spider-mario_ has joined #ruby
adriancb has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__adam has joined #ruby
Takle has quit [Remote host closed the connection]
Aswebb_ has joined #ruby
kblake has quit [Ping timeout: 245 seconds]
RegulationD has joined #ruby
spider-mario has quit [Ping timeout: 255 seconds]
__adam_ has joined #ruby
allcentury has joined #ruby
sean_1 has joined #ruby
hmsimha has quit [Ping timeout: 252 seconds]
jespada has quit [Ping timeout: 246 seconds]
RegulationD has quit [Ping timeout: 250 seconds]
__adam_ has quit [Client Quit]
Aswebb_ has quit [Ping timeout: 272 seconds]
__adam has quit [Ping timeout: 264 seconds]
__adam_ has joined #ruby
sean_1 has left #ruby ["Konversation terminated!"]
freerobby has joined #ruby
ismaelga has joined #ruby
Sawbones has joined #ruby
krasnus has joined #ruby
lkba_ has quit [Ping timeout: 255 seconds]
igorshp has quit [Ping timeout: 246 seconds]
__adam_ is now known as __adam
doodlehaus has quit [Remote host closed the connection]
delianides has quit []
plashchynski has quit [Quit: plashchynski]
tier has quit [Remote host closed the connection]
reinaldob has joined #ruby
adriancb has quit [Remote host closed the connection]
atomiccc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 272 seconds]
yh has quit [Ping timeout: 256 seconds]
n80 has joined #ruby
wallerdev has joined #ruby
heyimwill has joined #ruby
nii236 has joined #ruby
tkuchiki_ has joined #ruby
tkuchiki has quit [Ping timeout: 252 seconds]
scripore has joined #ruby
nii236 has quit [Client Quit]
spider-mario_ has quit [Ping timeout: 256 seconds]
nii236 has joined #ruby
doodlehaus has joined #ruby
aspiers has quit [Ping timeout: 252 seconds]
DLSteve has quit [Quit: Textual IRC Client: www.textualapp.com]
baweaver has quit [Remote host closed the connection]
otisZart has quit [Quit: Textual IRC Client: www.textualapp.com]
zachrab has quit [Remote host closed the connection]
spider-mario has joined #ruby
zachrab has joined #ruby
__adam has quit [Remote host closed the connection]
adriancb has joined #ruby
karmatr0n has quit [Ping timeout: 246 seconds]
pandaant has quit [Remote host closed the connection]
tvw has quit []
tvw has joined #ruby
zachrab has quit [Ping timeout: 252 seconds]
techietrash has joined #ruby
cpt_yossarian has joined #ruby
zachrab has joined #ruby
it0a has quit [Ping timeout: 246 seconds]
thumpba has quit [Ping timeout: 250 seconds]
graydot has quit [Remote host closed the connection]
MatthewsFace has quit [Remote host closed the connection]
iteratorP has joined #ruby
unreal has quit [Ping timeout: 246 seconds]
Sawbones has quit [Remote host closed the connection]
granitosaurus has quit [Ping timeout: 256 seconds]
Sawbones has joined #ruby
n80 has quit [Ping timeout: 246 seconds]
RegulationD has joined #ruby
binfalse has joined #ruby
zachrab has quit [Read error: Connection reset by peer]
plashchynski has joined #ruby
zachrab has joined #ruby
hmsimha has joined #ruby
yh has joined #ruby
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spider-mario has quit [Ping timeout: 250 seconds]
Hijiri has quit [Quit: WeeChat 1.0.1]
jonr22 has quit [Remote host closed the connection]
Lactobacillus has left #ruby [#ruby]
commmmodo has quit [Read error: Connection reset by peer]
commmmodo has joined #ruby
bklane has joined #ruby
mistermocha has joined #ruby
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zacts has joined #ruby
__adam_ has joined #ruby
deric_skibotn has quit [Ping timeout: 264 seconds]
cphrmky has quit [Read error: Connection reset by peer]
plashchynski has quit [Quit: plashchynski]
plashchynski has joined #ruby
justin_pdx has joined #ruby
bradleyprice has joined #ruby
bklane has quit []
jenrzzz has quit [Ping timeout: 264 seconds]
cpt_yossarian has quit [Ping timeout: 245 seconds]
__adam_ has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
Hobogrammer has joined #ruby
Hijiri has joined #ruby
mistermo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
martin_work has joined #ruby
pietr0 has quit [Quit: pietr0]
marr has quit [Ping timeout: 252 seconds]
tag has quit [Remote host closed the connection]
dc_ has quit [Remote host closed the connection]
Sawbones has quit [Remote host closed the connection]
towski_ has quit [Remote host closed the connection]
unreal has joined #ruby
adriancb has quit [Read error: Connection reset by peer]
dorei has quit []
adriancb has joined #ruby
Dolphi has joined #ruby
<a5i> Are there any browsers written in Ruby?
jshultz has quit [Quit: Connection closed for inactivity]
justin_pdx has quit [Quit: justin_pdx]
jonr22 has joined #ruby
<wallerdev> actual browsers?
TheNet has quit [Quit: Leaving...]
<wallerdev> or browser interfaces
<wallerdev> like just the rendering engine alone is complicated that there arent many written
<a5i> actual browsers
doodlehaus has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 245 seconds]
zacts has quit [Quit: leaving]
AlphaTech|AWAY is now known as AlphaTech
MatthewsFace has joined #ruby
dstarh has joined #ruby
nii236 has quit [Ping timeout: 246 seconds]
allcentury has quit [Ping timeout: 265 seconds]
spider-mario has joined #ruby
freerobby has joined #ruby
cpt_yossarian has joined #ruby
jottr has joined #ruby
<a5i> there is none?
TheRinger has joined #ruby
zacts has joined #ruby
robustus has quit [Ping timeout: 264 seconds]
Takle has joined #ruby
zachrab has quit [Remote host closed the connection]
zachrab has joined #ruby
mistermocha has joined #ruby
mistermo_ has quit [Read error: Connection reset by peer]
gregf has quit [Quit: WeeChat 1.1.1]
robustus has joined #ruby
DavidDudson has joined #ruby
plashchynski has quit [Quit: plashchynski]
erts has quit []
gphummer has quit [Quit: gphummer]
jespada has joined #ruby
Takle has quit [Ping timeout: 264 seconds]
gphummer has joined #ruby
gphummer has quit [Client Quit]
nii236 has joined #ruby
VBlizzard has joined #ruby
VBlizzard has quit [Max SendQ exceeded]
zachrab has quit [Ping timeout: 252 seconds]
plashchynski has joined #ruby
juanpaucar has joined #ruby
_blizzy_ has quit [Ping timeout: 255 seconds]
techietrash has quit [Quit: Bye! <(^_^<)]
dfinninger has joined #ruby
jespada has quit [Ping timeout: 252 seconds]
Rephiax_ has joined #ruby
reinaldob has quit [Remote host closed the connection]
havenwood has joined #ruby
DavidDud_ has joined #ruby
juanpaucar has quit [Ping timeout: 250 seconds]
DavidDud_ has quit [Client Quit]
spider-mario has quit [Ping timeout: 252 seconds]
justin_pdx has joined #ruby
mistermo_ has joined #ruby
jin_ has joined #ruby
JoshGlzBrk has joined #ruby
Rephiax has quit [Ping timeout: 240 seconds]
juanpablo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
<mwlang> I can’t quite get the reg-exp to extract “just this” from the following string: “"CN=just this,OU=Users,DC=US,DC=TEST,DC=com" Basically, I want everything between “CN=“ and first comma that occurs. Here’s my attempt: str.scan(/^CN\=(.*)\,/) => [[“just this,OU=Users,DC=US,DC=TEST,DC=com”]]
jin_ has quit [Read error: Connection reset by peer]
DavidDudson has quit [Ping timeout: 255 seconds]
spider-mario has joined #ruby
DavidDudson has joined #ruby
jenrzzz has joined #ruby
<jefus> mwlang: look into greedy matching in regex
<jefus> i'm not an expert so this is just a trip, try something like /^CN=[^,]+/
<jefus> just a tip*
<jefus> /^CN=([^,]+)/ rather
wallerdev has quit [Quit: wallerdev]
<mwlang> jefus: thanks…that got it.
<jefus> (.*) by itself will eat too much
<mwlang> as well as cn = Regexp.new(/^CN\=([^\,]*)/)
juanpablo_ has quit [Ping timeout: 246 seconds]
<jefus> thus is greedy
<jefus> cool, np
dfinninger has quit [Remote host closed the connection]
<mwlang> yours is probably more correct
<mwlang> since there will always be at least one alphanumeric before that comma.
bruno- has quit [Ping timeout: 250 seconds]
<jefus> right, in that case probably pretty much the same thing
vozcelik has joined #ruby
Joufflu has joined #ruby
Dolphi has quit [Quit: Leaving]
millerti has quit [Ping timeout: 244 seconds]
jlast has joined #ruby
martin_work has quit [Ping timeout: 255 seconds]
plashchynski has quit [Quit: plashchynski]
iamjarvo has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
DavidDudson has quit [Read error: Connection reset by peer]
dfinninger has joined #ruby
rcs has quit [Ping timeout: 264 seconds]
DavidDudson has joined #ruby
sivsushruth has quit [Ping timeout: 256 seconds]
kaiZen has quit [Quit: Computer has gone to sleep.]
mistermo_ has quit [Read error: Connection reset by peer]
rrrutr has quit [Ping timeout: 264 seconds]
mistermocha has joined #ruby
adriancb_ has joined #ruby
vozcelik has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
adriancb has quit [Read error: Connection reset by peer]
adriancb_ has quit [Remote host closed the connection]
dfinninger has quit [Ping timeout: 246 seconds]
vozcelik has joined #ruby
adriancb has joined #ruby
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
vozcelik has quit [Client Quit]
rcs has joined #ruby
maletor has joined #ruby
ItSANgo has quit [Read error: Connection reset by peer]
pandaant has joined #ruby
ItSANgo has joined #ruby
jenrzzz has joined #ruby
adriancb has quit [Ping timeout: 265 seconds]
<godd2> You can make * non-greedy with a following ?
<godd2> >> "CN=just this,OU=Users,DC=US,DC=TEST,DC=com".scan(/^CN\=(.*?)\,/)
<eval-in_> godd2 => [["just this"]] (https://eval.in/297966)
jottr has quit [Ping timeout: 272 seconds]
DavidDudson has quit [Ping timeout: 252 seconds]
<jefus> ah right
<godd2> It's also "faster" because the regex engine doesn't do as much backtracking
<shevy> huh
<shevy> we have a ruby-2.2.pc file these days? a pkgconfig file
<shevy> I suddenly noticed this in pkgconfig directory
<godd2> 32 minute talk on the Ruby regex engine: https://www.youtube.com/watch?v=JfwS4ibJFDw
DavidDudson has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
scripore has quit [Read error: Connection reset by peer]
scripore has joined #ruby
<jefus> thanks godd2
mistermocha has quit [Ping timeout: 245 seconds]
ghostpl_ has quit [Remote host closed the connection]
maletor has joined #ruby
Megtastique has quit []
jottr has joined #ruby
nii236 has quit [Ping timeout: 245 seconds]
tus has quit []
martinbmadsen has quit [Ping timeout: 256 seconds]
einarj has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
nii236 has joined #ruby
zorak8 has quit [Read error: Connection reset by peer]
zorak8 has joined #ruby
_blizzy_ has joined #ruby
fenzil has joined #ruby
nicolastarzia has quit [Remote host closed the connection]
martinbmadsen has joined #ruby
<Yzguy> how does one deal with single quotes in LDAP DN
<Yzguy> aka a last name of O'Neil
vozcelik has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
einarj has quit [Ping timeout: 256 seconds]
AndyBotwin has joined #ruby
adriancb has joined #ruby
RegulationD has quit [Remote host closed the connection]
dfinninger has joined #ruby
yfeldblum has quit [Remote host closed the connection]
Yzguy has quit [Quit: I'm bouncing outta here!]
claptor has joined #ruby
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DavidDudson has quit [Ping timeout: 264 seconds]
RegulationD has joined #ruby
nii236 has quit [Ping timeout: 252 seconds]
sevvie has quit [Ping timeout: 265 seconds]
k776 has joined #ruby
zachrab has joined #ruby
hmsimha has quit [Ping timeout: 252 seconds]
vozcelik has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sevvie has joined #ruby
k776 has left #ruby [#ruby]
vozcelik has joined #ruby
pragmatism has joined #ruby
nii236 has joined #ruby
vozcelik has quit [Client Quit]
zachrab has quit [Ping timeout: 245 seconds]
oo_ has joined #ruby
DavidDudson has joined #ruby
pontiki has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pontiki> o/
commmmodo has quit [Read error: Connection reset by peer]
vozcelik has joined #ruby
commmmodo has joined #ruby
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<godd2> \o
<shevy> ~o~
<pontiki> oooowiggly arms
vozcelik has quit [Max SendQ exceeded]
Hijiri has quit [Quit: WeeChat 1.0.1]
iamjarvo has joined #ruby
krz has joined #ruby
JoshGlzBrk has joined #ruby
<shevy> flapping like a bird
<shevy> singing like a cow
<shevy> dancing like a cat
JoshGlzBrk has quit [Client Quit]
juanpablo_ has joined #ruby
dandaman has quit [Quit: Leaving.]
krz has quit [Client Quit]
krz has joined #ruby
Megtastique has joined #ruby
Megtastique has quit [Max SendQ exceeded]
dandaman has joined #ruby
Megtastique has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
Spami has quit [Quit: This computer has gone to sleep]
Spami has joined #ruby
juanpablo_ has quit [Ping timeout: 250 seconds]
Spami has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
amystephen has quit [Quit: amystephen]
maletor has quit [Quit: Computer has gone to sleep.]
IrishGringo has quit [Remote host closed the connection]
ikeike443 has quit [Quit: Leaving...]
yh has quit [Ping timeout: 256 seconds]
ramfjord has quit [Ping timeout: 252 seconds]
adriancb has quit [Read error: Connection reset by peer]
Mon_Ouie has quit [Ping timeout: 246 seconds]
adriancb has joined #ruby
lemur has joined #ruby
lessless has joined #ruby
nettoweb has joined #ruby
chrishough has joined #ruby
millerti has joined #ruby
blazes816 has joined #ruby
bim has quit [Remote host closed the connection]
it0a has joined #ruby
defrang has joined #ruby
nettoweb has quit [Client Quit]
justin_pdx has quit [Quit: justin_pdx]
Megtastique has quit []
ikeike443 has joined #ruby
it0a has quit [Client Quit]
tcrypt has quit [Ping timeout: 245 seconds]
jespada has joined #ruby
blazes816 has quit [Ping timeout: 256 seconds]
lee_ has quit [Quit: Connection closed for inactivity]
jww42 has quit [Remote host closed the connection]
jww42 has joined #ruby
FooMunki_ has quit [Quit: FooMunki_]
jespada has quit [Ping timeout: 246 seconds]
reinaldob has joined #ruby
ghostpl_ has joined #ruby
amclain has joined #ruby
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
jottr has joined #ruby
hmsimha has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
jww42 has quit [Ping timeout: 250 seconds]
reinaldob has quit [Ping timeout: 245 seconds]
Channel6 has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
jottr has joined #ruby
pork_clips has joined #ruby
nettoweb has joined #ruby
nettoweb has quit [Client Quit]
jerematic has joined #ruby
jonr22 has quit [Remote host closed the connection]
arescorpio has joined #ruby
_cake has quit [Ping timeout: 264 seconds]
jerematic has quit [Remote host closed the connection]
jordanm has joined #ruby
ghostpl_ has quit [Ping timeout: 252 seconds]
doodlehaus has joined #ruby
JoshGlzBrk has joined #ruby
braincra- has joined #ruby
juanpaucar has joined #ruby
JoshGlzBrk has quit [Client Quit]
claptor has quit [Remote host closed the connection]
claptor has joined #ruby
tvw has quit [Remote host closed the connection]
braincrash has quit [Ping timeout: 264 seconds]
Mia has quit [Read error: Connection reset by peer]
basiclaser has quit [Quit: Connection closed for inactivity]
jottr has quit [Ping timeout: 256 seconds]
doodlehaus has quit [Ping timeout: 240 seconds]
JoshGlzBrk has joined #ruby
Sawbones has joined #ruby
markfletcher has joined #ruby
juanpaucar has quit [Ping timeout: 240 seconds]
Asher has joined #ruby
Asher has quit [Client Quit]
dfinninger has quit [Remote host closed the connection]
Cadillactica has joined #ruby
markfletcher has left #ruby [#ruby]
lemur has quit [Read error: Connection reset by peer]
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
adriancb has quit [Read error: Connection reset by peer]
lemur has joined #ruby
dandaman has quit [Ping timeout: 256 seconds]
Joufflu has quit [Read error: Connection reset by peer]
adriancb has joined #ruby
vdamewood has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
Joufflu has joined #ruby
Sawbones has quit [Remote host closed the connection]
heyimwill has quit [Ping timeout: 272 seconds]
krasnus has quit [Ping timeout: 272 seconds]
mrdtt has joined #ruby
mleung has quit [Ping timeout: 244 seconds]
justin_pdx has joined #ruby
<Cadillactica> I want to find where the #times method is defined in the Ruby docs… how would I go about doing that?
maximski has joined #ruby
pontiki has quit [Ping timeout: 256 seconds]
SirFunk has quit [Quit: ZNC - http://znc.in]
SirFunk has joined #ruby
mrdtt has quit [Quit: Textual IRC Client: www.textualapp.com]
yh has joined #ruby
nii236 has quit [Ping timeout: 244 seconds]
a5i has quit [Quit: Connection closed for inactivity]
defrang has quit [Read error: Connection reset by peer]
rrrutr has joined #ruby
yh has quit [Ping timeout: 250 seconds]
adriancb has quit [Read error: Connection reset by peer]
defrang has joined #ruby
livingstn has joined #ruby
justin_pdx has quit [Quit: justin_pdx]
ramfjord has joined #ruby
yfeldblum has joined #ruby
braincra- has quit [Quit: bye bye]
boshhead has quit [Ping timeout: 265 seconds]
bim has joined #ruby
adriancb has joined #ruby
End_ has joined #ruby
Wolland has quit []
commmmodo has quit [Quit: commmmodo]
braincrash has joined #ruby
maximski has quit []
bim has quit [Ping timeout: 264 seconds]
Aswebb_ has joined #ruby
adriancb has quit [Remote host closed the connection]
Cache_Money has joined #ruby
alem0lars has quit [Ping timeout: 252 seconds]
Cadillactica has quit [Quit: Cadillactica]
mrdtt has joined #ruby
jww42 has joined #ruby
Aswebb_ has quit [Ping timeout: 272 seconds]
ascarter_ has quit [Ping timeout: 245 seconds]
alem0lars has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JoshGlzBrk has quit [Read error: Connection reset by peer]
JoshGlzB_ has joined #ruby
dys has quit [Ping timeout: 272 seconds]
jww42 has quit [Ping timeout: 246 seconds]
Sawbones has joined #ruby
zachrab has joined #ruby
tvon has joined #ruby
jin_ has joined #ruby
jlast has quit [Remote host closed the connection]
vt102 has quit [Ping timeout: 250 seconds]
Hijiri has joined #ruby
bluOxigen has joined #ruby
zachrab has quit [Ping timeout: 272 seconds]
jin_ has quit [Remote host closed the connection]
tvon has quit [Client Quit]
mikecmpbll has quit [Read error: Connection reset by peer]
blueOxigen has joined #ruby
mikecmpbll has joined #ruby
sevvie has quit [Ping timeout: 240 seconds]
tvon has joined #ruby
bluOxigen has quit [Ping timeout: 250 seconds]
kyb3r_ has joined #ruby
juanpablo_ has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
craigp has joined #ruby
juanpablo_ has quit [Ping timeout: 264 seconds]
ismaelga has quit [Ping timeout: 264 seconds]
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sudog has quit [Ping timeout: 250 seconds]
jonathanwallace has quit [Ping timeout: 252 seconds]
GnuYawk has quit [Ping timeout: 255 seconds]
vdamewood has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sudog has joined #ruby
bluOxigen has joined #ruby
blueOxigen has quit [Ping timeout: 245 seconds]
astrobunny has joined #ruby
defrang has quit [Read error: Connection reset by peer]
defrang has joined #ruby
craigp has quit [Remote host closed the connection]
yh has joined #ruby
dfinninger has joined #ruby
defrang has quit [Read error: Connection reset by peer]
jespada has joined #ruby
nii236 has joined #ruby
defrang has joined #ruby
yh has quit [Ping timeout: 255 seconds]
skinny_much has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cache_Money has quit [Quit: Cache_Money]
krz has quit [Ping timeout: 264 seconds]
heyimwill has joined #ruby
jespada has quit [Ping timeout: 250 seconds]
Nuck has quit [Quit: Textual IRC Client: www.textualapp.com]
sevvie has joined #ruby
bruno- has joined #ruby
jlast has joined #ruby
fenzil has quit [Ping timeout: 245 seconds]
bim has joined #ruby
krz has joined #ruby
krasnus has joined #ruby
CorySimmons has joined #ruby
defrang has quit [Read error: Connection reset by peer]
bruno- has quit [Ping timeout: 244 seconds]
ghostpl_ has joined #ruby
defrang has joined #ruby
Mon_Ouie has joined #ruby
mistermocha has joined #ruby
oo_ has quit [Remote host closed the connection]
bim has quit [Ping timeout: 256 seconds]
jonr22 has joined #ruby
jlast has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
chrishough has joined #ruby
mistermocha has quit [Ping timeout: 256 seconds]
jonr22 has quit [Ping timeout: 256 seconds]
juanpaucar has joined #ruby
dseitz has joined #ruby
ghostpl_ has quit [Ping timeout: 264 seconds]
jww42 has joined #ruby
justin_pdx has joined #ruby
justin_pdx has quit [Client Quit]
juanpaucar has quit [Ping timeout: 246 seconds]
krz has quit [Quit: WeeChat 1.0.1]
justin_pdx has joined #ruby
Channel6 has quit [Quit: Leaving]
krz has joined #ruby
sevvie has quit [Ping timeout: 244 seconds]
RegulationD has quit [Remote host closed the connection]
karmatr0n has joined #ruby
justin_pdx has quit [Client Quit]
Renich has joined #ruby
Rephiax has joined #ruby
dseitz has quit [Read error: Connection reset by peer]
jww42 has quit [Ping timeout: 264 seconds]
dseitz has joined #ruby
doodlehaus has joined #ruby
Rephiax_ has quit [Ping timeout: 244 seconds]
jottr has joined #ruby
rrrutr has quit [Ping timeout: 264 seconds]
ramfjord has quit [Ping timeout: 264 seconds]
sevvie has joined #ruby
vdamewood has joined #ruby
doodlehaus has quit [Ping timeout: 245 seconds]
jottr has quit [Ping timeout: 256 seconds]
vdamewood has quit [Max SendQ exceeded]
jenrzzz has joined #ruby
GnuYawk has joined #ruby
narcan has joined #ruby
vdamewood has joined #ruby
pontiki has joined #ruby
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
arup_r has joined #ruby
arescorpio has quit [Excess Flood]
jottr has joined #ruby
arup_r has quit [Remote host closed the connection]
pontiki has quit [Ping timeout: 244 seconds]
teddyp1cker has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
arup_r has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
lxsameer has joined #ruby
Matadoer is now known as matadoer
CorySimmons has quit [Quit: Bye!]
lkba has joined #ruby
RegulationD has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
jin_ has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
commmmodo has joined #ruby
Aswebb_ has joined #ruby
commmmodo has quit [Client Quit]
nii236 has quit [Ping timeout: 252 seconds]
buub has joined #ruby
pragmatism has quit [Ping timeout: 240 seconds]
lemur has quit [Remote host closed the connection]
markholmes has joined #ruby
Aswebb_ has quit [Ping timeout: 272 seconds]
RegulationD has quit [Remote host closed the connection]
sivsushruth has joined #ruby
multi_io_ has joined #ruby
malcolmva has quit [Ping timeout: 246 seconds]
markholmes has quit [Quit: Textual IRC Client: www.textualapp.com]
mrdtt has quit [Quit: Textual IRC Client: www.textualapp.com]
piotrj has joined #ruby
millerti has joined #ruby
multi_io has quit [Ping timeout: 256 seconds]
wldcordeiro has joined #ruby
RegulationD has joined #ruby
GnuYawk has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
millerti has quit [Ping timeout: 246 seconds]
RegulationD has quit [Remote host closed the connection]
DerisiveLogic has quit [Ping timeout: 245 seconds]
zachrab has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
Sawbones has quit [Remote host closed the connection]
dfinninger has quit [Remote host closed the connection]
AndyBotwin has quit [Quit: Leaving]
psy_ has quit [Read error: Connection reset by peer]
jottr has quit [Ping timeout: 265 seconds]
dfinninger has joined #ruby
zachrab has quit [Ping timeout: 245 seconds]
malcolmva has joined #ruby
arup_r has quit [Ping timeout: 272 seconds]
jottr has joined #ruby
aryaching has joined #ruby
sigurding has joined #ruby
yfeldblum has joined #ruby
ramfjord has joined #ruby
Sawbones has joined #ruby
dfinninger has quit [Ping timeout: 272 seconds]
<agent_white> Allo
sivsushruth has quit [Read error: Connection reset by peer]
Hirzu has joined #ruby
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
juanpablo_ has joined #ruby
sivsushruth has joined #ruby
yfeldblu_ has joined #ruby
TDJACR has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 256 seconds]
ptrrr has joined #ruby
Sawbones has quit [Remote host closed the connection]
karmatr0n has quit [Remote host closed the connection]
Joufflu has quit [Quit: Peace]
yfeldblum has quit [Ping timeout: 265 seconds]
karmatr0n has joined #ruby
juanpablo_ has quit [Ping timeout: 256 seconds]
piotrj has quit [Remote host closed the connection]
jlast has joined #ruby
spider-mario has quit [Remote host closed the connection]
aryaching_ has joined #ruby
sivsushruth has quit [Read error: Connection reset by peer]
morenoh149 has joined #ruby
sivsushruth has joined #ruby
tobago has joined #ruby
aryaching has quit [Ping timeout: 272 seconds]
Morkel has joined #ruby
karmatr0n has quit [Ping timeout: 252 seconds]
jlast has quit [Ping timeout: 250 seconds]
TDJACR has joined #ruby
aganov has joined #ruby
tagrudev has joined #ruby
havenwood has quit []
<godd2> how goes it?
Guest65 has joined #ruby
hvxgr has quit [Ping timeout: 265 seconds]
aghalarp has joined #ruby
krz has quit [Ping timeout: 256 seconds]
sivsushruth has quit [Read error: Connection reset by peer]
aryaching_ has quit [Ping timeout: 244 seconds]
<agent_white> Good enough! And yourself?
sivsushruth has joined #ruby
krz has joined #ruby
jespada has joined #ruby
zenspider has quit [Quit: bye]
nii236 has joined #ruby
sivsushruth has quit [Read error: Connection reset by peer]
jespada has quit [Ping timeout: 246 seconds]
krzkrz has joined #ruby
sivsushruth has joined #ruby
zenspider has joined #ruby
krz has quit [Ping timeout: 272 seconds]
defrang has quit [Read error: Connection reset by peer]
roolo has joined #ruby
defrang has joined #ruby
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
davedev24_ has quit [Remote host closed the connection]
ValicekB has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
davedev24_ has joined #ruby
ghostpl_ has joined #ruby
roshanavand has joined #ruby
oki has joined #ruby
jonr22 has joined #ruby
apeiros_ has quit [Ping timeout: 246 seconds]
sinkensabe has joined #ruby
craigp has joined #ruby
davedev24_ has quit [Ping timeout: 250 seconds]
defrang has quit [Quit: defrang]
polysics has quit [Remote host closed the connection]
hgl has quit [Ping timeout: 245 seconds]
nii236 has quit [Ping timeout: 246 seconds]
nii236 has joined #ruby
jin_ has quit [Read error: Connection reset by peer]
roshanavand has quit [Ping timeout: 255 seconds]
jonr22 has quit [Ping timeout: 265 seconds]
ghostpl_ has quit [Ping timeout: 264 seconds]
juanpaucar has joined #ruby
<shevy> you guys are idling
neanderslob has quit [Ping timeout: 244 seconds]
hgl has joined #ruby
neanderslob has joined #ruby
bim has joined #ruby
Asher has joined #ruby
juanpaucar has quit [Ping timeout: 250 seconds]
adriancb has joined #ruby
hvxgr has joined #ruby
bim has quit [Ping timeout: 252 seconds]
AlphaTech has quit [Quit: Connection closed for inactivity]
RegulationD has joined #ruby
codecop has joined #ruby
JoshGlzB_ has quit [Quit: Textual IRC Client: www.textualapp.com]
josephcs has joined #ruby
josephcs has joined #ruby
last_staff has joined #ruby
<mozzarella> no
tkuchiki_ has quit [Ping timeout: 246 seconds]
piotrj has joined #ruby
adriancb has quit [Ping timeout: 245 seconds]
ptrrr has quit [Quit: ptrrr]
jin_ has joined #ruby
tkuchiki has joined #ruby
RegulationD has quit [Ping timeout: 250 seconds]
dfinninger has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
reinaldob has joined #ruby
bal has joined #ruby
josephcs_ has joined #ruby
aswen has joined #ruby
oivoodoo has joined #ruby
dfinninger has quit [Ping timeout: 264 seconds]
reinaldob has quit [Ping timeout: 252 seconds]
bal has quit [Read error: Connection reset by peer]
bal has joined #ruby
jlast has joined #ruby
pontiki has joined #ruby
josephcs has quit [Ping timeout: 244 seconds]
amclain has quit [Quit: Leaving]
wottam has joined #ruby
josephcs_ is now known as josephcs
oki has quit [Read error: Connection reset by peer]
oki has joined #ruby
jenrzzz has joined #ruby
jin_ has quit [Remote host closed the connection]
jottr has joined #ruby
jlast has quit [Ping timeout: 265 seconds]
doodlehaus has joined #ruby
piotrj has quit [Remote host closed the connection]
apeiros_ has joined #ruby
pontiki has quit [Ping timeout: 246 seconds]
martinbmadsen has quit [Ping timeout: 255 seconds]
piotrj has joined #ruby
ta has quit [Remote host closed the connection]
oki has quit [Ping timeout: 244 seconds]
jottr has quit [Ping timeout: 252 seconds]
doodlehaus has quit [Ping timeout: 250 seconds]
polysics has joined #ruby
sivsushruth has quit [Read error: Connection reset by peer]
{orb} has joined #ruby
chrishough has joined #ruby
<{orb}> where do I get The Book of Ruby? It comes with the Ruby Installer
sivsushruth has joined #ruby
anarang has joined #ruby
andikr has joined #ruby
<certainty> moin
fabrice31 has joined #ruby
fabrice31 has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 252 seconds]
fabrice31 has joined #ruby
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
Spami has joined #ruby
yh has joined #ruby
Dmr has joined #ruby
jimms has joined #ruby
sinkensabe has joined #ruby
jin_ has joined #ruby
yh has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: zzz]
Aswebb_ has joined #ruby
ypasmk has joined #ruby
<shevy> hey guys
<shevy> a case/when menu in ruby is quite nice
<shevy> case variable
sinkensabe has quit [Read error: Connection reset by peer]
<shevy> when 'a','b','c'
<shevy> 'blablabla'
<shevy> is there a shorter way to achieve the same there?
<shevy> where all of a,b,c map towards blablabla
<shevy> then I could omit the ruby constructs such as case or when
sinkensabe has joined #ruby
tkuchiki has quit [Quit: Leaving...]
relix has joined #ruby
jlast has joined #ruby
oki has joined #ruby
zachrab has joined #ruby
yh has joined #ruby
Bounga has quit [Ping timeout: 264 seconds]
craigp has quit [Remote host closed the connection]
wldcordeiro has quit [Ping timeout: 265 seconds]
Takle has joined #ruby
tkuchiki has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
Bounga has joined #ruby
Rephiax has quit []
jlast has quit [Ping timeout: 265 seconds]
oo_ has joined #ruby
amystephen has joined #ruby
Hobogrammer has quit [Ping timeout: 250 seconds]
DEA7TH has joined #ruby
zachrab has quit [Ping timeout: 246 seconds]
sinkensabe has joined #ruby
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
ghostpl_ has joined #ruby
ta has joined #ruby
akkad has quit [Quit: Emacs must have died]
krzkrz has quit [Quit: WeeChat 1.0.1]
aspiers has joined #ruby
strixd has joined #ruby
krz has joined #ruby
oki has quit [Read error: Connection reset by peer]
shevy has quit [Ping timeout: 246 seconds]
nfk has joined #ruby
oki has joined #ruby
<certainty> shmoon: if %w(a b c).include?(variable)
<certainty> sorry shmoon that was for shevy
wicope has joined #ruby
jottr has joined #ruby
jenrzzz has joined #ruby
ghostpl_ has quit [Ping timeout: 256 seconds]
elfuego_ has joined #ruby
juanpablo_ has joined #ruby
elfuego has quit [Ping timeout: 252 seconds]
elfuego_ is now known as elfuego
Takle has quit [Remote host closed the connection]
jin_ has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 252 seconds]
jimms has quit [Ping timeout: 264 seconds]
antgel has joined #ruby
charliesome has joined #ruby
juanpablo_ has quit [Ping timeout: 246 seconds]
granitosaurus has joined #ruby
Dmr has quit [Quit: Leaving]
dfinninger has joined #ruby
buub has quit [Ping timeout: 256 seconds]
Takle has joined #ruby
craigp has joined #ruby
ta has quit [Remote host closed the connection]
oki has quit [Read error: Connection reset by peer]
oki has joined #ruby
jin_ has joined #ruby
einarj has joined #ruby
aryaching has joined #ruby
sigurding has quit [Quit: sigurding]
dfinninger has quit [Ping timeout: 256 seconds]
nii236 has quit [Ping timeout: 256 seconds]
Aswebb_ has quit []
ki0 has joined #ruby
oki has quit [Ping timeout: 246 seconds]
jin_ has quit [Remote host closed the connection]
oki has joined #ruby
martianixor has joined #ruby
morenoh149 has quit [Ping timeout: 246 seconds]
sigurding has joined #ruby
danjordan has joined #ruby
lkba has quit [Read error: Connection reset by peer]
amundj has joined #ruby
jlast has joined #ruby
jin_ has joined #ruby
jimms has joined #ruby
nii236 has joined #ruby
Guest14990 has joined #ruby
rdark has joined #ruby
morenoh149 has joined #ruby
lkba has joined #ruby
End_ has quit [Quit: Leaving]
dumdedum has joined #ruby
kalusn has joined #ruby
jlast has quit [Ping timeout: 256 seconds]
jespada has joined #ruby
bal has quit [Ping timeout: 252 seconds]
piotrj has quit [Remote host closed the connection]
aryaching has quit [Ping timeout: 246 seconds]
piotrj has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
ghr has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
jespada has quit [Ping timeout: 244 seconds]
dumdedum has quit [Ping timeout: 245 seconds]
jimms has quit [Ping timeout: 252 seconds]
Takle has quit [Remote host closed the connection]
sinkensabe has joined #ruby
bruno- has joined #ruby
_Andres has joined #ruby
_Andres has quit [Client Quit]
jimms has joined #ruby
blackmesa has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
jonr22 has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
Soda has joined #ruby
jimms has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
jimms has joined #ruby
jonr22 has quit [Ping timeout: 265 seconds]
Akagi201 has joined #ruby
nii236 has quit [Ping timeout: 240 seconds]
juanpaucar has joined #ruby
mikecmpbll has joined #ruby
jottr has joined #ruby
ta has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
ta has quit [Client Quit]
joonty has joined #ruby
aspiers has quit [Ping timeout: 252 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
juanpaucar has quit [Ping timeout: 244 seconds]
sinkensabe has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
shadoi1 has quit [Quit: Leaving.]
oo_ has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 272 seconds]
oo_ has joined #ruby
crandersons has joined #ruby
dumdedum has joined #ruby
aspiers has joined #ruby
jimms has quit [Ping timeout: 264 seconds]
Takle has joined #ruby
ta has joined #ruby
crantron has quit [Ping timeout: 264 seconds]
yh has quit [Ping timeout: 252 seconds]
godd2 has quit [Ping timeout: 245 seconds]
marr has joined #ruby
craigp has quit [Remote host closed the connection]
crandersons has quit [Ping timeout: 252 seconds]
sigurding has quit [Quit: sigurding]
zachrab has joined #ruby
pontiki has joined #ruby
genpaku has quit [Ping timeout: 256 seconds]
genpaku has joined #ruby
CustosLimen has joined #ruby
zachrab has quit [Ping timeout: 255 seconds]
deepy has quit [Ping timeout: 264 seconds]
pontiki has quit [Ping timeout: 272 seconds]
dfinninger has joined #ruby
Zai00 has joined #ruby
kyb3r_ has quit [Read error: Connection reset by peer]
shevy has joined #ruby
vdamewood has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<shevy> ack
unshadow has joined #ruby
jin_ has quit []
<unshadow> Can I give file.each_line a line limit ? as in give me each_line from 0 to 20
vjt has quit [Ping timeout: 250 seconds]
<apeiros_> unshadow: no. but you can chain it. without a block you get an enumerator.
<certainty> shevy: if %w(a b c).include?(variable)
dfinninger has quit [Ping timeout: 245 seconds]
jottr has joined #ruby
jlast has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
craigp has joined #ruby
vandemar has joined #ruby
<shevy> certainty yeah in ruby code but
<shevy> I have about 1000 of such entries
<shevy> my connection is bad again :(
aghalarp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<certainty> shevy: ok then i don't get it :)
<shevy> certainty hmm
<shevy> perhaps I can do a custom file
<shevy> a,b,c
<shevy> blablabla
<shevy> d,e,f
<shevy> feebla
<certainty> yaml?
<shevy> not sure
<shevy> I may need extra tokens or? like :
<certainty> yeah
<shevy> a,b,c is perhaps not valid
Sawbones has joined #ruby
<shevy> I am just tired of extending case/when menus in all instances where they become too long
<shevy> for instance, I have a shortcut -> to -> URL file
<shevy> I use it like bookmarks in a browser
sigurding has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
<shevy> for instance, "rf ruby_forum" on the commandline, opens up the rubyforum at https://www.ruby-forum.com/
sinkensabe has joined #ruby
<certainty> replace conditionals with polymorphism is not applicable?
<shevy> slow down... can you simplify that lispy sentence? :)
jlast has quit [Ping timeout: 240 seconds]
vdamewood has joined #ruby
sivsushruth has quit [Ping timeout: 245 seconds]
doodlehaus has joined #ruby
jottr has joined #ruby
lessless has quit [Ping timeout: 240 seconds]
jlast has joined #ruby
Flcn has joined #ruby
unshadow has quit [Quit: leaving]
craigp_ has joined #ruby
Sawbones has quit [Ping timeout: 264 seconds]
livathinos has joined #ruby
<vandemar> >> ("\u2600"..."\u26c3").size
<eval-in_> vandemar => nil (https://eval.in/298116)
<vandemar> is that intended?
doodlehaus has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 256 seconds]
jlast has quit [Ping timeout: 256 seconds]
<vandemar> >> ("\u2600"..."\u26c3").to_a.size # given that this works fine
<eval-in_> vandemar => 195 (https://eval.in/298117)
craigp has quit [Ping timeout: 244 seconds]
sevenseacat has quit [Remote host closed the connection]
<vandemar> I guess so, optimized for numbers at the expense of other types, nevermind
aspiers has quit [Quit: WeeChat 1.1.1]
bim has joined #ruby
Hirzu_ has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
allcentury has joined #ruby
mbuf has joined #ruby
nii236 has joined #ruby
Hirzu has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
OrbitalKitten has joined #ruby
bim has quit [Ping timeout: 256 seconds]
<mbuf> where are the TODOs listed on improving Ruby performance?
hgl has quit [Ping timeout: 246 seconds]
bukington has quit [Remote host closed the connection]
sigurding has quit [Quit: sigurding]
yeticry has quit [Ping timeout: 252 seconds]
hgl has joined #ruby
bukington has joined #ruby
leafybasil has quit [Remote host closed the connection]
<apeiros_> vandemar: uuuh, I'm surprised that even exists. and a short check reveals that it's even wrong:
<apeiros_> >> (1.0...5.0).size
<eval-in_> apeiros_ => 4 (https://eval.in/298125)
<apeiros_> that's not correct
yeticry has joined #ruby
<shevy> hehehe
<shevy> I need to compile a list of pictures of apeiros_ going 'WTF?'
jenrzzz has joined #ruby
<shevy> like a facial expression study :D
<shevy> we should do that globally too
<shevy> all wtf-like moments
<vandemar> well, that should probably be Inf, but at least that's understandable. (1.0...5.0).to_a doesn't work, because floats aren't enumerable. character set ranges, however, are.
martianixor has quit [Quit: Leaving]
bw_ has quit [Remote host closed the connection]
<certainty> xD
jespada has joined #ruby
commmmodo has joined #ruby
govg has quit [Quit: leaving]
workmad3 has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
sillylogger has joined #ruby
jespada has quit [Ping timeout: 272 seconds]
<apeiros_> vandemar: character sets aren't the way you think they are
<apeiros_> >> "z".succ
<eval-in_> apeiros_ => "aa" (https://eval.in/298126)
davedev24_ has joined #ruby
<vandemar> apeiros_: I understand there are all sorts of complications with character sets, but if ("\u2600"..."\u26c3").to_a works, why wouldn't .size on that range give some positive number, at least?
yh has joined #ruby
Renich has quit [Quit: leaving]
<apeiros_> vandemar: because it wouldn't work for all
tmi_ is now known as tmi
<apeiros_> so with (String..String).size you'd sometimes get nil, sometimes get an integer
sigurding has joined #ruby
<apeiros_> I'd assume they decided against that and just return nil always
josephcs has quit [Quit: (null)]
craigp_ has quit [Remote host closed the connection]
yeticry has quit [Ping timeout: 264 seconds]
Mia has joined #ruby
livathinos has quit []
Mia has quit [Changing host]
Mia has joined #ruby
arup_r has joined #ruby
<vandemar> so why didn't they return [] always from (String..String).to_a ? It's just inconsistent.
yeticry has joined #ruby
juanpablo_ has joined #ruby
livathinos has joined #ruby
tkuchiki has quit [Ping timeout: 246 seconds]
_Andres has joined #ruby
livathin_ has joined #ruby
paradoja has joined #ruby
hanmac1 has joined #ruby
juanpablo_ has quit [Ping timeout: 256 seconds]
iterator_ has joined #ruby
<shevy> hmm no, that is an empty array
<shevy> I don't think (String..String).to_a can == equal []
<shevy> ('a'..'z').to_a # => ["a", "b", "
apoplexy has joined #ruby
<shevy> oh
<apoplexy> is anybody here?
<shevy> (''..'').to_a
<shevy> >> (''..'').to_a
<eval-in_> shevy => [] (https://eval.in/298129)
<shevy> apoplexy yeah but we are idling
<shevy> join us in our attempts to idle for more power
<vandemar> >> ('a'..'ab).to_a
<eval-in_> vandemar => /tmp/execpad-837def743e94/source-837def743e94:2: unterminated string meets end of file ... (https://eval.in/298130)
<vandemar> >> ('a'..'ab').to_a
<eval-in_> vandemar => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "aa", "ab"] (https://eval.in/298131)
<vandemar> >> ('z'..'ab').to_a
<eval-in_> vandemar => [] (https://eval.in/298132)
roshanavand has joined #ruby
<vandemar> *headdesk*. Yeah, not touching string ranges after seeing *that*
livathinos has quit [Ping timeout: 244 seconds]
iteratorP has quit [Ping timeout: 245 seconds]
davidhq has joined #ruby
<shevy> apoplexy go chat here, not in PRIVMSG please
coderhs has joined #ruby
iterator_ has quit [Ping timeout: 264 seconds]
<vandemar> but ranges from one character to another... iterator order is wrong ('z'.succ is 'aa'), but as far as I've seen, .to_a always does the right thing for ranges between single characters
<workmad3> vandemar: string ranges are fun though :)
<workmad3> >> "b" > "aa"
<eval-in_> workmad3 => true (https://eval.in/298133)
commmmodo has quit [Quit: commmmodo]
<workmad3> vandemar: ^^ that's why "b".."aa" is empty
yh has quit [Ping timeout: 244 seconds]
gfawcettpq has joined #ruby
fgo has joined #ruby
yh has joined #ruby
piotrj has quit [Remote host closed the connection]
leafybasil has joined #ruby
piotrj has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
coderhs has quit [Quit: Leaving]
scripore has joined #ruby
dmolina has joined #ruby
<apoplexy> shevy: sorry i just didnt want to post the project specs
dmolina has left #ruby [#ruby]
<apoplexy> can i paste you the link in pm and then you talk to me here? :]
scripore has quit [Client Quit]
marcoecc has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
dfinninger has joined #ruby
<apoplexy> shevy: ;(
yh has quit [Read error: Connection reset by peer]
norc has joined #ruby
ghostpl_ has joined #ruby
jimms has joined #ruby
nicolastarzia has joined #ruby
<shevy> apoplexy naaaah it needs to be out in the open
craigp has joined #ruby
<shevy> apoplexy in PRIVMSG, I need to click on the privmsg-tab in xchat, then answer there, then click back to a channel like #ruby
<shevy> and I have to repeat that every time a new privmsg arrives
<norc> Hi. I have about 80 network devices that I communicate with. Each session for a device is expected to last up to a minute before completing. What is the cleanest concurrent method to accomplish this?
<apoplexy> shevy, calm down soldier, i myself use xchat. i meant to paste 1 URL in 1 line in 1 msg to you privately. everything else can be discussed here.
<apoplexy> it wasnt a back and fourth deal, i dont think its asking much tbh
<shevy> I am very calm
<DefV> and lazy, it seems
<DefV> "OH NO, SO MUCH CLICKING"
<shevy> DefV volunteers :D
<DefV> I have irssi, I have to do actual typing to go to a private chat
jlast has joined #ruby
<DefV> I CAN'T HAVE THAT
marcoecc has quit [Read error: Connection reset by peer]
nicolastarzia has quit [Remote host closed the connection]
dfinninger has quit [Ping timeout: 244 seconds]
strixd_ has joined #ruby
sinkensabe has joined #ruby
<shevy> I'd so totally private chat with you now DefV
<apoplexy> so... no deal?
josephcs has joined #ruby
<shevy> have you finally written in public
jimms has quit [Ping timeout: 252 seconds]
<apoplexy> ??
<DefV> apoplexy: nobody cares about your project and its specs, just post it in here
martinbmadsen has joined #ruby
<shevy> ask DefV in a PRIVMSG
jimms has joined #ruby
claptor has quit [Read error: Connection reset by peer]
claptor has joined #ruby
strixd has quit [Ping timeout: 252 seconds]
wottam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apoplexy> there
scripore has joined #ruby
<apoplexy> its not a big deal, im just a more lowkey kid, i work at a bank and i dont even like saying the highest balance i've ever seen lol
jlast has quit [Ping timeout: 256 seconds]
shadeslayer has quit [Ping timeout: 252 seconds]
jlast has joined #ruby
paradoja has quit [Ping timeout: 245 seconds]
jottr has joined #ruby
oo_ has quit [Remote host closed the connection]
martinbmadsen has quit [Ping timeout: 256 seconds]
shadeslayer has joined #ruby
<apeiros_> vandemar: good question. I'd agree that String#succ and string ranges are inconsistent. I haven't put much thought into it yet, though.
<apoplexy> shevy, DefV: input please? :D
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> I am too scared to click on that
<shevy> why can't you be like a normal person and just type stuff here :(
<apoplexy> dude its a fucking conversation, wow
<shevy> I let the good people of #ruby know about everything
<shevy> between who
<shevy> you and ?
<apoplexy> me and a dude on another network
<apeiros_> apoplexy: the point about "no private chat" is usually: private chat == consulting, and personally I'd ask money for that ;-)
<shevy> greet that dude from me!
<apoplexy> you're one of those freenode users eh shevy. i see, all good.
<shevy> hey I can be in any network
<shevy> I used to be a heavy Galaxynet dude back in my mIRC days
<shevy> lots of Singaporeans out there - you even had to learn singlish to understand their Kauderwelsch english
<apeiros_> norc: a thread per device, a select loop, eventmachine. that's the ways that come to my mind.
<shevy> hmm english for Kauderwelsch is mumbo-jumbo ... that does not sound as awesome :(
zorak8 has quit [Ping timeout: 252 seconds]
jlast has quit [Ping timeout: 265 seconds]
<workmad3> shevy: I played some games in my youth that were active on quakenet :)
sillylogger has quit [Quit: sillylogger]
jottr has quit [Ping timeout: 250 seconds]
<shevy> never been on quakenet
<apoplexy> you arent welcome there shevy
<shevy> but I remember yahoo chat or so and having played strange time-wasters
sillylogger has joined #ruby
<shevy> apoplexy I am not even welcome here!
<apoplexy> then pretend you have social skills and be more normal
<norc> apoplexy: Yeah the "thread per device" approach didnt really settle nicely on my mind. Didnt seem that clean (even though technically threads are a solution to IO bound problems here)
<apeiros_> norc: thread per device can be very nice. but it depends a lot on your specifics.
<apoplexy> wat
postmodern has quit [Quit: Leaving]
scripore has quit [Quit: This computer has gone to sleep]
<apeiros_> apoplexy: norc meant me.
<norc> Oh yeah my apologies.
<apoplexy> yeah but he said me... so
<apoplexy> it cant really be undone
<norc> It can actually. I just need to wipe your chat log.
<workmad3> norc: and the public chat log
jonr22 has joined #ruby
<apoplexy> it cannot be undone
<apoplexy> so...
OrbitalKitten has joined #ruby
<workmad3> norc: or invent a time machine, go back in time and stop your younger self from making the mistake
<workmad3> (that's probably easier than changing the chatlogs)
Mon_Ouie has quit [Ping timeout: 244 seconds]
bw_ has joined #ruby
Mon_Ouie has joined #ruby
<norc> workmad3: Come to think of it, a time machine would also brilliantly solve my concurrency problem.
mrdtt has joined #ruby
selu has joined #ruby
<workmad3> norc: yeah, time machines are great for concurrency
<norc> apeiros_: What would be reasons to pick threads over EventMachine? I mean specifically I have these 80 devices (but they will get more in the future), and I need to initiate a session with each, and communicate with them, obtain data, etc.
dblessing has joined #ruby
<hanmac1> apeiros_ look at
<hanmac1> >> "1.2.9".succ
<eval-in_> hanmac1 => "1.3.0" (https://eval.in/298161)
bw_ has left #ruby [#ruby]
<workmad3> >> "z" > "z".succ
<eval-in_> workmad3 => true (https://eval.in/298162)
<workmad3> hanmac1: I always like that one ^^
<apeiros_> hanmac1: I know
<apeiros_> norc: easier to code IMO
OrbitalKitten has quit [Ping timeout: 250 seconds]
<apeiros_> norc: also 80 threads are nothing
jonr22 has quit [Ping timeout: 256 seconds]
juanpaucar has joined #ruby
<apeiros_> I'd probably go with select loop before eventmachine. but that may also just be personal bias.
blackmesa has joined #ruby
sivsushruth has joined #ruby
* apeiros_ afk
<apeiros_> lunch time
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
einarj has quit []
roolo has quit [Remote host closed the connection]
catphish has joined #ruby
Timba-as has joined #ruby
<catphish> can anyone explain the best way to approach the problem that SSLSocket buffers data, and therefore attempting to call Select on such a socket shows that there is no data to be read, even though there is buffered data to read?
CpuID has quit [Ping timeout: 245 seconds]
<jhass> I thought select special cases SSLSocket?
<jhass> "It is not happen for IO-like objects such as OpenSSL::SSL::SSLSocket." mmh, that could mean "don't use it there" I guess
juanpaucar has quit [Ping timeout: 245 seconds]
<catphish> i just read the manual for select and it says the best way to use it is immediately after a read_nonblock on all concerned sockets, i think that will solve the problem
doodlehaus has joined #ruby
<catphish> but makes my read loop messy
rsavage has joined #ruby
<catphish> jhass: it appears not to, at least in my application, select definitely doesn't return
<catphish> (when there's buffered data)
gccostabr has joined #ruby
<jhass> you can select on the underlying socket, you just need to handle the SSL layer eating the new data, that is the received data is TLS traffic only
<catphish> it seem that select on the sslsocket actually just calls select on the underlying socket
<catphish> but obviously data has already bee consumed into the buffer, so it never returns
DouweM has joined #ruby
<catphish> actually i needn't have asked, the situation is explained here: http://ruby-doc.org/core-2.2.1/IO.html#method-c-select
<catphish> openssl is a very special case and seemingly a huge problem
<jhass> yeah
AlphaTech has joined #ruby
astrobunny has quit [Remote host closed the connection]
<catphish> i wrote a webserver, it worked great until i added ssl and everything started blocking :)
<jhass> might just spawn a blocking reader into a thread that pushes stuff into a queue or something :/
<catphish> its tempting but i prefer to avoid threads like that wherever possible
<catphish> i'll read that IO.select documentation a few more times, i'm pretty sre it offers a solution, i just need to better understand it
robbyoconnor has quit [Ping timeout: 244 seconds]
einarj has joined #ruby
digitalextremist has joined #ruby
CpuID has joined #ruby
<jhass> I guess the truly efficient solution is EventMachine/libevent/libev/libuv stuff :P
<catphish> does EM not just use the same tricks underneath?
rsavage is now known as r3DKinG
<catphish> i'll rewrite using read_nonblock and see how that goes :)
lkba has joined #ruby
zachrab has joined #ruby
KnowledgeOwl has joined #ruby
elfuego has quit [Quit: elfuego]
rodfersou has joined #ruby
sillylogger has quit [Quit: sillylogger]
livathin_ has quit [Remote host closed the connection]
<jhass> I actually have no idea :P
pontiki has joined #ruby
livathinos has joined #ruby
jimms has quit [Ping timeout: 246 seconds]
bMalum has joined #ruby
jenrzzz has joined #ruby
zachrab has quit [Ping timeout: 246 seconds]
roshanavand1 has joined #ruby
aganov has quit [Ping timeout: 240 seconds]
lanemeyer has quit [Ping timeout: 252 seconds]
roshanavand has quit [Ping timeout: 250 seconds]
tagrudev has quit [Ping timeout: 245 seconds]
<catphish> wow, turns out i can write this much better with the combination of read_nonblock and select :)
tagrudev has joined #ruby
<catphish> amazing what happens when you read the manual
aganov has joined #ruby
reinaldob has joined #ruby
pontiki has quit [Ping timeout: 245 seconds]
polysics has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
scripore has joined #ruby
<shevy> lol
scripore has quit [Client Quit]
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
doodlehaus has quit [Remote host closed the connection]
jespada has joined #ruby
withnale__ has joined #ruby
bal has joined #ruby
julieeharshaw has quit [Ping timeout: 256 seconds]
DerisiveLogic has joined #ruby
davidhq has joined #ruby
fantazo has quit [Quit: Verlassend]
julieeharshaw has joined #ruby
dfinninger has joined #ruby
<arup_r> how to write this string quotes are causing issue
<arup_r> >> "//strong[text()="I'm strong"]/following-sibling:p/text()"
<eval-in_> arup_r => /tmp/execpad-615053b7c232/source-615053b7c232:2: syntax error, unexpected tCONSTANT, expecting keyword_end ... (https://eval.in/298169)
<arup_r> got it
<arup_r> >> "//strong[text()='I'm strong']/following-sibling:p/text()"
<eval-in_> arup_r => "//strong[text()='I'm strong']/following-sibling:p/text()" (https://eval.in/298170)
jlast has joined #ruby
oivoodoo has quit [Remote host closed the connection]
dfinninger has quit [Ping timeout: 256 seconds]
bMalum has quit [Quit: bMalum]
Takle has quit [Remote host closed the connection]
<catphish> arup_r: in case your mistake isn't clear, if you start a string with ", then it will finish the first time it sees ", unless it's escaped like this: \"
sigurding has quit [Quit: sigurding]
<catphish> arup_r: you could also probably write it like this if you wanted the double quotes:
<catphish> >> '//strong[text()="I\'m strong"]/following-sibling:p/text()'
<eval-in_> catphish => "//strong[text()=\"I'm strong\"]/following-sibling:p/text()" (https://eval.in/298173)
jlast has quit [Ping timeout: 256 seconds]
narcan has joined #ruby
<jhass> or %(//strong[text()="I'm strong"]/following-sibling:p/text())
<catphish> or "//strong[text()=\"I'm strong\"]/following-sibling:p/text()" - which is how the inspector outputs it
jlast has joined #ruby
maximski has joined #ruby
<catphish> i like jhass's option though
<catphish> jhass: deson't the () in the string break your %( example?
<catphish> >> %(//strong[text()="I'm strong"]/following-sibling:p/text())
<eval-in_> catphish => "//strong[text()=\"I'm strong\"]/following-sibling:p/text()" (https://eval.in/298179)
<catphish> i guess not
<jhass> need to be balanced ;)
<catphish> thats clever, i didnt know it counted
bruno- has joined #ruby
<jhass> but % takes about anything as delimiter
oo_ has joined #ruby
<jhass> %[ .. ] %{ ... } and so on
plsk has joined #ruby
<catphish> yeah, i thought it did, didnt know it counted opening ones inside the string though, thats cool
KnowledgeOwl has quit [Remote host closed the connection]
fabrice31 has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
<arup_r> catphish: thanks.. any idea why the spec is failing ? https://gist.github.com/aruprakshit/029824d6af879e3adf88
fabrice31 has joined #ruby
<catphish> i dont know anything about xpath, sorry
<jhass> arup_r: well, obviously because your xpath doesn't match any node
<jhass> and you hide that fact by calling to_s instead of .text
huddy has joined #ruby
Takle has joined #ruby
jlast has quit [Ping timeout: 265 seconds]
<arup_r> I forgot to vive the spec
Azure has quit [Ping timeout: 244 seconds]
bim has joined #ruby
ldnunes has joined #ruby
oo_ has quit [Ping timeout: 250 seconds]
bruno- has quit [Ping timeout: 256 seconds]
bim has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 250 seconds]
fabrice31 has quit [Ping timeout: 272 seconds]
User458764 has joined #ruby
<jhass> looks like // doesn't work with a document fragment
Tomasso has joined #ruby
<jhass> I guess because it wants to go back to the root node and there's none in a fragment
<Tomasso> do you know how to call a block recursively from within the same block (without any function name ) ?
<jhass> yeah .// works
<jhass> Tomasso: not possible afaik
<Tomasso> mm thanks :'*
<arup_r> let me see
<arup_r> jhass: no failing
nii236 has quit [Ping timeout: 250 seconds]
<jhass> arup_r: yeah, there's more in your xpath that doesn't work
bim has joined #ruby
<arup_r> what's that ?
Azure has joined #ruby
<jhass> .//strong[text()="I'm strong"] works
paradoja has joined #ruby
Mon_Ouie has quit [Ping timeout: 250 seconds]
<arup_r> then following-sibling::p/text() is valid also..
<arup_r> why then not working
cpt_yossarian has quit [Ping timeout: 250 seconds]
fabrice31 has joined #ruby
vt102 has joined #ruby
ypasmk has quit [Quit: ypasmk]
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<arup_r> jhass: any idea why not?
amundj has quit [Ping timeout: 256 seconds]
krz has quit [Quit: WeeChat 1.0.1]
<jhass> do you?
<arup_r> no,, why the ".//strong[text()=\"I'm strong\"]/following-sibling::p/text()" doesn't work
<catphish> so, can anyone recommend a method by which i might be able to fork and exec a new copy of my application (in order to update to a new version) but pass a listening tcp socket to create zero downtime
DouweM has quit [Read error: Connection reset by peer]
<apeiros_> catphish: not sure whether fd's can be passed around. but fd's have a number.
<apeiros_> see IO.for_fd
amundj has joined #ruby
<workmad3> catphish: maybe look up how puma does similar during its phased restart
<catphish> apeiros_: they do have a number, but that's per process unfortunately, i know forking keeps sockets open, and i also know there's a way to pass sockets through a unix socket, but i dont know the details
nii236 has joined #ruby
<jhass> there's also systemd socket activation to look at, though I guess there systemd holds a reference to the socket
<jhass> so it's not auto-closed
<catphish> new versions of linux actually allow multiple processes to listen on the same socket, but i dont think that's the right approach
oivoodoo has joined #ruby
juanpablo_ has joined #ruby
<workmad3> catphish: multiple listeners on the same socket sounds like a reasonable approach to me... bring up a new process listening to the same socket, signal the existing process(es) that they are to stop accepting connections and close down once they've finished all requests
<catphish> yeah, that could work, but it relies on some very new kernel features,
claptor has quit [Quit: this channel is bakas]
<catphish> another option is to fork (leaving the listening FD open), exec the new process, which then just attaches to the already open listener
oo_ has joined #ruby
<workmad3> catphish: what happens to connections to the original process then though?
<workmad3> catphish: as in, already established ones
<catphish> workmad3: both processes share all connections, its up to each of the 2 forks to close the ones they aren't going to use
<catphish> so the old fork would close the "listening" socket, and the new fork would close any sockets to active clients
<catphish> then the old fork could finish up with existing clients before exiting, and the new fork could handle new clients
<workmad3> catphish: ah yeah, that could work... sorry, got a bit messed up in my head about what exec would do with a fork :)
<catphish> thats a pretty cool solution if i can make it tidy, the tricky part is closing all the old client sockets in the new fork
<jhass> arup_r: your actual problem is that <p> is only allowed to have inline elements, <p> itself is a block element though, so nesting <p> into <P> is invalid
<jhass> arup_r: thus the parsed document is not what you think it is, call to_s on the doc to look at it
juanpablo_ has quit [Ping timeout: 264 seconds]
<catphish> exec starts a new process, replacing the old one (in the new fork), but keeps files open
jww42 has joined #ruby
<workmad3> catphish: yeah, I know that... for some reason, my mind decided that doing the exec would replace the original process, not the forked one because it's being dumb today :)
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<catphish> :)
<workmad3> catphish: that sounds somewhat like how puma does things, btw
<arup_r> jhass: humm I see here http://goo.gl/9G4HXO
<arup_r> <p> is the problen
aclearman037 has joined #ruby
<catphish> the other option is the unix socket thing: you start a new, totally unrelated process clean, but tell it to listen on a unix socket, then you hand it the tcp listener over the unix socket
<jhass> arup_r: note libxml2 (which nokogiri is a binding for) only supports xpath 1.0
pontiki has joined #ruby
<arup_r> yes..
govg has joined #ruby
<workmad3> arup_r: btw, <span> exists for this sort of reason
<arup_r> I didn't use any xpath 2.0 functions
<catphish> unfortunately my web server listens on several tcp sockets, so i'd better get to work :)
<jhass> just saying because you use a xpath 2 test tool
pontiki has quit [Client Quit]
jww42 has quit [Ping timeout: 255 seconds]
aclearman037 has quit [Client Quit]
jottr has joined #ruby
Dude007 has quit []
RegulationD has joined #ruby
govg has quit [Client Quit]
<arup_r> jhass: got your point
oki has quit [Read error: Connection reset by peer]
oki has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
mostlybadfly has joined #ruby
jerematic has joined #ruby
piotrj has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 244 seconds]
piotrj has joined #ruby
lolmaus has quit [Read error: Connection reset by peer]
lolmaus has joined #ruby
aclearman037 has joined #ruby
<arup_r> jhass: teaching myself JS.. Its way different than Ruby... :(
<gr33n7007h> right, can somebody help me out here I created a RemoteGem class and RemoteBot class, RemoteGem class works on the top level but not inside RemoteBot class https://gist.github.com/anonymous/b49ad52afe645e44926f
lanemeyer has joined #ruby
lumidragon has joined #ruby
<jhass> "does not work"
<catphish> it's unclear to me why that would fail to work
<jhass> that's because we didn't get any kind of problem description
<gr33n7007h> 1 sec
<catphish> my assumption was that the class wasn't being found
<catphish> but maybe the problem is actually much more mundane
hiyosi has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
bruno- has joined #ruby
nii236 has quit [Ping timeout: 250 seconds]
bjornar has quit [Read error: Connection reset by peer]
<catphish> try stripping the string
govg has joined #ruby
<jhass> yeah, looks like trailing newline
<catphish> ignoring any kind of error handling: gem = RemoteGemFetcher.search(match[1].strip)
<catphish> or fix your regex
brb3 has joined #ruby
<gr33n7007h> catphish: let me do that 1 sec
iamjarvo has joined #ruby
<jhass> or use an IRC framework like cinch that handles all the quirks for you already
mengu has joined #ruby
jottr has joined #ruby
<gr33n7007h> wtf strip that's all it was :) been looking at this for an hour :)
<gr33n7007h> thanks catphish jhass
<catphish> gr33n7007h: learn to think around what the error is telling you
<catphish> gr33n7007h: it was saying the URL was invalid, so at that point you should have run "inspect" on the URL to see what was in it, and you'd have seen the newline
<gr33n7007h> catphish: for sure I don't know whats wrong with me today :(
<catphish> good luck :)
<gr33n7007h> cheers 8)
jlast has joined #ruby
multiscan has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
sinkensabe has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
jlast has quit [Ping timeout: 265 seconds]
ponga has quit [Quit: Leaving...]
jlast has joined #ruby
dropp has joined #ruby
adriancb has joined #ruby
plashchynski has joined #ruby
B1n4r10 has joined #ruby
digitalextremist has quit [Ping timeout: 255 seconds]
lxsameer has quit [Remote host closed the connection]
sdothum has joined #ruby
multiscan has quit [Remote host closed the connection]
multiscan has joined #ruby
ponga has joined #ruby
LBRapid has joined #ruby
jonr22 has quit [Ping timeout: 265 seconds]
_Andres has joined #ruby
juanpaucar has joined #ruby
codecop has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: ciao.]
livathin_ has joined #ruby
Takle has quit [Remote host closed the connection]
jlast has quit [Ping timeout: 256 seconds]
Timba-as has quit [Quit: Be back later ...]
adriancb has quit [Read error: Connection reset by peer]
Timba-as has joined #ruby
jww42 has joined #ruby
roshanavand1 has quit [Ping timeout: 256 seconds]
juanpaucar has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
livathinos has quit [Ping timeout: 240 seconds]
dstarh has joined #ruby
Abhijit has joined #ruby
oki has quit [Read error: Connection reset by peer]
oki has joined #ruby
adriancb has joined #ruby
<shevy> gr33n7007h you are drunk
adriancb has quit [Remote host closed the connection]
techsethi_ has joined #ruby
andikr has quit [Remote host closed the connection]
plashchynski has quit [Quit: plashchynski]
joonty has quit [Quit: joonty]
sigurding has joined #ruby
paradoja has quit [Ping timeout: 252 seconds]
zachrab has joined #ruby
aspiers has joined #ruby
oki has quit [Read error: Connection reset by peer]
ypasmk has joined #ruby
oki has joined #ruby
nateberkopec has quit [Quit: Leaving...]
<gr33n7007h> shevy: nope, not yet! :)
<shevy> now there is your problem!
nii236 has joined #ruby
lektrik has joined #ruby
<gr33n7007h> haha
<shevy> I actually don't take alcohol well, I get immensely tired very quickly from it
<gr33n7007h> not much of a drinker then shevy
ypasmk has quit [Client Quit]
<shevy> yeah
oo_ has quit [Remote host closed the connection]
<gr33n7007h> sorts your little henries out :p
<gr33n7007h> little henries == grey matter cells
zachrab has quit [Ping timeout: 246 seconds]
scott1 has joined #ruby
mbuf has quit [Quit: Leaving]
scripore has joined #ruby
<gr33n7007h> >>> does drinking alcohol make you a better ruby programmer?
<eval-in_> gr33n7007h => /tmp/execpad-c0027301a1fb/source-c0027301a1fb:2: syntax error, unexpected '>' ... (https://eval.in/298218)
plashchynski has joined #ruby
<gr33n7007h> truthbot: true!!!!!!
tier has joined #ruby
sinkensa_ has joined #ruby
Takle has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
<gr33n7007h> didn't think eval-in_ responded to three wokkas
sgambino has joined #ruby
civim has joined #ruby
Takle has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 245 seconds]
<gr33n7007h> is there any ops here?
<gr33n7007h> just going to ask if I could test my bot for a minute?
sevenseacat has joined #ruby
<scott1> \exit
scott1 has quit [Quit: WeeChat 1.1.1]
<workmad3> gr33n7007h: just create a test channel, e.g /j #gr77nbot-test and have the bot join that
Abhijit has quit [Quit: Bye.]
<catphish> could anybody who knows sockets well, have a look at this for me? basically my socket isn't surviving an exec and i don't know why not: http://paste.codebasehq.com/pastes/xhc8lvhand0703gtsq
civim has left #ruby [#ruby]
allcentury has joined #ruby
<gr33n7007h> workmad3: ah ok, thanks
fenzil has joined #ruby
polysics has joined #ruby
antgel has quit [Ping timeout: 265 seconds]
<catphish> ruby 2.0 change
Hirzu_ has quit [Ping timeout: 245 seconds]
Abhijit has joined #ruby
curiousgeorge has quit [Ping timeout: 246 seconds]
paulfm has joined #ruby
QualityAddict has quit []
Hirzu has joined #ruby
jottr has joined #ruby
tkuchiki has joined #ruby
polysics has quit [Ping timeout: 245 seconds]
norc has quit [Ping timeout: 246 seconds]
zenith_ has joined #ruby
juanpablo_ has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
elfuego has joined #ruby
Abhijit has quit [Remote host closed the connection]
arup_r has quit [Remote host closed the connection]
apoplexy has quit [Ping timeout: 240 seconds]
elfuego has left #ruby [#ruby]
ych4k3r has joined #ruby
tlarevo has joined #ruby
Takle has joined #ruby
bryanculver has joined #ruby
tkuchiki has quit [Quit: Leaving...]
<gr33n7007h> can't believe it was just strip, can't get over that :(
bryanculver has left #ruby [#ruby]
Megtastique has joined #ruby
oivoodoo has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
dEPy has joined #ruby
paulfm has quit [Quit: Zzzzz...]
foureight84 has joined #ruby
bim has quit [Remote host closed the connection]
roshanavand has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thiagovsk has joined #ruby
foureight84 has quit [Read error: Connection reset by peer]
foureight84 has joined #ruby
freerobby has joined #ruby
bim has joined #ruby
freerobby has quit [Client Quit]
joonty has joined #ruby
paulfm has joined #ruby
freerobby has joined #ruby
jenrzzz has joined #ruby
roolo has joined #ruby
bim has quit [Remote host closed the connection]
techsethi_ has quit [Quit: techsethi_]
AlphaTech has quit [Quit: Connection closed for inactivity]
bjornar has joined #ruby
d10n-work has joined #ruby
fantazo has joined #ruby
GnuYawk has joined #ruby
arup_r has joined #ruby
jlast has joined #ruby
bim has joined #ruby
allcentu1 has joined #ruby
tkuchiki has joined #ruby
commmmodo has joined #ruby
arup_r has quit [Client Quit]
paulfm has quit [Quit: Goodbye]
gccostabr has quit [Quit: ZZZzzz…]
scripore has quit [Quit: This computer has gone to sleep]
allcentury has quit [Ping timeout: 265 seconds]
scripore has joined #ruby
blackmesa has joined #ruby
jlast has quit [Ping timeout: 256 seconds]
ojacobson has joined #ruby
jlast has joined #ruby
Cust0sLim3n has quit [Ping timeout: 255 seconds]
livathin_ has quit [Remote host closed the connection]
livathinos has joined #ruby
HOrangeJewce has joined #ruby
tlarevo has quit [Remote host closed the connection]
allcentu1 has quit [Ping timeout: 256 seconds]
allcentu1 has joined #ruby
enebo has joined #ruby
User458764 has joined #ruby
tkuchiki_ has joined #ruby
jlast has quit [Ping timeout: 250 seconds]
foureight84 has quit [Quit: Lingo: www.lingoirc.com]
krz has joined #ruby
_maes_ has joined #ruby
tkuchiki has quit [Ping timeout: 256 seconds]
adriancb has joined #ruby
top4o has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
foureight84 has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<shevy> strip down!
adriancb has quit [Read error: Connection reset by peer]
adriancb has joined #ruby
foureight84 has quit [Client Quit]
bim has quit [Remote host closed the connection]
vlad_sta- has quit [Quit: ZNC - http://znc.in]
multisca_ has joined #ruby
Soda has quit [Ping timeout: 246 seconds]
dANO_ has joined #ruby
vlad_starkov has joined #ruby
HOrangeJewce has quit [Quit: Leaving.]
nateberkopec has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
adriancb has quit [Remote host closed the connection]
Cust0sLim3n has joined #ruby
adriancb has joined #ruby
multiscan has quit [Ping timeout: 265 seconds]
plashchynski has quit [Quit: plashchynski]
bim has joined #ruby
juanpaucar has joined #ruby
juanpaucar has quit [Read error: Connection reset by peer]
waxjar has quit [Ping timeout: 240 seconds]
adriancb has quit [Read error: Connection reset by peer]
freerobby has quit [Quit: Leaving.]
juanpaucar has joined #ruby
adriancb has joined #ruby
Mives has joined #ruby
werelivinginthef has joined #ruby
plashchynski has joined #ruby
techsethi_ has joined #ruby
coderhs has joined #ruby
scripore has joined #ruby
iamjarvo has joined #ruby
rbennacer has joined #ruby
multisca_ has quit [Read error: Connection reset by peer]
multiscan has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
fantazo has quit [Quit: Verlassend]
multiscan has quit [Read error: Connection reset by peer]
bim has quit [Remote host closed the connection]
multiscan has joined #ruby
bim has joined #ruby
Altonymous has joined #ruby
RegulationD has joined #ruby
decoponio has joined #ruby
<Altonymous> I’m running a COPY FROM STDIN command in my ruby application to import data into the PG database. This is causing the CPU to peg at 100% constantly. Does anyone know how I might better handle this case?
elfuego has joined #ruby
antgel has joined #ruby
plashchynski has quit [Quit: plashchynski]
iamjarvo has quit [Client Quit]
apeiros has quit [Ping timeout: 252 seconds]
lkba has joined #ruby
phutchins has joined #ruby
sevenseacat has quit [Remote host closed the connection]
<apeiros_> Altonymous: insufficient information
<Altonymous> What other information do you need?
<Fluent> How about source code
<apeiros_> ^
RegulationD has quit [Ping timeout: 252 seconds]
top4o has quit [Quit: ChatZilla 0.9.91.1 [Firefox 36.0.1/20150305021524]]
<apeiros_> Altonymous: also, how do you figure it's the COPY FROM STDIN part?
Mon_Ouie has quit [Ping timeout: 240 seconds]
duggiefresh has joined #ruby
iamjarvo has joined #ruby
gccostabr has joined #ruby
<Altonymous> I have it traced with NewRelic, AppSignal, and logging. I use the pg gem and simply do “COPY widget.import_table FROM STDIN WITH (FORMAT 'csv’);” with conn.put_copy_data(data) command, it calls that command repeatedly until no records are left then calls conn.put_copy_end
iamjarvo has quit [Max SendQ exceeded]
<apeiros_> *sob*
<apeiros_> Altonymous: and you have no loop? you read all data at once into data?
<elfuego> i’m setting my cookie object in a sinatra app using cookies[‘cookiename’], but i’m trying to access it via last_response.cookies, and i’m getting this error in the test undefined method `cookies' for #<Rack::MockResponse:0xaf44011>
<Altonymous> aperos_: No it looks on the put_copy_data(data) command a record at a time
<Altonymous> I’m trying to find you the source code right now
sambao21 has joined #ruby
iamjarvo has joined #ruby
<apeiros_> Altonymous: hint: use tab completion for the nick name
iamjarvo has quit [Max SendQ exceeded]
<Fluent> telnet doesn't support tab completion j/k
last_staff has quit [Quit: last_staff]
iamjarvo has joined #ruby
<Fluent> Well not joking, but I'll stop trollin
boshhead has joined #ruby
<apeiros_> Fluent: just because you're using a sucky telnet client :-p
bim has quit [Remote host closed the connection]
apeiros has joined #ruby
techsethi_ has quit [Quit: techsethi_]
<apeiros_> Altonymous: copy_data.read( 256, buf ) # <- that's a *very* small chunk size
<apeiros_> increase it
<apeiros_> and it'll go more towards an IO bound problem
<apeiros_> question remains whether you're sure it's the ruby process and not pg which peaks the CPU
rocknrollmarc has joined #ruby
DouweM has joined #ruby
<apeiros_> and I don't get why you do a sleep 0.1 there
<Altonymous> It’s not using the buffer stuff it’s actually reading line by line. That’s the code I started with and modified to do it record by record
<Altonymous> That’s the sample from the pg gem
<Altonymous> I changed the while copy_data.read( 256, buf ) to file.each_line do |line|
lkba has quit [Ping timeout: 252 seconds]
jottr has joined #ruby
<apeiros_> Altonymous: lines are still a small chunk size
<apeiros_> unless you've huge records…
mitchellhenke has joined #ruby
<Altonymous> i checked and the sleep 0.1 isn’t ever getting hit.. that’s just for when the connection gets blocked
iamjarvo has quit [Client Quit]
<Altonymous> apeiros_: about 30 columns per record.
phreakocious has quit [Ping timeout: 246 seconds]
<Altonymous> varying size and data types
tagrudev has quit [Quit: Me = Awesome]
<apeiros_> that's not the relevant measurement. anyway, it'll probably be far below 1KB on average.
tagrudev has joined #ruby
iamjarvo has joined #ruby
phreakocious has joined #ruby
it0a has joined #ruby
multi_io_ is now known as multi_io
bim has joined #ruby
jottr has quit [Ping timeout: 265 seconds]
iamjarvo_ has joined #ruby
zenith_ has quit [Read error: Connection reset by peer]
zenith__ has joined #ruby
davedev24_ has quit [Read error: Connection reset by peer]
iamjarvo has quit [Ping timeout: 255 seconds]
jerematic has quit [Remote host closed the connection]
davedev24_ has joined #ruby
multisca_ has joined #ruby
jottr has joined #ruby
plashchynski has joined #ruby
davedev24_ has quit [Read error: Connection reset by peer]
Olipro has quit [Ping timeout: 252 seconds]
Olipro_ is now known as Olipro
iamjarvo has joined #ruby
davedev24_ has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
rbennacer has quit [Remote host closed the connection]
iamjarvo has joined #ruby
iamjarvo_ has quit [Ping timeout: 252 seconds]
multiscan has quit [Ping timeout: 245 seconds]
drewvanstone has joined #ruby
oivoodoo has joined #ruby
drewvanstone has quit [Client Quit]
jonr22 has joined #ruby
drewvanstone has joined #ruby
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scripore has quit [Quit: Leaving]
Timba-as has quit [Read error: Connection reset by peer]
multisca_ has quit [Ping timeout: 256 seconds]
<drewvanstone> Any recommendations of static code analysis tools? Currently using SonarQube, but it's quite slow. Have about 100 commits a day (each running through the CI pipeline), on about 15 projects, and SonarQube isn't scaling well
Soda has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
<shevy> certainty, I think I will just parse big case menus differently
KnowledgeOwl has joined #ruby
Olipro_ has joined #ruby
oivoodoo has quit [Ping timeout: 246 seconds]
<shevy> this should be the possible entries... hmm http://pastie.org/pastes/10016277/text
jonr22 has quit [Ping timeout: 240 seconds]
<shevy> though perhaps there are more keys, then I may add a new line
<shevy> and I use the indent as clue :\ :/
Deele has quit [Ping timeout: 256 seconds]
oo_ has joined #ruby
<shevy> the ruby variant is longer, logically, even if we exclude case - there is still a mandatory when entry, and strings must have '' or "" http://pastie.org/10016282
freerobby has joined #ruby
vozcelik has joined #ruby
<shevy> obviously the ruby variant is more powerful because we can discern whether something is a string, or a method invocation
unshadow has joined #ruby
<unshadow> My first gem (REST based API for my company's software), what do you guys think ? --> https://github.com/bararchy/safe-t-rest
tcrypt has joined #ruby
kaiZen- has joined #ruby
ta has quit [Remote host closed the connection]
spyderman4g63 has quit []
Deele has joined #ruby
tcrypt has quit [Remote host closed the connection]
nii236 has quit [Ping timeout: 245 seconds]
kobain has joined #ruby
DerisiveLogic has quit [Ping timeout: 264 seconds]
chthon has joined #ruby
kobain has quit [Max SendQ exceeded]
oivoodoo has joined #ruby
kobain has joined #ruby
fryguy9 has joined #ruby
jlast has joined #ruby
_maes_ has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org]
HOrangeJewce has joined #ruby
kblake has joined #ruby
renier has joined #ruby
rocknrollmarc has quit [Remote host closed the connection]
B1n4r10 has joined #ruby
<shevy> unshadow I'd suggest a block form for setting the values too
<shevy> example:
<shevy> Client.new {
<shevy> etc
<shevy> guid 'my_packge_GUID.123123'
<shevy> }
<shevy> hmm
B1n4r10 has quit [Max SendQ exceeded]
renier_ has quit [Ping timeout: 244 seconds]
<shevy> would that even be valid syntax? I am not sure what a block to .new does
<apeiros_> unshadow: your gem goes against naming conventions. - means /, _ is for casing
<apeiros_> i.e., foo-bar_baz --> require 'foo/bar_baz' --> Foo::BarBaz
<jhass> unshadow: require "rubygems" is implicit since 1.9, which is already EOL
silkfox has joined #ruby
<jhass> ruby community standard is 2 spaces for indentation
<apeiros_> client.getAppsProcessState # another thing that goes against conventions - ruby code commonly uses snake_case, not camelCase
<jhass> it's very uncommon to put parens around a call to attr_accessor
zachrab has joined #ruby
<jhass> iGetHistory? what's that? hungarian notation?
zenith__ has quit [Remote host closed the connection]
<apeiros_> unshadow: I hope SafeTRest.new can take the config as a hash too? otherwise it becomes quite cumbersome to configure it e.g. from a yaml file.
Mives has quit [Remote host closed the connection]
<jhass> is the value for BusinessLogic supposed to be json? if so I'd build a ruby hash and to_json it
<apeiros_> I'd expect a method like file_upload/file_download to do the encoding stuff for me
rocknrollmarc has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<jhass> docs would be nice describing which params each method takes
drewvanstone has quit [Quit: Lost terminal]
<apeiros_> the file reading too actually
<apeiros_> otherwise, don't call it file upload. call it base64_data_upload or whatever.
<jhass> all your methods are basically the same, you should be able to extract the majority of the redundancy to a private method
<apeiros_> why are all numeric values passed as strings?
<unshadow> Wow... ok :) just a sec I'll answer one at a time, Thanks for the feedback
zachrab has quit [Ping timeout: 244 seconds]
GnuYawk has quit [Ping timeout: 255 seconds]
rocknrollmarc has quit [Remote host closed the connection]
blackmesa has quit [Quit: WeeChat 1.1.1]
rbennacer has joined #ruby
<unshadow> shevy, I can do a block thingy instead of the attr_accesor, or to add a .new() to allow for the args to be set as a passed hash
sambao21_ has joined #ruby
perrier has quit [Remote host closed the connection]
sambao21 has quit [Read error: Connection reset by peer]
sambao21_ is now known as sambao21
perrier has joined #ruby
rocknrollmarc has joined #ruby
dys has joined #ruby
<shevy> hmm
<shevy> a {} to .new will be passed to initialize() ?
<apeiros_> shevy: all arguments are
defrang has joined #ruby
<unshadow> apeiros, Is that right ? it looks wierd to do a require safe/t/rest or a safe-t/rest .... but if thats the nameing conventions.. ill follow
<HOrangeJewce> all the arguments!
<apeiros_> unless you redefine new, of course
rocknrollmarc has quit [Read error: Connection reset by peer]
<apeiros_> unshadow: consult guides.rubygems.org if you don't believe me.
livathin_ has joined #ruby
<apeiros_> unshadow: you can do either, change your require or change your name. with SafeTRest, it'd be safe_t_rest
User458764 has joined #ruby
<unshadow> apeiros_, sorry, I didnt say I dont belive you :) I'll check it out and fix it
<apeiros_> since the company name seems to be SafeT, I'd say safe_t-rest would make sense, with require 'safe-t/rest' and SafeT::Rest
<unshadow> thats sound better (looks better I mean)
Channel6 has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
livathinos has quit [Ping timeout: 250 seconds]
DaniG2k has joined #ruby
<unshadow> apeiros_, about the encoding done at the lib, I wanted to give the user a better control over how interface with the methods, but I guess something like basic encoding is ok
silkfox has quit [Ping timeout: 265 seconds]
kaiZen- has quit [Ping timeout: 252 seconds]
<unshadow> jhass, I'll get rid of the () around the attr_accesor
RegulationD has joined #ruby
karmatr0n has joined #ruby
livathin_ has quit [Remote host closed the connection]
livathinos has joined #ruby
<apeiros_> unshadow: provide cascaded methods
<apeiros_> file_upload calls data_upload calls base64_upload
chrisja has joined #ruby
<apeiros_> i.e. file_upload(path) -> data_upload(File.read(path)) -> base64_upload(Base64.encode64(data))
commmmodo has quit [Quit: commmmodo]
kaiZen- has joined #ruby
<unshadow> I see, thats a nice idea
<unshadow> I got allot to do now XD thanks guys !
<jhass> I wish there would be a sane way to rename a gem sometimes
RegulationD has quit [Ping timeout: 256 seconds]
rbennacer has quit [Remote host closed the connection]
rbennacer has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
karmatr0n has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
karmatr0n has joined #ruby
jerematic has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
DouweM has quit [Ping timeout: 240 seconds]
jefus has quit [Ping timeout: 245 seconds]
crueber has joined #ruby
ixti has quit [Ping timeout: 265 seconds]
GnuYawk has joined #ruby
livingstn has quit []
dc_ has joined #ruby
troulouliou_div has joined #ruby
mgorbach has quit [Quit: ZNC - http://znc.in]
troulouliou_div has quit [Remote host closed the connection]
jimms has joined #ruby
troulouliou_div2 has joined #ruby
n80 has joined #ruby
mgorbach has joined #ruby
unshadow has quit [Quit: leaving]
craigp has quit [Remote host closed the connection]
scripore has joined #ruby
paradoja has joined #ruby
ixti has joined #ruby
maximski has quit []
voyd has quit [Quit: leaving]
charliesome has quit [Quit: zzz]
jimms has quit [Client Quit]
iamjarvo has joined #ruby
josephcs has quit [Quit: (null)]
mrdtt has quit [Quit: Textual IRC Client: www.textualapp.com]
<scripore> hi, is there a way to refactor this down even more? http://hastebin.com/eworakuwak.vbs
byprdct has joined #ruby
havenwood has joined #ruby
jimms has joined #ruby
<jhass> your pastebin is down
<mwlang> jhass: gem rename dumb_name better_name —sanely
downtown has joined #ruby
<gr33n7007h> jhass: just remove the vbs from it
Azure has quit [Ping timeout: 252 seconds]
<jhass> mwlang: <3 looking forward to your PR!
muzik has joined #ruby
<jhass> gr33n7007h: what does it do?
<mwlang> jhass: oh, yeah. I’ve needed it myself a couple times, too.
<apeiros_> mwlang: so the default is --insanely?
DerisiveLogic has joined #ruby
AlexRussia has joined #ruby
<jhass> of course!
<gr33n7007h> jhass: sorting the string "tab" by number of appearances in descending order in second parameter text block.
paradoja has quit [Ping timeout: 264 seconds]
<jhass> gr33n7007h: the .vbs
<gr33n7007h> jhass: yep
<mwlang> apeiros_: of course. renaming gems isn’t for the faint of heart.
maximski has joined #ruby
<jhass> gr33n7007h: what does it do. why is it there, why can I just remove it
sambao21 has quit [Quit: Computer has gone to sleep.]
maximski has quit [Max SendQ exceeded]
doodlehaus has joined #ruby
<gr33n7007h> jhass: idk
<scripore> my bad, here's the corrected url http://hastebin.com/eworakuwak.rb
prasselpikachu has quit [Ping timeout: 252 seconds]
bluOxigen has quit [Ping timeout: 256 seconds]
maximski has joined #ruby
<jhass> scripore: text.each_char but that's about it I guess
<jhass> maybe rename text to frequency or whatever
red_horned_rihno has joined #ruby
<jhass> appearances?
prasselpikachu has joined #ruby
<jhass> dunno, something like that
<scripore> ah, okay, I'll get that fixed. thank you for the suggestions.
byprdct has quit [Quit: Textual IRC Client: www.textualapp.com]
Morkel has quit [Quit: Morkel]
red_horned_rihno has quit [Max SendQ exceeded]
scripore has quit [Quit: This computer has gone to sleep]
maximski has quit [Client Quit]
Morkel has joined #ruby
red_horned_rihno has joined #ruby
scott1 has joined #ruby
cpt_yossarian has joined #ruby
scripore has joined #ruby
vtunka has joined #ruby
jefus has joined #ruby
roolo has quit [Quit: Leaving...]
<mwlang> gr33n7007h: text..split('').group_by{|gb| gb}.sort_by{|k,v| v.size}.reverse.map{|m| m[0]}
<jhass> mwlang: .split('') -> .chars
<mwlang> jhass: Ah, yes. I keep forgetting that.
<jhass> map(&:first)
<havenwood> group_by(&:itself)
oo_ has quit [Remote host closed the connection]
<havenwood> reverse_each
<havenwood> each_char
<jhass> mwlang: but look at the pastebin, the description is not too good ;)
sinkensa_ has quit [Read error: Connection reset by peer]
tagrudev has quit [Remote host closed the connection]
sigurding has quit [Quit: sigurding]
aganov has quit [Remote host closed the connection]
werelivinginthef has quit []
AlexRussia has quit [Quit: WeeChat 1.2-dev]
Takle has quit [Remote host closed the connection]
scott1 has left #ruby ["WeeChat 1.1.1"]
roolo has joined #ruby
<mwlang> jhass: heh, you’re right.
commmmodo has joined #ruby
oki has quit [Ping timeout: 255 seconds]
<mwlang> I think I shall finish my coffee before solving any more problems...
sinkensabe has joined #ruby
spider-mario has joined #ruby
<workmad3> mwlang: that's always a good plan, IME
nii236 has joined #ruby
rajeshchawla has joined #ruby
GaryOak_ has joined #ruby
GGMethos has quit [Quit: WeeChat 1.0.1]
rajeshchawla has quit [Remote host closed the connection]
plashchynski_ has joined #ruby
civim has joined #ruby
vtunka has quit [Quit: Leaving]
plashchynski has quit [Ping timeout: 240 seconds]
<havenwood> string.each_char.sort_by { |char| -text.count(char) }
plashchynski_ has quit [Read error: Connection reset by peer]
<jhass> havenwood: n*m instead of n+m though
sigurding has joined #ruby
<havenwood> jhass: doesn't have to sort as many chars though. guess it depends.
civim has left #ruby [#ruby]
civim has joined #ruby
<jhass> it does not?
Xiti has quit [Quit: Xiti]
sambao21 has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> just counts the three, no need to count `text` chars not in `string`
bim has quit [Remote host closed the connection]
<havenwood> just from the example
<jhass> oh, that's what you mean
tvw has joined #ruby
<havenwood> yeah, just that
_maes_ has joined #ruby
bim has joined #ruby
bim has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
vtunka has joined #ruby
tkuchiki_ has quit [Remote host closed the connection]
<jhass> well, it still has to (in the worst case) run through text each time though
vtunka has quit [Remote host closed the connection]
rippa has joined #ruby
tvon has quit [Quit: leaving]
civim has left #ruby [#ruby]
<jhass> and that's what significant here, counting all the other letters is constant time, potentially higher constant time in the small example, granted
chinmay_dd has joined #ruby
civim has joined #ruby
civim has left #ruby [#ruby]
jenrzzz has joined #ruby
<makerop> if I setup a variable in my spec_helper, can I use that in a context block within a test?
<makerop> it seems that I can puts @data (the var) outside the context block, but it's nill with in a describe
<makerop> how can I share that?
Azure has joined #ruby
<jhass> makerop: sounds like a constant
sambao21 has quit [Client Quit]
<makerop> touche
mengu has quit [Remote host closed the connection]
multiscan has joined #ruby
<jhass> and you won't have trouble accessing that
<hanmac1> havenwood: i am still looking for a count_by method ;P
<havenwood> jhass: seems for the sample at least mine is several times faster. i'd go with that simpler code till a slow case was found.
<havenwood> hanmac1: mmmm
civim has joined #ruby
roolo_ has joined #ruby
joast has quit [Ping timeout: 250 seconds]
kblake has quit [Ping timeout: 264 seconds]
<jhass> havenwood: yeah, as said because yours has less constant time overhead in this small case, building the count cache doesn't pay off due to all the Ruby context switches, where as count can stay at C land while iterating over the string
roolo has quit [Ping timeout: 252 seconds]
<havenwood> faster or bust!
* havenwood goes in search of coffee...
<jhass> havenwood: if you make the first parameter significantly bigger than the second, I bet yours looses
mloveless has joined #ruby
<makerop> is there an easy array matcher in rspec, to match all elements in an array against a regex?
<jhass> havenwood: or we shall port both to crystal and see which wins :P
Morkel has quit [Quit: Morkel]
Vile` has quit [Ping timeout: 252 seconds]
AlphaTech has joined #ruby
Beliq has joined #ruby
MatthewsFace has quit [Remote host closed the connection]
mengu has joined #ruby
Vile` has joined #ruby
Beliq has quit [Client Quit]
Beliq has joined #ruby
Takle has joined #ruby
zorak8 has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
SegFaultAX has quit [Excess Flood]
<havenwood> jhass: aye, let's get down to brass tacks - to crystal!
bricker has joined #ruby
SegFaultAX has joined #ruby
<jhass> meh, with the given data yours is still faster, didn't expect that :P
<jhass> the allocation hurts too much I guess
<havenwood> hanmac1: ^ implement #count_by in crystal-lang
<jhass> yeah, do it!
<hanmac1> havenwood: i currently do it in MRI
<jhass> asterite accepts anything :P
joonty has quit [Quit: joonty]
sambao21 has joined #ruby
plashchynski has joined #ruby
<jhass> hanmac1: with "tabtabtab" instead of "tab" yours is slower :P
<hanmac1> jhass: so than asterite does accepts asterisk? ("*") ;P
<jhass> havenwood: ^
<jhass> sorry
rrrutr has joined #ruby
<jhass> hanmac1: I guess so :P
joonty has joined #ruby
jmignault has joined #ruby
<Tomasso> any alternatives to sinatra?
jottr has quit [Ping timeout: 256 seconds]
<jhass> tons
<havenwood> Tomasso: Roda is great.
<Tomasso> something that works in the same way, not based in rack if possible..
roshanavand1 has joined #ruby
<jhass> what's wrong with rack?
<Tomasso> ive been dealing with a buig and got crazy, ive lost two weeks and a bit more.. im stucked
RegulationD has joined #ruby
<Tomasso> and migrate should not be that dificult, since just use get and post calls
mary5030 has joined #ruby
<havenwood> Tomasso: Well, these are all Rack adapters, but here are a number of options with Hello Worlds: https://github.com/luislavena/bench-micro#readme
roshanavand has quit [Ping timeout: 246 seconds]
<jhass> Tomasso: did you ask here before about the issue?
iamjarvo has joined #ruby
dfinning_ has joined #ruby
<jhass> are you sure the problem is in rack and not your appserver?
jimms has quit [Remote host closed the connection]
<havenwood> That's a nice thing about Rack, just swap out the web server.
<jhass> well, that's its entire point really
<Tomasso> yeah.. well my problem actually seems to be the session, that is not able to store a mongo session (needs to be different mongo session for each user)
Beliq has quit [Read error: Connection reset by peer]
centrx has joined #ruby
<jhass> that sounds like an application design problem to me tbh
pdoherty has joined #ruby
<Tomasso> the session is from rack, with the cookie session seems to work but the value gets lost from one route call to another
<jhass> nothing that switching the underlying libraries would solve
cjim___ has joined #ruby
tobago has quit [Remote host closed the connection]
cjim___ has quit [Client Quit]
apeiros_ has quit [Remote host closed the connection]
<jhass> you need to have a global in process cache and just store an id for that cache in the cookie
nii236 has quit [Ping timeout: 252 seconds]
<jhass> serializing entire ruby objects into a cookie is a very bad idea
roshanavand1 has quit [Ping timeout: 255 seconds]
<jhass> especially if those objects hold resources like a socket connection
roshanavand has joined #ruby
KnowledgeOwl has quit [Quit: Saindo]
jlebrech has joined #ruby
RegulationD has quit [Ping timeout: 256 seconds]
<jhass> and even that approach will break once you use a multi-process design
jimms has joined #ruby
<jhass> so I have no idea what a mongo session really is, but maybe you can store just an identifier or something and rebuild the object from it
jottr has joined #ruby
kblake has joined #ruby
<jlebrech> i want a gem that'll let me send to a variable to irb, i kinda did it using redis but is there something like that in the open other than binding.pry?
fgo has quit [Quit: WeeChat 1.1.1]
sambao21 has quit [Quit: Computer has gone to sleep.]
<Tomasso> i also.. tried marshalling the whole session to a string .. and same thing.. if I did an appart process to get the sessions wouldnt i be replicating same functionality twice
<jhass> jlebrech: what's your issue with binding.pry?
<Tomasso> https://github.com/sinatra/sinatra/issues/976 -> this was the issue
<GaryOak_> What's the best way to set a loop interval in ruby, should I just use sleep?
<jhass> Tomasso: sounds like you want to serialize a Mutex, which just makes no sense at all
rbennacer has quit [Remote host closed the connection]
<Tomasso> im afraid that if I store only ids the same thing happens,, since I also tried connecting to mongo for each query, and not using the session at all and got the same issue
<jlebrech> jhass: i'm not looking to pause execution but look back at vars i can play around with
anarang has quit [Quit: Leaving]
<jhass> one of the reasons why I said serializing objects into a cookie is a really bad idea
<havenwood> GaryOak_: Check out the timers gem: https://github.com/celluloid/timers#readme
<GaryOak_> havenwood: thanks
arup_r has joined #ruby
sambao21 has joined #ruby
<havenwood> GaryOak_: You can just sleep if you don't mind time slippage.
crantron has joined #ruby
<jhass> jlebrech: context = binding; Thread.new { context.pry; sleep 1 } ? :P
<jhass> (no idea if that actually works)
<GaryOak_> havenwood: will the clock time not match exactly or something?
<jlebrech> jhass: oh i'll try
<Tomasso> jhass: into cookie yes.. not good but i tried it and at least for the mongo session it worked, but when calling another route contents dissapear
sinkensabe has quit [Remote host closed the connection]
<jhass> Tomasso: I can only repeat myself, it doesn't work because the approach is flawed
<havenwood> GaryOak_: One thing is if you say sleep 5 min, then the thing takes ten seconds, you slowly slip forward by those ten seconds each time.
jimms has quit [Ping timeout: 240 seconds]
<GaryOak_> ohhh ok
nerium has joined #ruby
Beliq has joined #ruby
<jhass> Tomasso: no framework will change that
kblake has quit [Ping timeout: 265 seconds]
zorak8 has quit [Read error: Connection reset by peer]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fabrice31 has quit [Remote host closed the connection]
Xiti has joined #ruby
zorak8 has joined #ruby
<nerium> Anyone knows if there is a way to monkey patch Socket.getaddrinfo?
<nerium> It's currently causing my threads to freeze
hcnewsom has joined #ruby
<Tomasso> you would implement a separate process to get the sessions concurrently >
jonr22 has joined #ruby
<Tomasso> everytime you make a query ?
atomiccc has joined #ruby
<jlebrech> jhass: oh, that's cool
Xiti has quit [Client Quit]
<jhass> Tomasso: I haven't worked with Mongo yet, I have no idea what a Mongo session is, why you need one, why you need on per user, why you need to keep it across requests and how it's represented, that's however all needed to work out a sane approach
scripore has joined #ruby
<gr33n7007h> anyway to refactor this: https://gist.github.com/anonymous/e66a11ccac7b4e4da9f6
jimms has joined #ruby
rbennacer has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
<jlebrech> jhass: pry stops rendering correctly which is anoying
anarang has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
LiquidIn1ect is now known as LiquidInsect
rbennacer has quit [Remote host closed the connection]
<jhass> gr33n7007h: I'd start by typing out the hash literals, that Hash[%w[ is just obfuscation to me
vlad_starkov has joined #ruby
<workmad3> jhass: hmm... 'Mongo session' sounds, to me, like 'Store an HTTP session in mongo rater than a cookie'
<workmad3> *rather
<centrx> gr33n7007h, For one thing you could format it logically
<gr33n7007h> i know it looks ugly doesn't it
<civim> Any tips for looking at HTML in pry? I'm using awesome print, but printing nested divs would be really great.
jonr22 has quit [Ping timeout: 265 seconds]
<workmad3> but probably not, now I've read more of the backtrace
lemur has joined #ruby
rbennacer has joined #ruby
jimms has quit [Ping timeout: 252 seconds]
rhllor has joined #ruby
bayed has joined #ruby
Asher has quit [Quit: Leaving.]
<jhass> gr33n7007h: I just now realized the map call is on the %w and not on the Hash[ result, very confusingly formatted indeed
vlad_starkov has quit [Ping timeout: 246 seconds]
ta has joined #ruby
nerium has quit [Quit: nerium]
mloveless has quit [Ping timeout: 272 seconds]
bal has quit [Quit: bal]
ghostpl_ has quit [Remote host closed the connection]
Xiti has joined #ruby
mloveless has joined #ruby
Beliq has quit [Quit: My computer has gone to sleep. ZZZzzz…]
ghostpl_ has joined #ruby
<gr33n7007h> jhass: I'm trying to stay within a certain amount of chars in vim
krz has quit [Quit: WeeChat 1.0.1]
maletor has joined #ruby
<jhass> gr33n7007h: can you replace certain by a number?
<mwlang> why do I get an array within an array with this: “404-555-1234”.scan(/([0-9]{3})[\s\.\-]?([0-9]{3})[^[0-9]]?([0-9]{4})/) => [["404", "555", "1234"]]
<gr33n7007h> jhass: 80
tier_ has joined #ruby
<mwlang> any time I use scan, I find myself tacking on an extra call to #flatten
lemur has quit [Remote host closed the connection]
<centrx> gr33n7007h, That doesn't prevent you from using indentation
<mwlang> so I’m wondering if I’m using scan incorrectly.
tus has joined #ruby
iamjarvo has joined #ruby
<gr33n7007h> centrx: it's how vim formats it
<centrx> gr33n7007h, no it's not, vim doesn't choose to put newlines in strange places and then not put newlines in proper places
<jhass> gr33n7007h: just formatting and using recent methods, 69 is the longest line http://paste.mrzyx.de/ph5zqspdo
Hirzu has quit [Ping timeout: 246 seconds]
<havenwood> >> "404-555-1234".scan /\d+/
<centrx> gr33n7007h, Your code is designed to confuse the reader, putting functions on a newline with the same indentation level that are not at the same semantic level
<eval-in_> havenwood => ["404", "555", "1234"] (https://eval.in/298302)
<havenwood> mwlang: ^
civim has quit [Quit: This computer has gone to sleep]
<gr33n7007h> jhass: that's great thank you!
tier has quit [Ping timeout: 264 seconds]
<jhass> gr33n7007h: joining the first map into one line is still only 73
<gr33n7007h> centrx: You're right, it was me
oo_ has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
SouL has joined #ruby
Hirzu has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
ascarter has joined #ruby
<jhass> gr33n7007h: the 1s in a1a1 are redundant iirc
ascarter has quit [Read error: Connection reset by peer]
<gr33n7007h> jhass: yes, good call
<jhass> and only a confusing way to call .chars actually
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Read error: Connection reset by peer]
<gr33n7007h> let me tinker a bit
oo_ has quit [Ping timeout: 252 seconds]
Asher has joined #ruby
Asher is now known as Guest11239
zachrab has joined #ruby
Guest11239 has quit [Remote host closed the connection]
plashchynski has quit [Ping timeout: 240 seconds]
Tomasso has quit [Quit: Page closed]
maximski has joined #ruby
maximski has quit [Max SendQ exceeded]
<jhass> gr33n7007h: using .chars, the two cases are perfectly fine to combine into one
maximski has joined #ruby
sigurding has quit [Quit: sigurding]
maximski has quit [Max SendQ exceeded]
<gr33n7007h> jhass: how so?
maximski has joined #ruby
<jhass> >> special_chars = %w[<< >> * & + - ! ?].map {|c| [c, c.chars.flat_map {|n| n.unpack('H*') }.join('-').upcase] }.to_h
<eval-in_> jhass => {"<<"=>"3C-3C", ">>"=>"3E-3E", "*"=>"2A", "&"=>"26", "+"=>"2B", "-"=>"2D", "!"=>"21", "?"=>"3F"} (https://eval.in/298318)
<jhass> did I change result?
scripore has joined #ruby
<gr33n7007h> jhass: no, that's awesome thanks the result is the same :)
<gr33n7007h> jhass: (2**32) kudos points to you!
mengu has quit [Remote host closed the connection]
Altonymous has quit [Quit: Altonymous]
sigurding has joined #ruby
hsps_ has joined #ruby
zachrab has quit [Ping timeout: 252 seconds]
banister has joined #ruby
<havenwood> mwlang: You could use #match instead then ask for its #captures
<jhass> gr33n7007h: another variant I'd consider: http://paste.mrzyx.de/picjtrydn
survili has joined #ruby
<mwlang> havenwood: does your example handle different scenarios such as 404-555-1234, 4045551234, (404) 555-1234, etc? I’m trying to always break into 3,3,4 chunks
<mwlang> I’m not familiar with #captures, so I’ll check that out.
<gr33n7007h> jhass: that's what i love about ruby, more than one way to do things, which one should I use? I think the latter more readable to me
coderhs has quit [Ping timeout: 256 seconds]
dc_ has quit [Read error: Connection reset by peer]
<jhass> yeah, it points out that you're building a hash more directly
<gr33n7007h> yep, decided each_with_object it is :)
dc_ has joined #ruby
<gr33n7007h> jhass: many thanks
Megtastique has quit []
prasselpikachu has quit [Ping timeout: 264 seconds]
prasselpikachu has joined #ruby
arup_r has quit [Ping timeout: 256 seconds]
MatthewsFace has joined #ruby
MatthewsFace has quit [Remote host closed the connection]
MatthewsFace has joined #ruby
mistermocha has joined #ruby
<mwlang> havenwood: I like the #match + #captures approach. That worked quite well and seems to be more readable.
mistermocha has quit [Read error: Connection reset by peer]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mwlang> "(%s) %s-%s" % /([0-9]{3})[^[0-9]]?([0-9]{3})[^[0-9]]?([0-9]{4})/.match(phone).captures => “(404) 555-1234”
mistermocha has joined #ruby
livingstn has joined #ruby
<survili> hi, I need to write to a file in certain format(for 3rd party). The format is version(int), name(string), description(string). The format in which strings should be written is: length of string and then the string. I was wondering if there is some way to achieve this string format using .pack method. I couldn't figure out what pattern to pass to pack to achieve this string format. Anyone ?
rbennacer has quit [Remote host closed the connection]
mistermo_ has joined #ruby
<mwlang> survili: what about simply: puts “#{str.size}#{str}”
<centrx> Seems like that couldn't be the format if strings can start with numbers
hanmac1 has quit [Quit: Leaving.]
roolo has joined #ruby
<survili> mwlang: can't do it using pack ?
antgel has quit [Ping timeout: 264 seconds]
bim has joined #ruby
gccostabr has quit [Quit: See you later!]
razieliyo has joined #ruby
razieliyo has joined #ruby
<havenwood> mwlang: You might also look at named capture groups:
<havenwood> >> "404-555-1234".match(/(?<area>[0-9]{3})[\s\.\-]?(?<prefix>[0-9]{3})[^[0-9]]?(?<local>[0-9]{4})/) { |match| "(#{match['area']}) #{match['prefix']}-#{match['local']}" }
antgel has joined #ruby
<eval-in_> havenwood => "(404) 555-1234" (https://eval.in/298323)
<centrx> survili, How would this be related to the functionality of pack?
tcrypt has joined #ruby
digitalextremist has joined #ruby
livathinos has quit []
tcrypt has quit [Remote host closed the connection]
Asher- has joined #ruby
morenoh149 has quit [Ping timeout: 252 seconds]
danjordan has quit [Quit: danjordan]
max96at|off is now known as max96at
mistermocha has quit [Ping timeout: 244 seconds]
roolo_ has quit [Ping timeout: 240 seconds]
<mwlang> havenwood: interesting approach.
Asher- has quit [Client Quit]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> mwlang: here's another trick:
<havenwood> >> /(?<area>[0-9]{3})[\s\.\-]?(?<prefix>[0-9]{3})[^[0-9]]?(?<local>[0-9]{4})/ =~ "404-555-1234"; area
<eval-in_> havenwood => "404" (https://eval.in/298325)
Asher has joined #ruby
<havenwood> mwlang: Regexp on the left and local variable auto-assigned ^.
Megtastique has joined #ruby
Megtastique has quit [Max SendQ exceeded]
<survili> centrx: I'm trying to write everything using pack, read some tutorials and I see that people use pack/unpack to read/write structured data. Take a look at my sample https://gist.github.com/survili/81981400f022057da4ca
<mwlang> havenwood: nice trick — maybe too confusing. I think I’m settling on this one: "(%s) %s-%s" % phone.match(/(\d{3})[^\d]?(\d{3})[^\d]?(\d{4})/).captures
Megtastique has joined #ruby
<mwlang> its short and sweet, yet mostly readable.
sambao21 has quit [Quit: Computer has gone to sleep.]
danjordan has joined #ruby
<havenwood> mwlang: ;)
<survili> centrx: here I can write my string using int and then the string data using "A#{mystring.size}", but I was wondering maybe pack natively supports such strings format(len and then the data)
DaniG2k has quit [Quit: leaving]
bootstrappm has joined #ruby
<mwlang> definitely saving all the permutations of matching to my scratchpad, though. good info to have on hand.
decoponyo has joined #ruby
<jhass> survili: pack/unpack is for structure on the byte level, not on the character level
_hollywood has joined #ruby
mistermo_ has quit [Ping timeout: 245 seconds]
<jhass> (well, nibble level actually)
sambao21 has joined #ruby
decoponio has quit [Ping timeout: 244 seconds]
<survili> jhass: so the correct way for me to write it would be: [my_str.size,my_str, my_other_str.size, my_other_str].pack("vA#{my_str.size}vA#{my_other_str.size} ?
red_horned_rihno has quit [Ping timeout: 244 seconds]
<jhass> unlikely
anarang has quit [Quit: Leaving]
robustus has quit [Ping timeout: 255 seconds]
mistermocha has joined #ruby
<makerop> is there a good way to test methods that return data hashes?
<makerop> ie, am i missing something, in that, each method I'll have to test the key/value pairs individually?
juanpaucar has quit []
susmus has joined #ruby
werelivinginthef has joined #ruby
<mwlang> makerop: what do you have so far?
<jhass> survili: actually I fail to make any sense out of your description of the format
wldcordeiro has joined #ruby
roshanavand has quit [Remote host closed the connection]
<mwlang> you could make the hash the subject and then do several “its” checks. as in: its(“[:some_key]”) { should eq “foobar” }
scripore has quit [Quit: This computer has gone to sleep]
<mwlang> but if you want to just check that every key is present, then: its(“keys”) { should eq [:a, :b, :c] }
apeiros_ has joined #ruby
iamjarvo has joined #ruby
kaiZen- has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<jhass> survili: if I had to guess, "version(#{version}), description(#{description.size}#{description}) ..."
iamjarvo has quit [Max SendQ exceeded]
<survili> jhass: for the simplicity let's say that the format is made of 3 fields, version which is a number, and two stings(can be any length). I thought writing it [version, my_str.size,my_str, my_other_str.size, my_other_str].pack("vvA#{my_str.size}vA#{my_other_str.size}. The first v is for version, second is for string length and then there is A with lenght of the string and same for second string
robustus|Off has joined #ruby
robustus|Off is now known as robustus
iamjarvo has joined #ruby
<jhass> survili: which kind of int? which byte order?
wallerdev has joined #ruby
sigurding has quit [Quit: sigurding]
<jhass> which kind of int with which byte order for the string lengths?
<jhass> I think that's the missing part here
mistermocha has quit [Read error: Connection reset by peer]
<survili> jhass: 16-bit unsigned little endian
lkba has joined #ruby
mistermocha has joined #ruby
bim has quit [Remote host closed the connection]
Hirzu has quit [Ping timeout: 264 seconds]
<gr33n7007h> so that would be `S<`
<makerop> mwlang, yeah, I just want to check the keys, but that is prohibitive
juanpaucar has joined #ruby
<jhass> survili: [version, str1.size, str1, str2.size, str2].pack("S<S<AS<A") then?
<makerop> ..formattings weird
danjordan has quit [Quit: danjordan]
thumpba has joined #ruby
soulcake has quit [Quit: Quack.]
<mwlang> makerop: expect(@client.nic_data.keys).to ….
danjordan has joined #ruby
<jhass> v probably works too actually, no idea why you started interpolating the sizes as ascii characters then
<gr33n7007h> .pack('vvAvA')
<makerop> mwlang, I think ill use an include
ascarter has joined #ruby
<havenwood> vvAvAvoom
<survili> jhass: I read that 'v' is 16 bit little endian, regarding <S<AS I will read what it mean, will be glad if you could explain
<gr33n7007h> lol
strixd_ has quit [Quit: 500]
<mwlang> makerop: that’s what I generally use as well.
soulcake has joined #ruby
<mwlang> esp. if some keys are not always present.
<jhass> survili: S is 16 bit unsigned integer, < is a flag to turn it little endian instead of native endian
wottam has joined #ruby
<jhass> so looks like same as v actually
ascarter has quit [Max SendQ exceeded]
<makerop> yeah
gfawcettpq has quit [Ping timeout: 265 seconds]
RegulationD has joined #ruby
ascarter has joined #ruby
<mwlang> makerop: generally, if I’m testing functionality like this, I’m writing tests against each key anyway to check that expected data’s there…that infers the key is present so a spec to check that certain keys are present isn’t needed — its just extra test code to maintain.
<makerop> how do you test the data though?
<makerop> since you don't really knwo what it is?
red_horned_rihno has joined #ruby
plashchynski has joined #ruby
<makerop> ie, in this example, I'd need to testing interface_name, which can be like...anything
thumpba_ has joined #ruby
civim has joined #ruby
<mwlang> makerop: in your test setup, you’d name it yourself, feed it to your code, get back the answer, then check that the answer matches your expectation.
RegulationD has quit [Remote host closed the connection]
robustus has quit [Ping timeout: 264 seconds]
codegate has joined #ruby
<makerop> cool
<survili> jhass: I ran your sample and the output for version = 1, str1 = "str1", str2 = "str2" is "\x03\x00\x04\x00s\x04\x00s". A means one character no ? don't we need A#{str1.size} to achieve what I need ?
<makerop> I do that (via DATA)
bluOxigen has joined #ruby
<mwlang> makerop: exactly.
<jhass> survili: oh, that's why, * should be fine there
<mwlang> however, instead of a constant like DATA, use lets…as in: let(:data) { whatever_DATA_is_now }
<jhass> survili: eats as many as possible
joonty has quit [Quit: joonty]
robustus has joined #ruby
triangles has joined #ruby
thumpba has quit [Ping timeout: 256 seconds]
<gr33n7007h> >> [666].pack('i') == [666].pack('N') ? "big endian" : "little endian"
<eval-in_> gr33n7007h => "little endian" (https://eval.in/298341)
<jhass> survili: but seems you had a working version already, what was your question then?
blueOxigen has joined #ruby
ramfjord has joined #ruby
<bradland> shevy: you'll like this: https://www.omniref.com/ruby/2.2.1/symbols/Benchmark/bm?#annotation=4095926&line=182
zorak8 has quit [Read error: Connection reset by peer]
sevvie has quit [Ping timeout: 255 seconds]
<bradland> nice drilldown on some common pitfalls of benchmarking very fast operations
<survili> jhass: I was wondering if there is some pattern I can pass to .pack that "knows" to write strings in my format(i.e. size first and then the data). but I guess there is not
wolf4ood___ has joined #ruby
piotrj has quit [Remote host closed the connection]
zorak8 has joined #ruby
<jhass> well, I don't see any in the docs
arup_r has joined #ruby
<bradland> yeah, i don't think pack has any references like that
<bradland> i.e., references to total data size
codecop has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
RegulationD has joined #ruby
piotrj has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
deric_skibotn has joined #ruby
sevvie has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<survili> jhass: thank you
<jhass> survili: next time just don't include all that unnecessary baggage into your question, "Is there a directive for pack that prepends the size of string to it?" or something like that would've been much clearer :)
mog_ has joined #ruby
<survili> jhass: lol, great way to ask my question :)
<bradland> i'm always amazed at how hard it is to ask questions (speaking for myself here, not a passive-aggressive comment)
rbennacer has joined #ruby
Schmidt has quit [Ping timeout: 265 seconds]
piotrj has quit [Remote host closed the connection]
survili has quit [Quit: Page closed]
d10n-work has quit [Quit: Connection closed for inactivity]
<mwlang> bradland: I think sometimes I make it harder on myself because I’m trying to construct a question that won’t solicit the obvious answers I already considered and don’t want to wade through to get to the intended answer.
yqt has joined #ruby
dANO_ has quit []
CustosLimen has quit [Ping timeout: 252 seconds]
Sawbones has joined #ruby
robustus has quit [Ping timeout: 255 seconds]
sarlalian has quit [Quit: WeeChat 0.4.2]
<jhass> mwlang: that's simple to avoid. "I already tried to a, b, c and d. Any other options I missed?"
<jhass> if your attempts had small enough code samples including those is good too
dfinning_ has quit [Remote host closed the connection]
dc_ has quit [Ping timeout: 245 seconds]
robustus has joined #ruby
<jhass> since you might actually have had a non-obvious bug in one of these or something like that
Megtastique has quit []
jottr has quit [Ping timeout: 246 seconds]
SegFaultAX has quit [Excess Flood]
sigurding has joined #ruby
polysics has joined #ruby
<jhass> the actually confusing part about survili's question was the lengthy description of its whole format (including the actually unrelated version) and then the "I couldn't figure out what to pass to pack" at the end
<jhass> which made it sound like their question was about the (then even insufficiently described) format
sarlalian has joined #ruby
Beliq has joined #ruby
jottr has joined #ruby
SegFaultAX has joined #ruby
<jhass> instead of about a detail to it/an optimization to the already present solution
Rollabunna has quit [Remote host closed the connection]
dh64 has joined #ruby
Takle has quit [Remote host closed the connection]
Rollabunna has joined #ruby
Dodo1 has joined #ruby
Limix has joined #ruby
kalusn has quit [Remote host closed the connection]
Pupeno_ has quit [Quit: Leaving...]
multiscan has quit [Ping timeout: 252 seconds]
kalusn has joined #ruby
nfk has quit [Quit: yawn]
Pupeno has joined #ruby
Dodo1 has left #ruby [#ruby]
zachrab has joined #ruby
kblake has joined #ruby
Dodo1 has joined #ruby
robustus has quit [Ping timeout: 264 seconds]
sevvie has quit [Ping timeout: 252 seconds]
catphish has quit [Quit: Leaving]
<Dodo1> hello,
<Dodo1> are there any rules about posting stuff in here?
spyderman4g63 has joined #ruby
sevvie has joined #ruby
dc_ has joined #ruby
aryaching has joined #ruby
ki0 has quit [Remote host closed the connection]
robustus has joined #ruby
craigp has joined #ruby
jlebrech has quit []
Dodo1 has left #ruby [#ruby]
kalusn has quit [Ping timeout: 256 seconds]
Dodo1 has joined #ruby
dc_ has quit [Read error: Connection reset by peer]
<centrx> Dodo1, "stuff"?
danjordan has quit [Quit: danjordan]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dc_ has joined #ruby
rbennacer has quit [Remote host closed the connection]
<jhass> Dodo1: just ask, you'll be told if it was inappropriate ;)
zachrab has quit [Ping timeout: 264 seconds]
sigurding has quit [Quit: sigurding]
<Dodo1> okay =)
<Dodo1> I have a problem with JSON. I do get a JSON (LoadError) altough I have the JSON gem installed and require it in the file?
aspiers has quit [Ping timeout: 255 seconds]
<jhass> Dodo1: can you post a reproducing example to gist.github.com?
iamjarvo has joined #ruby
Megtastique has joined #ruby
chthon has quit [Ping timeout: 264 seconds]
iamjarvo has quit [Max SendQ exceeded]
mary5030 has quit [Remote host closed the connection]
<shevy> Dodo1 a minimal json file would be helpful
<shevy> ideally with how you can reproduce that error
iamjarvo has joined #ruby
<shevy> for me, require 'json' works
<shevy> I have the json-1.8.1.gem
marcoecc has joined #ruby
<Dodo1> okay. I'm trying it.
psy_ has joined #ruby
psy_ has quit [Max SendQ exceeded]
dc_ has quit [Read error: Connection reset by peer]
psy_ has joined #ruby
troulouliou_div2 has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
scripore has joined #ruby
troulouliou_div2 has quit [Client Quit]
Sawbones has quit [Remote host closed the connection]
dc_ has joined #ruby
pontiki has joined #ruby
towski_ has joined #ruby
shadoi1 has joined #ruby
_djbkd has joined #ruby
oivoodoo has quit [Remote host closed the connection]
baweaver has joined #ruby
nfk has joined #ruby
ismael__ has joined #ruby
plashchynski has quit [Ping timeout: 264 seconds]
commmmodo has quit [Quit: commmmodo]
nii236 has joined #ruby
ploshy has joined #ruby
DerisiveLogic has quit [Ping timeout: 264 seconds]
plashchynski has joined #ruby
<mwlang> I’m pulling binary data out of an LDAP field. Its a thumbnail headshot of the person. Is there a way I can tell if its JPG or PNG so I save the correct file extension?
<iamjarvo> so if you say Person = Struct.new(:name); p = Person.new("ruby"); p.instance_variables # => []; how do structs utilize instance variables
craigp has quit [Remote host closed the connection]
joast has joined #ruby
<mwlang> I know if I just save some file and call “file” on command-line I can get the file signature that way, but I’m hoping Ruby has a more elegant way.
tcrypt has joined #ruby
leafybasil has quit [Remote host closed the connection]
<Dodo1> I could sort out the problem. Thank you anyway
<wallerdev> mwlang: i dont think ruby has a built in way to do that, but you can use an image processing library
<wallerdev> such as imagemagick
jespada has quit [Ping timeout: 244 seconds]
GGMethos has joined #ruby
civim has quit [Quit: Leaving]
psy_ has quit [Read error: Connection reset by peer]
Bounga has quit [Quit: Bounga]
doodlehaus has quit [Ping timeout: 255 seconds]
zenith_ has joined #ruby
tcrypt has quit [Ping timeout: 245 seconds]
<mwlang> is libmagic part of ImageMagick?
ramfjord has quit [Ping timeout: 250 seconds]
<toretore> no
<toretore> nothing to to with im
<toretore> libmagic is what `file` uses
<jhass> iamjarvo: I guess not via fields, since they're implemented in C in MRI, I guess they use some internal struct or something for the fields
juanpaucar has quit [Remote host closed the connection]
polysics has quit [Remote host closed the connection]
jenrzzz has joined #ruby
juanpaucar has joined #ruby
lizander has joined #ruby
polysics has joined #ruby
<havenwood> mwlang: Or just look at what the file starts with.
<mwlang> havenwood: its a binary blob field.
jobewan has joined #ruby
<havenwood> when "\xFF"; 'jpg'; when "\x89"; 'png'
<mwlang> oh, wait, scan the beginning of the binary data and decipher file type from that...
Renich has joined #ruby
<mwlang> that’s the trick I was seeking.
<wallerdev> thats what these libraries do
jespada has joined #ruby
<wallerdev> they just support every type of file or image haha
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
dfinninger has joined #ruby
dc_ has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
binfalse has quit [Quit: leaving]
dfinninger has quit [Client Quit]
polysics has quit [Ping timeout: 252 seconds]
aldodelgado has joined #ruby
adriancb_ has joined #ruby
juanpaucar has quit [Ping timeout: 272 seconds]
adriancb has quit [Ping timeout: 252 seconds]
dc_ has joined #ruby
nateberkopec has joined #ruby
zachrab has joined #ruby
jonr22 has quit [Ping timeout: 252 seconds]
phale has joined #ruby
freerobby has joined #ruby
PaulCapestany has quit [Quit: .]
Jackneill has joined #ruby
lordkryss has joined #ruby
_djbkd has quit [Remote host closed the connection]
ptrrr has joined #ruby
DerisiveLogic has joined #ruby
phale has left #ruby [#ruby]
dc_ has quit [Remote host closed the connection]
chinmay_dd has quit [Quit: Connection closed for inactivity]
jespada has quit [Ping timeout: 245 seconds]
dc_ has joined #ruby
DLSteve has joined #ruby
<mwlang> thanks, guys. Got it. Since I had rmagick gem already, the most assured way worked out to this: @thumbnail = Magick::Image.from_blob(entry[:thumbnailPhoto) and then I just check @thumbnail.format for “JPEG” or “PNG”, etc.
mog_ has quit [Ping timeout: 272 seconds]
User458764 has joined #ruby
ianwessen has joined #ruby
atomi has quit [Quit: installing new notifications system bbiab]
Rephiax has joined #ruby
PaulCapestany has joined #ruby
apxm has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_djbkd has joined #ruby
banister has joined #ruby
banister has quit [Max SendQ exceeded]
Pupeno has quit [Quit: Leaving...]
SegFaultAX has quit [Excess Flood]
mistergibson has quit [Ping timeout: 246 seconds]
ianwessen has left #ruby [#ruby]
tcrypt has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
mog_ has joined #ruby
jespada has joined #ruby
Flcn has quit [Quit: Be back later ...]
dc_ has quit [Ping timeout: 272 seconds]
Spami has quit [Quit: This computer has gone to sleep]
ojacobson_ has joined #ruby
SegFaultAX has joined #ruby
ghr has quit [Ping timeout: 252 seconds]
martinbmadsen has joined #ruby
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
mistergibson has joined #ruby
ojacobson has quit [Ping timeout: 240 seconds]
Spami has joined #ruby
dfinninger has joined #ruby
unshadow has joined #ruby
zenith_ has quit [Remote host closed the connection]
<unshadow> What is the right way of handeling a long (50+) string in ruy code ?
Zai00 has quit [Quit: Zai00]
<centrx> Where did it come from?
<centrx> Where does it go?
towski_ has quit [Remote host closed the connection]
<GaryOak_> haha
nii236 has quit [Ping timeout: 264 seconds]
boadie has joined #ruby
<workmad3> centrx: ARRRRRGH!!!!
average has joined #ruby
<workmad3> centrx: make my internal voice stop singing!!!!
fmcgeough has joined #ruby
towski_ has joined #ruby
maximski has quit []
towski_ has quit [Remote host closed the connection]
boadie has quit [Remote host closed the connection]
<ericwood> I feel like I should be able to splat hashes as keyword args
<ericwood> like:
scripore has joined #ruby
<ericwood> >> def foo(bar:); puts bar; end; foo(*{bar: 'baz'})
<eval-in_> ericwood => wrong number of arguments (1 for 0) (ArgumentError) ... (https://eval.in/298355)
scripore has quit [Client Quit]
DerisiveLogic has quit [Ping timeout: 264 seconds]
tuelz has joined #ruby
<ericwood> see? wouldn't that be badass
Takle has joined #ruby
chrishough has joined #ruby
Pupeno has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
<tuelz> Is there a good way to check a version of a gem inside a project? I need to support a few versions of a gem and the core classes changed their namespace between versions
<tuelz> so I imagine Bundler.get_gem_version or something, but I can't find anything yet
<ojacobson_> >> def foo(bar:); puts bar; end; foo(**{bar: 'baz'})
<eval-in_> ojacobson_ => baz ... (https://eval.in/298357)
mistermocha has joined #ruby
<ericwood> tuelz: Gemfile.lock should show you
<ericwood> ojacobson_: tha hell
ojacobson_ is now known as ojacobson
<ericwood> wow that's greatttt
<mwlang> tuelz: which gem?
<tuelz> ericwood: was hoping there was a cleaner way, but at least now I know one way!
<ericwood> tuelz: you talking about programmatically?
m8 has joined #ruby
DerisiveLogic has joined #ruby
<tuelz> mwlang: it's an inhouse gem for an inhouse project that is SOA so we gemified the database setup process
<workmad3> tuelz: you've already mentioned one way
<workmad3> tuelz: check which top-level namespace is defined ;)
<tuelz> workmad3: I don't think that's a real method :p
<tuelz> jesus that makes so much more sense
<tuelz> thanks
<workmad3> hehe
<mwlang> tuelz: The usual pattern I’ve seen is GemNamespace::VERSION
<mwlang> or really, GemNamespace::version
<mwlang> for example:: Rails::version
ghostpl_ has quit [Remote host closed the connection]
<workmad3> tuelz: yeah, the way I said you mentioned was to check for a particular defined namespace
<tuelz> mwlang: that would be a good idea, too
<workmad3> tuelz: but I should really have said that you alluded to it rather than mentioned it :)
<tuelz> workmad3: yeah that sounds simple enough
ki0 has joined #ruby
<tuelz> brb chaging wifi
<workmad3> tuelz: btw, if you're interested in the Gemfile.lock approach, I've had success with 'Hash[File.read("Gemfile.lock").map(&:strip).map{|line| line.split(" ", 2)}.reject{|_, v| v.nil?}.reject{|_, v| v =~ /\((=|>|~)/}.map{|g, v| [g, v[1..-2]]}]' as a one-liner to produce a gem_name => version hash
wallerdev has quit [Quit: wallerdev]
unshadow has quit [Quit: leaving]
<mwlang> workmad3: 8-o
<workmad3> mwlang: it's pretty, right? :D
<Senjai> workmad3: You could just use shell utils xD
GaryOak_ has quit []
<Senjai> cut and friends
juanpaucar has joined #ruby
<workmad3> Senjai: I wanted the hash inside a chef deploy, kinda made sense to just use ruby capabilities
<mwlang> workmad3: yeah, I love to read that like I love to scan ingredient lists on packaged goods.
<Senjai> workmad3: Ah
<mwlang> but, hey, ya can’t argue with the results ya get.
jottr has joined #ruby
ramfjord has joined #ruby
dropp has quit [Quit: leaving]
<workmad3> mwlang: yeah... I probably should split that up into more readable lines... but I kinda like it as a one-liner :)
<workmad3> mwlang: and that one line of ugliness let me clean up a whole host of auto-detection of system dependencies based on reading a project's Gemfile :)
baweaver has quit [Remote host closed the connection]
tuelz has quit [Ping timeout: 246 seconds]
<workmad3> 'oh hey, this project has mini_magick in its gemfile... install imagemagick system package'
dEPy has quit [Quit: (null)]
yfeldblu_ has quit [Ping timeout: 265 seconds]
<workmad3> right, must run off
<workmad3> hf all
Dodo1 has quit [Ping timeout: 265 seconds]
yqt has quit [Ping timeout: 240 seconds]
<Senjai> workmad3: That actually sounds pretty cool
<Senjai> I never thought of that
<mwlang> workmad3: not a bad approach to gettting system dependencies installed.
<Senjai> we could do quite a bit with that approach
atomi has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
<mwlang> workmad3: something’s slightly off there… NoMethodError: undefined method `map' for #<String:0x007fe025428760>
doodlehaus has joined #ruby
dstarh has quit [Read error: Connection reset by peer]
mloveless has quit [Remote host closed the connection]
<mwlang> workmad3: needs a split before that first map: Hash[File.read("Gemfile.lock").split("\n").map(&:strip).map{|line| line.split(" ", 2)}.reject{|_, v| v.nil?}.reject{|_, v| v =~ /\((=|>|~)/}.map{|g, v| [g, v[1..-2]]}]
boadie has joined #ruby
craigp has joined #ruby
mloveless has joined #ruby
postmodern has joined #ruby
thumpba_ has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
craigp has quit [Client Quit]
thumpba has joined #ruby
perrier has quit [Remote host closed the connection]
_honning_ has joined #ruby
perrier has joined #ruby
selu has quit [Quit: Textual IRC Client: www.textualapp.com]
aldodelgado has quit [Quit: Leaving...]
thumpba_ has joined #ruby
GaryOak_ has joined #ruby
AlexRussia has joined #ruby
mloveless has quit [Ping timeout: 264 seconds]
mistergibson has quit [Ping timeout: 255 seconds]
boadie has quit [Remote host closed the connection]
fryguy9 has quit [Quit: Leaving.]
aldodelgado has joined #ruby
aryaching has quit [Ping timeout: 264 seconds]
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
thumpba has quit [Ping timeout: 245 seconds]
zenith_ has joined #ruby
baweaver has joined #ruby
dumdedum has quit [Ping timeout: 244 seconds]
mistergibson has joined #ruby
govg has quit [Ping timeout: 246 seconds]
mwlang has quit [Ping timeout: 256 seconds]
ojacobson_ has joined #ruby
<havenwood> Bundler::LockfileParser.new(Bundler.read_file('Gemfile.lock')).dependencies.map &:name
jottr has quit [Ping timeout: 256 seconds]
rbennacer has joined #ruby
govg has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
Prometheian has joined #ruby
ojacobson has quit [Ping timeout: 240 seconds]
Prometheian has quit [Remote host closed the connection]
eladmeidar has joined #ruby
vlad_starkov has joined #ruby
tjk11 has joined #ruby
ghostpl_ has joined #ruby
jottr has joined #ruby
tjk11 has left #ruby [#ruby]
sambao21 has quit [Quit: Computer has gone to sleep.]
tuelz has joined #ruby
phale has joined #ruby
<phale> why the hell does rvm want me to do /bin/bash --login?
<phale> that's fucking stupid
oivoodoo has joined #ruby
zachrab has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
zachrab has joined #ruby
tvon has joined #ruby
tvw has quit [Remote host closed the connection]
<tuelz> I'm calling methods defined on a variable top level namespace in a rakefile. Inside the gem I'm loading up all the files with ruby and I need to put that top level namespace in a variable if that's possible, or would it be better just to write out two seperate rake tasks and load them depending on which top level namespace exists?
tearan has joined #ruby
juanpaucar has quit [Remote host closed the connection]
<tuelz> phale: I haven't used rvm in a couple of months, but I've never had to do that.
<phale> tells me i need a login shell or whatever
zachrab has quit [Read error: Connection reset by peer]
<phale> do you realize how inefficient this is in a window manager?
_blizzy_ has quit [Ping timeout: 252 seconds]
zachrab has joined #ruby
<makerop> phale, your profile is not setup, or .bashrc etc
<tuelz> sounds like you don't have it setup properly. Are you exporting to your PATH correctly when you open your bash shell?
<makerop> depending on your environment
oivoodoo has quit [Ping timeout: 246 seconds]
<phale> what?
<phale> i just got it from rvm.io
fryguy9 has joined #ruby
Takle has quit []
<makerop> sorry wrong ilink
<tuelz> phale: this isn't installing to some /usr/bin or something, you have to include it in your PATH somewhere for rvm magic to work because it does a lot of weird things behind the curtains
vlad_starkov has quit [Ping timeout: 256 seconds]
GnuYawk has quit [Ping timeout: 256 seconds]
aryaching has joined #ruby
<tuelz> alternatively if you want a ruby manager you can understand and has less features I would also recommend chruby
<tuelz> rvm worked just fine for years for me though
mog_ has quit [Ping timeout: 255 seconds]
<phale> that's retarded
relix has joined #ruby
<phale> meh
<tuelz> lol.
teddyp1cker has quit [Remote host closed the connection]
<makerop> there are numerous tus out there on how to setup things correctly
<tuelz> either you want the features or you don't. Nothing retarded about it
<makerop> only takes a minute or two
<makerop> tuts*
alexherbo2 has joined #ruby
Takle has joined #ruby
<tuelz> at least your typo wasn't on the 'u' ;P
<phale> meh
<phale> i'll be programming in C now
<phale> cya
* tuelz hopes everyone realizes the 'i' key is beside the 'u'
zachrab has quit [Ping timeout: 272 seconds]
<tuelz> phale: peace
<phale> (hippy smile)
phale has left #ruby ["Leaving"]
<tuelz> I wonder how far someone who hates reading the docs gets with C...
<makerop> heh
<miah> depends on which docs you're reading
<makerop> and rvm vs make?
<makerop> c'mon
<miah> make vs rake more like
jgrevich has joined #ruby
<miah> rvm isn't really comparable to make
<makerop> true
AlexRussia has quit [Ping timeout: 265 seconds]
sambao21 has joined #ruby
<miah> i think the problem with C is that most of the
<miah> 'good books' were written before 1990 =)
AlexRussia has joined #ruby
fryguy9 has quit [Read error: Connection reset by peer]
fryguy9 has joined #ruby
<makerop> I still like K&r
<miah> and also that the language will let you shoot yourself in the face, and foot multiple times
aldodelgado has quit [Quit: Linkinus - http://linkinus.com]
<miah> and lots of the older books dont really touch on those subjects well
aldodelgado has joined #ruby
psy_ has joined #ruby
d10n-work has joined #ruby
<makerop> I have some good PDFs
psy_ has quit [Max SendQ exceeded]
<miah> i think the openbsd devs could write a good book on writing good c
plashchynski has quit [Quit: plashchynski]
Mon_Ouie has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<average> miah: what do you mean "writing good c" ?
akkad has joined #ruby
plashchynski has joined #ruby
<tuelz> I mean to do anything substantial in C you need like 4 million libraries
<miah> writing c that is not going to ruin your day somewhere down the road when somebody figures out how to do bad shit =)
Soda has quit [Remote host closed the connection]
<tuelz> that's a lot of RTFM
<average> miah: C today means a lot message-passing, event-based or thread-based mux/demux very scalable architectures passing around a lot of data
<miah> right
<average> miah: or embedded, or writing drivers
<miah> thats what im saying. modern c is much more different than historic c
Beoran_ has quit [Ping timeout: 256 seconds]
<average> or a ton of different things
<miah> but most of the good books cover historic c
<average> what does "writing good c" equate to ? because it doesn't equate to anything
juanpaucar has joined #ruby
<average> it tells no more about what the book would be about than saying "writing in a programming language"
Guest14990 has quit [Read error: Connection reset by peer]
<average> like writing what ?
sevvie has quit [Ping timeout: 256 seconds]
sambao21 has quit [Client Quit]
<average> because every type of application has its own idioms
<miah> sure
alexherbo2 has quit [Read error: Connection reset by peer]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<miah> i grew up with the security crowd. so much of my c knowledge comes from dealing with broken ass shit.
einarj has quit [Remote host closed the connection]
<average> yes, well i think you're very biased then
<miah> probably
nateberkope has joined #ruby
<average> security people don't actually do anything. they just prevent bad things from happening
nateberkopec has quit [Ping timeout: 252 seconds]
<miah> oh i agree
kadoppe has quit [Ping timeout: 240 seconds]
<average> but that doesn't actually bring any value when there is no broken thing to fix
MatthewsFace has quit [Remote host closed the connection]
<miah> especially when you see that most security software is ripe with holes of its own
<miah> and i didnt say the language was bad
<average> security is a fear-driven business
<miah> just that, you can shoot yourself in the foot very easily unless you know wtf you are doing
sambao21 has joined #ruby
<average> there is nothing productive about it, except for money, but there is no actual product
<average> it's a non-product, "you won't get your servers broken" or "you are less likely to have your boxes broken into"
<average> but that's not a product
aldodelgado has quit [Quit: Linkinus - http://linkinus.com]
<average> it's just a mild sort-of guarantee
kadoppe has joined #ruby
aldodelgado has joined #ruby
juanpaucar has quit [Remote host closed the connection]
sambao21 has quit [Client Quit]
<average> miah: I actually tried to work on a product with this guy
<average> miah: he was so freaked out that we spent around 2 weeks for security measures
<average> instead of writing actual fucking code
<makerop> you can define "writing good c"
<average> because he was a security guy and that's how he thinks "things have to be done"
malcolmva has quit [Ping timeout: 256 seconds]
<miah> well, it sounds more like a personal problem
<average> security is a piece of shit, you're never going to get anything done if you think about security all the time
<miah> like he knew more theory than had practice
<miah> i disagree =)
sambao21 has joined #ruby
<makerop> yeah, I disagree too
<makerop> that's a ridiculous statement
teddyp1cker has joined #ruby
yqt has joined #ruby
<average> no you don't understand what you're disagreeing to
<average> let me re-state it again
<miah> ya i dont understand
<miah> bye
miah has left #ruby [#ruby]
<average> i'm glad he left
<average> anyway
<makerop> you have to wrry about security though imo
<average> re-stating: spent 2 weeks configuring stuff to make sure everything is "safe" instead of actually building a product. in those 2-weeks no code was written
<average> that's such poor judgement on people thinking like that
enebo has quit [Quit: enebo]
<makerop> it depends on the context imo
<makerop> if it's a stupid webapp for a startup, yes, agreed
<average> exactly
<average> that's what it was
<average> a stupid webapp
_djbkd has quit [Remote host closed the connection]
<makerop> then just use rails etc, and throw something together
<makerop> most of the security that is baked in, is transparent
plashchynski has quit [Quit: plashchynski]
miah has joined #ruby
<miah> im coming back just for this one thing
<miah> 19:17 [average<~stefan@unaffiliated/average>] please don't come back
<miah> 19:17 [average<~stefan@unaffiliated/average>] thanks
<miah> <3.
<miah> average: may you choke while eating.
hcnewsom has quit [Ping timeout: 245 seconds]
miah has left #ruby [#ruby]
<average> miah i definitely won't choke
eladmeidar has quit [Read error: Connection reset by peer]
dc_ has joined #ruby
juanpaucar has joined #ruby
Beoran_ has joined #ruby
dstarh has joined #ruby
hcnewsom has joined #ruby
yfeldblum has joined #ruby
bim has joined #ruby
<average> makerop: well yes
Dmr has joined #ruby
urbanautomaton has joined #ruby
iamjarvo has joined #ruby
zenith_ has quit [Remote host closed the connection]
jerematic has quit []
AndyBotwin has joined #ruby
urbanautomaton has quit [Client Quit]
Zai00 has joined #ruby
malcolmva has joined #ruby
<shevy> god you kids
jlast has quit [Remote host closed the connection]
martinbmadsen has quit [Ping timeout: 252 seconds]
Flcn has joined #ruby
antgel has quit [Ping timeout: 252 seconds]
plashchynski has joined #ruby
jlast has joined #ruby
wottam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kromm has joined #ruby
huddy has quit [Quit: Connection closed for inactivity]
kromm has quit [Client Quit]
Akagi201 has quit [Ping timeout: 245 seconds]
juanpaucar has quit [Remote host closed the connection]
<tuelz> is there a difference between ::var and $var?
allcentu1 has quit [Quit: WeeChat 1.1.1]
bootstrappm has quit [Remote host closed the connection]
<pipework> tuelz: yes
<tuelz> pipework: they are both global, but one is just namespaced?
<tuelz> or I guess one isn't global.
<tuelz> it exists only when a namespace is included?
Akagi201 has joined #ruby
<pipework> tuelz: One can be a namespace if the right object is attached, right?
<tuelz> or am I making any sense?
<pipework> Classes and modules.
<tuelz> so Class::var exists where that class in inherited and $ exists everywhere?
<centrx> tuelz, ::Var refers to a class or module and doesn't store an arbitrary variable
zorak8 has quit [Ping timeout: 240 seconds]
<centrx> tuelz, MyClass::var refers to a class method, aka MyClass.var
buub has joined #ruby
Spami has joined #ruby
bim has quit [Remote host closed the connection]
oki has joined #ruby
Asher has quit [Quit: Leaving.]
Renich has quit [Quit: leaving]
_honning_ has quit [Read error: Connection reset by peer]
<pipework> centrx: It refers to a constant!
baweaver has joined #ruby
<pipework> Or to nest, a class/module or a 'leaf' Constant.
<tuelz> I think this is starting to make sense
<pipework> I think, anyways.
<eam> >> def Foo; 99; end; send :Foo
<eval-in_> eam => 99 (https://eval.in/298371)
bim has joined #ruby
ramfjord has joined #ruby
<atmosx> aloha fellow rubyists
<eam> >> def Foo; 99; end; Foo()
<eval-in_> eam => 99 (https://eval.in/298372)
<eam> >> def Foo; 99; end; Foo
<eval-in_> eam => uninitialized constant Foo (NameError) ... (https://eval.in/298373)
_honning_ has joined #ruby
_djbkd has joined #ruby
maximski has joined #ruby
maximski has quit [Max SendQ exceeded]
<makerop> is there somewhere I can go to get code reviewed?
jlast has quit [Remote host closed the connection]
wottam has joined #ruby
jlast has joined #ruby
maximski has joined #ruby
<atmosx> makerop: robocop
maximski has quit [Max SendQ exceeded]
<atmosx> makerop: if you want humans, the ruby-ml is a good place to do so. or YN 'ask' threads. Reddit probably.
<makerop> not so much style, but more "setup"
maximski has joined #ruby
<makerop> how I arrange classes/modules/gems/testing etc
<makerop> ill try HN, good diea
<atmosx> well
<atmosx> that's more 'complicated'
<atmosx> is your project web based?
maximski has quit [Max SendQ exceeded]
rajeshchawla has joined #ruby
cpt_yossarian has quit [Ping timeout: 240 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maximski has joined #ruby
jonr22 has joined #ruby
einarj has joined #ruby
bim has quit [Remote host closed the connection]
maximski has quit [Max SendQ exceeded]
<makerop> atmosx, I have a gem i'm working on, and a web app yes
User458764 has quit [Quit: Textual IRC Client: www.textualapp.com]
jottr has quit [Quit: WeeChat 1.1.1]
blueOxigen has quit [Ping timeout: 256 seconds]
maximski has joined #ruby
freerobby has quit [Quit: Leaving.]
<atmosx> makerop: well, both of them have well defined structures
maximski has quit [Max SendQ exceeded]
jlast has quit [Ping timeout: 256 seconds]
<makerop> well, I feel like Im just copying stuff, rather than understanding why
phutchins has quit [Ping timeout: 245 seconds]
<atmosx> makerop: okay
<makerop> ie, the gem, im writing, im looking at twitter-oath
<makerop> oauth*
<makerop> but im not sure why it's better
maximski has joined #ruby
maximski has quit [Max SendQ exceeded]
<havenwood> makerop: show us here?
<makerop> yeah, ill do that tonight
<makerop> i have to get github re-setup etc first
maximski has joined #ruby
kalusn has joined #ruby
maximski has quit [Max SendQ exceeded]
freerobby has joined #ruby
maximski has joined #ruby
sevvie has joined #ruby
jonr22 has quit [Ping timeout: 265 seconds]
zorak8 has joined #ruby
maximski has quit [Max SendQ exceeded]
<atmosx> actually, when I wrote my first gem, it was a little bit confusing. In the 2nd gem I ever wrote, it was all clear. I mean the 'why' of the structure other popular gems had.
einarj has quit [Read error: Connection reset by peer]
einarj has joined #ruby
maximski has joined #ruby
maximski has quit [Max SendQ exceeded]
wallerdev has joined #ruby
malcolmva has quit [Ping timeout: 255 seconds]
maximski has joined #ruby
MatthewsFace has joined #ruby
red_horned_rihno has quit [Ping timeout: 252 seconds]
iamjarvo has joined #ruby
jottr has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
apxm has joined #ruby
ssd7 has joined #ruby
rbennacer has quit [Remote host closed the connection]
iamjarvo has quit [Max SendQ exceeded]
<atmosx> >> b = '12/03/15'.split('/'); Date.parse(b[2],b[1],b[0])
<eval-in_> atmosx => uninitialized constant Date (NameError) ... (https://eval.in/298375)
coderanger has joined #ruby
<atmosx> >> b = '12/03/15'.split('/'); DateTime.parse(b[2],b[1],b[0])
<eval-in_> atmosx => uninitialized constant DateTime (NameError) ... (https://eval.in/298376)
iamjarvo has joined #ruby
<atmosx> >> require 'Date'; b = '12/03/15'.split('/'); DateTime.parse(b[2],b[1],b[0])
<eval-in_> atmosx => cannot load such file -- Date (LoadError) ... (https://eval.in/298377)
<atmosx> fuck
<centrx> This is not your date
<wallerdev> lol
rbennacer has joined #ruby
<atmosx> this works -> Date.parse(b[2], b[1], b[0].to_i)
<atmosx> this doesn't -> Date.parse(b[2], b[1], b[0])
<wallerdev> >> require 'date'; b = '12/03/15'.split('/'); DateTime.parse(b[2],b[1],b[0])
<eval-in_> wallerdev => no implicit conversion to float from string (TypeError) ... (https://eval.in/298378)
<atmosx> All of them are strings though
<wallerdev> rip
revoohc has joined #ruby
<atmosx> >> require 'date'; b = '12/03/15'.split('/'); DateTime.parse(b[2],b[1],b[0].to_i)
<atmosx> >> require 'date'; b = '12/03/15'.split('/'); DateTime.parse(b[2],b[1],b[0].to_i)
<eval-in_> atmosx => #<DateTime: 2015-03-15T00:00:00+00:00 ((2457097j,0s,0n),+0s,2299161j)> (https://eval.in/298379)
SOLDIERz has joined #ruby
<atmosx> see?
Limix has quit [Quit: Limix]
<atmosx> weird
zachrab has joined #ruby
einarj has quit [Read error: Connection reset by peer]
maximski has quit [Ping timeout: 256 seconds]
einarj has joined #ruby
<atmosx> on MySQL 'date' column you save date/time objects or strings ?
ssd7 has left #ruby [#ruby]
<havenwood> >> '12/03/15'.split('/').rotate(2).join('/')
<eval-in_> havenwood => "15/12/03" (https://eval.in/298380)
<atmosx> MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format.
<atmosx> hm
_honning_ has quit [Ping timeout: 244 seconds]
SegFaultAX has quit [Excess Flood]
SegFaultAX has joined #ruby
nii236 has joined #ruby
zachrab has quit [Ping timeout: 252 seconds]
Dmr has quit [Quit: Leaving]
Takle has quit [Remote host closed the connection]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
einarj_ has joined #ruby
smallfoot- has joined #ruby
<smallfoot-> What is the de facto way to do HTTP POST requests?
einarj has quit [Remote host closed the connection]
coderanger has left #ruby ["Bye"]
sambao21 has quit [Quit: Computer has gone to sleep.]
mengu has joined #ruby
mengu has joined #ruby
cphrmky has joined #ruby
Megtastique has quit []
naftilos76 has joined #ruby
dmr8 has joined #ruby
malcolmva has joined #ruby
sambao21 has joined #ruby
Channel6 has joined #ruby
bradleyprice has quit []
r3DKinG has quit [Remote host closed the connection]
kirun has joined #ruby
Takle has joined #ruby
bradleyprice has joined #ruby
aryaching has quit [Ping timeout: 252 seconds]
randiman has joined #ruby
<havenwood> smallfoot-: There're a number of HTTP gems and no consensus. You could use Net::HTTP or one of its wrappers. HTTPClient and Excon are pure Ruby options. I think the HTTP gem has a particularly nice interface: https://github.com/httprb/http.rb#post-requests
ghostpl_ has quit [Remote host closed the connection]
<havenwood> smallfoot-: Net::HTTP of course being the stdlib option.
lanemeyer has quit [Ping timeout: 244 seconds]
justin_pdx has joined #ruby
<smallfoot-> ah, I see.. thanks
roolo_ has joined #ruby
<havenwood> smallfoot-: here's a bit dated spreadsheet comparing options: https://spreadsheets.google.com/pub?hl=en&hl=en&key=0AiZsKd8d4hSJdHFFbjR5aWNjWjlzWlhiNGxQejdBWWc&output=html
<smallfoot-> with .NET its much simpler, you get HttpClient, and thats what you should use
bim has joined #ruby
tubuliferous has joined #ruby
<smallfoot-> havenwood, wow thats ridiculously silly many options
<havenwood> smallfoot-: There are multiple high quality HTTP client libraries in Ruby. They vary in a number of characteristics though, and some are better for certain tasks than others.
<havenwood> smallfoot-: Or there are options like Faraday, where you can keep the same code and swap between multiple HTTP client adapters.
polysics has joined #ruby
fryguy9 has quit [Read error: Connection reset by peer]
<smallfoot-> I see
fryguy9 has joined #ruby
<smallfoot-> Too confusing, I'll guess I'll go with some more coherent, organized and sane language with a solid standard library such as .NET or Python instead
smallfoot- has left #ruby ["Leaving"]
roolo has quit [Ping timeout: 272 seconds]
<havenwood> smallfoot-: just use the option in the stdlib
<havenwood> or use .NET, whatever make you happy...
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> More than one library? Flee!
<Obfuscate> It's often best to retreat when outnumbered.
frem_ has joined #ruby
bim has quit [Remote host closed the connection]
GaryOak_ has quit [Remote host closed the connection]
n80 has quit [Quit: n80]
rdark has quit [Quit: leaving]
<HOrangeJewce> back to the keep!
Jackneill has quit [Remote host closed the connection]
jlast has joined #ruby
adriancb_ is now known as adriancb
n80 has joined #ruby
cphrmky has quit [Read error: Connection reset by peer]
roolo has joined #ruby
towski_ has joined #ruby
oo_ has joined #ruby
digitalextremist has quit [Ping timeout: 256 seconds]
zorak8 has quit [Read error: Connection reset by peer]
ploshy has quit [Quit: leaving]
malcolmva has quit [Ping timeout: 252 seconds]
zorak8 has joined #ruby
average has quit [Ping timeout: 252 seconds]
bim has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
_djbkd has quit [Remote host closed the connection]
roolo_ has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 245 seconds]
_honning_ has joined #ruby
waxjar has joined #ruby
GambitK has joined #ruby
<GambitK> Hello, I'm trying to find info about it and can't get info on how "self.logger.debug" works
jottr has joined #ruby
oo_ has quit [Ping timeout: 240 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
bim has quit [Remote host closed the connection]
zenith_ has joined #ruby
graft has quit [Quit: Lost terminal]
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 36.0/2015022000]]
DLSteve has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iamjarvo has joined #ruby
<havenwood> GambitK: Is there anything in particular you want to know about it?
morenoh149 has joined #ruby
last_staff has joined #ruby
zenith_ has quit [Remote host closed the connection]
Wolland has joined #ruby
sambao21 has joined #ruby
<GambitK> havenwood: thanks, I'm trying to use this gem, https://github.com/csirtgadgets/rb-cif-sdk, to query a cif instance and I'm getting this error: /var/lib/gems/1.9.1/gems/cif-sdk-0.0.1/lib/cif-sdk/client.rb:23:in `_make_request': undefined method `debug' for nil:NilClass (NoMethodError)
nii236 has quit [Ping timeout: 272 seconds]
fenzil has quit [Read error: Connection reset by peer]
maximski has joined #ruby
<GambitK> but I get an error when I try to use the methods where self is referenced
<Phage> I have this JSON code: https://dpaste.de/hFKC But I simply can't figure out how to get two of the objects 'title' and 'url'... I know how to parse it, just not how to extract what I want.
Megtastique has joined #ruby
<wallerdev> obj["data"]["title"]
average has joined #ruby
malcolmva has joined #ruby
<havenwood> GambitK: You need to set `logger = Logger.new(STDOUT)` in #initialize or however you want just have `@logger` be a Logger or at least respond to #debug.
jblancett has joined #ruby
relix has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> GambitK: If you haven't set `@logger` then you're doing `nil.debug`.
iceden has quit [Read error: Connection reset by peer]
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
<havenwood> GambitK: When you're supposed to be calling #debug on an instance of Logger.
x1337807x has joined #ruby
<havenwood> GambitK: Though I suppose if you're using the Gem not creating it, you'll want to use their wonky method of setting `logger`: https://github.com/csirtgadgets/rb-cif-sdk/blob/729595c51339932b9da8a32b1d7774518cf639aa/lib/cif-sdk/client.rb#L11-L12
<Phage> wallerdev: parsed = JSON.parse(source)
<Phage> title = parsed["data"]["domain"]
<Phage> returns a "."
<Phage> s/domain/title
plashchynski has quit [Quit: plashchynski]
<wallerdev> are you sure
<wallerdev> haha
<GambitK> havenwood: should i just create a new logger instance and pass it as a parameter to the class
<wallerdev> well first of all its not a .
<wallerdev> its a blank
<wallerdev> you already have the . in your string
<havenwood> GambitK: Look at the link I just pasted ^. They parse the `params` Hash and set the key to the value. Like: {'logger' => Logger.new(STDOUT)}
<Phage> Oh!
<havenwood> GambitK: ^ I don't approve... but that's what they're doing. :P
<Phage> Well... Why doesn't it pull the title and url?
_hollywood has quit [Quit: Leaving]
<wallerdev> your format for the json is incorect
<wallerdev> i just loaded the url and its not how you said it is
<wallerdev> thats why
<wallerdev> it comes back as a list of results
jmignault has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<wallerdev> parsed['data']['children'][0]['data']['title']
<wallerdev> will get the first result
neonalpine has joined #ruby
chrishough has joined #ruby
deepu has joined #ruby
Notte has joined #ruby
bim has joined #ruby
<deepu> Can someone please tell me how I can do this? http://pastie.org/10017014
<Phage> wallerdev: You're a life savor.
<wallerdev> savor lolol
SOLDIERz has quit [Quit: Be back later ...]
<Phage> wallerdev: lol, dat typo.
zachrab has joined #ruby
brb3 has quit [Quit: <.<]
apoplexy has joined #ruby
jenrzzz_ has joined #ruby
aldodelgado has quit [Quit: Linkinus - http://linkinus.com]
aclearman037 has quit [Quit: I'm out!]
charliesome has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GnuYawk has joined #ruby
tier_ has quit [Remote host closed the connection]
<jhass> deepu: with Array#each, Hash#[] and Kernel#system
tier has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
iamjarvo has joined #ruby
_djbkd has joined #ruby
iceden has joined #ruby
enebo has joined #ruby
jenrzzz_ has quit [Ping timeout: 256 seconds]
_djbkd has quit [Remote host closed the connection]
aldodelgado has joined #ruby
aldodelgado has quit [Client Quit]
rodfersou has quit [Quit: leaving]
fryguy91 has joined #ruby
fryguy9 has quit [Ping timeout: 256 seconds]
aldodelgado has joined #ruby
aldodelgado has quit [Client Quit]
ascarter has joined #ruby
GnuYawk has quit [Ping timeout: 256 seconds]
tier has quit [Remote host closed the connection]
Rephiax has quit [Read error: Connection reset by peer]
plashchynski has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
dogweather has joined #ruby
tvw has joined #ruby
juanpaucar has joined #ruby
maximski has quit []
graydot has joined #ruby
naftilos76 has quit [Remote host closed the connection]
einarj_ has quit [Remote host closed the connection]
_honning_ has quit [Read error: Connection reset by peer]
cpt_yossarian has joined #ruby
ghostpl_ has joined #ruby
_honning_ has joined #ruby
tectonic has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GnuYawk has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
zachrab has quit [Remote host closed the connection]
iamninja has joined #ruby
wottam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n80 has quit [Quit: n80]
zachrab has joined #ruby
<GambitK> havenwood: I don't know how to fix it
The_Phoenix has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
twistedpixels is now known as zz_twistedpixels
Spami has quit [Quit: This computer has gone to sleep]
phutchins has joined #ruby
vt102 has quit [Remote host closed the connection]
rbennacer has quit [Remote host closed the connection]
jespada has quit [Quit: WeeChat 1.1.1]
baweaver has quit [Remote host closed the connection]
juanpaucar has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
ghostpl_ has quit [Ping timeout: 245 seconds]
teddyp1cker has quit [Remote host closed the connection]
<havenwood> GambitK: What are you trying?
zachrab has quit [Ping timeout: 264 seconds]
mattwildig has joined #ruby
lektrik has quit [Ping timeout: 246 seconds]
jgrevich has quit [Ping timeout: 272 seconds]
jgrevich has joined #ruby
rbennacer has joined #ruby
sevvie has quit [Ping timeout: 272 seconds]
mistermocha has quit [Read error: Connection reset by peer]
<havenwood> GambitK: This?: {'logger' => Logger.new(STDOUT)}
sevvie has joined #ruby
mistermocha has joined #ruby
juanpaucar has joined #ruby
kaiZen has joined #ruby
tearan has quit [Quit: Textual IRC Client: www.textualapp.com]
mitchellhenke has quit [Quit: Computer has gone to sleep.]
ghr has joined #ruby
reinaldob has quit [Remote host closed the connection]
doodlehaus has quit [Remote host closed the connection]
revoohc has quit [Quit: revoohc]
sevvie has quit [Ping timeout: 252 seconds]
wolf4ood___ has quit [Quit: (null)]
withnale__ has quit [Ping timeout: 250 seconds]
<deepu> Can someone please tell me how I can do this? http://pastie.org/10017014
<jhass> deepu: with Array#each, Hash#[] and Kernel#system
ych4k3r has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pupeno has quit [Quit: Leaving...]
randiman has quit [Quit: (null)]
ych4k3r has joined #ruby
<GambitK> havenwood: it works now http://pastebin.com/ezScnB99 but I have to check because it seems that the remote path is not being received
<helpa> Hi GambitK. We in #ruby would really appreciate it if you did not use pastebin during your time with us.
<helpa> Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
<GambitK> helpa: thanks
duggiefresh has quit [Remote host closed the connection]
<deepu> jhass: would you mind giving me an .each example?
duggiefresh has joined #ruby
_honning_ has quit [Ping timeout: 246 seconds]
<jhass> deepu: not at all, just go to http://tryruby.org, it'll come soon enough
<havenwood> deepu: h.map { |command| system '/usr/bin/create.pl', *command.map { |k, v| ["--#{k}", "\"#{v}\""].join ' ' } }
kalusn has quit [Remote host closed the connection]
<havenwood> deepu: err, make that first #map an #each. you get the idea.
<jhass> havenwood: you're not helping
<deepu> havenwood: thank you
<havenwood> jhass: just throwing out some rough code for consideration
SouL has quit [Remote host closed the connection]
<havenwood> didn't try it to see if it works >.>
<jhass> how do I say this without attacking... you're playing the unpaid consultant here
zachrab has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
zachrab has quit [Remote host closed the connection]
ych4k3r has quit [Ping timeout: 265 seconds]
<havenwood> Hey, pay me!
<Phage> Can anybody help me resolve this error? https://dpaste.de/Cjom
zachrab has joined #ruby
freerobby has quit [Quit: Leaving.]
<havenwood> Phage: Why might it be wanting an Integer?
jonr22 has joined #ruby
duggiefresh has quit [Ping timeout: 246 seconds]
_djbkd has joined #ruby
<havenwood> jhass: You'd rather me be an unpaid tutor? :P
<Phage> havenwood: I have no clue.
<jhass> Phage: you get an array, you treat it like a hash
rbennacer has quit [Remote host closed the connection]
<Phage> jhass: how would I go about it, then?
Notte has quit []
<havenwood> Phage: What Class that you call ::[] on wants an Integer as an arg?
<makerop> access it like you would an array
<jhass> Phage: pull out pry, do line 21, look at the structure
<makerop> [0], etc
atomiccc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> it's not what you think it is
rhllor has quit [Ping timeout: 240 seconds]
<pipework> "It never is"
<jhass> gradually walk through your code, one #[] at the time
<jhass> in pry
<Phage> nvm, got it to work.
x1337807x has joined #ruby
buub has quit [Ping timeout: 256 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
wldcordeiro_ has quit [Read error: Connection reset by peer]
sevvie has joined #ruby
wldcordeiro_ has joined #ruby
<havenwood> Phage: Drop the `require 'rubygems'` unless you really do mean to be supporting the very dead 1.8.
<Phage> havenwood: Really? didn't know that.
<Phage> Thanks.
rbennacer has joined #ruby
helpa has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
chrisja has quit [Quit: leaving]
GaryOak_ has joined #ruby
jonr22 has quit [Ping timeout: 256 seconds]
zachrab has quit [Ping timeout: 272 seconds]
last_staff has quit [Quit: last_staff]
<Phage>
apipkin has left #ruby [#ruby]
helpa has joined #ruby
wldcordeiro has quit [Ping timeout: 245 seconds]
<havenwood> jhass: Why no irc tip jar? :(
<jhass> coin4privmsg.com ?
it0a has quit [Ping timeout: 256 seconds]
<havenwood> In other channels at least I get an inc in payment (which i'm sure converts to cash, right? Right...?!).
elfuego has quit [Quit: elfuego]
mengu has quit [Remote host closed the connection]
boadie has joined #ruby
<jhass> mmh, I should make Karmalicious silent and put it into this channel
leafybasil has joined #ruby
GnuYawk has quit [Quit: WeeChat 1.0]
tectonic has quit [Quit: Textual IRC Client: www.textualapp.com]
GnuYawk has joined #ruby
baweaver has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
rhllor has joined #ruby
ghr has quit [Ping timeout: 245 seconds]
dogweather has quit [Quit: Leaving...]
atomiccc has joined #ruby
reinaldob has joined #ruby
boadie has quit [Ping timeout: 245 seconds]
rhllor_ has joined #ruby
sambao21 has joined #ruby
m8 has quit [Quit: Sto andando via]
rhllor has quit [Ping timeout: 244 seconds]
rhllor_ is now known as rhllor
Sawbones_ has joined #ruby
GambitK has quit [Quit: Page closed]
bootstrappm has joined #ruby
kalusn has joined #ruby
Phage is now known as AnimaTempli
pdoherty has quit [Ping timeout: 245 seconds]
plashchynski has quit [Ping timeout: 244 seconds]
ghr has joined #ruby
bootstrappm has left #ruby [#ruby]
defrang has quit [Quit: defrang]
graydot has quit [Quit: graydot]
Sawbones_ has quit [Ping timeout: 265 seconds]
deric_skibotn has quit [Ping timeout: 252 seconds]
wicope has quit [Remote host closed the connection]
dmr8 has quit [Quit: Leaving]
hgl has quit [Ping timeout: 252 seconds]
iamjarvo has joined #ruby
hgl has joined #ruby
makerop has quit [Remote host closed the connection]
buub has joined #ruby
crueber has quit [Quit: Leaving.]
graydot has joined #ruby
plashchynski has joined #ruby
werelivinginthef has quit [Remote host closed the connection]
baweaver has joined #ruby
decoponio has joined #ruby
GaryOak_ has quit [Ping timeout: 252 seconds]
relix has joined #ruby
_honning_ has joined #ruby
decoponyo has quit [Ping timeout: 244 seconds]
deric_skibotn has joined #ruby
fryguy9 has joined #ruby
defrang has joined #ruby
wottam has joined #ruby
fryguy91 has quit [Ping timeout: 252 seconds]
Liothen has quit [Ping timeout: 252 seconds]
Musashi007 has joined #ruby
dblessing has quit [Quit: Textual IRC Client: www.textualapp.com]
yosafbridge has quit [Ping timeout: 252 seconds]
zz_twistedpixels has quit [Ping timeout: 252 seconds]
commmmodo has joined #ruby
_honning_ has quit [Ping timeout: 244 seconds]
fumduq has quit [Ping timeout: 252 seconds]
yosafbridge has joined #ruby
kalusn has quit [Remote host closed the connection]
fumduq has joined #ruby
juanpaucar has quit [Remote host closed the connection]
gregf has joined #ruby
plashchynski has quit [Ping timeout: 240 seconds]
Liothen has joined #ruby
kalusn has joined #ruby
zz_twistedpixels has joined #ruby
GnuYawk has quit [Ping timeout: 252 seconds]
marr has quit [Ping timeout: 252 seconds]
einarj has joined #ruby
AnimaTempli is now known as Phage
plashchynski has joined #ruby
marr has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
mattwildig has quit []
malcolmva has quit [Ping timeout: 252 seconds]
pontiki has quit [Quit: going home]
einarj has quit [Ping timeout: 240 seconds]
riotjon__ has joined #ruby
ki0 has quit [Remote host closed the connection]
Musashi007_ has joined #ruby
plashchynski has quit [Read error: Connection reset by peer]
Musashi007 has quit [Ping timeout: 245 seconds]
Musashi007_ is now known as Musashi007
kirun has quit [Quit: Client exiting]
riotjone_ has quit [Ping timeout: 252 seconds]
fumduq has quit [Ping timeout: 252 seconds]
wottam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fumduq has joined #ruby
nii236 has joined #ruby
nateberkope has quit [Quit: Linkinus - http://linkinus.com]
elfuego has joined #ruby
acl_ has joined #ruby
aghalarp has joined #ruby
mois3x has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hcnewsom has quit [Quit: hcnewsom]
razieliyo_ has joined #ruby
razieliyo_ has quit [Client Quit]
malcolmva has joined #ruby
GaryOak__ has joined #ruby
charliesome has quit [Quit: zzz]
_djbkd has quit [Quit: My people need me...]
iamjarvo has joined #ruby
_djbkd has joined #ruby
narcan has joined #ruby
blizzy has joined #ruby
blizzy has quit [Max SendQ exceeded]
ojacobson_ has quit [Quit: Leaving...]
blizzy has joined #ruby
blizzy has quit [Max SendQ exceeded]
aghalarp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blizzy has joined #ruby
aswen has quit [Ping timeout: 245 seconds]
baweaver has quit [Remote host closed the connection]
stormchaser30000 has joined #ruby
stormchaser30000 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
HOrangeJewce has quit [Quit: Leaving.]
enebo has quit [Quit: enebo]
jenrzzz has joined #ruby
rrrutr has quit [Ping timeout: 256 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
nucular11 has joined #ruby
GaryOak__ has quit [Remote host closed the connection]
martinbmadsen has joined #ruby
Stalkr_ has joined #ruby
baweaver has joined #ruby
<nucular11> hey all. i'm trying to reproduce the assert_equals functionality of a test harness. i tried comparing the eval of the two params but ruby's complaining about eval'ing a string. ideas?
aghalarp has joined #ruby
plashchynski has joined #ruby
roolo has quit [Remote host closed the connection]
<bradland> nucular11: what's the exact error message? eval'ing a string is what Kernel#eval is made to do.
<bradland> there's probably an issue with the ruby code within your string
lordkryss has quit [Quit: Connection closed for inactivity]
adriancb has quit [Remote host closed the connection]
charliesome has joined #ruby
brandon__ has quit [Read error: Connection reset by peer]
<nucular11> it complains "in `eval': undefined local variable or method `i18n' for Test:Class (NameError)"
rhllor has quit [Quit: rhllor]
reinaldob has quit []
<bradland> uh...
neonalpine has quit [Remote host closed the connection]
<bradland> line 3, why are you calling eval on the string passed to assert_equal?
<bradland> why are you calling eval at all?
sarlalian has quit [Quit: WeeChat 0.4.2]
<bradland> on either of the parameters
sarlalian has joined #ruby
fumduq has quit [Ping timeout: 252 seconds]
<bradland> nucular11: the eval method takes a string, and evaluates it as ruby code
Flcn has quit [Quit: Be back later ...]
robbyoconnor has joined #ruby
<bradland> what happens if you create a new file and just type "i18n" in the file (without the quotes)
<bradland> then try to run the file?
jlast has quit [Remote host closed the connection]
brandon_ has joined #ruby
<nucular11> no errors when i do that
<bradland> smells like copy/paste in here
mengu has joined #ruby
mengu has joined #ruby
<bradland> nucular11: when you do what?
nii236 has quit [Ping timeout: 256 seconds]
reinaldob has joined #ruby
<bradland> don't put quotes around it
<nucular11> ah, k
<bradland> just create a file with i18n in it
<bradland> and try to run it
<nucular11> got it. error
<bradland> right
n80 has joined #ruby
rajeshchawla has quit []
fumduq has joined #ruby
<bradland> so, do you understand why you got the error?
<bradland> when the interpreter encounters that text by itself, it tries to figure out if it's a method name or a variable
Wolland has quit [Remote host closed the connection]
<bradland> but since there is no method named i18n, and no variable named i18n, the interpreter gives up
<bradland> in your code, you're calling eval twice on line 3
<bradland> do you know how to use irb?
<bradland> i want you to try something out
<bradland> it should help you understand what eval does
<nucular11> yep
<nucular11> shoot
Wolland has joined #ruby
<bradland> ok, in an irb session, type: 1 + 1
<bradland> and press enter
<bradland> it should return the value 2
<bradland> now, type: eval "1 + 1"
<bradland> be sure to use the quotes
<bradland> you should also get 2
<bradland> eval takes the string, and runs it as ruby code
<jhass> jeez, give'em time to respond :P
<bradland> heh :)
mengu has quit [Ping timeout: 252 seconds]
<nucular11> hmm so in my case, i should just eval(param1 + "==" + param2)
<jhass> nucular11: why?
<jhass> why do you need eval?
<bradland> ask yourself, "why use eval"?
dfinninger has quit [Remote host closed the connection]
<bradland> what are you trying to accomplish? you want to compare the return value of Abbreviator.abbreviate and the string literal "i18n"
<bradland> do you need eval for that?
<Senjai> >> eval("eval('lol')")
<jhass> let's wait for a response :)
<eval-in_> Senjai => undefined local variable or method `lol' for main:Object (NameError) ... (https://eval.in/298412)
dfinninger has joined #ruby
<Senjai> >> lol = "hi"; eval("eval('lol')")
<eval-in_> Senjai => "hi" (https://eval.in/298413)
<Senjai> EVAL YOUR EVALS
<nucular11> got it
jobewan has quit [Quit: Leaving]
graydot has quit [Quit: graydot]
<bradland> nucular11: what'd you end up with?
<bradland> i ask because eval can be very dangerous
DEA7TH has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Wolland has quit [Ping timeout: 256 seconds]
plashchynski has quit [Read error: Connection reset by peer]
boadie has joined #ruby
<bradland> yay!
<bradland> good work
aghalarp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nucular11> thanks bradland
max96at is now known as max96at|off
dfinninger has quit [Remote host closed the connection]
duggiefresh has joined #ruby
Sawbones_ has joined #ruby
reinaldob has quit [Remote host closed the connection]
Channel6 has joined #ruby
codecop has quit [Remote host closed the connection]
atom3 has quit [Ping timeout: 276 seconds]
ascarter has quit [Ping timeout: 244 seconds]
Guest65 has quit [Ping timeout: 256 seconds]
jgrevich has quit [Ping timeout: 264 seconds]
Feyn has joined #ruby
lanemeyer has joined #ruby
buub has quit [Ping timeout: 246 seconds]
seal has joined #ruby
atom3 has joined #ruby
Musashi007 has quit [Quit: Musashi007]
reinaldob has joined #ruby
boadie has quit [Ping timeout: 246 seconds]
fryguy9 has quit [Quit: Leaving.]
juanpablo_ has quit [Quit: (null)]
Volsus has joined #ruby
juanpablo_ has joined #ruby
Takle has quit [Remote host closed the connection]
plashchynski has joined #ruby
thiagovsk has quit [Quit: Connection closed for inactivity]
duggiefresh has quit [Ping timeout: 240 seconds]
Musashi007 has joined #ruby
Musashi007 has quit [Client Quit]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
juanpablo_ has quit [Ping timeout: 255 seconds]
commmmodo has quit [Ping timeout: 250 seconds]
it0a has joined #ruby
zachrab has joined #ruby
gregf has quit [Quit: WeeChat 1.1.1]
tuelz has quit [Ping timeout: 252 seconds]
teddyp1cker has joined #ruby
Altonymous has joined #ruby
<Altonymous> apeiros: still fighting with this import issue :(
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jonr22 has joined #ruby
<Altonymous> tried using put_copy_data with multiple lines instead of a line at a time. Tried 10, 100, 1000 records at a time didn’t see any difference in CPU usage. Still pegged at 100%
kaiZen has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
phutchins has quit [Ping timeout: 264 seconds]
teddyp1cker has quit [Ping timeout: 240 seconds]
<Senjai> Altonymous: code?
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<Altonymous> It’s pretty much just the sample code that in the pg gem’s source code. I’ll try and track it down
<Altonymous> The only difference is I read from a file instead of from string
Wolland has joined #ruby
iamjarvo has joined #ruby
<Senjai> Aye, but I dont want to go and search for stuff to help you, if you can gist what you're running that'd be great xD
zachrab has quit [Remote host closed the connection]
zachrab has joined #ruby
centrx has joined #ruby
<Altonymous> That’s the sample
<Senjai> Yeah
<Senjai> that'd probably use a lot of CPU
<Senjai> lots of while loops
<Senjai> Do you run this often?
<Altonymous> Lots.
jonr22 has quit [Ping timeout: 265 seconds]
<Senjai> Why
<Senjai> You should be importing things, once
<Altonymous> We import about 10k files a day
<Altonymous> Most are around 90MB
tvon has quit [Quit: leaving]
<Altonymous> This only imports the file once..
<Senjai> Altonymous: Well it's going to work as fast as it can
<Senjai> Unless you say it cant
<Altonymous> Well that’s part of the problem is, it’s not fast enough..
<Altonymous> It’s only importing about 8k records per second.
<Senjai> IO is slow
<Senjai> Welcome to life xD
<Senjai> There are ways you can speed up your harddisk
<Senjai> by disabling write barriers and stuff
phutchins has joined #ruby
<Senjai> as well as stuff you can do in pg to speed up imports
RegulationD has quit [Remote host closed the connection]
kaiZen has joined #ruby
<Altonymous> The IO isn’t being used
<Senjai> but I dont know what they are
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blizzy is now known as _blizzy_
<Senjai> increase the size you import at any given time
oivoodoo has joined #ruby
tvon has joined #ruby
baweaver has quit [Remote host closed the connection]
<Altonymous> The IO resource is pretty much flat
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Musashi007 has joined #ruby
<Altonymous> It’s only CPU that’s pegged. We read the entire file into memory then iterate over it to do the import..
<Senjai> Altonymous: You might want to find the pg equiv of https://gist.github.com/Senjai/d4a4a456e77839023879#file-my-cnf-L44-L48
<Altonymous> We tried streaming, but it made no difference on the CPU
<Senjai> Altonymous: Well, then thats the obvious block. Get a faster CPU?
<Senjai> Or run a profiler on it
<Senjai> find out the bottlenecks
Wolland has quit [Ping timeout: 245 seconds]
Sawbones_ has quit [Remote host closed the connection]
waxjar has quit [Quit: ZNC - http://znc.in]
<Altonymous> The DB is pretty much idle.. it’s not being pushed at all, already optimized it for imports
<Senjai> run a profiler on your code
<Senjai> to tell you where the time is being spent
<Altonymous> It’s on the put_copy_data()
average has quit [Ping timeout: 252 seconds]
<Altonymous> I have new relic on it already
sdothum has joined #ruby
<Senjai> LOL at the sleep call
<Senjai> :(
<Altonymous> Nope
<Altonymous> Never hits that
eladmeidar has joined #ruby
<Senjai> where in put_copy_data is the time being taken ?
<Altonymous> I logged it to verify.. it only hits that if put_copy_data gets blocked during it’s process
<Senjai> 256 is also a VERY small amount to read at a time
<Altonymous> inside the put_copy_data which is part of the pg gem.
mistermocha has quit [Read error: Connection reset by peer]
<Altonymous> I’m not doing it exactly like the example
eladmeidar has quit [Client Quit]
<Altonymous> like I said I’m doing it by lines in the file.. I’ve tried sending 1, 10, 1000 lines at a time..
mistermocha has joined #ruby
<Senjai> Have you tried increasing the readsize?
<Senjai> from 256?
<Senjai> Does it have to be inserted 256 bytes at a time?
phutchins has quit [Ping timeout: 272 seconds]
marr has quit [Ping timeout: 250 seconds]
aghalarp has joined #ruby
ChoiKyuSang has quit [Quit: AdiIRC is updating to v1.9.6 Beta Build (2015/03/10) 32 Bit]
sevvie has quit [Ping timeout: 244 seconds]
<Altonymous> I’m not reading 256 at a time
<Senjai> for a 90 mb file
<Senjai> at 256 bytes per put_copy_data
<Altonymous> Senjai: that’s just the sample code.. I changed the while copy_data.read( 256, buf ) to file_contents.each_line ...
<Senjai> that function is called 351.5k times for the import to complete
momomomomo has joined #ruby
sevvie has joined #ruby
kalusn has quit [Remote host closed the connection]
<Altonymous> Like I said, not reading 256 at a time..
<Senjai> Altonymous: Okay, well I'm not going to even try to help unless you gist the actual code
ChoiKyuSang has joined #ruby
<Senjai> We dont do fake code here
ponga has quit [Quit: Leaving...]
aghalarp has quit [Max SendQ exceeded]
<jhass> ^ don't whine for being judged by the sample code if all you show is that
<Senjai> !rule3.2
<helpa> NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
<helpa> Hi Altonymous. We in #ruby would really appreciate it if you did not use pastebin during your time with us.
<helpa> Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
lordkryss has joined #ruby
ponga has joined #ruby
<Senjai> And your profile is saying put_copy_data is taking the longest here?
<Senjai> You're doing a lot of stuff
<Senjai> before put_copy_data is even called
<Senjai> FOr each line
<Senjai> And a line is less than 256 bytes
ips|malc has quit [Ping timeout: 276 seconds]
ips|malc has joined #ruby
<Senjai> Assuming each line was 256 bytes, for 90mb, 351.5 THOUSAND calls to put_copy_data
<Altonymous> I don’t have the old code where we did 1000 lines at a time
<Senjai> Step 1: If you're SURE put copy data is where the time is being spent (emphasis on sure), find ways to call it less
<Altonymous> it’s definitely on the put_copy_data() put a newrelic trace around it..
<Altonymous> I reduced the number of times it was called when doing 1000 lines at a time and it made no difference
<Senjai> Step 2: IF that doesnt help, FIND WHAT PUT_COPY_DATA does to take so long, which means using a real profiler, not one that stops at put_copy_data
<Senjai> Step 3: Make decisions based on output from step 2
<Senjai> Step 4: If put_copy_data cannot be optimized, then its a problem with the other end of the pipe
<Senjai> Step 5: Fix the other end of the pipe, if possible
<Senjai> Default RDBMS settings are terrible for high volume
ptrrr has quit [Quit: ptrrr]
seal has quit [Quit: Ex-Chat]
<Senjai> Altonymous: If you've tried those, and still cant figure it out, come back and let us know
<Altonymous> 1. I’m sure. 2. I am unfamiliar with pg gem internal workings, don’t know to begin to optimize it. 3. nil. 4. The other end of the pipe has achived 30k /recs per sec not using ruby. 5. nil.
it0a has quit [Ping timeout: 265 seconds]
Megtastique has quit []
deepu has quit [Ping timeout: 246 seconds]
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tuelz has joined #ruby
zz_twistedpixels is now known as twistedpixels
Zai00 has quit [Quit: Zai00]
phutchins has joined #ruby
<jhass> Altonymous: you could start with obvious optimizations before the copy data call even happens, like combining the gsubs into one, not doing them if take_how_many is nil and possibly even combine the split and gsub into a single pass by using scan
oki has quit [Ping timeout: 255 seconds]
<Altonymous> profiler says those lines account for less than 1sec of the runtime But I did change the gsub to column_data = line.delete("\b").tr("\r\n"," ").split("\t")
tuelz has quit [Ping timeout: 240 seconds]
<Altonymous> will have to investigate the scan
plashchynski_ has joined #ruby
plashchynski has quit [Ping timeout: 240 seconds]
plashchynski_ is now known as plashchynski
<Altonymous> and the take_how_many is a good point, I don’t need that line anymore, the default is always set now.
<jhass> put_copy_data seems to run the stuff through PG::TextEncoder::CopyRow, should be worth investigating what that does
baweaver has joined #ruby
<Senjai> Altonymous: New Relic profiler is hardly a profiler
robustus has quit [Ping timeout: 264 seconds]
<Senjai> There are tons of things that take up time in that loop. Each line is a small amount of data
deric_skibotn has quit [Ping timeout: 256 seconds]
<Senjai> and then you perform tons of operations on that small amount of data
<Senjai> then pass it into the connection
<Senjai> That will be an optimization pain point EVENTUALLY
Zai00 has joined #ruby
juanpaucar has joined #ruby
plashchynski has quit [Ping timeout: 255 seconds]
plashchynski_ has joined #ruby
<Senjai> Altonymous: If you're unfamiliar with the pg gem workings, time to get familiar. Reading code is 70-80% of the job. Other coders aren't perfect, and they probably didnt design this tool for your usecase.
robustus has joined #ruby
<centrx> Altonymous, Wouldn't it make more sense to use the native Postgres COPY to load from CSV?
<centrx> for performance
commmmodo has joined #ruby
<Senjai> centrx: Probably, but he's doing a bunch of manipulation to the data