apeiros_ changed the topic of #ruby to: Ruby 2.0.0-p0: http://ruby-lang.org (Ruby 1.9.3-p392) || Paste >3 lines of text on http://gist.github.com
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Changing host]
banjara has joined #ruby
jtharris has quit [Quit: WeeChat 0.4.0]
banjara has quit [Client Quit]
banjara has joined #ruby
_nitti has quit [Remote host closed the connection]
banjara has quit [Client Quit]
banjara has joined #ruby
jtharris has joined #ruby
stopbit has quit [Quit: Leaving]
banjara has quit [Client Quit]
grayson_ has quit [Quit: Computer has gone to sleep.]
banjara has joined #ruby
arya_ has joined #ruby
Yakko has quit [Read error: Connection reset by peer]
banjara has quit [Client Quit]
banjara has joined #ruby
babykosh has quit [Ping timeout: 276 seconds]
angusiguess has quit [Ping timeout: 240 seconds]
banjara has quit [Client Quit]
weddingcakes has quit [Ping timeout: 276 seconds]
banjara has joined #ruby
c0rn has joined #ruby
hbpoison has quit [Ping timeout: 246 seconds]
banjara has quit [Client Quit]
banjara has joined #ruby
SeySayux has quit [Ping timeout: 244 seconds]
banjara has quit [Client Quit]
banjara has joined #ruby
bean__ has quit [Quit: Computer has gone to sleep.]
Spooner_ has quit [Remote host closed the connection]
banjara has quit [Client Quit]
banjara has joined #ruby
mercwithamouth has joined #ruby
banjara has quit [Client Quit]
weddingcakes has joined #ruby
banjara has joined #ruby
baroquebobcat has joined #ruby
nga4 has quit [Ping timeout: 244 seconds]
SeySayux has joined #ruby
AntiTyping has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
techhelp has quit [Quit: This computer has gone to sleep]
arya_ has quit [Ping timeout: 248 seconds]
banjara has joined #ruby
Spooner has joined #ruby
banjara has quit [Client Quit]
toekutr has quit [Remote host closed the connection]
banjara has joined #ruby
banjara has quit [Client Quit]
toekutr has joined #ruby
baroquebobcat has quit [Client Quit]
baroquebobcat has joined #ruby
survili has quit [Quit: Leaving]
c0rn has quit [Ping timeout: 264 seconds]
icole has joined #ruby
weddingcakes has quit [Ping timeout: 276 seconds]
shadowshell has joined #ruby
c0rn has joined #ruby
yshh_ has joined #ruby
emanu has joined #ruby
<samphippen> is 1.8.7 still supported?
greenarrow has quit [Ping timeout: 252 seconds]
<Spooner> samphippen : No, it is not supported any more.
<samphippen> ok
greenarrow has joined #ruby
<Spooner> Use 1.9.3 though. 2.0 is a bit new ;)
arya_ has joined #ruby
thams has quit [Quit: thams]
<Spooner> samphippen : 1.8.7 has only just stopped being supported though.
darthdeus has joined #ruby
gyre007 has joined #ruby
yshh_ has quit [Ping timeout: 272 seconds]
Spooner has quit [Read error: Connection reset by peer]
ephemerian has quit [Quit: Leaving.]
banjara has joined #ruby
danieldocki has joined #ruby
36DACZHS9 has quit [Quit: 36DACZHS9]
darthdeus has quit [Ping timeout: 245 seconds]
jimeh has quit [Quit: Computer has gone to sleep.]
Qwak has quit [Ping timeout: 256 seconds]
arya_ has quit [Ping timeout: 248 seconds]
reppard has joined #ruby
zodiak has quit [Ping timeout: 245 seconds]
emmanuelux has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
miso1337 has quit [Quit: afk]
niklasb has quit [Quit: WeeChat 0.4.0]
billiam has quit [Quit: Leaving]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
pandawarrior has joined #ruby
<pandawarrior> hi, looking for a site / book this has lots of small to medium sized challenges/ quiz sets to practice
nga4 has joined #ruby
<pandawarrior> rubyquiz is good, does anyone have any other recommendations?
<mackwic> pandawarrior, project euler
thams has joined #ruby
<pandawarrior> looks, good. very math specific, though - although that's not a bad thing
chrishough has quit [Quit: chrishough]
Es0teric has joined #ruby
elaptics is now known as elaptics`away
<mackwic> also prologin subjects are fun
<mackwic> but quiet hard in the end
<mackwic> (unless you like AI)
<pandawarrior> prologin - what's that?
apeiros_ has quit [Remote host closed the connection]
<Es0teric> when using case/when, is it possible to compare two variables on a "when" block?
malkomalko has joined #ruby
pdamer has joined #ruby
<Es0teric> like.. case var1 when "val1" && var2 == "something" puts "var1 and var2 match"
<mackwic> pandawarrior, french programmation contest, the records are open
predator117 has quit [Read error: Operation timed out]
adkron has quit [Ping timeout: 260 seconds]
<pandawarrior> oh wow, this is the major leagues...
tomzx_mac has joined #ruby
berserkr has joined #ruby
<mackwic> ah, and it's in french only
<mackwic> :/
hashmal has joined #ruby
<Es0teric> when using case/when, is it possible to compare two variables on a "when" block? like.. case var1 when "val1" && var2 == "something" puts "var1 and var2 match"
<pandawarrior> chrome translates each page on the fly
tommyvyo has quit [Quit:]
predator117 has joined #ruby
<pandawarrior> but it's still pretty high level
ph^ has joined #ruby
zodiak has joined #ruby
Mattx has quit [Quit: Leaving]
nari has quit [Ping timeout: 255 seconds]
pdamer has quit [Quit: pdamer]
chendo_ has quit [Ping timeout: 252 seconds]
skcin7 has quit []
chrishough has joined #ruby
chendo_ has joined #ruby
nomenkun has joined #ruby
reppard has quit [Ping timeout: 245 seconds]
ph^ has quit [Ping timeout: 252 seconds]
senayar has quit [Quit: Quitte]
slainer68 has quit [Remote host closed the connection]
ner0x has joined #ruby
nomenkun has quit [Ping timeout: 245 seconds]
havenwood has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
gaahrdner has joined #ruby
brum has joined #ruby
tish has joined #ruby
jonahR has joined #ruby
cyong has joined #ruby
cyong has quit [Max SendQ exceeded]
angusiguess has joined #ruby
TheFuzzball has quit [Quit: Computer has gone to sleep.]
kofno has quit [Read error: Connection reset by peer]
dpollen has joined #ruby
gaahrdner has quit [Ping timeout: 255 seconds]
<sam113101> is there a goto in ruby?
tommyvyo has joined #ruby
techhelp has joined #ruby
kofno has joined #ruby
cyong has joined #ruby
cyong has quit [Max SendQ exceeded]
<Xeago> samphippen: only under certain compilation flags
tommyvyo has quit [Excess Flood]
shammancer has quit [Quit: Leaving.]
dv_ has quit [Ping timeout: 255 seconds]
<Xeago> that flag also enables some other modes
brianpWins has quit [Quit: brianpWins]
gaahrdner has joined #ruby
tommyvyo has joined #ruby
shammancer has joined #ruby
yshh has joined #ruby
dpollen has quit [Remote host closed the connection]
kofno has quit [Read error: Connection reset by peer]
jpcamara has quit [Quit: jpcamara]
kofno has joined #ruby
<havenwood> sam113101: GOTO is an anti-pattern, Ruby does flow control in better ways.
AltGrendel has left #ruby [#ruby]
cyong has joined #ruby
cyong has quit [Client Quit]
<aedornm> I like unraveling very deeply nested hashes by {}.to_s.slice /some impossible pattern/
rburton- has joined #ruby
svandiepen has quit [Read error: Connection reset by peer]
Mon_Ouie has quit [Ping timeout: 260 seconds]
svandiepen has joined #ruby
chrisja has quit [Quit: leaving]
arya_ has joined #ruby
PragCypher has quit [Remote host closed the connection]
S1kx has joined #ruby
mmitchell has joined #ruby
brum has quit [Remote host closed the connection]
root has joined #ruby
root is now known as Guest30660
kraljev3 has joined #ruby
allaire has quit []
mercwithamouth has quit [Ping timeout: 248 seconds]
arya_ has quit [Ping timeout: 276 seconds]
miso1337 has joined #ruby
zeade has quit [Quit: Leaving.]
taoru has joined #ruby
mmitchell has quit [Ping timeout: 272 seconds]
taoru has quit [Remote host closed the connection]
jonahR_ has joined #ruby
Spooner has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
marr has quit [Ping timeout: 276 seconds]
hbpoison has joined #ruby
jonahR has quit [Ping timeout: 240 seconds]
jonahR_ is now known as jonahR
foxnewsnetwork has quit [Quit: Leaving.]
ckrailo has quit [Quit: Computer has gone to sleep.]
mlr has quit [Ping timeout: 252 seconds]
arya_ has joined #ruby
dv_ has joined #ruby
spider-mario has quit [Remote host closed the connection]
insanedreamr has joined #ruby
R_Macy_ has quit [Ping timeout: 252 seconds]
tzenes has left #ruby [#ruby]
[[johnonymous]] has joined #ruby
insanedreamr has left #ruby [#ruby]
joshman_ has quit [Quit: Computer has gone to sleep.]
darthdeus has joined #ruby
tommyvyo has quit [Ping timeout: 276 seconds]
nari has joined #ruby
`p has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
huoxito has joined #ruby
tommyvyo has joined #ruby
arya_ has quit [Ping timeout: 276 seconds]
<mackwic> time to sleep, thanks again for the help !
mackwic has quit [Quit: _o/]
fedza has joined #ruby
darthdeus has quit [Ping timeout: 252 seconds]
bigkm has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
mneorr has quit [Remote host closed the connection]
nga4 has quit [Ping timeout: 244 seconds]
mercwithamouth has joined #ruby
etcetera has quit []
havenwood has quit [Ping timeout: 240 seconds]
mattbl has joined #ruby
arya_ has joined #ruby
v0n has joined #ruby
kraljev3 has quit [Ping timeout: 244 seconds]
mikepack has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 256 seconds]
pewter_tao has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
pewter_tao has left #ruby [#ruby]
mattbl has quit [Quit: This computer has gone to sleep]
chussenot has joined #ruby
chussenot has quit [Client Quit]
samphippen has quit [Quit: Computer has gone to sleep.]
yfeldblum has quit [Ping timeout: 252 seconds]
hackerdude has quit [Remote host closed the connection]
ffranz has quit [Quit: Leaving]
chendo_ has quit [Ping timeout: 252 seconds]
[[johnonymous]] has quit [Ping timeout: 252 seconds]
gabrielrotbart has quit [Remote host closed the connection]
chendo_ has joined #ruby
baroquebobcat has joined #ruby
mattbl has joined #ruby
zzing has joined #ruby
ph^ has joined #ruby
Guest30660 has quit [Quit: leaving]
arya_ has joined #ruby
apeiros_ has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
zzing has quit [Ping timeout: 260 seconds]
eka has quit [Quit: Computer has gone to sleep.]
pdamer has joined #ruby
reppard has joined #ruby
jpcamara has joined #ruby
tyebud has joined #ruby
PragCypher has joined #ruby
etcetera has joined #ruby
peregrine81 has joined #ruby
apeiros_ has quit [Ping timeout: 248 seconds]
cheese1756 has quit [Quit: ZNC - http://znc.in]
pewter_tao has joined #ruby
pewter_tao has left #ruby [#ruby]
pewter_tao has joined #ruby
etcetera has quit [Client Quit]
tyebud has quit [Remote host closed the connection]
tyebud has joined #ruby
<moeSizlak> Did you know that if you mixed equal parts of gasoline and frozen orange juice concentrate you could make napalm?
<tyebud> Hey ruby. I'm having some trouble running rake. I get this error - https://gist.github.com/tylerdavis/5035119 Any help would be greatly appreciated!
<pewter_tao> if I have def somefunc() end, then how do I call somethingelse(zero) which is inside of somefunc() ... from another file?
brianpWins has joined #ruby
<pewter_tao> moeSizlak: I'll quote fightclub if you help :)
arya_ has quit [Ping timeout: 256 seconds]
<nightfly> moeSizlak: gasoline and styrofoam are pretty effective too
shirokuro11 has joined #ruby
cheese1756 has joined #ruby
mneorr has joined #ruby
jekotia has joined #ruby
<moeSizlak> One could make all sorts of explosives using ordinary household chemicals. If one was so inclined.
jrendell has quit [Quit: jrendell]
Domon has joined #ruby
mercwithamouth has joined #ruby
weddingcakes has joined #ruby
<pewter_tao> ok guys, how do I access this
gabrielrotbart has joined #ruby
PragCypher has quit [Remote host closed the connection]
<moeSizlak> your question is not verbose enough
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
mrsolo_ has quit [Quit: Leaving]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<moeSizlak> It could be worse. A woman could cut off your penis while you're sleeping and toss it out the window of a moving car.
drago757 has joined #ruby
angusiguess has quit [Ping timeout: 248 seconds]
drago757 has quit [Client Quit]
elkclone has quit [Ping timeout: 244 seconds]
mneorr has quit [Remote host closed the connection]
Eerbin has quit [Ping timeout: 252 seconds]
bean__ has joined #ruby
fedza has quit []
maletor has quit [Quit: Computer has gone to sleep.]
crackfu has joined #ruby
zzing has joined #ruby
etcetera has joined #ruby
tyebud has quit [Remote host closed the connection]
havenwood has joined #ruby
tyebud has joined #ruby
DrShoggoth has joined #ruby
pewter_tao has quit [Quit: Leaving.]
jrendell has joined #ruby
tyebud has quit [Remote host closed the connection]
newUser1234 has joined #ruby
freeayu has joined #ruby
chrishough has quit [Quit: chrishough]
jpfuentes2 has joined #ruby
peregrine81 has quit [Quit: Computer sleeping.]
peteyg has quit [Ping timeout: 276 seconds]
newUser1234 has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
mmitchell has joined #ruby
mockra has quit [Remote host closed the connection]
sn0wb1rd has quit [Quit: sn0wb1rd]
Kobrakao has joined #ruby
tyebud has joined #ruby
tylersmith has quit [Quit: tylersmith]
arya_ has joined #ruby
<aedornm> oooh, Rails 4 beta. I shall go forth and make a beta Rails 4 beta application that will be about beta fish.
enebo has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
kaen has quit [Ping timeout: 256 seconds]
dallasm has joined #ruby
mneorr has joined #ruby
mmitchell has quit [Ping timeout: 272 seconds]
banisterfiend has quit [Ping timeout: 252 seconds]
banisterfiend has joined #ruby
aedornm has quit [Remote host closed the connection]
reppard has quit [Ping timeout: 255 seconds]
stopbit has joined #ruby
joeycarmello has quit [Remote host closed the connection]
<Spooner> tyebud, Downgrade your Bundler version to 1.2.something. 1.3 is compatible with Ruby 2.0, but seems to have messed up 1.9 ;)
<tyebud> ugh, really? WIll do. Thanks for the response!
kaen has joined #ruby
jonahR has quit [Quit: jonahR]
werdnativ has quit [Read error: Connection reset by peer]
werdnativ has joined #ruby
<Spooner> It is because 2.0 uses UTF as a default in every file, so I assume now so does Bundler 1.3.0 (by setting it manually), but it might be messing up with other gems that expect regular ASCII.
<tyebud> Is there a way to see what versions are available on rubygems?
werdnativ has quit [Read error: Connection reset by peer]
kaen has quit [Max SendQ exceeded]
werdnativ has joined #ruby
kaen has joined #ruby
darthdeus has joined #ruby
jrendell has quit [Quit: jrendell]
<Spooner> Admittedly, I am only guessing, but lots of people have had unicode errors since 2.0 came out in 1.9 ;)
pandawarrior has quit [Quit: Leaving.]
<tyebud> Let's see what happen
<tyebud> s
sayan has joined #ruby
<tyebud> Alright, which bundle produces a version of 1.2.5 but I'm still getting the error
newUser1234 has quit [Ping timeout: 240 seconds]
werdnativ has quit [Ping timeout: 245 seconds]
darthdeus has quit [Ping timeout: 260 seconds]
werdnativ has joined #ruby
gaahrdner has quit [Remote host closed the connection]
gaahrdner has joined #ruby
meoblast001 has joined #ruby
robbyoconnor has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
amcsi_work has quit [Ping timeout: 244 seconds]
<Spooner> tyebud, Hmm. I know 1.2.1 worked for me before I upgraded, though I guess it could be nothing to do with bundler and be another gem or, well, anything :$
sn0wb1rd has joined #ruby
<tyebud> Shity
gyre007 has quit [Remote host closed the connection]
gaahrdner has quit [Ping timeout: 248 seconds]
reppard has joined #ruby
mneorr has quit [Remote host closed the connection]
Evixion has joined #ruby
amcsi_work has joined #ruby
robbyoconnor has quit [Ping timeout: 245 seconds]
* Spooner shrugs.
yfeldblum has joined #ruby
dallasm has quit [Remote host closed the connection]
jaygen has quit [Remote host closed the connection]
etcetera has quit []
ferdev is now known as ferdev|away
havenwood has quit [Ping timeout: 245 seconds]
rupee has quit [Read error: Connection reset by peer]
twoism has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
mando has quit [Remote host closed the connection]
etcetera has joined #ruby
kofno has quit [Remote host closed the connection]
joeycarmello has joined #ruby
aapzak has quit [Ping timeout: 255 seconds]
sayan has quit [Ping timeout: 252 seconds]
mercwithamouth has quit [Ping timeout: 248 seconds]
PragCypher has joined #ruby
etcetera has quit [Client Quit]
tommyvyo has quit [Quit:]
aapzak has joined #ruby
newUser1234 has joined #ruby
<tyebud> Thanks a ton for the help
<tyebud> I'll let you know if I come up with anything else.
kofno has joined #ruby
<moeSizlak> The gehoxigogan is framed up by the ramistam.
arya_ has quit []
ph^ has joined #ruby
yacks has joined #ruby
weddingcakes has quit [Ping timeout: 276 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
banister_ has joined #ruby
Deltaoo has quit [Ping timeout: 246 seconds]
hogeo_ has joined #ruby
ph^ has quit [Ping timeout: 244 seconds]
jbw has quit [Ping timeout: 244 seconds]
hbpoison has quit [Ping timeout: 252 seconds]
arya_ has joined #ruby
locriani has quit [Read error: Connection reset by peer]
locriani has joined #ruby
hogeo has quit [Read error: Connection reset by peer]
hogeo__ has joined #ruby
pandawarrior has joined #ruby
pandawarrior has quit [Client Quit]
hogeo_ has quit [Ping timeout: 272 seconds]
nga4 has joined #ruby
dallasm has joined #ruby
hogeo has joined #ruby
adamjleonard has quit [Quit: Leaving...]
freeayu__ has joined #ruby
hogeo has quit [Read error: Connection reset by peer]
freeayu has quit [Read error: Connection reset by peer]
hogeo has joined #ruby
jrajav has joined #ruby
angusiguess has joined #ruby
swarley- has joined #ruby
Hanmac1 has joined #ruby
bigmac has joined #ruby
io_syl has quit [Ping timeout: 260 seconds]
hogeo__ has quit [Ping timeout: 260 seconds]
swarley| has quit [Ping timeout: 256 seconds]
Hanmac has quit [Ping timeout: 244 seconds]
angusiguess has quit [Ping timeout: 248 seconds]
danieldocki has quit [Quit: Linkinus - http://linkinus.com]
swarley- has quit [Ping timeout: 276 seconds]
Spooner has quit [Remote host closed the connection]
Kobrakao has quit [Remote host closed the connection]
Ripp__ has joined #ruby
mneorr has joined #ruby
Ripp__ has left #ruby ["Leaving"]
jbw has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
cr3 has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
arya_ has joined #ruby
inao has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.90-rdmsoft [XULRunner 18.0.2/20130201065344]]
mneorr has quit [Read error: No route to host]
mneorr has joined #ruby
allaire has joined #ruby
rhyselsmore_ has joined #ruby
newUser1234 has quit [Remote host closed the connection]
etcetera has joined #ruby
mmitchell has joined #ruby
etcetera has quit [Client Quit]
mercwithamouth has joined #ruby
techhelp has joined #ruby
squidBits has quit [Quit: whoops]
blaxter has quit [Ping timeout: 246 seconds]
tjbiddle has quit [Read error: Operation timed out]
hoens has quit [Quit: ( www.nnscript.com :: NoNameScript 4.22 :: www.esnation.com )]
mmitchell has quit [Ping timeout: 272 seconds]
rburton- has quit [Quit: Linkinus - http://linkinus.com]
vabenjamin has joined #ruby
jrendell has joined #ruby
reppard has quit [Ping timeout: 244 seconds]
mneorr has quit [Remote host closed the connection]
darthdeus has joined #ruby
arya_ has quit [Ping timeout: 245 seconds]
wmoxam has joined #ruby
moos3 has quit [Quit: Computer has gone to sleep.]
Virunga has quit [Remote host closed the connection]
blaxter has joined #ruby
arya_ has joined #ruby
darthdeus has quit [Ping timeout: 248 seconds]
enebo has quit [Quit: enebo]
gaahrdner has joined #ruby
moos3 has joined #ruby
tyebud has left #ruby [#ruby]
MrZYX is now known as MrZYX|off
jrendell has quit [Quit: jrendell]
rhinux has joined #ruby
pdamer has quit [Quit: pdamer]
werdnativ has quit [Ping timeout: 252 seconds]
arya_ has quit [Ping timeout: 248 seconds]
newUser1234 has joined #ruby
berserkr has quit [Quit: Leaving.]
<bnagy> afternoon rubynauts
<bnagy> what's a decent style for adding fuctionality via modules when the container class has some private methods you'd like to be able to see?
harrymoreno has quit [Quit: harrymoreno]
<bnagy> basically I have a thing that has some of its own basic public API and basic private utility methods, and I am trying to move less-core stuff out of that class and into a few modules
etcetera has joined #ruby
gyre007 has joined #ruby
arya_ has joined #ruby
mahmoudimus has quit [Ping timeout: 252 seconds]
tjbiddle has joined #ruby
gyre007 has quit [Ping timeout: 240 seconds]
ner0x has quit [Quit: Leaving]
arya_ has quit [Ping timeout: 276 seconds]
ph^ has joined #ruby
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
reset has quit [Ping timeout: 276 seconds]
banjara has joined #ruby
banjara has quit [Client Quit]
arya_ has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
Jedi_SCT1 has quit [Ping timeout: 248 seconds]
banjara has quit [Client Quit]
banjara has joined #ruby
dhruvasagar has joined #ruby
banjara has quit [Client Quit]
nari has quit [Remote host closed the connection]
allaire has quit []
banjara has joined #ruby
chrishough has joined #ruby
nari has joined #ruby
HecAtic has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
Bosox20051 has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
sayan has joined #ruby
sayan has joined #ruby
sayan has quit [Changing host]
angusiguess has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
tomzx_mac has quit [Quit: return 0;]
tomzx_mac has joined #ruby
mockra has joined #ruby
cr3 has quit [Quit: leaving]
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
tish has quit [Quit: Leaving.]
harrymoreno has joined #ruby
jarjar_prime has quit [Quit: Sleep time.]
banjara has quit [Client Quit]
banjara has joined #ruby
Nisstyre has quit [Ping timeout: 276 seconds]
banjara has quit [Client Quit]
zeade has joined #ruby
banjara has joined #ruby
bean__ has quit [Quit: Computer has gone to sleep.]
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
ninjanoise has joined #ruby
banjara has joined #ruby
Beoran_ has joined #ruby
blf has joined #ruby
brum has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
thams has quit [Quit: thams]
<ninjanoise> rake question if anyone is around, I'm not using rails just straight up ruby, how do I check if a postgres table exists in a rakefile?
banjara has quit [Client Quit]
banjara has joined #ruby
<blf> What do you guys think? Am I being too verbose with my variable names? I'm interested in trying to make the intent of my code as clear as possible. https://gist.github.com/anonymous/341842d9845b2e21e04f
<brum> ninjanoise: are you using activerecord
mneorr has joined #ruby
banjara has quit [Client Quit]
<brum> ninjanoise: or sequel
bpfh has quit [Quit: Saindo]
banjara has joined #ruby
<ninjanoise> brum: I've been using pg
Beoran__ has quit [Ping timeout: 260 seconds]
banjara has quit [Client Quit]
<ninjanoise> conn = PG.connect(:dbname => 'database')
banjara has joined #ruby
<ninjanoise> conn.prepare('query_statement', 'select count(*) from table where id = $1')
mneorr has quit [Remote host closed the connection]
<ninjanoise> stuff like that, I'm fairly new to ruby been messing with it for about 3-4 days now
fir_ed has joined #ruby
banjara has quit [Client Quit]
harrymoreno has quit [Ping timeout: 255 seconds]
banjara has joined #ruby
harrymoreno has joined #ruby
newUser1234 has quit [Remote host closed the connection]
genxweb has joined #ruby
ebobby has quit [Quit: Lost terminal]
banjara has quit [Client Quit]
mmitchell has joined #ruby
etcetera has quit []
nonotza has joined #ruby
whitedawg has joined #ruby
ananthakumaran has joined #ruby
<genxweb> I have a pretty noob question. I have a socket that conencts and then reads the input from the website. I want to search that info for a certain line and if I find it do x. I am pretty new to this and I think my issue I dont know what I should be searching for to read
<brum> ninjanoise: maybe a begin, rescue? sorry don't know too much ab out it
banjara has joined #ruby
mattbl has joined #ruby
<brum> genxweb: what is the format of the input
<ninjanoise> brum: so can the Rakefile have the require pg and all that in it? It's essentially just a ruby file right?
banjara has quit [Client Quit]
banjara has joined #ruby
<brum> ninjanoise: anything that works in a ruby script will work in a rakefile
banjara has quit [Client Quit]
<ninjanoise> brum: thanks!
<genxweb> @brum Iam doing line = s.gets
banjara has joined #ruby
crackfu has quit [Remote host closed the connection]
Nisstyre has joined #ruby
<brum> genxweb: what kind of content is in 'line'
banjara has quit [Client Quit]
kaen has quit [Ping timeout: 245 seconds]
<brum> genxweb: are you trying to parse HTML or JSON?
banjara has joined #ruby
mneorr has joined #ruby
<genxweb> @brum the content containsts a mix of text and html code. I am trying to grab the server type
mmitchell has quit [Ping timeout: 245 seconds]
banjara has quit [Client Quit]
Rizzle has joined #ruby
banjara has joined #ruby
whitedawg has quit [Client Quit]
banjara has quit [Client Quit]
kaen has joined #ruby
banjara has joined #ruby
<brum> so can you parse it? not sure how much experience you have, where you need help
mneorr has quit [Remote host closed the connection]
<brum> but i'm glad to help if i can
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
<genxweb> @brum my issue is trying to figure out how to read and search that info as it is in a value a line at a time
<brum> if you could send a sample of the data and what you're trying to get at, it'd be great
<brum> or just a mock up of the structure
<genxweb> yeah one sec
banjara has joined #ruby
<genxweb> @brum http://pastebin.com/2Cai22Cx replace the hostname line with genxweb.net
freeayu__ has quit [Ping timeout: 248 seconds]
banjara has quit [Client Quit]
<genxweb> @brum the output will say Server:Apache I want to grab that value apache
banjara has joined #ruby
freeayu__ has joined #ruby
banjara has quit [Client Quit]
darthdeus has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
etcetera has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
divout has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
darthdeus has quit [Ping timeout: 260 seconds]
banjara has quit [Client Quit]
elico has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
<ninjanoise> @brum question again :)
kaen has quit [Ping timeout: 255 seconds]
<brum> hit me
<ninjanoise> syntax error, unexpected keyword_rescue, expecting keyword_end
<ninjanoise> rescue PG::ERROR
<ninjanoise> 12 conn.exec_prepared('drop_sql')
<ninjanoise> 13 rescue PG::ERROR
<ninjanoise> 14 puts "Note! table does not exist"
<ninjanoise> error above, code below..
banjara has joined #ruby
elico has quit [Client Quit]
<brum> you have a begin..rescue..end
<brum> true?
wmoxam has quit [Quit: leaving]
<ninjanoise> I have noticed that most rescue examples I'm seeing are within a begin..
<ninjanoise> yeah I don't have a begin..
kaen has joined #ruby
<brum> there's yr problem captain
banjara has quit [Client Quit]
<ninjanoise> so I just need to enclose the part that can fail within the begin / end?
harrymoreno has quit [Ping timeout: 260 seconds]
<brum> you must try everything that might fail inside of a begin
banjara has joined #ruby
<ninjanoise> ah
tealmage has quit [Remote host closed the connection]
<brum> and the rescue will save the code if it breaks
<ninjanoise> cool
<brum> :)
<ninjanoise> that makes sense :)
<dcope> how can i match a regex to the end of string?
banjara has quit [Client Quit]
<ninjanoise> $
<brum> depends what part you want dcope
banjara has joined #ruby
<dcope> i'm having trouble on rubular... \/login|\/password
jblack has quit [Ping timeout: 264 seconds]
<dcope> trying to match "/login" and "/password....."
banjara has quit [Client Quit]
<genxweb> exit
banjara has joined #ruby
genxweb has quit [Quit: Leaving]
Jebron has joined #ruby
<ninjanoise> rake setup
<ninjanoise> Note! table does not exist
<ninjanoise> Setting up Database
<ninjanoise> @brum
<ninjanoise> Thanks!
<ninjanoise> :)
banjara has quit [Client Quit]
nfk has quit [Quit: yawn]
robbyoconnor has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
gaahrdner has quit [Remote host closed the connection]
<dcope> got it
<dcope> \/login|(\/password\S+)
banjara has joined #ruby
<brum> genxweb
banjara has quit [Client Quit]
<brum> he's gone! i solve his problem and he leaves
banjara has joined #ruby
<brum> sweet ninjanoise, glad to hear things are good
mneorr has joined #ruby
<ninjanoise> @brum ever read hackernews?
banjara has quit [Client Quit]
banjara has joined #ruby
<brum> yeah yeah
<ninjanoise> I'm working on making a little ruby app that shows comment changes since the last time loaded
banjara has quit [Client Quit]
banjara has joined #ruby
moos3 has quit [Quit: Computer has gone to sleep.]
banjara has quit [Client Quit]
harrymoreno has joined #ruby
banjara has joined #ruby
<ninjanoise> what I have so far, it works fairly well
ananthakumaran has quit [Quit: Leaving.]
banjara has quit [Client Quit]
<brum> i'm giving you the comment master award
<brum> at the post oscar ruby ceremony
<ninjanoise> lol!
twoism has joined #ruby
<ninjanoise> it helps when I'm learning something new to keep track of what the heck I'm doing lol
<rickmasta> What does .map(&:text) do?
Voodoofish430 has quit [Quit: Leaving.]
banjara has joined #ruby
banjara has quit [Client Quit]
forced_request has quit [Read error: Connection reset by peer]
<bnagy> gives you an array populated by invoking the 'text' method on every element in a collection
banjara has joined #ruby
banjara has quit [Client Quit]
twoism has quit [Remote host closed the connection]
banjara has joined #ruby
twoism has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
znode has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
<rickmasta> I currently have something like this: thisweekmondaytime = page.search('/html/body/div/table/tr[2]/td/table/tr[3]/td[2]/pre').map(&:text)
blf has quit [Quit: Page closed]
banjara has quit [Client Quit]
k3rn3lito has quit [Ping timeout: 256 seconds]
Roa has quit [Ping timeout: 260 seconds]
<ninjanoise> task :second => :first
banjara has joined #ruby
moos3 has joined #ruby
<ninjanoise> That means that rake second also runs the first task right?
<rickmasta> But that gives me an array with one thing in it, I just want that one thing as a string. Though, if I remove the .map(&:text) I get the <pre></pre>.
banjara has quit [Client Quit]
banjara has joined #ruby
io_syl has joined #ruby
<bnagy> rickmasta: map will always return an array. You could add .first to the end?
sandGorgon has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
yacks has quit [Ping timeout: 240 seconds]
banjara has quit [Client Quit]
ph^ has joined #ruby
k3rn3lito has joined #ruby
banjara has joined #ruby
gaahrdner has joined #ruby
<bnagy> although frankly if you know it only has one match then just do page.search(blah).first.text
<rickmasta> Just adding .to_s does nothing. Can I do .map(:&text).first.to_s?
banjara has quit [Client Quit]
banjara has joined #ruby
<brum> yeah try it
banjara has quit [Client Quit]
<rickmasta> Oh nice, it works.
banjara has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
cheese1756 has quit [Changing host]
cheese1756 has joined #ruby
banjara has quit [Client Quit]
trent1 has joined #ruby
<brum> ninjanoise: nice work with the sinatra hn app, another way to make it readable besides the comments would be use more methods!
banjara has joined #ruby
<ninjanoise> @brum thanks, and yeah I'll try and break it out into smaller chunks now that it works :)
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
ph^ has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
harrymoreno has quit [Ping timeout: 264 seconds]
banjara has joined #ruby
Domon has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
<ninjanoise> @brum thanks for the help I got a rake file working too!
<ninjanoise> you are awesome! https://gist.github.com/anonymous/5035992
BrianJ has joined #ruby
<ninjanoise> (ignore the pasted cat lol)
<rickmasta> How do I choose what db to use for a project?
banjara has quit [Client Quit]
<ninjanoise> @rickmasta when I am using the pg gem it's like this
<ninjanoise> conn = PG.connect(:dbname => 'database_name')
banjara has joined #ruby
jtharris has quit [Quit: WeeChat 0.4.0]
banjara has quit [Client Quit]
techhelp has quit [Quit: This computer has gone to sleep]
banjara has joined #ruby
banjara has quit [Client Quit]
<rickmasta> No, I mean. There are so many db systems out there, and everyone uses different ones. How do I know whether mongo, sqlite, pg, myslq, redis and any other database will be the best for my project?
mikeg has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
banjara has quit [Client Quit]
<ninjanoise> ah
banjara has joined #ruby
<ninjanoise> close your eyes point to the screen?
<rickmasta> haha
<ninjanoise> I'm not sure on that one..
banjara has quit [Client Quit]
banjara has joined #ruby
<ninjanoise> postgres seems to be good for most things.. but I'm sure that's one of the "holy war" topics if you bring it up
<ninjanoise> which db is like which language to use for a project
banjara has quit [Client Quit]
moos3 has quit [Quit: Computer has gone to sleep.]
generalissimo has joined #ruby
banjara has joined #ruby
<bnagy> not really
browndawg has joined #ruby
<brum> do you have millions of users
banjara has quit [Client Quit]
<bnagy> if you don't have highly relational data, pick a nosql style, they're easier to use
banjara has joined #ruby
<bnagy> but they're not going to perform well under certain workloads
jrendell has joined #ruby
<brum> unless you're doing something important, just pick the one that looks like the most fun
banjara has quit [Client Quit]
xemu has quit [Ping timeout: 256 seconds]
banjara has joined #ruby
DrCode has quit [Remote host closed the connection]
<bnagy> I happen to, personally, like the oklahoma mixer API a lot, so I still use that even though it hasn't been touched for ages and tokyocabinet is supposedly deprecated
banjara has quit [Client Quit]
banjara has joined #ruby
<bnagy> if you need the DB to be accessed concurrently that will shape your choices, as well
toekutr has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
banjara has quit [Client Quit]
jonathanwallace has quit [Read error: Connection reset by peer]
mattbl has quit [Quit: This computer has gone to sleep]
hogeo_ has joined #ruby
toekutr` has joined #ruby
banjara has joined #ruby
jonathanwallace has joined #ruby
<brum> ルビ
Yakko has joined #ruby
banjara has quit [Client Quit]
ninjanoise has left #ruby ["@brum thanks again"]
tchebb has quit [Read error: Connection reset by peer]
banjara has joined #ruby
<brum> 日本ですか?
<brum> 日本語ですか?!
himsin has quit [Remote host closed the connection]
banjara has quit [Client Quit]
jarjar_prime has joined #ruby
banjara has joined #ruby
<brum> 私は日本語花ません。
banjara has quit [Client Quit]
banjara has joined #ruby
himsin has joined #ruby
gaahrdner has quit [Remote host closed the connection]
tchebb has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
gaahrdner has joined #ruby
banjara has quit [Client Quit]
hogeo has quit [Ping timeout: 248 seconds]
banjara has joined #ruby
banjara has quit [Client Quit]
himsin has quit [Remote host closed the connection]
mmitchell has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
pakchoi2 has joined #ruby
banjara has joined #ruby
yacks has joined #ruby
banjara has quit [Client Quit]
Tricon has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
DrCode has joined #ruby
puff has quit [Ping timeout: 260 seconds]
gaahrdner has quit [Ping timeout: 272 seconds]
jpcamara has quit [Quit: jpcamara]
mmitchell has quit [Ping timeout: 245 seconds]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
DrCode has quit [Excess Flood]
Yakko is now known as yakko_r4b1
DrCode has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran1 has joined #ruby
ocnam has joined #ruby
darthdeus has joined #ruby
pakchoi2 has quit [Quit: This computer has gone to sleep]
kanja has joined #ruby
sepp2k has quit [Remote host closed the connection]
<kanja> I'm having some trouble installing rmagick - I installed the gem and now I'm getting "libMagickCore.so.5: cannot open shared object file: <path>", but the path exits - is there a step to installing this gem I'm missing?
ananthakumaran has quit [Ping timeout: 252 seconds]
mahmoudimus has joined #ruby
<kanja> I can require it in IRB - why can't rails see it?
meoblast001 has quit [Read error: Connection reset by peer]
<ryanf> kanja: I think rmagick isn't compatible with the newest version of imagemagick
<ryanf> you may need to install a slightly older version
<ryanf> unless they updated it? I haven't checked
takeru_ has joined #ruby
<kanja> oy
etcetera has quit [Ping timeout: 276 seconds]
ninegrid_ is now known as ninegrid
darthdeus has quit [Ping timeout: 255 seconds]
havenwood has joined #ruby
thams has joined #ruby
zzing has quit [Quit: Computer has gone to sleep.]
Axsuul has joined #ruby
takeru_ has quit [Ping timeout: 244 seconds]
bigmac has quit [Quit: Leaving]
<kanja> I think I got it via symlinking
<kanja> ug
tealmage has joined #ruby
mikeg has quit [Quit: Leaving]
freakazoid0223 has quit [Ping timeout: 252 seconds]
mercwithamouth has quit [Ping timeout: 252 seconds]
tealmage has quit [Ping timeout: 252 seconds]
dhruvasagar has quit [Ping timeout: 272 seconds]
JohnBat26 has joined #ruby
angusiguess has quit [Ping timeout: 264 seconds]
error404 has quit [Read error: Operation timed out]
twoism_ has joined #ruby
tish has joined #ruby
stopbit has quit [Quit: Leaving]
twoism has quit [Ping timeout: 264 seconds]
averiso has joined #ruby
jgrevich_ has joined #ruby
kanja has quit [Ping timeout: 244 seconds]
<rickmasta> I have never used any db without Rails. haha
jlast has quit [Remote host closed the connection]
jgrevich has quit [Ping timeout: 252 seconds]
jgrevich_ is now known as jgrevich
ph^ has joined #ruby
miso1337 has quit [Quit: afk]
zmike123 has joined #ruby
razibog has joined #ruby
krz has joined #ruby
zmike123 has quit [Client Quit]
tish has quit [Quit: Leaving.]
timonv has joined #ruby
ph^ has quit [Ping timeout: 272 seconds]
decoponio has joined #ruby
razibog has quit [Ping timeout: 244 seconds]
Eerbin has joined #ruby
twoism_ has quit [Ping timeout: 276 seconds]
miso1337 has joined #ruby
malkomalko has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
malkomalko has joined #ruby
S2kx has joined #ruby
S1kx has quit [Ping timeout: 244 seconds]
rippa has joined #ruby
browndawg has quit [Quit: Leaving.]
malkomalko has quit [Ping timeout: 264 seconds]
browndawg has joined #ruby
Retistic has quit [Quit: Retistic]
arya_ has quit [Ping timeout: 252 seconds]
mneorr has quit [Remote host closed the connection]
Jebron has quit [Quit: Leaving]
decoponio has quit [Quit: Reboot my PC]
ryanf has quit [Quit: leaving]
cha1tanya has joined #ruby
spaceships has quit [Quit: leaving]
bubblehead has quit [Remote host closed the connection]
cyong has joined #ruby
arya has joined #ruby
mmitchell has joined #ruby
brum has quit [Remote host closed the connection]
DrCode has quit [Quit: ZNC - http://znc.in]
chrishough has quit [Quit: chrishough]
Zolo has joined #ruby
dallasm has quit [Remote host closed the connection]
hbpoison has joined #ruby
macmartine has joined #ruby
bluOxigen has joined #ruby
mmitchell has quit [Ping timeout: 245 seconds]
stayarrr has joined #ruby
toekutr` has quit [Remote host closed the connection]
nachtwandler has joined #ruby
toekutr has joined #ruby
miso1337 has quit [Quit: afk]
gaahrdner has joined #ruby
decoponio has joined #ruby
havenwood has quit [Remote host closed the connection]
BizarreCake has joined #ruby
znode has quit [Remote host closed the connection]
zzing has joined #ruby
znode has joined #ruby
ph^ has joined #ruby
carraroj has joined #ruby
Qwak has joined #ruby
gaahrdner has quit [Ping timeout: 255 seconds]
miso1337 has joined #ruby
browndawg has quit [Quit: Leaving.]
zzing has quit [Ping timeout: 248 seconds]
joeycarmello has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
mockra has joined #ruby
Qwak has quit [Ping timeout: 248 seconds]
evos has joined #ruby
Myconix has quit [Ping timeout: 244 seconds]
tealmage has joined #ruby
mpfundstein has joined #ruby
yacks has quit [Quit: Leaving]
znode_ has joined #ruby
mpfundstein has quit [Read error: Connection reset by peer]
pyrac has joined #ruby
angusiguess has joined #ruby
Myconix has joined #ruby
<evos> Hello! :D
mpfundstein has joined #ruby
<Boohbah> 2.times { print "HI!" }
znode has quit [Ping timeout: 272 seconds]
arietis has joined #ruby
mockra has quit [Remote host closed the connection]
generalissimo has quit [Remote host closed the connection]
tealmage has quit [Ping timeout: 246 seconds]
gabrielrotbart has quit [Remote host closed the connection]
tomzx_mac has quit [Ping timeout: 248 seconds]
angusiguess has quit [Ping timeout: 248 seconds]
braoru has joined #ruby
fir_ed has quit [Ping timeout: 248 seconds]
kofno has quit [Ping timeout: 245 seconds]
evos has left #ruby [#ruby]
Myconix has quit [Ping timeout: 272 seconds]
bean__ has joined #ruby
ph^ has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 264 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
bean__ has quit [Client Quit]
blf has joined #ruby
<blf> Hey guys, do you think it's bad practice to break a calculation down into multiple lines? As an example, https://gist.github.com/blfisher/c81e5ee96da53d3fb6f0 I'm referring to lines 9-11
apeiros_ has joined #ruby
fixl has joined #ruby
<yxhuvud> seems fine, assuming that weird syntax marking isn't how it is really parsed.
shadowshell has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 252 seconds]
greenarrow has quit [Quit: IRC is just multiplayer notepad]
<blf> yxhuvud: Haven't tested yet, but most languages support %= so I figured I'd go with it until it breaks. In any event, thanks for the feedback :)
huoxito has quit [Quit: Leaving]
pen has joined #ruby
<yxhuvud> Try, and you'll find out.
mneorr has joined #ruby
nachtwandler has quit [Remote host closed the connection]
jarred has joined #ruby
cads has joined #ruby
<cads> hey guys, is there anything in ruby that runs like stack exchange?
<jarred> hi all
girija has joined #ruby
Zolo has quit [Remote host closed the connection]
codecop has joined #ruby
<cads> hey jarred
nonotza has quit [Quit: nonotza]
newUser1234 has joined #ruby
timonv has quit [Remote host closed the connection]
twoism has joined #ruby
bluOxigen has joined #ruby
newUser1234 has quit [Remote host closed the connection]
heftig has quit [Ping timeout: 245 seconds]
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
<jarred> I haven't worked much with methods that take a block as an argument. I'm trying to define a method that gets passed both a string and a block. I defined it like, "def match(matcher, &block)", but I get "syntax error, unexpected '{', expecting end-of-input" when I call the method (not the block). Here's an example: https://gist.github.com/Jarred-Sumner/fb442a3f0905afbb81d2. What am I doing wrong/misunderstanding?
browndawg has joined #ruby
kofno has joined #ruby
stayarrr has quit [Quit: Leaving...]
jlast has joined #ruby
<bnagy> jarred: I think you probably just need braces for your param
<bnagy> match( 'bagel' ) { ...
_veer has quit [Quit: Leaving]
quaxor has joined #ruby
joeycarmello has joined #ruby
jrendell has quit [Quit: jrendell]
quaxor has left #ruby [#ruby]
apeiros_ has quit [Remote host closed the connection]
gosshedd has joined #ruby
Slivka has quit [Read error: Operation timed out]
twoism has quit [Remote host closed the connection]
Myconix has joined #ruby
jlast has quit [Ping timeout: 244 seconds]
cyong has quit [Quit: Leaving.]
miso1337 has quit [Quit: afk]
<blf> jarred: Yes, you just need parentheses. Braces bind tightly, so they are currently binding to 'bagel' as if it were the invocation. you could use do/end if you don't want to use parentheses.
Elhu has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
miso1337 has joined #ruby
<jarred> blf: Okay
<jarred> That makes sense and it worked. Thanks for your guys' help
ryanf has joined #ruby
<blf> Sure thing :)
mneorr has quit [Remote host closed the connection]
rippa has quit [Read error: Connection reset by peer]
spinagon has joined #ruby
mneorr has joined #ruby
stayarrr has joined #ruby
stayarrr has quit [Read error: Connection reset by peer]
malkomalko has joined #ruby
stayarrr has joined #ruby
mafolz has joined #ruby
quaxor has joined #ruby
emergion has joined #ruby
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
sayan has quit [Ping timeout: 272 seconds]
quaxor has left #ruby [#ruby]
mmitchell has joined #ruby
generalissimo has joined #ruby
malkomalko has quit [Ping timeout: 256 seconds]
generalissimo has quit [Remote host closed the connection]
techlife has quit [Ping timeout: 255 seconds]
techlife has joined #ruby
puppeh has joined #ruby
tagrudev has joined #ruby
lolmaus has joined #ruby
mneorr has quit [Remote host closed the connection]
mmitchell has quit [Ping timeout: 245 seconds]
jrendell has joined #ruby
heftig has joined #ruby
VinceThePrince has joined #ruby
pyrac has quit [Quit: pyrac]
pakchoi2 has joined #ruby
gosshedd has quit [Ping timeout: 276 seconds]
AntiTyping has quit [Quit: AntiTyping]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
etcetera has joined #ruby
sandGorgon has quit [Ping timeout: 245 seconds]
kaen has quit [Read error: Connection timed out]
girija has quit [Ping timeout: 244 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
jarred has quit [Quit: Leaving.]
sayan has joined #ruby
sayan has quit [Read error: Connection reset by peer]
spinagon has quit [Ping timeout: 240 seconds]
BizarreCake has quit [Read error: Connection reset by peer]
etcetera has quit [Ping timeout: 272 seconds]
hbpoison has quit [Ping timeout: 255 seconds]
wallerdev has quit [Quit: wallerdev]
arya has quit [Ping timeout: 256 seconds]
mlr has joined #ruby
codecop has quit [Remote host closed the connection]
ph^ has joined #ruby
arya has joined #ruby
rhyselsmore_ has quit [Quit: Computer has gone to sleep.]
DrCode has joined #ruby
mercwithamouth has quit [Ping timeout: 272 seconds]
angusiguess has joined #ruby
sandGorgon has joined #ruby
d2dchat has quit [Remote host closed the connection]
<blf> Anyone ever overridden the each_with_index method of the Enumerble Module? I'm thinking about returning an array of values as the object's index.
Honeycomb has joined #ruby
mercwithamouth has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
girija has joined #ruby
angusiguess has quit [Ping timeout: 264 seconds]
mneorr has joined #ruby
dr_bob has joined #ruby
joschi has quit [Read error: Operation timed out]
timonv has joined #ruby
joschi has joined #ruby
vlad_starkov has joined #ruby
MrSamuel has quit [Quit: MrSamuel]
Radnor has quit [*.net *.split]
r126l has quit [*.net *.split]
srid has quit [*.net *.split]
quazimodo has quit [*.net *.split]
objectivemo has quit [*.net *.split]
pac1 has quit [*.net *.split]
dross has quit [*.net *.split]
reactormonk has quit [*.net *.split]
regedarek has quit [*.net *.split]
mrmist has quit [*.net *.split]
volte has quit [*.net *.split]
matled has quit [*.net *.split]
sharpobject has quit [*.net *.split]
yxhuvud has quit [*.net *.split]
madhatter has quit [*.net *.split]
DanKnox has quit [*.net *.split]
vetsin has quit [*.net *.split]
moeSizlak has quit [*.net *.split]
kirotan has quit [*.net *.split]
Rious has quit [*.net *.split]
thams has quit [Quit: thams]
raddazong has joined #ruby
matled has joined #ruby
r126l has joined #ruby
Qwak has joined #ruby
Rious has joined #ruby
moeSizlak has joined #ruby
moeSizlak has joined #ruby
moeSizlak has quit [Changing host]
pac1 has joined #ruby
quazimodo has joined #ruby
akam-it has joined #ruby
reactormonk has joined #ruby
<akam-it> hello
rezzack has quit [Quit: Leaving.]
mockra has joined #ruby
<ryanf> blf: why? have you considered just defining your own method with a different name that does that?
Morkel has joined #ruby
Honeycomb has quit [Quit: Leaving.]
eldariof has joined #ruby
pencilcheck has joined #ruby
browndawg has quit [Quit: Leaving.]
<akam-it> how to operate with hex codes? i try to read binary file, but i get codes like, for example \x80 or \xF3 or even \u0001. but i need 0x80 or 0xF3 or 0x01.
kofno has quit [Ping timeout: 245 seconds]
zeade has quit [Quit: Leaving.]
horrror has joined #ruby
jimeh has joined #ruby
timonv has quit [Remote host closed the connection]
Morkel has quit [Ping timeout: 246 seconds]
werdnativ has joined #ruby
mockra has quit [Ping timeout: 276 seconds]
filipe has joined #ruby
Morkel has joined #ruby
filipe_ has joined #ruby
pen has quit [Ping timeout: 245 seconds]
hbpoison has joined #ruby
Radnor has joined #ruby
srid has joined #ruby
sharpobject has joined #ruby
DanKnox has joined #ruby
mrmist has joined #ruby
dross has joined #ruby
volte has joined #ruby
objectivemo has joined #ruby
vetsin has joined #ruby
kirotan has joined #ruby
regedarek has joined #ruby
yxhuvud has joined #ruby
filipe_ has quit [Client Quit]
kofno has joined #ruby
mlr has quit [Ping timeout: 248 seconds]
timonv has joined #ruby
hiall has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
pencilcheck has quit [Remote host closed the connection]
VinceThePrince has quit [Quit: brb]
Elhu has joined #ruby
Elhu has quit [Client Quit]
zigomir has joined #ruby
<ryanf> akam-it: it sounds like you want a combination of unpack and to_i(16)
<ryanf> unpack to turn a binary string into an array of numbers, and then to_i(16) to format them as hex
aganov has joined #ruby
Akuma has quit [Ping timeout: 252 seconds]
slainer68 has joined #ruby
mpfundstein has quit [Remote host closed the connection]
anderse has joined #ruby
VinceThePrince has joined #ruby
blueOxigen has joined #ruby
Quebert has joined #ruby
rocket has quit [Ping timeout: 256 seconds]
timonv has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
bluOxigen has quit [Ping timeout: 240 seconds]
pandawarrior has joined #ruby
emergion has joined #ruby
Retistic has joined #ruby
pandawarrior has quit [Client Quit]
mmitchell has joined #ruby
arturaz has joined #ruby
timonv has joined #ruby
slainer68 has quit [Remote host closed the connection]
mlr has joined #ruby
mlr has quit [Client Quit]
Akuma has joined #ruby
mmitchell has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Remote host closed the connection]
<akam-it> ryanf: like this? f.read(1).unpack('H*')[0].to_i(16)
seraph has joined #ruby
pyrac has joined #ruby
filipe has quit [Ping timeout: 276 seconds]
kristofers has joined #ruby
<ryanf> hmm, I think you might want 'C' instead
lkba has quit [Ping timeout: 260 seconds]
<ryanf> oops, I meant to_s also
<ryanf> >> p "\x80\x81\x82\x83\x84\x85\x86\x87".unpack('C*').map { |b| '0x' + b.to_s(16) }
<eval-in> ryanf: Output: "[\"0x80\", \"0x81\", \"0x82\", \"0x83\", \"0x84\", \"0x85\", \"0x86\", \"0x87\"]\n" (http://eval.in/11179)
TheFuzzball has joined #ruby
razibog has joined #ruby
mercwithamouth has quit [Ping timeout: 276 seconds]
VinceThePrince has quit [Quit: Leaving]
browndawg has joined #ruby
VinceThePrince has joined #ruby
Quebert has quit [Quit: Linkinus - http://linkinus.com]
yacks has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
dankest has joined #ruby
maxmanders has joined #ruby
Quebert has joined #ruby
Bosox20051 has quit [Ping timeout: 248 seconds]
toekutr has quit [Remote host closed the connection]
rocket has joined #ruby
railsbros_dirk has joined #ruby
apeiros_ has joined #ruby
Synesthesia32 has joined #ruby
tealmage has joined #ruby
filipe has joined #ruby
<Synesthesia32> Sup
<Synesthesia32> I,m developping a proyect in PHP but everybody talks about Ruby on Rails now. Is it really that good?
Quebert has quit [Ping timeout: 245 seconds]
marr has joined #ruby
emergion has joined #ruby
shiin has joined #ruby
ocnam has quit [Ping timeout: 264 seconds]
Slivka has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
lkba has joined #ruby
Synesthesia32 has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
stayarrr has quit [Quit: Leaving...]
tealmage has quit [Ping timeout: 276 seconds]
stayarrr has joined #ruby
mneorr has quit [Remote host closed the connection]
hamed_r has joined #ruby
Deltaoo has joined #ruby
atyz has joined #ruby
<blf> for dimension in (dimensions..0) {} why is this not entering the body when dimensions >= 1?
<bnagy> because ranges don't do that
kevinfagan has joined #ruby
kevinfagan has quit [Remote host closed the connection]
sandGorgon has quit [Ping timeout: 246 seconds]
<bnagy> you can use downto, maybe
<bnagy> or reverse.each
arya has quit [Ping timeout: 244 seconds]
Retistic has quit [Quit: Retistic]
<bnagy> also for ... in ... is ( imvho ) amazingly ugly and non-idiomatic syntax
<blf> Oh. So I'd have to use (0..dimensions)?
<bnagy> yep
HecAtic has quit [Quit: HecAtic]
<bnagy> dimensions.downto( 0 ).each {|dim| ...
<blf> bnagy: This is what I'm working with (minus the new correct). Any pointers for cleaning it up are greatly appreciated. I'm pretty new to ruby. https://gist.github.com/anonymous/9e9d5a3a51986a48bb42
mpfundstein has joined #ruby
anderse has quit [Quit: anderse]
Elhu has joined #ruby
hoelzro|away is now known as hoelzro
<blf> bnagy: Also, you suggestion fixed the issue. Thanks :)
Qwak has quit []
<bnagy> woo
Tricon has quit [Quit: Leaving...]
ohcibi has quit [Read error: Connection reset by peer]
gosshedd has joined #ruby
dankest has quit [Quit: Leaving...]
frihd has joined #ruby
ohcibi has joined #ruby
<mtfk__> hi any one can look on that: http://pastie.org/6339653
<mtfk__> and explain me why for 0.02 and 0.08 I have wrong results?
verysoftoiletppr has joined #ruby
<mtfk__> is any know bug related with that ?
<hoelzro> it's not a bug
<mtfk__> or I miss something
<hoelzro> it's just a strange behavior associated with how a computer stores floating point numbers
zzing has joined #ruby
<mtfk__> so what to do to make sure that the result will be correct?
<hoelzro> well, you need to ask yourself how important being 100% correct is first
sk87 has joined #ruby
<hoelzro> for most things, floating point numbers such as these are acceptably accurate
<hoelzro> and they're fast
pakchoi2 has quit [Quit: This computer has gone to sleep]
<hoelzro> for some things (ex. banking), you're willing to sacrifice performance for accuracy
<mtfk__> in my case it is very important
<hoelzro> what are you doing, if you don't mind my asking?
<mtfk__> measure a weight of some small items and store in database
<hoelzro> if it's *really* important, you should use BigDecimal
<hoelzro> but for that purpose, floats are probably good enough
<mtfk__> and 0.1 is significant
<bnagy> the results aren't out by 0.1
<bnagy> not even close
<mtfk__> sorry 0.01 is significant
elaptics`away is now known as elaptics
<mtfk__> but I see your point
<bnagy> they're probably orders of magnitude more precise than your measurements, tbh
kraljev3 has joined #ruby
atmosx has joined #ruby
atmosx has quit [Client Quit]
luckyruby has quit [Remote host closed the connection]
sandGorgon has joined #ruby
tesuki has joined #ruby
rzs has joined #ruby
otters has quit [Ping timeout: 256 seconds]
<blf> heh. I spelled spatial... spacial :)
emergion has quit [Quit: Computer has gone to sleep.]
brianpWins has quit [Quit: brianpWins]
blf has quit [Quit: "back in a bit!"]
vabenjamin has left #ruby [#ruby]
companion has quit [Quit: Poweroff]
companion has joined #ruby
a_a_g has joined #ruby
pong42_ has joined #ruby
rawler has quit [Ping timeout: 276 seconds]
pong42_ is now known as pong42
mmitchell has joined #ruby
otters has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
tish has joined #ruby
krz has quit [Ping timeout: 252 seconds]
kraljev3 has quit [Ping timeout: 244 seconds]
adambeynon has joined #ruby
hbpoison has quit [Ping timeout: 255 seconds]
hiall has quit [Quit: hiall]
darthdeus has joined #ruby
mmitchell has quit [Ping timeout: 245 seconds]
<pong42> I have a directory with sub-directories that are timestamps. I want to find a DVD iso file in the latest directory. Can it be written more elegantly than this?
blacktulip has joined #ruby
<pong42> build = Dir.entries(isodir).sort.reverse.find do
<pong42> |build|
<pong42> Dir.glob(File.join(isodir, build, "*.iso"))[0]
<pong42> end
<pong42> iso = Dir.glob(File.join(isodir, build, "*.iso"))[0]
horrror has quit [Quit: horrror]
Al__ has joined #ruby
Lemtzas_ has joined #ruby
ephemerian has joined #ruby
nomenkun has joined #ruby
girija has quit [Ping timeout: 245 seconds]
Lemtzas has quit [Ping timeout: 260 seconds]
krz has joined #ruby
pakchoi2 has joined #ruby
nari has quit [Ping timeout: 276 seconds]
rawler has joined #ruby
goganchic has joined #ruby
<goganchic> hi2all
anderse has joined #ruby
slainer68 has joined #ruby
<hoelzro> ahoy
Vainoharhainen has joined #ruby
VinceThePrince has quit [Remote host closed the connection]
clocKwize has joined #ruby
dawkirst has joined #ruby
yewton has quit [Excess Flood]
hbpoison has joined #ruby
ferdev|away is now known as ferdev
yewton has joined #ruby
VinceThePrince has joined #ruby
nari has joined #ruby
beiter has joined #ruby
beiter has quit [Client Quit]
beiter has joined #ruby
tealmage has joined #ruby
beiter has joined #ruby
girija has joined #ruby
znode_ has quit [Remote host closed the connection]
shirokuro11 has quit [Remote host closed the connection]
tealmage has quit [Ping timeout: 248 seconds]
schaerli has joined #ruby
charliesome_ has joined #ruby
marr has quit [Ping timeout: 264 seconds]
dankest has joined #ruby
elico has joined #ruby
charliesome_ is now known as charliesome
rdark has joined #ruby
werdnativ has quit [Quit: FAMOUS_LAST_WORDS is nil]
ferdev has quit [Quit: Leaving...]
Es0teric has quit [Quit: Computer has gone to sleep.]
mneorr has joined #ruby
workmad3 has joined #ruby
justsee has quit [Quit: Linkinus - http://linkinus.com]
buibex has joined #ruby
duosrx has joined #ruby
Retistic has joined #ruby
blueOxigen has quit [Ping timeout: 252 seconds]
chussenot has joined #ruby
mneorr has quit [Read error: No route to host]
mneorr has joined #ruby
neurotech has joined #ruby
kaen has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
yacks has quit [Remote host closed the connection]
Retistic has quit [Ping timeout: 272 seconds]
kaen has quit [Max SendQ exceeded]
pyrac has quit [Read error: Connection reset by peer]
pyrac_ has joined #ruby
nari has quit [Ping timeout: 276 seconds]
VinceThePrince has quit [Ping timeout: 245 seconds]
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
gyre007 has joined #ruby
hbpoison has quit [Ping timeout: 256 seconds]
casheew has quit [Read error: Connection reset by peer]
frihd has quit [Quit: Leaving.]
Al___ has joined #ruby
casheew has joined #ruby
banisterfiend has joined #ruby
Axsuul has quit [Ping timeout: 240 seconds]
mneorr has quit [Remote host closed the connection]
monkegji_ has joined #ruby
cdt has joined #ruby
rhinux has quit [Quit: Konversation terminated!]
darthdeus has left #ruby ["Linkinus - http://linkinus.com"]
lkba has quit [Ping timeout: 252 seconds]
Al__ has quit [Ping timeout: 245 seconds]
tish has quit [Quit: Leaving.]
shirokuro11 has joined #ruby
pong42 has left #ruby ["Leaving"]
drale2k has joined #ruby
mmitchell has joined #ruby
nari has joined #ruby
charnel has joined #ruby
mneorr has joined #ruby
<charnel> is there anyone who could make the processing language work with Ruby ? I need to capture an image from a digital screen and process it.
VinceThePrince has joined #ruby
ferdev has joined #ruby
VinceThePrince has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
Al___ has quit [Ping timeout: 245 seconds]
JonnieCache has quit [Quit: leaving]
lkba has joined #ruby
mmitchell has quit [Ping timeout: 248 seconds]
shirokuro11 has quit [Ping timeout: 272 seconds]
hordo has joined #ruby
<hordo> hy there
<hordo> i have ruby installed on windows 7
seoaqua has joined #ruby
<hordo> i need to automatically run some tests on different versions of IE
<hordo> e.g IE8 IE9 IE10
<hordo> for this i need to start a Virtual Machine from my ruby script and then control it
Al__ has joined #ruby
<hordo> can anyone help me with this?
lkba has quit [Ping timeout: 272 seconds]
mneorr has quit [Remote host closed the connection]
tvw has joined #ruby
Al___ has joined #ruby
<bw_> hordo: that is by far no easy task
<hordo> i know is not
<hordo> that's why i need help
Xeago has quit [Ping timeout: 245 seconds]
<bnagy> I think selenium works on windows
<bnagy> if not, there's a wrapper for autoit
<bnagy> should be easy enough - IE has all the OLE automation hooks you would probably want, unless you have to get super clicky clicky
jrendell has quit [Quit: jrendell]
<bnagy> and starting a VM from any kind of script should be trivial
berserkr has joined #ruby
<bnagy> although imho you're probably going to have an easier time using osx or linux as your VM host
<bnagy> actually imnsho
Al__ has quit [Ping timeout: 246 seconds]
<hordo> i have to use my windows as server
casheew has quit [Read error: Connection reset by peer]
whitedawg has joined #ruby
casheew has joined #ruby
<bnagy> "have to"
<hordo> and i need control of the IE installed on VM
marr has joined #ruby
hiall has joined #ruby
<Zelest> IE.. ew
cads has quit [Remote host closed the connection]
gregoryigelmund has joined #ruby
<bnagy> ok well the simple idea is to use a couple of scripts that talk via DRb
<bnagy> but it makes it a bit tricky to scale out asynchronously
VinceThePrince has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
<bnagy> anyway I'd recommend scripting up the basic automation all in the VM, first
kristofers has quit []
<bnagy> the rest is way easier
<hordo> i just need to run one test at the time
Apathetic has joined #ruby
<Apathetic> hi
<hordo> but i want the scripts to be on my windows
<hordo> and just to control VM browser
<Apathetic> i'm trying to learn ruby, and I saw this in the quickstart
<Apathetic> Math.sqrt(a+b) => 5.0
<Apathetic> what does it do?
browndawg has left #ruby [#ruby]
<hoelzro> Apathetic: well, a + b adds a and b
<hoelzro> Math.sqrt takes an input and outputs its square root
<Apathetic> and the => 5.0 part?
MrZYX|off is now known as MrZYX
<Hanmac1> this one is for showing you the output
Hanmac1 is now known as Hanmac
<Apathetic> oh maybe it wasn't just inserted on a new line
Spooner_ has joined #ruby
yewton has quit [Excess Flood]
<Hanmac> PS: if you want to use the hypotenuse of an rectangled triangle ... (3² + 4² = 5²) then this line is better because its faster: Math.hypot(3,4) #=> 5.0
yewton has joined #ruby
bapa has quit [Read error: Connection reset by peer]
shirokuro11 has joined #ruby
rippa has joined #ruby
berserkr has quit [Quit: Leaving.]
VinceThePrince has quit [Remote host closed the connection]
arturaz has quit [Ping timeout: 248 seconds]
pakchoi2 has quit [Quit: This computer has gone to sleep]
hbpoison has joined #ruby
bapa has joined #ruby
timmow has joined #ruby
timmow has quit [Read error: Connection reset by peer]
skattyadz has joined #ruby
cableray has quit [Quit: cableray]
undersc0re97 has quit [Quit: "The destruction of balance constitutes leaping forward and such destruction is better than balance. Imbalance and headache are good things." - Mao]
kraljev3 has joined #ruby
timmow has joined #ruby
kristofers has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
undersc0re97 has joined #ruby
Virunga has joined #ruby
casheew has quit [Read error: Connection reset by peer]
schaerli has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
<heftig> Hanmac: yould be nice if hypot would allow a variable amount of arguments
<heftig> for a more generic inner product
<heftig> er, dot product
hbpoison has quit [Ping timeout: 255 seconds]
<Hanmac> why not? Math.hypot(a,b) works too
<heftig> Hanmac: huh?
casheew has joined #ruby
vlad_starkov has joined #ruby
<heftig> I was lamenting the fact there's no equivalent to a Math.hypot(a,b,c) to get the length of a three-dimensional vector
shirokuro11 has quit [Remote host closed the connection]
<Hanmac> oh okay, (yeah that would be a bit more complicated)
<Hanmac> you can still make a feature request
shirokuro11 has joined #ruby
tvw has quit []
spider-mario has joined #ruby
tvw has joined #ruby
Guest39684 has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
Guest39684 has left #ruby [#ruby]
ferdev has quit [Quit: Linkinus - http://linkinus.com]
banisterfiend has joined #ruby
ferdev has joined #ruby
pakchoi2 has joined #ruby
yacks has joined #ruby
ferdev has quit [Client Quit]
casheew has quit [Read error: Connection reset by peer]
grn_ has quit [Quit: leaving]
<bnagy> oh, so, /^[Hh].*/ .. while you're on. I have a modularity style question
pac1 has quit [Ping timeout: 248 seconds]
sweet_kid has quit [Quit: ZNC - http://znc.in]
pandawarrior has joined #ruby
fermion has joined #ruby
pandawarrior has quit [Client Quit]
<bnagy> got a base class which has a very basic API, and I want to add modules with extra methods, but I would like those modules be able to use private methods in the core clas
greenarrow has joined #ruby
<hordo> how can I start a virtual machine from a ruby script?
casheew has joined #ruby
wobblini has joined #ruby
grn has joined #ruby
pakchoi2 has quit [Read error: Connection reset by peer]
berserkr has joined #ruby
tvw has quit [Ping timeout: 245 seconds]
chussenot has quit [Quit: chussenot]
<Apathetic> hordo, vagrant
miso1337 has quit [Quit: afk]
mengu__ has joined #ruby
skattyadz has quit [Quit: skattyadz]
monkegji_ has quit [Remote host closed the connection]
hamed_r has quit [Quit: Leaving]
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby
averiso_ has joined #ruby
chussenot has joined #ruby
averiso has quit [Ping timeout: 246 seconds]
<banisterfiend> bnagy: they can do that (kind of quirk about ruby)
Apathetic has quit [Quit: Leaving]
skattyadz has joined #ruby
samphippen has joined #ruby
mmitchell has joined #ruby
<drale2k> When i try to install ruby 2.0.0 with RVM, i get an error because of openssl which is "Error running 'make'"
tvw has joined #ruby
ozgura has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 240 seconds]
main has quit [Remote host closed the connection]
skattyadz has quit [Client Quit]
<bnagy> banisterfiend: uh, they can? how?
browndawg has joined #ruby
<bnagy> and, is it likely to lead to pretty code :)
browndawg has quit [Max SendQ exceeded]
mmitchell has quit [Ping timeout: 272 seconds]
browndawg has joined #ruby
<banisterfiend> assuming i understand what u mean
Quebert has joined #ruby
<bnagy> huh
buibex has quit [Remote host closed the connection]
<bnagy> yeah that's exactly what I mean
<bnagy> but when I tried it that way it seemed to not work
<bnagy> but I could have been fucking about with self
rocket has quit [Read error: Connection reset by peer]
averiso_ has quit [Ping timeout: 245 seconds]
nari has quit [Ping timeout: 276 seconds]
<bnagy> for some reason I don't like invoking methods from a module that are in the class they're going to be included into
Al___ has quit [Ping timeout: 245 seconds]
BRMatt has joined #ruby
<bnagy> it would be nice if you could read the module src and have some idea of what is an external function
rocket has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
tvw has quit []
beiter has quit [Quit: beiter]
tvw has joined #ruby
casheew has quit [Read error: Connection reset by peer]
Quebert has quit [Ping timeout: 260 seconds]
hordo has quit [Quit: Page closed]
JohnBat26 has quit [Read error: Connection reset by peer]
takeru_ has joined #ruby
JohnBat26 has joined #ruby
eka has joined #ruby
casheew has joined #ruby
averiso has joined #ruby
nkr has joined #ruby
miso1337 has joined #ruby
casheew has quit [Read error: Connection reset by peer]
tvw has quit [Ping timeout: 245 seconds]
raddazong is now known as madhatter
madhatter is now known as Guest92108
mneorr has joined #ruby
takeru_ has quit [Ping timeout: 255 seconds]
buibex has joined #ruby
Guest92108 is now known as madhatter
madhatter has quit [Changing host]
madhatter has joined #ruby
casheew has joined #ruby
schaerli has joined #ruby
Dan_ has joined #ruby
a_a_g has quit [Quit: Leaving.]
Dan_ is now known as Guest96361
jonahR has joined #ruby
jpcamara has joined #ruby
mneorr has quit [Ping timeout: 252 seconds]
ExxKA has joined #ruby
dankest has quit [Ping timeout: 248 seconds]
hoelzro is now known as hoelzro|away
pskosinski has quit [Quit: Red Eclipse, game of racist admins/devs: http://pawelk.pl/racist-red-eclipse-quin-zeroknight-gingerbear/]
hbpoison has joined #ruby
philcrissman has joined #ruby
miso1337 has quit [Quit: afk]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
pyrac_ has quit [Read error: Connection reset by peer]
pyrac has joined #ruby
Proshot has joined #ruby
sonda has joined #ruby
angusiguess has joined #ruby
Deltaoo has quit [Ping timeout: 252 seconds]
<csmrfx> :q
<csmrfx> oops 8) not vim
<bnagy> oh, I thought it was like a tongue smiley
arturaz has joined #ruby
malkomalko has joined #ruby
yewton has quit [Excess Flood]
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
Guest96361 has quit [Quit: Leaving...]
<csmrfx> heh, I have 7 vims and one irc win and still managed to miss vim
tvw has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
yewton has joined #ruby
girija has quit [Ping timeout: 248 seconds]
atno has quit [Remote host closed the connection]
ozgura has joined #ruby
rramsden_ is now known as rramsden
Deltaoo has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
tvw has quit [Ping timeout: 245 seconds]
weddingcakes has joined #ruby
Al__ has joined #ruby
weddingcakes has quit [Client Quit]
chussenot has quit [Quit: chussenot]
sandGorgon has quit [Ping timeout: 252 seconds]
nari has joined #ruby
atno has joined #ruby
blacktul_ has joined #ruby
atno has quit [Client Quit]
seraph has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 244 seconds]
F1skr has joined #ruby
samphippen has joined #ruby
blacktulip has quit [Ping timeout: 264 seconds]
Jedi_SCT1 has joined #ruby
rickmasta has quit [Quit: Leaving...]
BrianJ has quit [Quit: Computer has gone to sleep.]
slainer68 has quit [Remote host closed the connection]
elico has quit [Ping timeout: 272 seconds]
jonahR has quit [Quit: jonahR]
seoaqua has quit [Ping timeout: 240 seconds]
<dmonjo> is there a way to make a custom tcp packet in ruby? like set the headers,payload,sequence number etc?
fbernier has quit [Read error: Connection reset by peer]
girija has joined #ruby
shiin has quit [Read error: Connection reset by peer]
beiter has joined #ruby
pakchoi2 has joined #ruby
atno has joined #ruby
tk_ has joined #ruby
_bart has joined #ruby
wobblini has left #ruby [#ruby]
wobblini has joined #ruby
sandGorgon has joined #ruby
zoonfafer has joined #ruby
carloslopes has joined #ruby
railsbros_dirk has quit [Ping timeout: 244 seconds]
rdark has quit [Ping timeout: 264 seconds]
mmitchell has joined #ruby
angusiguess has quit [Ping timeout: 272 seconds]
Kovensky has quit [Ping timeout: 255 seconds]
Bry8Star has quit [Ping timeout: 276 seconds]
rdark has joined #ruby
Xeago has joined #ruby
chussenot has joined #ruby
xemu has joined #ruby
<dmonjo> i want to forge a packet
<dmonjo> not only use the tcp packet
Elhu has quit [Quit: Computer has gone to sleep.]
<dmonjo> like put the different parameters manually
mmitchell has quit [Ping timeout: 245 seconds]
<csmrfx> Well then it is time for you to read the source for that lib, isn't it?
<dmonjo> i want to know if there is a library already there that allows this
<halfdan-> eh sorry
<halfdan-> dmonjo: ^
hordo_ has joined #ruby
<hordo_> does anyone here knows watir?
<csmrfx> ask
<csmrfx> or, #selenium
<csmrfx> in fact, gtg for 4 minutes, brb
philcrissman has quit [Remote host closed the connection]
frihd has joined #ruby
atno has quit [Remote host closed the connection]
miso1337 has joined #ruby
atno has joined #ruby
alnitak has joined #ruby
philcrissman has joined #ruby
himsin has joined #ruby
Xeago has quit [Remote host closed the connection]
atno has quit [Remote host closed the connection]
monkegji_ has joined #ruby
<hordo_> i want to take screenshots but only at some part of the page using watir-webdriver
<hordo_> can anyone help me with this?
ExxKA has quit [Quit: This computer has gone to sleep]
kraljev3 has quit [Ping timeout: 256 seconds]
kofno has quit [Remote host closed the connection]
kofno has joined #ruby
<dmonjo> halfdan-: no other?
seraph has joined #ruby
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
monkegji_ has quit [Remote host closed the connection]
seraph has quit [Remote host closed the connection]
seraph has joined #ruby
<csmrfx> hordo_: you have pastie?
atno has joined #ruby
<shevy> got dope?
nari has quit [Ping timeout: 256 seconds]
<csmrfx> naw, aint a plumber
pothibo has joined #ruby
miso1337 has quit [Quit: afk]
Kovensky has joined #ruby
<Spooner_> hordo_, I've used watir
nari has joined #ruby
maverick9 has joined #ruby
<Spooner_> But not much.
<hordo_> i need to save parts of a webpage as .png
alnitak has left #ruby [#ruby]
tealmage has joined #ruby
<hordo_> not the entire page just parts of it
slainer68 has joined #ruby
<Spooner_> You mean take a screenshot or save images?
<hordo_> can I do that?
<hordo_> yep
tcurdt has joined #ruby
<Spooner_> "yep" isn't a valid reply to a question with "or" in it ;)
<hordo_> take screenshot
divout has quit [Remote host closed the connection]
<Spooner_> Saving images should be easy. Screenshot I haven't a clue if that is possible, I'm afraid.
<hordo_> i'm using b=Watir::Browser.new
tcurdt has quit [Client Quit]
<hordo_> b.screenshot.save('file.png')
browndawg has left #ruby [#ruby]
<hordo_> but this saves the whole page
<Spooner_> Oh, I see.
<hordo_> I just need let's say 10x10 px of the page to be saved
<Spooner_> You could reload the image and edit it with something.
<hordo_> i can but i rather not do that
hoelzro|away is now known as hoelzro
<Spooner_> I don't mean manually.
<hordo_> if there is a way to do this in watir
<hordo_> i know
jrajav has quit [Quit: I tend to be neutral about apples]
<hordo_> i can do that in ruby
<hordo_> but it takes time
krz has quit [Quit: krz]
<Spooner_> You mean processing time or tiem to implement.
angusiguess has joined #ruby
<csmrfx> I think webdriver takes a screenshot and that is it
<hordo_> processing
cascalheira has joined #ruby
<Spooner_> Nah, it wouldn't if you did it sensibly.
<TomJ> Using pry, is there a way to source a file and have it executed in the current pry session? Basically like "source file.sh" in the shell? I can't see anything in the docs. on the command line it has -e for exec, but I want to be able to run a script while already in a pry session, and have it execute as if I'd typed those commands (so that commands like 'reload!' work, when running pry as rails console)
tealmage has quit [Ping timeout: 248 seconds]
<Spooner_> TomJ, You can just use "load 'file.rb'"
<csmrfx> and dont use processing -- use rubymagick
<csmrfx> hordo_: ^
<hordo_> i'm using chunky_png
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<Spooner_> Yeah, chunky is in Ruby. Very slow.
<hordo_> ok thanks for helping me out
<hordo_> i will take screenshot of the whole page and then crop it with other functionalities
<Spooner_> RMagick would be fine, but ImageMagick itself sucks. There must be a better option.
<TomJ> Spooner_: great, thanks a lot!
banisterfiend has quit [Remote host closed the connection]
<csmrfx> Spooner_: well, what is there that could be improved? I am spectical
<Spooner_> Leaking a shitload of memory ;)
<Spooner_> And being easier to install.
fteem has joined #ruby
<shevy> rmagick is still alive?
rocket has quit [Quit: Linkinus - http://linkinus.com]
Elhu has joined #ruby
<csmrfx> it's just a C-bitmap processing lib
a_BossBOY has joined #ruby
objectivemo has quit [Quit: objectivemo]
a_BossBOY has left #ruby ["Leaving"]
khismetix has joined #ruby
<csmrfx> Spooner_: so, what are the better options?
<shevy> :D
guiguidoc has quit [Remote host closed the connection]
<Spooner_> I've used Devil before on windows, where installing Imagemagick is a pain (and Devil comes with everything in the c-extension).
<Spooner_> Everything else there is just a different API for Imagemagick though. Shame there isn't something better really.
brian___ has quit [Quit: brian___]
<csmrfx> Well, I could always coax Image/RubyMagick to do my bidding
shadewind has quit [Ping timeout: 264 seconds]
Mon_Ouie has quit [Read error: Operation timed out]
m8 has joined #ruby
t-mart has joined #ruby
t-mart has quit [Changing host]
t-mart has joined #ruby
buibex has quit []
seraph has quit [Remote host closed the connection]
rdark has quit [Ping timeout: 260 seconds]
banisterfiend has joined #ruby
hordo_ has quit [Quit: Page closed]
Jedi_SCT1 has quit [Quit: See ya]
rdark has joined #ruby
wobblini has quit [Ping timeout: 246 seconds]
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
<halfdan-> dmonjo: no idea
browndawg has joined #ruby
noop has quit [Remote host closed the connection]
Jedi_SCT1 has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
horrror has joined #ruby
horrror has quit [Client Quit]
cantonic has quit [Quit: cantonic]
ozgura has quit [Read error: Connection reset by peer]
ozgura has joined #ruby
ozgura has quit [Read error: Connection reset by peer]
ozgura has joined #ruby
monkegji_ has joined #ruby
chichou has joined #ruby
willob has joined #ruby
schaerli has quit [Remote host closed the connection]
malkomalko has quit [Remote host closed the connection]
mark_locklear has joined #ruby
philcrissman has quit [Remote host closed the connection]
pakchoi2 has quit [Ping timeout: 248 seconds]
jlebrech has joined #ruby
jpfuentes2 has joined #ruby
<jlebrech> what's the shorthand for 'a = b.foo unless b.nil? else nil'?
<shevy> hmm
feedbackloop has quit [Read error: Connection reset by peer]
<shevy> is there?
<shevy> perhaps ||=
robustus has quit [Ping timeout: 255 seconds]
feedbackloop has joined #ruby
<shevy> your nil worries me
<jlebrech> "a ||= b" would assign a to b is a is nil
mmitchell has joined #ruby
<jlebrech> just change it to "" in your mind
<apeiros_> a = b && b.foo
<jlebrech> ahh
* apeiros_ still wishes nobu had managed to get .? syntax through: a = b.?foo
monkegji_ has quit [Remote host closed the connection]
robustus has joined #ruby
vlad_sta_ has quit [Remote host closed the connection]
<jlebrech> apeiros_, i see there, is b is nil then use that as the value
hiall has quit [Ping timeout: 252 seconds]
sandGorgon has quit [Read error: Connection reset by peer]
mmitchell has quit [Ping timeout: 245 seconds]
sandGorgon has joined #ruby
hoelzro is now known as hoelzro|away
tealmage has joined #ruby
pakchoi2 has joined #ruby
emergion has joined #ruby
ner0x has joined #ruby
cantonic has joined #ruby
pyrac has quit [Read error: Connection reset by peer]
pyrac_ has joined #ruby
karupanerura has quit [Excess Flood]
zz_Inoperable has joined #ruby
monkegji_ has joined #ruby
tealmage has quit [Ping timeout: 256 seconds]
pakchoi2 has quit [Read error: Connection reset by peer]
gaahrdner has joined #ruby
Proshot has quit [Quit: Leaving]
TomJ has quit [Ping timeout: 252 seconds]
karupanerura has joined #ruby
<Spooner_> apeiros_, There is a gem that does it, but it is nearly as verbose (a = b.andand.foo) unless you are chaining several methods.
<apeiros_> Spooner_: it's also not syntax, hence doesn't benefit from any shortcutting.
<Spooner_> shortcutting?
end_guy has joined #ruby
<apeiros_> a chain can be halted the moment a nil is introduced
<apeiros_> andand will still run the whole chain. even if on possibly cheaper methods than the one on non-nil values
pakchoi2 has joined #ruby
<Spooner_> It will not need to run them all after the nil, but will have to go through them all, but that is just method calls (and fake method calls).
puppeh has quit [Read error: Connection reset by peer]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<apeiros_> that's pretty much what I said with "will still run the whole chain"
puppeh has joined #ruby
pakchoi2 has quit [Max SendQ exceeded]
pakchoi2 has joined #ruby
<Spooner_> Well, yes, but I read it as having to run all the potentially expensive methods in the chain.
yshh has quit [Remote host closed the connection]
carloslopes has quit [Read error: Connection reset by peer]
<apeiros_> method_missing has costs of its own. any even a regular empty method is more expensive than no method call at all.
<apeiros_> -> syntax would be nice
maverick9 has left #ruby ["Leaving"]
kalib has joined #ruby
khismetix has quit [Quit: Computer has gone to sleep.]
<apeiros_> also arguments to the methods in the chain will still be evaluated (those can be expensive too)
<Spooner_> Yeah, but I feel the ? prefix would be confusing since we already use a ? postfix.
carloslopes has joined #ruby
<apeiros_> well, my suggestion was ->, but since 1.9's ->{} lambda syntax, that'd be confusing too.
<Spooner_> Mmm. b$foo$bar ?
<workmad3> Spooner_: looks good to me!
<kalib> Hello guys. I'm new with ruby language. I got a doubt. I have this peace of code, for example: "number = gets.chomp" .. On the next line I wanna use something like "puts The new number is ..." and I wanna give that number + 1. How would be the correct way?
<workmad3> Spooner_: with that syntax we could abuse it and get R running natively in ruby ;)
<Spooner_> workmad3, I got the idea from Haskell ;)
<apeiros_> kalib: you'd have to convert the string to an integer
<Spooner_> Though I suppose it is different meaning there.
<apeiros_> kalib: you can do that with String#to_i (instance method 'to_i' of class 'String'), or Kernel#Integer
khismetix has joined #ruby
<apeiros_> Kernel#Integer looks like a global function, i.e. you call it as `Integer("12")` # => 12
pakchoi2 has quit [Read error: Connection reset by peer]
<kalib> apeiros_, I tried to use: "puts 'Wow, the new number is ' + number.to_i += 1 + '.'"
Mattix has joined #ruby
pakchoi2 has joined #ruby
<kalib> but got an error:
<kalib> misturando.rb:8:in `<main>': undefined method `to_' for "12":String (NoMethodError)
v0n has joined #ruby
<tobiasvl> to_ ?
<Spooner_> puts "Wow, the new number is #{number.to_i + 1}."
<kalib> ops.. sorry
<kalib> misturando.rb:8:in `+': String can't be coerced into Fixnum (TypeError)
<kalib> from misturando.rb:8:in `<main>'
rzs has quit [Quit: Leaving]
pakchoi2 has quit [Max SendQ exceeded]
<kalib> let me try your tip..
<apeiros_> kalib: += <-- = means assign
<apeiros_> and you can only assign to variables
<apeiros_> number <-- variable
<apeiros_> number.to_i <-- not a variable, that's an expression, can't assign to that
geekbri has joined #ruby
maycon has joined #ruby
<kalib> ok.
<kalib> got it.
<apeiros_> and the other error - String#+ expects the other operand to be a string too
<kalib> That's what I have now:
<kalib> puts 'Huuum... acho que o número ' + #{numero.to_i + 1}.
<apeiros_> so before doing "string" + variable, you have to make sure that variable is a String. .to_s does that on integers.
<Spooner_> kalib, Copy and paste fail there ;)
<apeiros_> but Spooner_'s solution with #{} and + is nicer
eka has joined #ruby
freeayu__ has quit [Ping timeout: 256 seconds]
<kalib> misturando.rb:8: syntax error, unexpected $end
karupanerura has quit [Excess Flood]
<Spooner_> puts "Huuum... acho que o número #{numero.to_i + 1}."
monkegji_ has quit [Remote host closed the connection]
tish has joined #ruby
<kalib> worked.
statarb3 has joined #ruby
<kalib> thanks.
bw_ has left #ruby [#ruby]
<kalib> I didn't know about this #{}
<kalib> thanks. ;]
karupanerura has joined #ruby
timonv has quit [Ping timeout: 276 seconds]
<workmad3> apeiros_: well, technically 'number.to_i += 1' will call 'number.to_i=(number.to_i + 1)'
<Spooner_> It is called string interpolation. It is used a lot more than + and it automatically does a to_s for you.
charnel has quit [Quit: Leaving]
seraph has joined #ruby
<kalib> got it. thanks
<workmad3> apeiros_: rather than it being invalid :)
<apeiros_> workmad3: I pondered explaining that. But I think that's far over kalib's head right now.
jrajav has joined #ruby
pakchoi2 has joined #ruby
seraph has quit [Remote host closed the connection]
<kalib> lol agree
dannluciano has joined #ruby
<workmad3> apeiros_: well, you know me... pedantic to the core :P
<workmad3> apeiros_: at least with other people's explanations ;)
<apeiros_> but maybe I should have mentioned something with regards to foo= methods.
m8 has quit [Quit: Sto andando via]
<apeiros_> workmad3: well, feel free to explain better to kalib :)
jerius has joined #ruby
<kalib> thank you guys.
<workmad3> apeiros_: nah, I agree it's probably too much to get into the details... but being aware that such a thing exists helps future explorations IMO :)
<kalib> I'll read a litle bit more now. back to the manual.
Evixion` has joined #ruby
Bry8Star has joined #ruby
gregor3005 has joined #ruby
Evixion has quit [Ping timeout: 276 seconds]
otherj has joined #ruby
mmitchell has joined #ruby
<shevy> those who love Readlien API, raise hand now
<shevy> *Readline
monkegjinni has joined #ruby
bubblehead has joined #ruby
* jrajav weakly raises his hand about halfway
timonv has joined #ruby
<shevy> lol
atyz has quit [Quit: Leaving...]
<shevy> jrajav you are funny
v0n has quit [Read error: Operation timed out]
<jrajav> :P
Hanmac has quit [Read error: Connection reset by peer]
Hanmac has joined #ruby
nfk has joined #ruby
pakchoi2 has quit [Ping timeout: 264 seconds]
jacktrick has joined #ruby
Bry8Star has quit [Remote host closed the connection]
wtee has joined #ruby
sayan_ has joined #ruby
sayan_ has quit [Remote host closed the connection]
otherj has quit []
malkomalko has joined #ruby
Bry8Star has joined #ruby
wmoxam has joined #ruby
monkegjinni has quit [Remote host closed the connection]
fedza has joined #ruby
wf2f has quit []
sailias has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
banister_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
iBot_23 has joined #ruby
kalib has quit [Quit: Leaving]
girija has quit [Ping timeout: 264 seconds]
nfk has quit [Ping timeout: 255 seconds]
ozgura has quit [Read error: Connection reset by peer]
<iBot_23> Hi, whats a good way to write html mails in ruby? i tried 4 different gems, including gmail and mail and I only get the HTML code in my mail but the mail clients are not "rendering" but just displaying it. so it is obviosly malformed then.
buibex has joined #ruby
virtuose has quit [Remote host closed the connection]
ozgura has joined #ruby
sailias has quit [Ping timeout: 257 seconds]
VinceThePrince has joined #ruby
ozgura has quit [Read error: Connection reset by peer]
dustint has joined #ruby
ozgura has joined #ruby
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
akashj87 has joined #ruby
virtuose has joined #ruby
ozgura has quit [Read error: Connection reset by peer]
ozgura has joined #ruby
poikon has joined #ruby
tommyvyo has joined #ruby
<shevy> hmm ... readline fun
<shevy> l = Readline.readline "\e[33m> \e[37m\e[33m"; print "\e[0m"; l
<shevy> anyone knows of a simple library that would eliminate the \e thingies for me?
<wmoxam> iBot_23: shounds like a mime-type misconfiguration
sandGorgon has quit [Ping timeout: 245 seconds]
nfk has joined #ruby
tomzx_mac has joined #ruby
<dmonjo> what is the best method to extrfact a substring from a string using regex?
<Spooner_> dmonjo, str[/regex/]
whowantstolivefo has quit [Ping timeout: 272 seconds]
<dmonjo> grep does not work since not iterator
<dmonjo> Spooner_: can you give me a small example?
dhruvasagar has quit [Ping timeout: 264 seconds]
whitedawg1 has joined #ruby
d2dchat has joined #ruby
<dmonjo> nevermind it works fine thanks
emergion has quit [Quit: Computer has gone to sleep.]
<iBot_23> wmoxam: what can I do about it?
whitedawg has quit [Read error: Connection reset by peer]
<iBot_23> wmoxam: even pony doesnt work for me https://github.com/benprew/pony
krawchyk has joined #ruby
malkomal_ has joined #ruby
thams has joined #ruby
shirokuro11 has quit [Remote host closed the connection]
beiter has quit [Quit: beiter]
Slivka has quit [Ping timeout: 245 seconds]
girija has joined #ruby
<yfeldblum> shevy, oniguruma
matled has quit [Remote host closed the connection]
Udom0 has joined #ruby
<Spooner_> dmonjo, "moon and tree and frogtree wine"[/\b\w+tree/] #=> "frogtree"
<jacktrick> with th mail gem you'd type somethine like content_type 'text/html; charset=UTF-8'
<jacktrick> my typing is terrible today
<jacktrick> :/
malkomalko has quit [Ping timeout: 272 seconds]
<dmonjo> trying to extract h1 from a get response
<dmonjo> h1 = line[/\<h1\>(.*)\<\/h1\>/]{$1}
sailias has joined #ruby
<dmonjo> something is missing
zph has joined #ruby
<Spooner_> Why ignore what I said and add {$1} ?
gaahrdner has quit [Remote host closed the connection]
thomasfedb has quit [Ping timeout: 264 seconds]
zph has quit [Client Quit]
atyz has joined #ruby
<dmonjo> trying to get whats between <h1> </h1>
gregoryigelmund has quit [Ping timeout: 248 seconds]
aedornm has joined #ruby
<dmonjo> so using the ()
<Spooner_> I know, but you aren't doing what I told you to do.
tealmage has joined #ruby
monkegjinni has joined #ruby
breakingthings has joined #ruby
pdamer has joined #ruby
<jacktrick> don't use regex to parse html
<jacktrick> it's an exercise in madness D:
beiter has joined #ruby
<Spooner_> Yeah, that is another point. Use nokogiri
<iBot_23> yay
<dmonjo> ok noted, for the sake of curiosity whats wrong with my code?
whowantstolivefo has joined #ruby
<Spooner_> I have told you already.
<iBot_23> pony worked :) just had to shuffle a bracket. O_o
postmodern has quit [Quit: Leaving]
<workmad3> Spooner_: well, your code would have kept the <h1> </h1> wrapping ;)
<workmad3> Spooner_: but that could easily have been solved with a lookahead and a lookbehind
tealmage has quit [Read error: Connection reset by peer]
<dmonjo> no way to use the {$1} to extractwhats in between in 1 shot instead of using ahead and behind?
<Spooner_> workmad3, Yes, but I gave that before I knew it was parsing XML ;) Adding the {$1} was never going to work.
<dmonjo> whY?
rismoney has joined #ruby
<Spooner_> Because that was what you had to do in a completely different example.
maycon has quit [Read error: Connection reset by peer]
<workmad3> dmonjo: because the String#[] method doesn't execute a block
nari has quit [Ping timeout: 255 seconds]
neurotech has quit [Remote host closed the connection]
<dmonjo> ok good to know
maycon has joined #ruby
maycon has quit [Changing host]
maycon has joined #ruby
thomasfedb has joined #ruby
znode has joined #ruby
jonahR has joined #ruby
<Spooner_> dmonjo, "<h1>use nokogiri please!</h1>"[/\<h1\>(.*)\<\/h1\>/, 1] #=> "use nokogiri please!"
inao has quit [Quit: Leaving...]
fbernier has joined #ruby
<dmonjo> looking up on that
jpcamara has quit [Quit: jpcamara]
fels__ has joined #ruby
miso1337 has joined #ruby
<Spooner_> Goody ;)
mengu__ has quit [Ping timeout: 245 seconds]
<aedornm> I really want to put "[/\<h1\>(.*)\<\/h1\>/, 1]" all over my code now. I'll need to add some characters, though.
_nitti has joined #ruby
<workmad3> >> p "<h1>use nokogiri please!</h1>"[/(?<=<h1>)(.*)(?=<\/h1>)/]
<eval-in> workmad3: Output: "\"use nokogiri please!\"\n" (http://eval.in/11197)
<dmonjo> how can i know if nokogiri is installed with my 1.9.3?
<dmonjo> seems it needs a gem install
<Spooner_> It isn't. It is a gem.
<dmonjo> ok
Deltaoo has quit [Ping timeout: 264 seconds]
ffranz has joined #ruby
tealmage has joined #ruby
Xeago has joined #ruby
lkba has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<shevy> yfeldblum ok
<iBot_23> as long as I dont use attachments, because then only the image is in the mail not the html anymore :/
chichou has quit [Remote host closed the connection]
jpfuentes2 has joined #ruby
<aedornm> Not like it would be hard to write, but is there a gem that will keep track of the initial values of an object, so that one may 'reset' it to the original at a given point in time? And by an object, I really mean 50 some variables
DaltonUS has joined #ruby
<lupine> hrm, there's no way to see if an ensure block is being triggered because an exception has been raised, is there?
pothibo has quit [Quit: pothibo]
jgarvey has joined #ruby
vlad_starkov has joined #ruby
<lupine> (I guess I could set a flag in a rescue => err ; raise err ; ensure ; end sort of way, but that's eviler)
<Spooner_> lupine, ensure is called whether there is an exception or not.
cha1tanya has quit [Quit: Leaving]
<lupine> I know, hence the question :)
swex has quit [Remote host closed the connection]
<Spooner_> Maybe you want to just use "else"?
chichou has joined #ruby
<Spooner_> If you want something that only happens if an exception isn't raised.
<Spooner_> Or just put it in the main block.
<aedornm> You don't need to raise the error again. You can just set the var in the rescue and let it end.
<lupine> I was looking for a way to execute something if an exception *is* raised, without impeding the exception flow (so no need to raise the captured exception in a rescue block)
<Spooner_> I see. You've just explained how to do that (re-raise).
<aedornm> Unless you're wanting the error, then I guess you do. Nevermind.
znode has quit [Remote host closed the connection]
<lupine> aye, it's a transaction, so on exception I need to reset some instance variable and let the exception propagate up the stack. I know how to do that - it just annoys me a bit that that messes with the exception call trace
lolmaus has quit []
hashmal has quit [Quit: Computer has gone to sleep.]
znode has joined #ruby
<Spooner_> Right.
jekotia has joined #ruby
pskosinski has joined #ruby
znode_ has joined #ruby
arya has joined #ruby
newUser1234 has joined #ruby
znode has quit [Read error: Connection reset by peer]
<aedornm> oh
<aedornm> just check against $!
arya has quit [Client Quit]
arya has joined #ruby
<aedornm> If there was no exception then $!.nil? would be true
<iBot_23> can anyone tell me where i can find a code snippet for multipart emails with pony
<iBot_23> ?
jtharris has joined #ruby
iamjarvo has quit [Quit: Leaving.]
goganchic has left #ruby [#ruby]
<aedornm> >> begin; raise "an error"; ensure puts $!; end
<eval-in> aedornm: Output: "/tmp/execpad-3a45dd1cceae/source-3a45dd1cceae:1:in `<main>': an error (RuntimeError)\nan error\n" (http://eval.in/11198)
DaltonUS has quit [Quit: DaltonUS]
<dmonjo> test5.rb:2:in `<main>': uninitialized constant Nokogiri (NameError)
<lupine> aedornm, haha, that would work
<lupine> my, that's evil
<Spooner_> dmonjo, You need to require it.
<lupine> presumably, that has special magic under the hood to be thread-safe?
girija has quit [Ping timeout: 252 seconds]
thams has quit [Quit: thams]
yshh has joined #ruby
joast has quit [Quit: Leaving.]
<aedornm> hmmmmm.. I'm not sure I'd presume that.
JonnieCache has joined #ruby
teamon has joined #ruby
<aedornm> I really want to say it keeps them thread-local, though.
<lupine> mm, I'm having second thoughts on it - just trying to test it
sayan has quit [Read error: Connection reset by peer]
maletor has joined #ruby
khismetix has quit [Quit: Computer has gone to sleep.]
<teamon> bundler question: is it possible to have gem "foo", :group => :production and gem "foo", :path => "../foo", :group => :development somehow? this is raising en error (multiple sources)
<aedornm> http://ruby.runpaint.org/globals says $! is thread local
buibex has quit []
mulinux has joined #ruby
<dmonjo> puts @doc.xpath("//h1") is extracting <h1>...<h1>
<dmonjo> i need to ommit the h1s
dblack_ has joined #ruby
<Spooner_> @doc.xpath("//h1").text
<dmonjo> lovely
<lupine> *method-local* ?
<lupine> dear me
mengu__ has joined #ruby
<workmad3> aedornm: my quick test confirms that :)
v0n has joined #ruby
tomzx_mac has quit [Ping timeout: 252 seconds]
<dmonjo> would it be best to use xpath with nokogiri or css3 selectors? anyone would like to share his experience?
<lupine> it's a cool trick, but I think I'll avoid it, on retrospect
<Spooner_> They both do the same thing. Just use the one you like better.
<workmad3> aedornm: 10.times do |i|; Thread.new do; begin; raise i.to_s; ensure; sleep rand(2); puts $!; end; end; end;
VinceThePrince has quit [Remote host closed the connection]
<Spooner_> I use xpath, because I can automatically generate that with my browser, but I think the css is more readable.
newUser1234 has quit [Remote host closed the connection]
<dmonjo> you cant generate css with the browser?
<aedornm> workmad3: fabulous
<aedornm> lupine: I really think you're safe!
<Spooner_> No, I mean I can click "copy xpath" when I right-click on something in my browser, which saves me working it out ;)
stopbit has joined #ruby
adamjleonard has joined #ruby
<workmad3> aedornm: when you get the case of it printing out two different $!'s at the same time (because a context switch happened between puts printing out the number and the \n), that's what I take as a good sign :)
<Spooner_> xpath is more standard, but is ugly as hell. The css search is nicer to read/write manually, but my browser doesn't know about it because I don't think it is a standard.
<dmonjo> which browser is that
<Spooner_> I use Chromium.
[[johnonymous]] has joined #ruby
<Spooner_> well, right-click on what I want, then "inspect element" then right-click on the html and "copy xpath"
<dmonjo> why not chrome ? :)
<aedornm> workmad3: Yup, just tried it also, and it looks good to me!
<lupine> I quite like xpath
zzing has quit [Quit: Computer has gone to sleep.]
<Spooner_> dmonjo, I'm on Linux. Don't really gain anything from going for the full Chrome.
<dmonjo> i am using linuxmint with chrome, runs great
<Spooner_> So does Chromium ;)
<Spooner_> The only thing missing (that matters) is a built-in PDF viewer.
<aedornm> Spooner_: and 4 color logo!
<Spooner_> aedornm, Yeah, I knew there was something else that irked me!
zykes- has quit [Ping timeout: 245 seconds]
razibog1 has joined #ruby
pyrac_ has quit [Read error: Connection reset by peer]
pyrac has joined #ruby
razibog has quit [Quit: Leaving.]
<aedornm> I still use Firefox because of Firebug
DrShoggoth has quit [Quit: Leaving]
BizarreCake has joined #ruby
interactionjaxsn has joined #ruby
dannluciano has quit [Quit: dannluciano]
wtee has quit [Quit: wtee]
<dmonjo> Spooner_: i am trying to use the xpath inspected by an element from a page: //*[@id="box"]/p/text()
<dmonjo> doest work with the nokogiri
<aedornm> oh, and the web developer toolbar. That's pretty handy, too.
<Xeago> HA
<dmonjo> puts @doc.xpath(//*[@id="box"]/p/text()).text
silasdavis has joined #ruby
<Xeago> finally I can present pdf files on osx with Preview.app!
<silasdavis> using rvm install 1.8.6
banisterfiend has joined #ruby
<silasdavis> gems seem to install fine
<Spooner_> dmonjo, You need quotes and, I think it should return an array.
<silasdavis> by none show up with gem list
<silasdavis> any ideas?
<Spooner_> Did you use sudo to install the gem?
kpshek has joined #ruby
<silasdavis> Spooner_, no
banister_ has quit [Read error: Connection reset by peer]
<Spooner_> dmonjo, puts @doc.xpath('//*[@id="box"]/p/text()').first.text
ph^ has quit [Ping timeout: 260 seconds]
zykes- has joined #ruby
huoxito has joined #ruby
philcrissman has joined #ruby
kpshek has quit [Read error: Connection reset by peer]
kanja has joined #ruby
shirokuro11 has joined #ruby
cilquirm has joined #ruby
quazimodo has quit [Ping timeout: 256 seconds]
kpshek has joined #ruby
quazimodo has joined #ruby
jacktrick has quit [Quit: Leaving]
baroquebobcat has joined #ruby
elux has joined #ruby
znode_ has quit [Remote host closed the connection]
sayan has joined #ruby
swex has joined #ruby
enebo has joined #ruby
adkron has joined #ruby
kanja has left #ruby [#ruby]
hiall has joined #ruby
mark_locklear has quit [Quit: Leaving]
hoelzro|away is now known as hoelzro
emergion has joined #ruby
<iBot_23> Is there a better gem than pony to write multipart html emails? I'm not getting the correct header for an inline image into the mail.
averiso_ has joined #ruby
znode has joined #ruby
averiso has quit [Ping timeout: 246 seconds]
tk_ has quit [Ping timeout: 255 seconds]
breakingthings has quit []
axhlf has joined #ruby
<iBot_23> aedornm: thx
breakingthings has joined #ruby
bean__ has joined #ruby
banisterfiend has quit [Remote host closed the connection]
atyz has quit [Quit: Leaving...]
Choobie has joined #ruby
newUser1234 has joined #ruby
<iBot_23> aedornm: unfortunately there is no example where they use it for inline images
dblack_ has quit [Quit: dblack_]
<iBot_23> aedornm: but i will just try if it works
<axhlf> I'm reinstalling rvm and all that comes with that (and trying out ruby2). When doing 'gem install bundler' with ruby 2.1 I get http://pastie.org/6341859 this error. It complains about not having openssl. How do one install that, in this context? Thankful for any pointers in the right direction :)
<breakingthings> Ruby 2.1? Are you from the future?
<breakingthings> also openssl is an issue for many right now
beiter has quit [Quit: beiter]
<Spooner_> 2.0 installed fine for me with rbenv (Ubuntu).
<axhlf> breakingthings: oh, sorry! It's no time machine, just fat fingers. 2.0
generalissimo has joined #ruby
<axhlf> sadly enough
jpcamara has joined #ruby
<breakingthings> what OS are you using, axhlf?
<axhlf> osx lion
<breakingthings> take a look at this thread
<breakingthings> Don't know if it will help any.
mikepack has joined #ruby
siert has joined #ruby
malkomalko has joined #ruby
<siert> regex question - howto match [ Classification: this string containing digit and non didits without the classification part ] ?
<dmonjo> puts @doc.xpath('//*[@id="dsq-global-toolbar"]/ul[2]/li[3]/ul/li[2]')
<aedornm> It's not enough to subclass OpenStruct... one must rewrite it!
maycon has quit [Quit: Saindo]
<dmonjo> is returning nothing
<dmonjo> even though i inspected the element i want it to return
fels__ has quit [Ping timeout: 264 seconds]
takeru has joined #ruby
<dmonjo> the inspected element is "and 2 others liked this." in the comments section
<axhlf> breakingthings: thanks, solving the problem.
dblack_ has joined #ruby
zoonfafer has quit [Ping timeout: 264 seconds]
puppeh has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
malkomal_ has quit [Ping timeout: 255 seconds]
SCommette has joined #ruby
VinceThePrince has joined #ruby
tk_ has joined #ruby
rippa has joined #ruby
banisterfiend has joined #ruby
LBRapid has joined #ruby
peregrine81 has joined #ruby
<Spooner_> dmonjo, The comments are loaded using javascript, which you aren't running when you just download the raw html. Look at watir, which runs an instance of your browser and scrapes from that.
dhruvasagar has joined #ruby
braoru has quit [Quit: Leaving]
joshman_ has joined #ruby
banister_ has joined #ruby
huttan has joined #ruby
<dmonjo> you mean watir will simulate that for me and return the html wit hthe javascript?
takeru has quit [Ping timeout: 255 seconds]
seoaqua has joined #ruby
<Spooner_> It doesn't simulate. It actually opens the page in a real browser, then lets it run the javascript and just gives you a nokogiri doc.
moos3 has joined #ruby
<dmonjo> perfect :)
<Spooner_> You will want watir-webdriver though, since you aren't on Windows.
<dmonjo> will look into that
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
v0n has quit [Ping timeout: 255 seconds]
mando_ has joined #ruby
<iBot_23> aedornm: this gem requires sendmail, i just want to send stuff via gmail
m3pow has quit [Read error: Connection reset by peer]
banisterfiend has quit [Ping timeout: 252 seconds]
<dmonjo> Spooner_: i see you can even fill forms and submit with watir
<dmonjo> awesome
spaceships has joined #ruby
<Spooner_> You can indeed. Mechanise is better for that if you don't need Javascript/Ajax though, since that just emulates the browser rather than running one.
jlast has joined #ruby
<Spooner_> *mechanize even
atmosx has joined #ruby
<aedornm> iBot_23: It can use sendmail, but it does not require it
zzing has joined #ruby
<dmonjo> mechanize would be way faster i think
shirokuro11 has quit [Remote host closed the connection]
<dmonjo> watir would be a bit slow if you run for example like a 100 instance
mark_locklear has joined #ruby
<Spooner_> Mainly it doesn't get in the way by popping up a browser and, obviously, would be less memory intensive if you wanted to run 10 instances of it at once :D
skattyadz has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
<Spooner_> They are both fine though. Not usually in a rush to scrape.
cilquirm has quit [Read error: Connection reset by peer]
enroxorz-work has joined #ruby
mulinux has quit [Quit: mulinux]
<Spooner_> Well, not in the scrapers I've written anyway :D
<dmonjo> maybe use it to bruteforce a user/pass authentication :D
skattyadz has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
sepp2k has joined #ruby
skattyadz has joined #ruby
<Spooner_> I earned a whopping $60 last week writing scrapers. Feel free to subcontract :P
<aedornm> capybara-webkit will also work, and it's a tad bit less intensive than running a WebDriver instance of Firefox
maletor has quit [Quit: Computer has gone to sleep.]
Elhu has quit [Ping timeout: 252 seconds]
<iBot_23> aedornm: I dont see an example with inline images anywhere. I hacked a python version in 10 minutes and will use that now, thank you anyway :)
<Spooner_> aedornm, Good to know.
dustint has quit [Ping timeout: 252 seconds]
xclite has joined #ruby
Elhu has joined #ruby
<dmonjo> wonbat can be used on ajax/jscript?
<dmonjo> wombat*
ananthakumaran has joined #ruby
<aedornm> I really want to do Watir for PhantomJS
Kuifje has joined #ruby
Kuifje has joined #ruby
dannluciano has joined #ruby
malkomal_ has joined #ruby
malkomal_ has quit [Read error: Connection reset by peer]
eldariof has quit [Read error: Operation timed out]
malkomal_ has joined #ruby
tk_ has quit [Quit: ばいばい]
malkomalko has quit [Ping timeout: 248 seconds]
troulouliou_dev has joined #ruby
<troulouliou_dev> hi stupid question i know but i m using gedit as IDE for all ruby tasks , would like to switch to something other ; maybe a terminal one under terminator ; any good ideas , experience here ?
banisterfiend has joined #ruby
bobinator60 has joined #ruby
LBRapid has quit [Quit: Computer has gone to sleep.]
mcatch has joined #ruby
<bobinator60> does ruby have the notion of nested modules stored in hierarchical directors (a la Python)? [i have read this: http://stackoverflow.com/questions/2868835/ruby-and-rails-nested-module-syntax]
<hoelzro> troulouliou_dev: I rather like vim
<bobinator60> s/directors/directories/
<hoelzro> bobinator60: it can do that, but it doesn't enforce it
velCzupa has joined #ruby
<Spooner_> bobinator60, No, it doesn't, but it is good practice to do it manually.
iBot_23 has left #ruby [#ruby]
atmosx has quit [Quit: And so the story goes…]
carloslopes has joined #ruby
<mcatch> Does ruby have a built-in way to execute a program (on Windows) given a file path? ie, a file sitting at "C:\runMe.exe"
a_a_g has joined #ruby
znode has quit [Remote host closed the connection]
<bobinator60> how would it work? src/Outermodule.rb and src/subpackage/Innermodule.rb ?
<bobinator60> (ignore caps)
<hoelzro> mcatch: probably spawn/system
<Spooner_> mcatch, system, exec, ``
banister_ has quit [Ping timeout: 248 seconds]
dustint has joined #ruby
<bobinator60> or if someone has an example of hierarchitecal modules in rb, i would love a pointer
<shevy> bobinator60 you can use any layout you want to. people usually do it like this
<shevy> module Foo; class Bar
<shevy> foo/bar.rb
maletor has joined #ruby
<shevy> and perhaps a foo.rb at the base
schaerli has joined #ruby
<shevy> "For a Rails example let's look into the railties/lib/rails/engine.rb"
<shevy> class Rails::Engine
<bobinator60> (thinking)
<shevy> notice, it is -> rails/engine.rb
<shevy> in my example it would be Foo::Bar
<shevy> using class Bla::Something directly is not that common
arya has quit [Ping timeout: 248 seconds]
<shevy> mostly it is just "class OneWordHere"
axl_ has joined #ruby
Deltaoo has joined #ruby
<mcatch> Spooner_: doesn't seem to be working
dannluciano has quit [Quit: dannluciano]
<mcatch> irb(main):013:0> system("exec", "c:\asdf.msi")
<mcatch> doesn't run anything
<mcatch> yet it returns successfully
<bobinator60> right, and rails/engine.rb would have module rails; class engine ?
<Spooner_> mcatch, No, those where three options. system("c:\asdf.msi")
zzing has quit [Quit: Computer has gone to sleep.]
<Spooner_> Or: output = `c:\asdf`
<bobinator60> what about rails/caboose.rb ?
<mcatch> same thing Spooner_ system("c:\asdf.msi") simply returns => nil
<mcatch> but nothing launches
<Spooner_> Mmm.
<bobinator60> wouldn't that also have module rails; class caboose? would these be two separate modules? or one namespace?
<hoelzro> you probably need msiexec or something?
<bobinator60> shevy: ^
<shevy> bobinator60 a module must start with an upcased character
<bobinator60> ok, well ignore the cas
<bobinator60> e
<shevy> I can't, I must pay attention to detail :)
arya has joined #ruby
etcetera has joined #ruby
<shevy> bobinator60 your class would reside within the module namespace
<bobinator60> thanks. I have just written it down
tagrudev has quit [Remote host closed the connection]
Roa has quit [Ping timeout: 256 seconds]
k3rn3lito has quit [Ping timeout: 248 seconds]
<aedornm> system("msiexec c:\asdf.msi")
Mattix is now known as Matip
<shevy> but you can "include Rails" to include that namespace, into.. I dunno... main... or whatever the name is
<bobinator60> would rails/engine.rb and rails/caboose.rb be in the same Rails:: namespace?
<shevy> if you would use this logical directory structure, sure
<Spooner_> mcatch, #system will just return nil though. The output will go to stdout. Use output = `msiexec c:\asdf.msi` to get the text output.
siert has left #ruby [#ruby]
techhelp has joined #ruby
<dmonjo> core_tests.rb should be there after watir is installed on linux? cant find them
LBRapid has joined #ruby
rafrcruz has joined #ruby
carloslopes has quit [Remote host closed the connection]
velCzupa has quit [Remote host closed the connection]
<rafrcruz> Hello guys
k3rn3lito has joined #ruby
<rafrcruz> I really need help to install nmatrix. Someone have some time to try to explain me how to install it in linuxmint? I tryed the tutorials on sciruby.com but it's not working for me :/
dannluciano has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
chrishough has joined #ruby
SCommette has quit [Quit: SCommette]
carloslopes has joined #ruby
SCommette has joined #ruby
samphippen has joined #ruby
razibog1 has quit [Ping timeout: 264 seconds]
<bobinator60> shevy: include Modulename ?
<bobinator60> or include Modulename::classname
<hoelzro> bobinator60: you can only include modules
tobor_one has joined #ruby
<Spooner_> You include modules.
clocKwize has quit [Quit: clocKwize]
znode has joined #ruby
end_guy has quit [Ping timeout: 276 seconds]
<bobinator60> ok, i'm switching over from python. bear with me :)
TomJ has quit [Ping timeout: 248 seconds]
mcatch has quit [Quit: Page closed]
DrCode has quit [Ping timeout: 276 seconds]
<hoelzro> bobinator60: what prompted the switch, if you don't mind my asking?
<Spooner_> bobinator60, I'm going the other way at the moment (The reason being $)
codecop has joined #ruby
<bobinator60> hoelrzo: its a polyglot app
yakko_r4b1 has quit [Ping timeout: 255 seconds]
end_guy has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<hoelzro> bobinator60: what's it do?
<bobinator60> so instead of require_relative 'mymodule/myclass.rb' i use Include Mymodule
<Spooner_> No, include means something else.
<bobinator60> hoelzro: you'll have to sign a 12 page NDA
<hoelzro> heh, ok
<bobinator60> so instead of require_relative 'mymodule/myclass.rb' i use include Mymodule
<hoelzro> bobinator60: no, you still need to require
<hoelzro> include has nothing to do with loading code
<Spooner_> require_relative loads the file. include just affects the namespace of what you've loaded.
<bobinator60> oi
<bobinator60> got it thanks
<Spooner_> require_relative "frog"; include Frog => from frog import *
VinceThePrince has quit [Remote host closed the connection]
<bobinator60> touchdown jesus
<Spooner_> require_relative "frog" => import frog
schaerli has quit [Remote host closed the connection]
dblack_ has quit [Quit: dblack_]
DrShoggoth has joined #ruby
generalissimo has quit [Remote host closed the connection]
<bobinator60> thank you. one more question
DrCode has joined #ruby
<Spooner_> Though in your example, you'd require_relative all those files, then include Rails to get them all in the global namespace.
mattbl has joined #ruby
<bobinator60> can i do this multiple levels deep?
<bobinator60> like require 'out/mid/in/someclass.rb'
<dmonjo> ie = Watir::IE.new what is the equivalent of this on linux
<hoelzro> sure
<Hanmac> you mean with require_relative? yeah as deep as you want
<dmonjo> usig the webdrivers
<Spooner_> Yeah, though require_relative it and don't add the .rb (it knows you mean .rb).
wallerdev has joined #ruby
<bobinator60> how does that affect the modules?
<bobinator60> thanks Spooner_
zastern has joined #ruby
k3rn3lito has quit [Ping timeout: 256 seconds]
jfarrell has joined #ruby
<bobinator60> do I say module out; module mid; module in; class myclass ?
<bobinator60> and include Out::Mid::In ?
jfarrell has left #ruby [#ruby]
Roa has quit [Ping timeout: 276 seconds]
chomp has joined #ruby
<hoelzro> bobinator60: you don't *need* to include
<bobinator60> correction: do I say module Out; module Mid; module In; class myclass ?
<hoelzro> you can just refer to it as Out::Mid::In::MyClass
<Spooner_> Yes, you can do that.
rafrcruz has quit [Quit: Saindo]
k3rn3lito has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
<bobinator60> is "module" an executable statement? can I compose the modules by examining the path?
<Spooner_> As hoelzro said, you don't need to include anything. You only need to do that if you want to put everything from the module in the current namespace (so you can do MyClass instead of Out::Mid::In::MyClass).
<bobinator60> i see
freakazoid0223 has joined #ruby
<bobinator60> is "module" an executable statement? can I compose the modules by examining the path?
Slivka has joined #ruby
<Spooner_> Modules have nothing to do with paths in Ruby. It just makes sense to put things in inner modules in directories of the same name.
<bobinator60> Spooner_: yes, i got that. just trying to avoid typing mistakes :)
hackeron has quit [Read error: Operation timed out]
<Spooner_> (well, MyModule would be my_module as a path, of course).
ph^ has joined #ruby
<bobinator60> yep. ok.makes sense. thanks
himsin has quit [Remote host closed the connection]
<Kovensky> \ruby 2.0/
<dmonjo> Spooner_: you ran watir with which browsers?
<dmonjo> on linux
<apeiros_> Spooner_: MyModule -> my_module is rails convention. ruby convention is MyModule -> mymodule (I find neither good)
<dmonjo> headless or with browsers?
<Spooner_> apeiros_, I follow the Rails convention then. I am evil ;)
znode has quit [Remote host closed the connection]
fteem has quit [Ping timeout: 248 seconds]
<apeiros_> is the second statement a conclusion from the first, or just on its own? :)
zigomir has quit [Quit: zigomir]
<Spooner_> Conclusion. I don't use eval, so I can't be all bad.
<apeiros_> everybody uses eval.
<apeiros_> that's how require and load work :-p
Kuifje has quit [Ping timeout: 260 seconds]
<bobinator60> why do some ruby method parameters have leading colons?
<Spooner_> Oh, I was just going to say that is how attr_reader works.
<bobinator60> def foo :param
<apeiros_> (which is why it's stupid to carte-blanche vilify eval)
<Spooner_> It is a symbol, which is a sort of string.
kpshek has quit []
_nitti has quit [Ping timeout: 255 seconds]
<apeiros_> It is a symbol, which is a sort of an integer
<Spooner_> Ha, OK. Good point.
Slivka has quit [Remote host closed the connection]
verysoftoiletppr has quit [Ping timeout: 252 seconds]
<apeiros_> bobinator60: lets just say, just like 12, and "hello" are Integer and String objects (literals), :foo is a Symbol object (a literal too)
<apeiros_> :foo.class # => Symbol
generalissimo has joined #ruby
<apeiros_> and String is in many regards which matter to a coder closer to a string than to an integer ;-)
<apeiros_> gah
<apeiros_> and *Symbol* is in many regards which matter to a coder closer to a string than to an integer ;-)
<bobinator60> apeiros_: ok, its just another kind of object that seems to be used instead of quoted string constants
* apeiros_ has seen too much sql today and hence is going slightly mad
dr_bob has left #ruby [#ruby]
maletor has quit [Quit: Computer has gone to sleep.]
<Spooner_> Yep. Used a lot for Hash (dict) keys among other things.
<_br_> apeiros_: which type of sql? oracle? pg?
j^2 has joined #ruby
<bobinator60> Spooner_: thanks
<apeiros_> _br_: oracle, with a bit of plsql
j^2 has quit [Client Quit]
strg has joined #ruby
<dmonjo> can anyone assist me in my first watir code: http://pastebin.com/iThwau9N
strg has left #ruby [#ruby]
<bobinator60> ruby-mode.el gives them a nice aqua color
<Spooner_> bobinator60, And while you are here, enjoy our wonderful case expression. I miss it so in Python ;(
ananthakumaran has quit [Ping timeout: 252 seconds]
<apeiros_> but with those queries, it wouldn't matter… it's just not my type of problem
mahmoudimus has joined #ruby
<dmonjo> forgot a '
<dmonjo> working fine
verysoftoiletppr has joined #ruby
<bobinator60> Spooner_: thanks, i will partake when it gets passed around
<dmonjo> Spooner_: you meant previously to run watir headless and to get the html code into a nokogiri?
<Spooner_> No, I've only used watir with a browser. I used mechanize when I didn't need Javascript running.
j^2 has joined #ruby
<dmonjo> Spooner_: how can you get a nokogiri from the watir browser?
tealmage has quit [Remote host closed the connection]
carlyle has joined #ruby
ph^ has quit [Remote host closed the connection]
atyz has joined #ruby
<Spooner_> The html doesn't go directly into nokogiri, which is what I said before. I think mechanize integrates with nokogiri, but you can create a nokogiri doc with watir using doc.html
shadowshell has joined #ruby
cableray has joined #ruby
_nitti has joined #ruby
<dmonjo> problem would be mechanize doesnt work with jscript and ajax
aganov has quit [Quit: aganov]
<Spooner_> Indeed.
Tricon has joined #ruby
<Spooner_> Nokogiri::HTML(doc.html) is easy enough to do.
v0n has joined #ruby
<Spooner_> Or rather, doc = Nokogiri::HTML(browser.html)
graft has quit [Quit: leaving]
LBRapid has quit [Quit: Computer has gone to sleep.]
<dmonjo> sorry for being a bit slow in that, you mean open watir webpage and trigger the jscript section then call nokogiri on that page (browser.html) ?
shadowshell has quit [Client Quit]
<Spooner_> Yeah, though you don't have to do anything yourself to get the javascript to run.
shadowshell has joined #ruby
endzyme has joined #ruby
hoelzro is now known as hoelzro|away
dannluciano has quit [Quit: dannluciano]
shadowshell has quit [Client Quit]
shadowshell has joined #ruby
shadowshell has quit [Client Quit]
<dmonjo> ok in watir i can get that browser.html returned, into ruby to manipulate with nokogiri?
a_a_g has quit [Quit: Leaving.]
shadowshell has joined #ruby
dblack_ has joined #ruby
<aedornm> hmmm.. why does OpenStruct initialize with hash=nil, instead of hash={} to remove the "if hash" check? And why does it use for k,v in hash instead of hash.each?
adamjleonar has joined #ruby
adamjleonard has quit [Read error: Connection reset by peer]
<_br_> apeiros_: well if its oracle I can totally understand ... better use some "eyebleach" ;)
gosshedd has quit [Ping timeout: 245 seconds]
asobrasil has joined #ruby
joast has joined #ruby
pyrac has quit [Ping timeout: 244 seconds]
carloslopes has quit [Remote host closed the connection]
<aedornm> I'm just looking at one of those not-very-Ruby-like Ruby standard lib examples, aren't I?
<Spooner_> It was probably written in 1964.
maletor has joined #ruby
the_mentat has joined #ruby
<aedornm> still trying to figure out what the purpose of comparing the method name to :[] is
cableray has quit [Read error: Connection reset by peer]
Matip has quit [Ping timeout: 240 seconds]
<Spooner_> Probably because it wants to not over-write that method, so you can still do ostruct[:bleh]
<Spooner_> As well as ostruct.bleh
<aedornm> You can't do ostruct[:anything] though
<aedornm> So it doesn't matter
<Spooner_> aedornm, It works for me.
dhruvasagar has quit [Ping timeout: 248 seconds]
ph^ has joined #ruby
<Spooner_> OpenStruct.new(frog:'head')[:frog] #=> "head"
<aedornm> OpenStruct.new(test: 'this')[:test] #=> NoMethodError: undefined method `[]' for #<OpenStruct test="this">
chussenot has quit [Quit: chussenot]
skattyadz has quit [Quit: skattyadz]
<Spooner_> I should say I'm on 2.0 ;)
<aedornm> Yeah, that adds [].
<apeiros_> _br_: eyebleach.com? :)
kraljev3 has joined #ruby
<Spooner_> Odd that it is thinking about [] then in older versions.
depassion has joined #ruby
tealmage has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
__BigO__ has joined #ruby
<Spooner_> Maybe it wants to be sure to say "undefined method []" not just return nil, which is what you'd get otherwise from any other method call on the OopenStruct.
monkegjinni has quit [Remote host closed the connection]
kristofers has quit [Read error: Connection reset by peer]
depassion has left #ruby [#ruby]
<apeiros_> aedornm: I always patched ostruct to what it is in 2.0
mahmoudimus has quit [Quit: Computer has gone to sleep.]
tealmage has quit [Remote host closed the connection]
depassion has joined #ruby
<aedornm> heh.. in 2.0 it's hash.each_pair, but still checks against hash. I guess they really don't want you to pass nil. 2.0 it doesn't check against :[], either.
<aedornm> apeiros_: I'm seeing why.
m3pow has joined #ruby
kristofers has joined #ruby
atyz has quit [Quit: Leaving...]
jpcamara has quit [Quit: jpcamara]
tealmage has joined #ruby
nomenkun has quit [Remote host closed the connection]
<aedornm> Well, no matter. For my purpose I just need to change a few instance methods, and it looks like it will still work in 2.0
halfdan- has left #ruby [#ruby]
vabenjamin has joined #ruby
<bobinator60> how close are ruby regular expressions to the ones in python?
<bobinator60> (i'm looking at you perl)
<Spooner_> Think they are the same. Big difference is that they are an actual object in Ruby.
<banisterfiend> literals*
<bobinator60> python has the 're' package, but I get the point
<Kovensky> too bad ruby has no magic s/// or y/// operator :(
<Spooner_> re.match("\d{3}", "999") compared to /\d{3}/.match("999") (or "999".match(/\d{3}/)
<dmonjo> b.text_field(:name => "q").set "Watir-WebDriver"
<dmonjo> b.button(:name => "btnG").click is not clicking
elico has joined #ruby
<_br_> apeiros_: hehe bingo
banisterfiend has quit [Remote host closed the connection]
sn0wb1rd has quit [Quit: sn0wb1rd]
<dmonjo> watir is always opening google in my local coutnry i want it to open www.google.com
green_leaf2 has quit [Quit: Leaving]
adamjleonard has joined #ruby
adamjleonar has quit [Read error: Connection reset by peer]
frem has joined #ruby
skattyadz has joined #ruby
JohnBat26 has quit [Read error: Operation timed out]
blacktul_ has quit [Remote host closed the connection]
Zolo has joined #ruby
reppard has joined #ruby
blacktulip has joined #ruby
dr_bob has joined #ruby
mephux has quit [Excess Flood]
jlast_ has joined #ruby
nga4 has quit [Ping timeout: 272 seconds]
mephux has joined #ruby
filipe has quit [Remote host closed the connection]
dankest has joined #ruby
<dmonjo> http://pastebin.com/7624Mhn8 not clicking still...
razibog has joined #ruby
xardas has joined #ruby
dankest has quit [Client Quit]
dblack_ has quit [Quit: dblack_]
<bobinator60> Spooner_: ruby has different quoting rules for regexes :(
<bobinator60> i mean for regex constructores /.../
otters has quit [Quit: WeeChat 0.4.0]
<Spooner_> bobinator60, Oh right, haven't done much with regexps in Python.
jlast has quit [Ping timeout: 264 seconds]
<aedornm> dmonjo: try btnK instead of btnG
<bobinator60> and ruby-mode.el is freaked out
otters has joined #ruby
Todd has quit [Read error: Connection reset by peer]
<Spooner_> bobinator60, You can use Regexp.new("bleh") or %r{bleh} if you prefer.
<dmonjo> Spooner_: works! can you please explain how did you guess that?!
Evixion` has quit [Ping timeout: 264 seconds]
<Spooner_> bobinator60, And Ruby has decent string interpolation.
<Spooner_> Guess what?
joeycarmello has quit [Read error: Connection reset by peer]
reppard has quit [Ping timeout: 240 seconds]
<dmonjo> it is btnG in the source code
<dmonjo> how code btnK works
joeycarmello has joined #ruby
lethjakman_lapto has joined #ruby
<Spooner_> If Google detects you scraping them, they change the html ;)
<lethjakman_lapto> I just learned about _why is there any other cool ruby history?
<lethjakman_lapto> I really like the community that this language supports.
<bobinator60> yeah, i'm gonna have to get the escaping right: warning: regular expression has ']' without escape
maletor has quit [Quit: Computer has gone to sleep.]
Al__ has quit [Ping timeout: 245 seconds]
<dmonjo> Spooner_: you mean they detected some kind of watir now so they made it K isntead of G
<dmonjo> lol
<Spooner_> Ah right, I thought you just meant for escaping \/
peteyg has joined #ruby
thams has joined #ruby
<aedornm> lol
<Spooner_> Dunno, but they changed it for me when I was writing my text browser ;) Had to leave off for a few days for it to go back.
<dmonjo> lol
Voodoofish430 has joined #ruby
alvaro_o has joined #ruby
mlr has joined #ruby
depassion has quit [Ping timeout: 255 seconds]
<Spooner_> dmonjo, https://github.com/Spooner/google-browse (don't use it too much or too fast or they'll ban you :D).
joeycarmello has quit [Ping timeout: 244 seconds]
ephemerian has left #ruby [#ruby]
<Spooner_> Should have put a random delay in it, but I couldn't be arsed by then.
<dmonjo> lol will check it tonight on my break
dr_bob has left #ruby [#ruby]
<Spooner_> That uses mechanize.
Umren has joined #ruby
malkomal_ has quit [Remote host closed the connection]
mattbl has quit [Quit: This computer has gone to sleep]
LBRapid has joined #ruby
colonolGron has joined #ruby
eldariof has joined #ruby
mockra has joined #ruby
sn0wb1rd has joined #ruby
mattbl has joined #ruby
alv-r- has joined #ruby
breakingthings has quit []
maletor has joined #ruby
dankest has joined #ruby
mafolz has quit [Quit: mafolz]
<dmonjo> almost there
banisterfiend has joined #ruby
Mon_Ouie has joined #ruby
Retistic has joined #ruby
<dmonjo> Spooner_: still not returning the javascript :/
Stilo has joined #ruby
predator117 has quit [Quit: leaving]
tjbiddle has joined #ruby
<Spooner_> Returning the javascript?
<dmonjo> Spooner_: i want to return from http://zigzag.github.com/2010/03/31/grep-in-ruby----a-powerful-enumerable-method.html the part that says "and 2 others liked this"
<Spooner_> .text isn't the html, it is the plain text (html stripped out). I said to use #html
sn0wb1rd has quit [Client Quit]
<dmonjo> ok!
breakingthings has joined #ruby
joeycarmello has joined #ruby
mpfundstein has quit [Remote host closed the connection]
tylersmith has joined #ruby
<dmonjo> b.html still same nothing returned
wallerdev has quit [Quit: wallerdev]
<Spooner_> You may possibly have to wait a bit for the comments section to fill up too. Try a sleep 1 before you get b.html
<dmonjo> hmm ok
chrishough has quit [Quit: chrishough]
<Spooner_> And puts @full_html just to see if it is what you expect (i.e. whether the html is wrong or the xpath is wrong).
Xeago has quit [Remote host closed the connection]
<dmonjo> workdss great :)
beliveyourdream has joined #ruby
<Spooner_> You should probably use: while @doc.xpath('//*[@id="dsq-global-toolbar"]/ul[2]/li[3]/ul/li[2]').nil?; sleep 0.1; end rather than waiting 1 (which might be too long or too short).
<dmonjo> ill try now with headles to see if i can get watir with a faster response
foxnewsnetwork has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
takeru has joined #ruby
_bart has left #ruby [#ruby]
etcetera has quit []
Zolo has quit [Remote host closed the connection]
Retistic has quit [Quit: Retistic]
<foxnewsnetwork> why does Array#zip return nil when you pass it a block? Is there some sort of zip_with method somewhere to get (for example) [1,2,3].zip([1,2,3]) { |a| a.first + a.last } to return [2,4,6] other than straight up doing [1,2,3].zip([1,2,3]).map { |a| a.first + a.last } ?
<aedornm> Spooner_: can just use .when_present
<Spooner_> foxnewsnetwork, Using map is the right way.
apeiros_ has quit [Remote host closed the connection]
znode has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.90-rdmsoft [XULRunner 18.0.2/20130201065344]]
dougireton has joined #ruby
<Spooner_> aedornm, Ah, that is good to know :$
carloslopes has joined #ruby
dblack_ has joined #ruby
skattyadz has quit [Quit: skattyadz]
<Spooner_> I'm such a nub, it seems!
mlr has quit [Quit: leaving]
<Hanmac> this may better: [1,2,3].to_enum(:zip,[1,2,3]).map { |a| a.first + a.last }
takeru has quit [Ping timeout: 252 seconds]
nachtwandler has joined #ruby
<dmonjo> the guru awakened :)
<foxnewsnetwork> Hanmac: can you please explain what's the point of doing #to_enum on an array?
<spider-mario> [1, 2, 3].zip([1, 2, 3]).map {|a, b| a + b}
<Hanmac> foxnewsnetwork: my to_enum prefends the zip method from returning an array, so map can use the enumerator directly
ckrailo has joined #ruby
undersc0re97 has quit [Quit: "The destruction of balance constitutes leaping forward and such destruction is better than balance. Imbalance and headache are good things." - Mao]
gosshedd has joined #ruby
znode has quit [Ping timeout: 255 seconds]
zeade has joined #ruby
<dblack_> require 'matrix'; (Vector[1,2,3] + Vector[1,2,3]).to_a :-)
<Spooner_> spider-mario, Or even [1, 2, 3].zip([1, 2, 3]).map :+ (though the enum solution would be more efficient for super-large arrays)
<Spooner_> spider-mario, Oops, you don't get automatic extraction of the array into a and b in #map, so ignore me.
fedza has quit [Read error: Connection reset by peer]
<Spooner_> spider-mario, Oops, you don't get automatic extraction of the array into a and b in #map, so ignore me entirely.
<dmonjo> what happens if you call to_enum(:non_iterator_method... ) (a method that doesnt iterate) null is reutrned or the same data?
rickmasta has joined #ruby
fedza has joined #ruby
<Spooner_> dmonjo, Tokyo has an Earthquake.
<aedornm> poor Tokyo
jlebrech has quit [Read error: Connection reset by peer]
ozgura has quit [Remote host closed the connection]
<Spooner_> Between that and Godzilla, they have a bad time.
undersc0re97 has joined #ruby
<Tricon> Spooner_: Heh.
<aedornm> We have designed in the US, and made in China... When do we get "programmed in X country" on the label?
jsilver has joined #ruby
pyrac has joined #ruby
nga4 has joined #ruby
<aedornm> Guess that's not limited to here. This Gigabyte board was "Designed in Taipei, made in China"
<Spooner_> People are the same. Conceived in X, born in Y ;)
<aedornm> Need an alien race to come in so we can have "Designed/Made by humans"
mlr has joined #ruby
kevinfagan has joined #ruby
cdt has quit [Ping timeout: 252 seconds]
<Hanmac> Spooner_ you mean like this: http://pics.nase-bohren.de/horse-shampoo.jpg :P
dpatel has joined #ruby
sk87 has quit [Quit: sk87]
frihd has quit [Quit: Leaving.]
<aedornm> rofl
dpatel has quit [Client Quit]
dpatel has joined #ruby
<Spooner_> It has horse tail in it. Is that like ox tail soup?
tealmage has quit [Remote host closed the connection]
_nitti has quit [Remote host closed the connection]
slainer68 has quit [Remote host closed the connection]
dblack_ has quit [Quit: dblack_]
<Spooner_> Should be the #ruby poster: http://pics.nase-bohren.de/code-doesnt-work.jpg
sebastorama has joined #ruby
wallerdev has joined #ruby
breakingthings has quit []
predator117 has joined #ruby
<JonnieCache> speak for yourself :P
<JonnieCache> i prefer this: http://xkcd.com/844/ (i have it on the wall by my desk at work)
jrendell has joined #ruby
mrsolo has joined #ruby
mlr has quit [Quit: leaving]
thone has joined #ruby
angusiguess has quit [Ping timeout: 255 seconds]
mlr has joined #ruby
tommyvyo has quit [Quit:]
silasdavis has quit [Quit: Leaving]
thone_ has quit [Ping timeout: 255 seconds]
psyprus has quit [Ping timeout: 248 seconds]
Skalax has joined #ruby
psyprus has joined #ruby
angusiguess has joined #ruby
<Skalax> enum = str.enum_for(:each_byte) <----- each_byte is a symbol here not a method name right? so enum_for will yield to each_byte block?
Vainoharhainen has quit [Quit: Leaving...]
jrendell has quit [Ping timeout: 248 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
mattbl has quit [Quit: This computer has gone to sleep]
adamjleonard has quit [Read error: Connection reset by peer]
adamjleonard has joined #ruby
mmitchell has quit [Remote host closed the connection]
<Hanmac> Skalax yeah, but each_byte also returns that if no block is given
averiso_ has quit [Quit: Quit.]
mmitchell has joined #ruby
m8 has joined #ruby
<aedornm> Nothing is more infuriating than having to use MS Office 365 for mail.
krawchyk_ has joined #ruby
<aedornm> I take that back. Having to use MS Office 365 for email as the back end and having to use old Unix "mail" as the front end would most certainly annoy me more.
jpcamara has joined #ruby
reset has joined #ruby
apeiros_ has joined #ruby
<Skalax> means, puts "Using enum",name.to_enum(:each_char).map {|x| x} puts "Using each_char",name.each_char.map {|x| x} are exactly the same not even minor difference :/
Xeago has joined #ruby
sn0wb1rd has joined #ruby
mmitchell has quit [Ping timeout: 248 seconds]
<apeiros_> why's that :/ ?
carraroj has quit [Ping timeout: 252 seconds]
jonahR has quit [Quit: jonahR]
carraroj has joined #ruby
Xeago has quit [Remote host closed the connection]
khismetix has joined #ruby
jonahR has joined #ruby
niklasb has joined #ruby
goodieboy has joined #ruby
krawchyk has quit [Ping timeout: 244 seconds]
goodieboy has quit [Remote host closed the connection]
mmitchell has joined #ruby
chichou has quit [Remote host closed the connection]
Xeago has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
yalue has joined #ruby
Skalax has quit [Quit: Page closed]
ozgura has joined #ruby
jpcamara has quit [Ping timeout: 272 seconds]
zeade has quit [Quit: Leaving.]
zeade has joined #ruby
mityaz has joined #ruby
forrest has joined #ruby
ahhhh has joined #ruby
<ahhhh> hey i'm new with ruby
kevinfagan has quit [Ping timeout: 245 seconds]
<ahhhh> i've installed rvm and sinatra
malkomalko has joined #ruby
<ahhhh> to get started
<ahhhh> now i receive an error
dblack_ has joined #ruby
<ahhhh> inside app folder i do
<ahhhh> ruby basics.rb
jlast_ has quit [Remote host closed the connection]
<ahhhh> and it says MacBook-di-Filippo:Sinatra ispuk$ ruby basic.rb
<ahhhh> ruby: No such file or directory -- basic.rb (LoadError)
<ahhhh> MacBook-di-Filippo:Sinatra ispuk$ ruby basics.rb
<ahhhh> /Users/ispuk/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- sinatra (LoadError)
<ahhhh> from /Users/ispuk/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
<ahhhh> from basics.rb:2:in `<main>'
<ahhhh> this tut
Elhu has quit [Quit: Computer has gone to sleep.]
newUser1234 has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
elaptics is now known as elaptics`away
<matti> ahhhh: require 'rubygems'?
<JonnieCache> matti: you shouldnt need that except in 1.8
<ahhhh> oh gosh old tutorial i htink )
dougireton has quit [Quit: Leaving.]
<matti> JonnieCache: Dunno, he pasted random error and not code ;p
<ahhhh> code is:
<matti> No.
<matti> No.
<ahhhh> require 'sinatra'
<ahhhh> get '/' do
<ahhhh> "Hello, World!"
<ahhhh> end
<matti> DONT PASTE
<JonnieCache> lol
<ahhhh> sorry
<ahhhh> :D
<matti> Use pastebin.com
<matti> Crazy U
<matti> ;d
<ahhhh> ok sorry
<matti> ;]
<ahhhh> :P
<ahhhh> so now how to browse that page? )
malkomal_ has joined #ruby
<Morrolan> Copy-pasting it into your browser's URL bar would be a start. :D
whowantstolivef1 has joined #ruby
<ahhhh> i tryed on http://localhost:4567/ but nothing comes up :D blank page
<Hanmac> ahhhh it cant find sinatra ... where is your gem file pointing? what does "gem env" shows you? is the sinatra listed in "gem list"
twoism has joined #ruby
BizarreCake has quit [Ping timeout: 248 seconds]
carraroj has quit [Ping timeout: 248 seconds]
<ahhhh> Hanmac: please 1 thing at time… what do now?
pettsson has joined #ruby
<ahhhh> gem env?
bradleyprice has joined #ruby
<Morrolan> A console command, ahhhh. :)
malkoma__ has joined #ruby
malkomal_ has quit [Read error: Connection reset by peer]
shock_one has joined #ruby
Zolo has joined #ruby
<ahhhh> and the gem list http://pastebin.com/57Dp8Ebj
malkoma__ has quit [Read error: Connection reset by peer]
otters has quit [Quit: WeeChat 0.4.0]
<interactionjaxsn> no sinatra in the gem list?
philcrissman has quit [Remote host closed the connection]
<Hanmac> ahhhh as you can see, sinatra is missing in gem list
malkomal_ has joined #ruby
<ahhhh> nope )
llaskin has joined #ruby
<ahhhh> so now install that !?
<ahhhh> gem install sinatra ?
<llaskin> in test unit, is there a way to set an action to perform on failiure?
otters has joined #ruby
workmad3 has quit [Ping timeout: 276 seconds]
timmow has quit [Remote host closed the connection]
<llaskin> so for example if a test fails, I want it to output something to the screen(or in my case take a screenshot)....is there some setting I can set?
benmatthew_ has joined #ruby
<interactionjaxsn> ahhhh: gem install sinatra
malkomalko has quit [Ping timeout: 248 seconds]
fschuindt has joined #ruby
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
<ahhhh> :/
tjbiddle has quit [Quit: tjbiddle]
io_syl has joined #ruby
<interactionjaxsn> gem install openssl?
Honeycomb has joined #ruby
otters has quit [Client Quit]
otters has joined #ruby
rickmasta has quit [Quit: Leaving...]
Honeycomb has quit [Client Quit]
<ahhhh> ERROR: Loading command: install (LoadError)
<ahhhh> cannot load such file -- openssl
<ahhhh> :/
<aedornm> Hmmm.. Ruby is not timing out a socket connection
<ahhhh> so my mac decided i can't install nothing today!?
<benmatthew_> Hey all, I was wondering if anyone could answer this question. Is there a way to pass a singular string/object through to do a block. I want to test a object.each statement with a single variable by just replacing the first line.
jlast has joined #ruby
dmonjo has quit [Quit: Leaving]
<Tricon> benmatthew_: And object doesn't implement :each?
<ahhhh> interactionjaxsn: why does i receive these errors? :/
<otters> okay, this is weird
f0ster has joined #ruby
<Tricon> ahhhh: What is the output of `ruby -v`?
newUser1234 has joined #ruby
<ahhhh> ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]
mneorr has joined #ruby
<Tricon> ahhhh: Did you install that with RVM/rbenv?
mattbl has joined #ruby
<benmatthew_> Tricon: That's correct, like a String.
banjara has joined #ruby
dblack_ has quit [Quit: dblack_]
<banisterfiend> benmatthew_: i dont know what u're asking, can u show some code
<ahhhh> lol
carlyle_ has joined #ruby
<Tricon> benmatthew_: You could do: [object].each do |my_object|
jarjar_prime has quit [Quit: Sleep time.]
<Tricon> benmatthew_: Put it into an array.
<interactionjaxsn> ahhhh: openssl version
hiall has quit [Quit: hiall]
<ahhhh> interactionjaxsn: i got this ERROR: While executing gem ... (NoMethodError)
<ahhhh> undefined method `invoke_with_build_args' for nil:NilClass
browndawg has quit [Quit: Leaving.]
Al__ has joined #ruby
<ahhhh> can someone tells me how to easly re-install ruby, rvm and sinatra
<ahhhh> so i'll be sure everythings ok !?
<apeiros_> rvm implode
<Tricon> Is Sinatra confirmed to work on R2?
<benmatthew_> Tricon: Ah yeah, I guess you could put it into an array. Was wondering if there was an elegant way.
<apeiros_> then reinstall following http://rvm.io
<Tricon> benmatthew_: I'd go with simplicity, which putting it into an array is.
mneorr has quit [Remote host closed the connection]
<ahhhh> dude to re-install this:
<benmatthew_> Tricon: Thanks, I'll start doing that from now on :)
<ahhhh> curl -L https://get.rvm.io | bash -s stable --ruby
<ahhhh> it's enought?
<Tricon> ahhhh: For RVM, ys.
<Tricon> *yes
weehuy has joined #ruby
jsilver has quit [Remote host closed the connection]
BizarreCake has joined #ruby
davetherat has quit [Remote host closed the connection]
carlyle has quit [Ping timeout: 245 seconds]
davetherat has joined #ruby
<ahhhh> do i need to specify or to move to a specific dir?
<ahhhh> or it will install that anyway under Users/ ?
dpatel has quit [Quit: dpatel]
<Tricon> ahhhh: It installs to $HOME.
<ahhhh> oh ok seems the second so it's Clever ) i like it right now )
maletor has quit [Quit: Computer has gone to sleep.]
hackeron has joined #ruby
mando_ has quit [Read error: Connection reset by peer]
dougireton has joined #ruby
<ahhhh> is my ruby version ok!?
rdark has quit [Quit: leaving]
<ahhhh> ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
baroquebobcat has quit [Quit: baroquebobcat]
mando_ has joined #ruby
<Tricon> ahhhh: That's system ruby.
<Tricon> ahhhh: You'll need to install another Ruby once RVM is installed.
<ahhhh> oh ok
<ahhhh> please follow me so i can set everythings right to start with sinatra :P
<ahhhh> it is taking little bit to reinstalling rvm
<ahhhh> normal i think …
jmaya has joined #ruby
squidBits has joined #ruby
<ahhhh> do you think i should start with RoR or Sinatra?
[rupee] has joined #ruby
tjbiddle has joined #ruby
<ahhhh> my friend uses sinatra and he feels good on it so i think i can learn that better but ….
<jmaya> ahhhh: it depends what you want to do.
<ahhhh> dunno at all
<ahhhh> jmaya: framework should leave me no limits
dhruvasagar has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
<interactionjaxsn> ahhhh: a working dev env first...
decoponio has quit [Quit: Leaving...]
otters has quit [Quit: WeeChat 0.4.0]
otters has joined #ruby
<ahhhh> interactionjaxsn: oh sure dad )
<interactionjaxsn> ahhhh: ;)
Al__ has quit [Quit: Al__]
<ahhhh> #compiling )
a_a_g has joined #ruby
Es0teric has joined #ruby
kofno has quit [Remote host closed the connection]
angusiguess has quit [Ping timeout: 276 seconds]
<ahhhh> :o i got an error http://pastebin.com/x8Bf3GZT :(
ddv has quit [Changing host]
ddv has joined #ruby
gaahrdner has joined #ruby
Slivka has joined #ruby
<interactionjaxsn> ahhhh: please read /Users/ispuk/.rvm/log/ruby-2.0.0-p0/rubygems.install.log
kofno has joined #ruby
c0rn has joined #ruby
<ahhhh> i have lot of errors as i can see
ephemerian has joined #ruby
<ahhhh> require still not working !?
gyre007 has quit [Remote host closed the connection]
poikon has quit [Remote host closed the connection]
jsilver has joined #ruby
yacks has quit [Remote host closed the connection]
<interactionjaxsn> ahhhh: which ruby
gyre007 has joined #ruby
khismetix has quit [Quit: Computer has gone to sleep.]
whitedawg1 has quit [Ping timeout: 248 seconds]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
tjbiddle_ has joined #ruby
pyrac has quit [Quit: pyrac]
angusiguess has joined #ruby
<interactionjaxsn> ahhhh: rvm --version
Mattix has joined #ruby
hbpoison has quit [Ping timeout: 264 seconds]
otherj has joined #ruby
otters has quit [Quit: bye]
otters has joined #ruby
jpcamara has joined #ruby
the_mentat has quit [Quit: Computer has gone to sleep.]
dankest has quit [Quit: Leaving...]
jrendell has joined #ruby
predator117 has quit [Ping timeout: 255 seconds]
tjbiddle has quit [Ping timeout: 252 seconds]
tjbiddle_ is now known as tjbiddle
dougireton has quit [Quit: Leaving.]
bricker has joined #ruby
ryanf has quit [Quit: leaving]
br4ndon has joined #ruby
khismetix has joined #ruby
<interactionjaxsn> ahhhh: real monsters
sayan has quit [Ping timeout: 272 seconds]
weehuy has left #ruby [#ruby]
<ahhhh> rvm 1.18.14 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
otherj has quit []
chrishough has joined #ruby
<ahhhh> :D
<ahhhh> and now ? (
<interactionjaxsn> ahhhh: which ruby
<otters> in what situation would two environments have the same $LOAD_PATH but one be unable to load an installed gem
samphippen has quit [Quit: Computer has gone to sleep.]
asterite has joined #ruby
<ahhhh> interactionjaxsn: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]
duosrx has quit [Remote host closed the connection]
arturaz has quit [Remote host closed the connection]
llaskin has left #ruby [#ruby]
unix has joined #ruby
arturaz has joined #ruby
Bosox20051 has joined #ruby
<ahhhh> interactionjaxsn: actually dunno what to do :(
<interactionjaxsn> ahhhh: try install ruby 1.9 with rvm and see if it barfs
the_jeebster has joined #ruby
zoned has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
jmaya has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<ahhhh> step by step?
dougireton has joined #ruby
_nitti has joined #ruby
<zoned> how can i add an attribute to an object? i just need it for a very short time, i don't want it to be part of the objects class, or persist in the database in any way
io_syl has quit [Ping timeout: 252 seconds]
tenmilestereo has joined #ruby
bigkevmcd has quit [Quit: Ex-Chat]
<ahhhh> interaction and how to re-install ruby now ? :O
thams has quit [Quit: thams]
carraroj has joined #ruby
Deltaoo has quit [Ping timeout: 272 seconds]
pyrac has joined #ruby
jsilver has quit [Remote host closed the connection]
imami|afk is now known as banseljaj
maletor has joined #ruby
bigkevmcd has joined #ruby
io_syl has joined #ruby
<ahhhh> sudo apt-get install ruby18 ruby18-dev ?
vlad_starkov has joined #ruby
<ahhhh> 19 maybe?
<shevy> eeks
otherj has joined #ruby
<shevy> you try to install debian ruby with apt-get
wrapids has joined #ruby
<ahhhh> i'm on macosx
<shevy> you use apt-get on mac?
<ahhhh> never used
<aedornm> shevy: I think you have some secret sense when someone mentions installing Ruby via apt-get...
<shevy> aedornm hey, perhaps he is lucky and it works :D
<ahhhh> pls help dudes
<shevy> zoned you cant from the outside, unless you added a method to it beforehand
<ahhhh> i'm in trouble
<shevy> ahhhh hey you use mac man
<ahhhh> and ? :D
<shevy> dont the mac users have some supercool way to install things?
Nitrodist has joined #ruby
<ahhhh> maybe they have but i'm newbie on mac too :D
whitedawg has joined #ruby
<ahhhh> so help me pls :D
<aedornm> I don't know macs, sorry. When I win the lottery maybe I will buy one!
<Nitrodist> anyone having issues with rubygems.org? getting an OpenSSL::SSL::SSLError
<shevy> I have no idea how mac people install anything
<zoned> after searching and trying to do this for about 45 minutes, i finally found something that worked. why was it so easy yet so hard to find?? @object[:new_var] = "value" works perfectly
<wrapids> Does anyone see a reason that I would be getting a MySQL 1064 syntax error near '' with this? https://gist.github.com/anonymous/1962238995d915baf04f . I've printed the query statement (line 29, being run at 30), and it's perfectly valid, and returns the correct results in mysql.
sebastorama has quit [Quit: Computer has gone to sleep.]
<ahhhh> rvm
<ahhhh> !?
<shevy> ahhhh I tell you what I do as linux guy: ftp://ftp.ruby-lang.org/pub/ruby/ and download a version, then compile it
philcrissman has joined #ruby
<shevy> I dont use rvm
a_a_g1 has joined #ruby
brianpWins has joined #ruby
<shevy> but you use a mac, so possibly compiling is not easy
<shevy> on linux every 3 year old can do so
<shevy> except debian users
<ahhhh> where is inter my friend
_nitti has quit [Remote host closed the connection]
DrCode_ has joined #ruby
_nitti has joined #ruby
<shevy> zoned yes, internally, but not externally
mengu__ has quit [Quit: Konversation terminated!]
TheFuzzball has quit [Quit: Leaving...]
<shevy> zoned in your example @object is a hash, an instance variable, which you define within your class
thams has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
bobinator60 has quit [Quit: Page closed]
a_a_g has quit [Read error: Operation timed out]
predator117 has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
interactionjaxsn has joined #ruby
main has joined #ruby
<ahhhh> so no one uses a mac here ? :(
<ahhhh> i need to reinstall all the ruby env
<ahhhh> ruby,rvm,homebrew, sinatra
DrCode has quit [Ping timeout: 276 seconds]
DrCode_ is now known as DrCode
i_s has joined #ruby
ahhhh has left #ruby [#ruby]
banisterfiend has quit [Ping timeout: 240 seconds]
<interactionjaxsn> ahhhh: i'm on a mac
<wrapids> This one's a bit more in scope for the particular problem http://bit.ly/XAbw4B
banisterfiend has joined #ruby
<Xeago> banisterfiend: you are dutch right?
breakingthings has joined #ruby
<banisterfiend> Xeago: no, i just live in this land of the blonde
<Xeago> of the blonde ;O
vlad_starkov has joined #ruby
<banisterfiend> Xeago: what does "riblappen" mean?
<Xeago> I'd rather search blondines in scandinavia
<Xeago> braising beef
dankest has joined #ruby
<Xeago> on bone
hbpoison has joined #ruby
khismetix has quit [Quit: Computer has gone to sleep.]
<banisterfiend> Xeago: so what's the name for normal frying steak?
<banisterfiend> i cna't seem to find any of that
<wrapids> At line 5 on that gist I'm getting a mysql syntax error, but the query I'm running (pasted into the comments) runs perfectly in the terminal.
<Xeago> biefstuk
<Xeago> bief
sw99 has joined #ruby
<banisterfiend> Xeago: do you think we should force all dutch to speak english all the time
<Xeago> totall
<Xeago> y
<Xeago> banisterfiend: so where do you come from, where do you live, and why do you call it the land of the blonde?
BizarreCake has quit [Ping timeout: 264 seconds]
<otters> does rubygems have its own version of require?
<Xeago> otters: yes, you should use a newer version of ruby tho
<sw99> Can I install Ruby in a custom location like this? Download the source, do ./configure --prefix=/Users/sw99/Desktop/foo and then make and make install ?
dannluciano has joined #ruby
<banisterfiend> Xeago: 1. new zealand 2. leiden 3. because there's lots of blondes here
<otters> Xeago: I'm using 1.9.1
Umren has quit [Read error: Connection reset by peer]
<otters> but having load problems with Weechat
<sw99> I wanna install Ruby 1.9 in a custom location. My current OS X has version 1.8 by default
<banisterfiend> otters: yuck
<otters> banisterfiend: have to
<banisterfiend> otters: 1.9.1 is the weirdest ruby ever
<otters> yeah
<Xeago> otters: it shouldn't be necessary to require rubygems (so it redefines require)
<otters> I'm just trying to figure out how to get require to work
<banisterfiend> otters: how come u have to? who ever is making you use that buggy, messed up ruby should be shot
whitedawg has quit [Ping timeout: 252 seconds]
<otters> $LOAD_PATH are the same in irb and weechat, but require 'ruby_gntp' works in irb but not in weechat
<otters> and I want to know why
<Xeago> banisterfiend: I'd like some proof of the quantity of that
duosrx has joined #ruby
<interactionjaxsn> sw99: rvm
<banisterfiend> otters: even instance_eval is broken in 1.9.1
<Xeago> with decent quality aswell..
<otters> so help me work around it
the_jeebster has quit [Remote host closed the connection]
<otters> can I manually set up gem load paths?
otherj has quit []
<Xeago> otters: si the gem apath set up correctly?
<banisterfiend> otters: it's like someone using a knife to hammer in nails and asking for help
ahhhh has joined #ruby
<otters> Xeago: no idea
<ahhhh> i got The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
<Xeago> try requiring the full path from
<ahhhh> with rvm install ruby-1.9.2-p320
razibog has quit [Ping timeout: 252 seconds]
<otters> from???
<Xeago> ahhhh: I recommend ruby_build gem to build ruby
schaerli has joined #ruby
<otters> banisterfiend: it's like someone using a bad hammer to hammer in nails
tjbiddle_ has joined #ruby
<ahhhh> Xeago: what i need to do? ruby_build gem ?
<ahhhh> in terminal?
samphippen has joined #ruby
<Xeago> sorry it is ruby-build: https://github.com/sstephenson/ruby-build
<banisterfiend> otters: given the brokenness of 1.9.1, it's really more like a knife :) srsly, any library using instance_eval will mostly just not work. Anyway..goodluck! :)
<otters> banisterfiend: it's not using instance_eval
<banisterfiend> otters: no, but any gem you use that uses it (which is quite a lot) will just not work, so you've cut the number of available gems you can use down quite a lot
* Xeago is still waiting for quantity with at least average quality, banister!
<banisterfiend> Xeago: im just talking from experience
wrapids has left #ruby [#ruby]
<banisterfiend> i've been to many other countries, and holland has the most blondes per capita i've encountered
<Xeago> never been to scandinavia then :)
ahhhh has left #ruby [#ruby]
maxmanders has joined #ruby
<banisterfiend> Xeago: well i have, but i was too young to pay atetntion to those things :)
mattbl has joined #ruby
tjbiddle has quit [Ping timeout: 272 seconds]
tjbiddle_ is now known as tjbiddle
Todd has joined #ruby
<Amnesia> question, how could I filter "12345" in "last full capacity: 12345 mwh" using scanf?
tenmilestereo[aw has joined #ruby
tenmilestereo[aw has quit [Read error: Connection reset by peer]
<Amnesia> .scanf("last full capacity: %s\n"))
<Amnesia> ^ no success
tenmilestereo[aw has joined #ruby
kevinfagan has joined #ruby
<otters> oh, oky
<otters> and now the Gem internals say that there are no rubygems installed at all
<otters> this is bullshit
twoism has quit [Ping timeout: 264 seconds]
the_mentat has joined #ruby
<Spooner_> Amnesia, Don't use scanf. "last full capacity: 12345 mwh"[/\d+/]
ForSpareParts has joined #ruby
<Amnesia> Spooner_: well it
sw99 has quit [Quit: sw99]
<Amnesia> 's a file I'm reading
<banisterfiend> otters: just curious, why are oyu stuck on 1.9.1 ?
etcetera has joined #ruby
<otters> one sec
<ForSpareParts> Does anybody know the "right way" to set precision in SASS when I'm using it through the sass-rails gem?
<Spooner_> Amnesia, That matters because?
fermion has quit [Quit: Textual IRC Client: www.textualapp.com]
<Spooner_> Or you mean you have the full file and want to find it in there, not just on a line?
<Amnesia> well I want to get multiple values out of it
<Xeago> String#[] doesn't alter the string as far as I know
elico has quit [Ping timeout: 248 seconds]
arietis has joined #ruby
tenmilestereo has quit [Ping timeout: 264 seconds]
mercwithamouth has joined #ruby
twoism has joined #ruby
<otters> banisterfiend: because debian
<Spooner_> Xeago, I know, but I was assuming people might think to do num = str[//]
maxmanders has quit [Ping timeout: 248 seconds]
<banisterfiend> otters: well i know for a fact that ubuntu just *calls* it 1.9.1 but it's actuall 1.9.2+
<banisterfiend> otters: so are you actually sure it's 1.9.1? what does RUBY_VERSION say?
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
nomenkun has joined #ruby
senayar has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
dannluciano has left #ruby [#ruby]
<otters> hang on
<banisterfiend> otters: ruby -v :)
samphippen has quit [Quit: Computer has gone to sleep.]
maxmanders has joined #ruby
newUser1234 has quit [Remote host closed the connection]
br4ndon has joined #ruby
shiningblue has joined #ruby
br4ndon has quit [Client Quit]
newUser1234 has joined #ruby
twoism has quit [Remote host closed the connection]
<Amnesia> Spooner_: would you know a better way?
Stilo has joined #ruby
wtee has joined #ruby
enroxorz-work is now known as enroxorz-away
skattyadz has joined #ruby
<Spooner_> "last full capacity: 12345 mwh"[/(?<=last full capacity:\s)(\d+)/]=> "12345" And use f.gets ???
malcolmva has quit [Read error: Connection reset by peer]
twoism has joined #ruby
<otters> is there a rubygems API
[OES] has joined #ruby
_nitti_ has joined #ruby
<Xeago> !
<banisterfiend> otters: of course
<Spooner_> Amnesia, I never use scanf, to tell the truth.
<[OES]> Evening folks
<banisterfiend> otters: under the 'Gem' namespace, believe or not ;)
malcolmva has joined #ruby
<[OES]> And Xeago :-)
runixo has joined #ruby
<Amnesia> Spooner_: ty, I'll give f.gets a shot
<Xeago> apeiros_: got some spare time perhaps?
eldariof has quit []
daig0ro has joined #ruby
takeru has joined #ruby
wtee has quit [Client Quit]
<Spooner_> Amnesia, Is it failing, however, because you didn't include "mwh" in your scanf pattern before the newline?
<runixo> heyas. we're chasing a "memory leak", we know the object_id of the 'leaked' string, but we don't know how to find the object referencing it. any hints?
<Amnesia> hm could be
drale2k has quit [Quit: Leaving...]
<otters> banisterfiend: can it install gems
ebobby has joined #ruby
<banisterfiend> otters: yeah
<Xeago> runixo: sounds like a banisterfiend challenge
skattyadz has quit [Client Quit]
piotr_ has joined #ruby
<otters> okay, the only thing that looks like it could do that is Gem::Installer which is not in scope
interactionjaxsn has quit [Remote host closed the connection]
s3m73x has quit [Remote host closed the connection]
<runixo> Xeago: um. I've no idea what are you talking about :)
timonv has quit [Remote host closed the connection]
_nitti has quit [Ping timeout: 248 seconds]
mephux has quit [Excess Flood]
<Xeago> banisterfiend has quite the knowledge about bindings, he might nkow some tricks to get the binding the object is still 'used' in
<runixo> Xeago: ah. ok. he's a person. great :)
skattyadz has joined #ruby
<Spooner_> runixo, If you think it is in an instance variable, you could use: https://gist.github.com/Spooner/5034125
* Hanmac knows about C-Bindings
tommyvyo has joined #ruby
<[OES]> Can anyone see why bundler is not working. Getting error running bundle https://gist.github.com/weblee/5041329
khismetix has joined #ruby
mephux has joined #ruby
sebastorama has joined #ruby
sebastorama has quit [Max SendQ exceeded]
takeru has quit [Ping timeout: 252 seconds]
Neomex has joined #ruby
<runixo> Spooner_: yep, I did something similar for instance variables, class variables, array values, hashes keys and values, MatchData#string
Neomex has quit [Client Quit]
malkomal_ has quit [Remote host closed the connection]
zigomir has joined #ruby
zigomir has quit [Client Quit]
sebastorama has joined #ruby
Neomex has joined #ruby
<Spooner_> Sounds like you covered most things already.
<banisterfiend> runixo: you can do it for procs too
<runixo> banisterfiend: tnx, will check that
<banisterfiend> runixo: OS.each_object(Proc) { |v| locals = v.binding.eval("local_variables"); locals.each { |l| v.binding.eval(l.to_s).object_id == the_id_you_look_for }
DrShoggoth has quit [Quit: Leaving]
<banisterfiend> in case a closure is keeping it alive
<runixo> banisterfiend: letme see
<banisterfiend> you'll need to fix that code, i just typed it out, likely needs adjusting
workmad3 has joined #ruby
chrishough has quit [Ping timeout: 256 seconds]
hackeron_ has joined #ruby
seoaqua has quit [Ping timeout: 255 seconds]
kuzushi has joined #ruby
dblack_ has joined #ruby
chrishough has joined #ruby
chrishough has quit [Client Quit]
_nitti_ is now known as _nitti
chrishough has joined #ruby
<runixo> banisterfiend: um. I got "can't create binding from C level Proc"... those are 100% opaque to me or, not?
hackeron has quit [Ping timeout: 264 seconds]
<banisterfiend> runixo: then just skip them by checking for source_location == nil
<runixo> tnx.
<Xeago> banisterfiend: knows his tricks!
skattyadz has quit [Quit: skattyadz]
verysoft_ has joined #ruby
verysoftoiletppr has quit [Read error: Connection reset by peer]
breakingthings has quit []
<aedornm> damn, I have to start parsing command line opts
drale2k has joined #ruby
kirun has joined #ruby
bluOxigen has joined #ruby
maxmanders has quit [Ping timeout: 248 seconds]
pyrac has quit [Quit: pyrac]
<runixo> banisterfiend: dammit. it's not there. also tried Mass ( https://github.com/archan937/ruby-mass ) which can't find references..
undersc0re97 has quit [Quit: "The destruction of balance constitutes leaping forward and such destruction is better than balance. Imbalance and headache are good things." - Mao]
<banisterfiend> runixo: do you recognize the string? what's in it?
undersc0re97 has joined #ruby
<aedornm> anyone try Trollop on 2.0?
<runixo> banisterfiend: I recognize it 100%, I know where it came from, and I tried to trace, manually where it could leak. but no luck... (in the meanwhile I found a weird leak on String#gsub("foo"))
whowantstolivef1 has quit [Ping timeout: 260 seconds]
ryanf has joined #ruby
shevy has quit [Ping timeout: 264 seconds]
reset has quit [Ping timeout: 276 seconds]
maxmanders has joined #ruby
<banisterfiend> runixo: is it being modified at all?
<banisterfiend> runixo: or does it remain the same?
jsaak has quit [Ping timeout: 255 seconds]
Virunga has quit [Remote host closed the connection]
samir has joined #ruby
Nitrodist has left #ruby [#ruby]
maletor has quit [Quit: Computer has gone to sleep.]
<runixo> banisterfiend: seems to be the original string, unchanged
malomalo has joined #ruby
<banisterfiend> runixo: at what point do you expect the string to be GC'd ? can't you step through with a debugger up until the point it's supposed to have all references to it lost
<banisterfiend> also
<banisterfiend> keep an eye out for any procs that might close over it
<banisterfiend> as they're often the culprit in things like this
<banisterfiend> and check the lifetime of those procs
asterite has left #ruby [#ruby]
pyrac has joined #ruby
arturaz has quit [Ping timeout: 272 seconds]
wtee has joined #ruby
<runixo> banisterfiend: ok, letme check this
verysoft_ has quit []
Bosox20051 has quit [Remote host closed the connection]
adkron_ has joined #ruby
frem has quit [Ping timeout: 264 seconds]
jpcamara has quit [Quit: jpcamara]
thams has quit [Quit: thams]
rippa has quit [Ping timeout: 240 seconds]
jpcamara has joined #ruby
Virunga has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
breakingthings has joined #ruby
adkron_ has quit [Ping timeout: 240 seconds]
sebastorama has quit [Quit: Computer has gone to sleep.]
ninp0 has quit [Ping timeout: 248 seconds]
shevy has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
jpcamara has quit [Ping timeout: 248 seconds]
krawchyk_ has quit [Remote host closed the connection]
mpfundstein has joined #ruby
Virunga has quit [Ping timeout: 252 seconds]
elaptics`away is now known as elaptics
krawchyk has joined #ruby
krawchyk has quit [Remote host closed the connection]
<Xeago> counterstrike 1.6 on osx runs great!
Mattix has quit [Quit: Leaving]
shiningblue1 has joined #ruby
whitedawg has joined #ruby
shiningblue1 has quit [Read error: Connection reset by peer]
shiningblue has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
daniel_- has joined #ruby
shiningblue has joined #ruby
Choobie has quit [Ping timeout: 244 seconds]
enroxorz-away is now known as enroxorz-work
Udom0 has left #ruby [#ruby]
statarb3 has quit [Ping timeout: 260 seconds]
hackeron_ has quit [Ping timeout: 264 seconds]
akashj87 has quit [Ping timeout: 264 seconds]
skattyadz has joined #ruby
<shock_one> Xeago, windows must die!
<Xeago> hellyea!
ninp0 has joined #ruby
<sam113101> guys
daig0ro has quit [Quit: Textual IRC Client: www.textualapp.com]
s3m73x has joined #ruby
samphippen has joined #ruby
<shock_one> sam?
<sam113101> how do I puts the result of something.inject, directly?
davetherat has quit [Remote host closed the connection]
monkegjinni has joined #ruby
davetherat has joined #ruby
<shock_one> directly in what?
<bean__> >> puts [1,2,3,4].inject
<bean__> ?
<eval-in> bean__: Output: "/tmp/execpad-6d7f179d73e8/source-6d7f179d73e8:1:in `each': no block given (LocalJumpError)\n\tfrom /tmp/execpad-6d7f179d73e8/source-6d7f179d73e8:1:in `inject'\n\tfrom /tmp/execpad-6d7f179d73e8/source-6d7f179d73e8:1:in `<main>'\n" (http://eval.in/11206)
[diecast] has joined #ruby
<bean__> oh
<bean__> i have not had enough coffee today
<sam113101> shock_one: http://pastebin.com/WvxNJx8i
huoxito has quit [Ping timeout: 248 seconds]
<sam113101> I don't want to use the test variable
<bean__> >> [1,2,3,4].inject {|x| puts x}
<eval-in> bean__: Output: "1\n\n\n" (http://eval.in/11207)
<shock_one> bean__, inject is a ruby way to say reduce
<bean__> yeah
<bean__> i know
<bean__> I haven't had enough cofee
<apeiros_> Xeago: time theoretically yes, but practically I've fallen asleep twice this evening already :(
<sam113101> I tried putting it inside parentheses
<sam113101> doesn't work
<shock_one> puts (blocks)
mattbl has joined #ruby
<sam113101> didn't work though
DDark has joined #ruby
shiningblue has quit [Read error: Connection reset by peer]
<Xeago> apeiros_: ok, monobattles?
<shock_one> sam113101, doesn't it work? https://gist.github.com/shockone/5041680
<Xeago> or raynors party?
<Xeago> that one is awesome
a_a_g1 is now known as a_ag
a_ag is now known as a_a_g
<apeiros_> Xeago: probably just more sleeping
whitedawg1 has joined #ruby
<Xeago> also apeiros_: https://github.com/Xeago/ird remote control for Preview.app
<DDark> Hey All, I have a string like "book-club,math,science:element=uranium" I have a regex like >(/(\w+)*|-:?(.*)/)< which worked great until the string contained book-club. The hyphen throws it off, and ive been testing with rublar, but I cannot seem to match it properly.
arturaz has joined #ruby
<Xeago> fugly system("call"); tho
dmerrick has joined #ruby
<sam113101> no it doesn't
<sam113101> problem22.rb:4: syntax error, unexpected keyword_do_block, expecting ')'
hackeron has joined #ruby
<apeiros_> Xeago: cool
<DDark> correction
<DDark> the working regex is >/(\w+):?(.*)/)<
enroxorz-work is now known as enroxorz-cryingw
<Amnesia> question, would there be something prettier as: 'MemTotal: 234334 kB'[/\d+/] if 'MemTotal: 234334 kB'.match(/^(MemTotal:|MemFree:|Buffers:|Cached)/) ?
_nitti_ has joined #ruby
<DDark> Im trying to match the book-club also, but its matching book and club as two separate words, and I need to match the entire thing
shiningblue has joined #ruby
whitedawg has quit [Ping timeout: 248 seconds]
ForSpareParts has quit [Quit: ForSpareParts]
<Xeago> DDark: also http://www.debuggex.com
<apeiros_> reading the questions here, I think I indeed better keep sleeping
_nitti has quit [Ping timeout: 276 seconds]
<sam113101> shock_one why do I get this?
<DDark> oh cool. Thank Xeago. Ill see if I can get this nailed out.
<Xeago> I find debuggex quite nice, the graph does wonders
<Xeago> (and sliders!)
piotr_ has quit [Read error: Connection reset by peer]
<shock_one> sam113101, I'm not sure, but I think you can't write blocks inside of brackets
<sam113101> ;_;
dougireton has quit [Quit: Leaving.]
i_s has quit [Quit: i_s]
<shock_one> sam113101, you can factor this code out to a function
<Amnesia> apeiros_: know how to do that with one function:)?
<apeiros_> Xeago: wow, debuggex looks nice
ForSpareParts has joined #ruby
<shock_one> sam113101, actually, I think your code is too functional. I would do each_with_index and inside it add score to some outer variable, like sum.
<apeiros_> Amnesia: hint, String#[] returns nil if it doesn't match
toekutr has joined #ruby
jsaak has joined #ruby
<shock_one> sam113101, this way you wouldn't need inject at all.
<shock_one> sam113101, makes sense?
<Amnesia> apeiros_: yeah but it has to be preceded by (MemTotal:|MemFree:|Buffers:|Cached)
<sam113101> yes, but it wouldn't fix my problem
hadees has joined #ruby
etcetera has quit [Ping timeout: 252 seconds]
jpcamara has joined #ruby
enroxorz-cryingw is now known as enroxorz
<sam113101> wait
<shock_one> sam113101, why printing on the separate line is a problem?
skattyadz has quit [Quit: skattyadz]
rickmasta has joined #ruby
<sam113101> shock_one: actually, you don't need both sum and score
<shock_one> sam113101, right
maletor has joined #ruby
Myconix has quit [Read error: Connection reset by peer]
<sam113101> yeah it works, but I'd still like to know how to chain them like I wanted to
unix has quit [Quit: WeeChat 0.4.0]
Neomex has quit [Quit: Neomex]
dougireton1 has joined #ruby
psyprus has quit [Read error: Connection reset by peer]
psyprus has joined #ruby
gyre007 has quit [Remote host closed the connection]
<shock_one> sam113101, you can also do something like 'z'.ord - 'a'.ord instead of searching an index.
a_a_g has quit [Quit: Leaving.]
dougireton1 has quit [Remote host closed the connection]
<sam113101> true
s0ber has quit [Read error: Connection reset by peer]
frem has joined #ruby
s0ber has joined #ruby
<shock_one> and chain each_with_index to map :). But in this case subsequent chaining doesn't make sense since each doesn't return anything meaningful
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
i_s has joined #ruby
mattbl has quit [Ping timeout: 260 seconds]
<sam113101> ah, I meant, puts the result of inject
<sam113101> without using a variable
<shock_one> I don't know how to do that.
nkr has quit [Quit: Linkinus - http://linkinus.com]
dougireton has joined #ruby
<shock_one> Are you trying to save some memory? :)
jrendell has quit [Quit: jrendell]
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
<shock_one> sam113101, try to use {} instead of do end
Lemtzas_ is now known as Lemtzas
maletor has quit [Quit: Computer has gone to sleep.]
bawigga has joined #ruby
benmatthew_ has quit [Quit: benmatthew_]
maletor has joined #ruby
mattbl has joined #ruby
_nitti_ has quit [Ping timeout: 248 seconds]
whitedawg1 has quit [Quit: Leaving.]
mando_ has quit [Remote host closed the connection]
DrCode has quit [Ping timeout: 276 seconds]
dougireton has quit [Quit: Leaving.]
sonda has quit [Remote host closed the connection]
<Spooner_> sam113101, Why str[1..-2]? Is it a csv file or something?
Myconix has joined #ruby
<shock_one> I tried it for you and it works. Stackoverflow rocks, as always. http://stackoverflow.com/questions/2127836/ruby-print-inject-do-syntax
<lethjakman_lapto> shock_one: does {} save memor over do/end?
llaskin has joined #ruby
<shock_one> Spooner_, business logic, man.
poikon has joined #ruby
<llaskin> why would this tell me that the } at the end of the gist is "unexpected" in rubymine? https://gist.github.com/llaskin/5041940
<Spooner_> No, not in the slightest. They just bind differently.
Morkel_ has joined #ruby
<shock_one> lethjakman_lapto, no, it just binds block to a different thing.
ph^ has quit [Remote host closed the connection]
Vert has joined #ruby
txdv has quit [Read error: Connection reset by peer]
<Spooner_> llaskin, Looks fine to me, but we usually use do/end for multi-line blocks.
txdv has joined #ruby
Morkel has quit [Ping timeout: 255 seconds]
Morkel_ is now known as Morkel
fschuindt has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<lethjakman_lapto> ahh I was going to say that was weird
Mattix has joined #ruby
<apeiros_> meh
<Spooner_> It does save a few characters though and we all know that source file bloat is a problem ;)
<shock_one> llaskin, what does ruby parser say? You should submit a but to rubymine tracker :)
timonv has joined #ruby
* apeiros_ uses do/end for side-effect blocks
<apeiros_> and {} for return value
apok has joined #ruby
<apeiros_> do/end just looks ugly when chained (and chain == return value, not side effect)
<shock_one> apeiros_, did you know about that binding stuff?
<Spooner_> That should still be a do/end ;)
<apeiros_> shock_one: sure. precedence matters.
<apeiros_> DSL's (== side effect) fit well with precedence of do/end too usually
poikon has quit [Ping timeout: 248 seconds]
dankest has quit [Quit: Linkinus - http://linkinus.com]
hackeron_ has joined #ruby
hackeron has quit [Read error: Connection reset by peer]
DrCode has joined #ruby
statarb3 has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
fermion has joined #ruby
railsbros_dirk has joined #ruby
<shock_one> What is the sacral meaning in making in making the precedence of them different?
<llaskin> this errors saying it expects an expression: "if client.text.include?("Cancel Client")"
<llaskin> I would argue that an if is a boolean argument and thus shoudl expect a true or false value, not an expression
<llaskin> am I wrong?
stayarrr has quit [Quit: Linkinus - http://linkinus.com]
khismetix has quit [Quit: Computer has gone to sleep.]
<shock_one> expression returns a value, that can be either truthful of not.
<apeiros_> shock_one: I'd say that you have a choice
<shock_one> or not
<Spooner_> If requires a truthy or falsy value, not strictly true/false (that is false/nil vs anything else).
interactionjaxsn has joined #ruby
<runixo> banisterfiend: thanks for your help. we haven't still found the bug. we'll continue tomorrow. thanks!
<Spooner_> runixo, Just buy more memory and forget about the bug :D
<shock_one> apeiros_, right. Like with «or» and «||». Sometimes I can't use this lovely «or» because of goddamn precedence
<runixo> Spooner_: :)
carraroj has quit [Quit: Konversation terminated!]
main is now known as threesome
gyre007 has joined #ruby
theRoUS has quit [Ping timeout: 252 seconds]
mercwithamouth has quit [Ping timeout: 248 seconds]
timonv has quit [Remote host closed the connection]
<shock_one> I agree that it's a matter of opinion, but I think it's a bad design decision that makes things more complicated without necessity
colonolGron has quit [Quit: leaving]
gyre007 has quit [Remote host closed the connection]
gyre008 has joined #ruby
tjbiddle_ has joined #ruby
meoblast001 has joined #ruby
malkomalko has joined #ruby
dannluciano has joined #ruby
JohnBat26 has quit [Ping timeout: 252 seconds]
<wrench> I'm trying to use the dashing gem. I'm following short tutorial: installed gem, created new dashing project, ran bundle, but when I run 'dashing start' I get this error:
<wrench> /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin.rb:6:in `require': cannot load such file -- openssl (LoadError)
<wrench> any ideas?
tjbiddle has quit [Ping timeout: 252 seconds]
tjbiddle_ is now known as tjbiddle
<shock_one> wrench, install openssl package
threesome has quit [Quit: Leaving]
horofox has joined #ruby
dannluciano has left #ruby [#ruby]
main has joined #ruby
jblack has joined #ruby
ffranz1 has joined #ruby
willb has quit [Ping timeout: 255 seconds]
<wrench> shock_one: its already installed
<shock_one> wrench, maybe you need libssl or something.
etcetera has joined #ruby
main is now known as threesome
threesome has quit [Read error: Connection reset by peer]
main has joined #ruby
apok has quit [Quit: apok]
iamjarvo has joined #ruby
dmerrick_ has joined #ruby
ffranz has quit [Ping timeout: 264 seconds]
main has quit [Read error: Connection reset by peer]
main has joined #ruby
khismetix has joined #ruby
squishy_1 has joined #ruby
<squishy_1> if i said
maletor has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<squishy_1> blah[:hashname] = {value: "thisvalue", attrthing: "blah2"}
<squishy_1> how would I access the value at that hashname?
<squishy_1> blah[:hashname][:value] ? or something like that
<shock_one> blah[:hashname][:value]
<squishy_1> hmm
Quebert has joined #ruby
dmerrick has quit [Ping timeout: 248 seconds]
dmerrick_ is now known as dmerrick
<squishy_1> ill try that again
<shock_one> squishy_1, why not to try it by yourself?
_nitti has joined #ruby
elkclone has joined #ruby
nachtwandler has quit [Remote host closed the connection]
maycon has joined #ruby
maycon has quit [Changing host]
maycon has joined #ruby
headius has joined #ruby
<squishy_1> yeah i definately typed it as was said but that gives this error "can't convert Symbol into Integer"
alv-r- has quit [Quit: Konversation terminated!]
<squishy_1> so i thought there was something I wasnt understanding
dougireton has joined #ruby
main has quit [Client Quit]
<banisterfiend> squishy_1: definitely*
main has joined #ruby
<Spooner_> squishy_1, Means blah is an array, not a hash.
mercwithamouth has joined #ruby
Progster has joined #ruby
<squishy_1> well I was trying to make my example more generic. Im pretty sure it is a hash
chomp has quit [Quit: Leaving]
BRMatt has quit [Quit: Leaving]
main is now known as threesome
<squishy_1> actual application is cookies[:secure_user_id] = {value: session[:username], protect_from_forgery: true}
DrShoggoth has joined #ruby
headius has quit [Client Quit]
<squishy_1> trying to learn things about cookies
threesome has quit [Read error: Connection reset by peer]
<Spooner_> Well, in that case, either cookies and/or session are actually Arrays, not Hashes.
headius has joined #ruby
main has joined #ruby
<Spooner_> Try cookies.class and session.class
ph^ has joined #ruby
willb has joined #ruby
banisterfiend is now known as banister`sleep
Progster_q has joined #ruby
hackeron_ has quit [Ping timeout: 252 seconds]
<squishy_1> Spooner_: examples I find use things like session[:username] and that seems to work
<squishy_1> Spooner_: also I got the session name part to work I just wanted to be able to close my browser and then reopen it and be logged in
<Spooner_> Yes, but can't convery Symbol into Integer is what you get when you try to index an array (which only accepts integers) with a Symbol.
<DDark> ok so im getting close. I dont think I need the regex and thus id improve performance. I have my string >str = "foo-bar,foo,bar:baz=foo"< and my inject >str.split(',').inject({}) { |h, (k, v)| if v.nil? then h[k] = nil else h[k] = v end ; h }<. If you try that in IRB you will get >{"foo"=>nil, "bar:baz=foo"=>nil, "foo-bar"=>nil}<
<DDark> Id like to get >{"foo"=>nil, "bar"> { "baz" => "foo"}, "foo-bar"=>nil}<
kraljev3 has quit [Ping timeout: 256 seconds]
dougireton has quit [Remote host closed the connection]
<DDark> not quite sure how to get baz=foo into a hash under bar. Any help would be appreciated.
<apeiros_> `; h ` means you're abusing inject.
<apeiros_> you want each_with_object
swex_ has joined #ruby
dmonjo has joined #ruby
<DDark> im on ruby 1.8.7 i do not have each with object :(
Progster has quit [Ping timeout: 276 seconds]
swex has quit [Ping timeout: 248 seconds]
<Spooner_> The question then is why use 1.8.7, but I know we won't get a useful answer ;)
<DDark> company *cough* standards *cough*
thams has joined #ruby
Zolo has quit [Remote host closed the connection]
<DDark> not up to me in other words
kofno has quit [Remote host closed the connection]
lsoa has joined #ruby
<Spooner_> Always sensible to use products that have stopped being supported, but yeah, companies are companies :D
gosshedd has quit [Ping timeout: 255 seconds]
<shevy> just because it is not supported anymore doesn't mean it is non functional
railsbros_dirk has quit [Quit: railsbros_dirk]
dblack_ has quit [Quit: dblack_]
kofno has joined #ruby
<Spooner_> It is if you value security for your web-server.
<DDark> So keeping in mind i do not have the luxary of 1.9 fun, how can I achieve my original goal? Id appreciate any pointers or constructive flaming.
squishy_1 has quit [Remote host closed the connection]
<Spooner_> DDark, Well, for starters, you dance around nil for no reason: str.split(',').inject({}) { |h, (k, v)| h[k] = v; h } is the same
zzing has joined #ruby
<DDark> by god so it is. heh yeah if nil is already nil no need to assign ;)
<tesuki> Interjection> RHEL5 and RHEL6 ships with 1.8.5 and 1.8.7.
ph^ has quit [Ping timeout: 248 seconds]
etcetera has quit [Ping timeout: 248 seconds]
<shevy> they can upgrade to 1.8.7-p358
Zolo has joined #ruby
shock_one has quit [Ping timeout: 272 seconds]
<DDark> I was thiking about tryiing Hash[v.split(":")] but I get a stack to deep error
apok has joined #ruby
<Spooner_> DDark, str.split(',').inject({}) { |h, e| k, v = e.split(":"); h[k] = v ? Hash[*v.split("=")] : v; h }
<DDark> I apprecate the hand holding spooner, but id like to understand a bit more about that. What is the purpose of the * before v.split in the hash?
mattbl has quit [Quit: This computer has gone to sleep]
<Spooner_> Works in that case, but not sure I know the full spec.
<dmonjo> is their something like filestreams in ruby? example i want to connect tcpport output from 1 connection to be redirected to a tcpport of another connection, i used to do that using streams in java
<Spooner_> Hash[] wants an even number of params which are k, v, k2, v2, etc.
<Spooner_> * (splat) means to convert the array, which is a single value, into multiple parameters.
<Spooner_> Hash[*["x", "y"]] => Hash["x", "y"]
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
<DDark> interesting. I was not aware of that tidbit.
<DDark> not aware of a lot apparently lol
<aedornm> hmmm.. Slop doesn't exit on --help. I find that odd
runixo has quit [Quit: leaving]
<Spooner_> Yeah, you have to do it yourself, aedornm. Confuses me too!
<shevy> file a bug report!!!
<aedornm> bug report!? so much work
Animawish has joined #ruby
etcetera has joined #ruby
<Animawish> x = [[-1, 0, 1].sample, [-1, 0, 1].sample]. I want x to reroll if it gets [0,0]. what do?
anderse has quit [Quit: anderse]
mityaz has quit [Quit: See ya!]
takeru has joined #ruby
jrendell has joined #ruby
main has quit [Quit: Leaving]
threesome has joined #ruby
<Amnesia> Could anyone over here give me any feedback on https://privatepaste.com/fe23efd3ba?
<Spooner_> Animawish, def roll; result = [[-1, 0, 1].sample, [-1, 0, 1].sample]; result == [0, 0] ? roll : result; end; x = roll
mark_locklear has quit [Quit: Leaving]
<Animawish> cheers Spooner_
pyrac has quit [Quit: pyrac]
<otters> does 124MB sound appropriate memory usage for one unicorn master and one worker hosting a small personal site?
<apeiros_> result = [0,0]; while result == [0,0]; …; end; result
ffranz1 has quit [Quit: Leaving]
khismetix has quit [Quit: Computer has gone to sleep.]
<otters> oops, this isn't rails
llaskin has quit [Quit: Leaving.]
ffranz has joined #ruby
<Spooner_> Amnesia, File.read('/sys/bus/acpi/drivers/thermal/LNXTHERM:00/thermal_zone/temp')[0, 1]
mattbl has joined #ruby
takeru has quit [Ping timeout: 252 seconds]
fdsafgdf has joined #ruby
threesome has quit [Read error: Connection reset by peer]
<apeiros_> hm, better: begin; …roll…; end while result == [0, 0]
Zolo has quit [Remote host closed the connection]
chrishough has quit [Quit: chrishough]
<apeiros_> that one doesn't need the initialisation
<Amnesia> Spooner_: [0,1] is the same as [0..1] right ?
threesome has joined #ruby
<Spooner_> It is.
<Spooner_> Oh yeah, 0..1 is fine. I just changed it for no reason.
<Amnesia> :)
<Amnesia> anything else perhaps?
<Spooner_> Actually, complete lie! [0..1] == [0, 2] [0...1] == [0, 1]
<Spooner_> Explicit returns seem redundant when at the end of methods.
Stilo has joined #ruby
thams has quit [Quit: thams]
<Amnesia> 3 dots is excluding the last one
m104 has joined #ruby
<bean__> Spooner_: s/seems/are/g
<Spooner_> (remaining.to_f / values[1].to_f ) => remaining.fdiv(values[1])
<Amnesia> Spooner_: imo it makes it more readible
mando has joined #ruby
<bean__> its a very not ruby thing
<bean__> to have explicit returns like that
hck89 has joined #ruby
<Amnesia> could you elaborate :)?
tommyvyo is now known as jchalk
jchalk is now known as 13WAAOKIU
cascalheira has quit [Quit: Linkinus - http://linkinus.com]
fdsafgdf has quit [Ping timeout: 276 seconds]
<bean__> why would you write more code when you can write less :)
rickmasta has quit [Quit: Leaving...]
vlad_starkov has quit [Remote host closed the connection]
13WAAOKIU is now known as theFirstMohican
rismoney has quit []
robwerks has joined #ruby
mercwithamouth has quit [Ping timeout: 252 seconds]
beliveyourdream has quit [Read error: Connection reset by peer]
br4ndon has joined #ruby
havenn has joined #ruby
khismetix has joined #ruby
jekotia has joined #ruby
<Amnesia> bean__: readability
dougireton has joined #ruby
<bean__> i disagree with you. If you know ruby you know that the last line is a return
<Amnesia> hm ok:P
Animawish has quit [Quit: Animawish]
willb has quit [Ping timeout: 260 seconds]
slainer68 has joined #ruby
<Spooner_> Well, at least you aren't using 'for' instead of 'each' ;)
zul_ has joined #ruby
* bean__ has been in bash land all day.... and has a for loop running right now :(
threesome has quit [Quit: Leaving]
dannluciano has joined #ruby
threesome has joined #ruby
arya__ has joined #ruby
<aedornm> while :; do sleep 1; done are the best kinds of bash loops.
Progster_q is now known as Progster
threesome has quit [Read error: Connection reset by peer]
khismetix has quit [Ping timeout: 255 seconds]
malomalo has quit [Quit: Textual IRC Client: www.textualapp.com]
threesome has joined #ruby
<Amnesia> Spooner_: :)
ph^ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
carloslopes has quit [Remote host closed the connection]
chrishough has joined #ruby
arya__ has quit [Read error: Connection reset by peer]
gaahrdner has quit [Read error: Connection reset by peer]
gaahrdner has joined #ruby
wmoxam has quit [Ping timeout: 252 seconds]
Evixion has joined #ruby
khismetix has joined #ruby
otherj has joined #ruby
_nitti has quit [Remote host closed the connection]
mneorr has joined #ruby
arya has joined #ruby
ph^ has quit [Ping timeout: 248 seconds]
mercwithamouth has joined #ruby
threesome has quit [Quit: Leaving]
sailias has quit [Ping timeout: 276 seconds]
_nitti has joined #ruby
_nitti has quit [Remote host closed the connection]
threesome has joined #ruby
carlyle_ has quit [Remote host closed the connection]
rocket has joined #ruby
geekbri has quit [Remote host closed the connection]
tish has quit [Quit: Leaving.]
LBRapid has quit [Quit: Farewell.]
pandawarrior1 has joined #ruby
v0n has quit [Ping timeout: 244 seconds]
<pandawarrior1> hi i've created a class and i need a way for this class to keep track off all instances of itself
DDark has quit [Quit: Page closed]
<pandawarrior1> is there a common idiom ruby uses to do this?
tish has joined #ruby
<Spooner_> pandawarrior1, Use a class instance variable which is an array and add to it in initialize.
F1skr has quit [Quit: WeeChat 0.4.0]
_nitti has joined #ruby
tethra has joined #ruby
dallasm has joined #ruby
duosrx_ has joined #ruby
hashmal has joined #ruby
<arturaz> pandawarrior1, there's also ObjectSpace, but its a hack
<dmonjo> threads execute on multiple cpu cores automatically? or we need to specify multiple cores somewhere? like putting single core for low priority ones and multiple for others?
banjara has quit [Quit: Leaving.]
<Spooner_> Not in CRuby they don't. Other implementations they do.
banjara has joined #ruby
<pandawarrior1> Spooner_: how would i do that?
duosrx has quit [Ping timeout: 246 seconds]
banjara has quit [Client Quit]
peregrine81 has quit [Quit: Computer sleeping.]
Quebert has quit [Ping timeout: 248 seconds]
<pandawarrior1> @classes ||= [], then @classes << self
banjara has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
horofox has quit [Quit: horofox]
<Spooner_> Oops, meant accessor not writer.
threesome has quit [Quit: Leaving]
threesome has joined #ruby
<pandawarrior1> this is lovely
dallasm has quit [Remote host closed the connection]
<interactionjaxsn> it is
<pandawarrior1> it looks like magic, though
jrendell has quit [Quit: jrendell]
<Spooner_> Get used to magic in Ruby ;)
<pandawarrior1> i'm guessing ':instances: is a method avaliable to instances of Object?
huoxito has joined #ruby
<pandawarrior1> just trying to get my head around stuff, don't want to be a copy and paste 'coder'
<Spooner_> No, it is on the class itself, so you would do Fish.instances to get it (or self.class.instances in an instance).
<Spooner_> Look up "Ruby class instance variables" for more examples.
<pandawarrior1> k
dallasm has joined #ruby
<pandawarrior1> thanking youuu!
<Spooner_> pandawarrior1, Updated it with example.
c0rn has quit [Ping timeout: 248 seconds]
pdamer has quit [Quit: pdamer]
jrendell has joined #ruby
beiter has joined #ruby
bricker has quit [Read error: Operation timed out]
<pandawarrior1> nice
kazoo has joined #ruby
<pandawarrior1> yeah this is sweet
<pandawarrior1> if I wanted the class itself to return those instances, I would use self.instances?
c0rn has joined #ruby
<interactionjaxsn> am i correct in saying that class << self; attr_accessor :instances; end creates getter and setters?
<canton7> self.class.instances . Spooner_ said that above
Emplitz has quit [Ping timeout: 252 seconds]
<Spooner_> "self" when inside the class block refers to the class. Outside of it it doesn't.
Guest33203 is now known as ixx
<pandawarrior1> ah ok
tjbiddle_ has joined #ruby
<Spooner_> interactionjaxsn, Yeah, if it wasn't inside the class << self; end, then they would be for the instance, but there they are added to the class itself.
mattbl has quit [Quit: This computer has gone to sleep]
bricker has joined #ruby
<Spooner_> Inside an instance method, "self" refers to the instance itself.
j^2 has quit [Quit: for i in `/names` ; do adios $i; done]
otherj has quit []
<apeiros_> s/an instance//
ffranz has quit [Quit: Leaving]
ForSpareParts has quit [Quit: ForSpareParts]
weddingcakes has joined #ruby
vlad_starkov has joined #ruby
<pandawarrior1> is there a way to get a copy of, say, an array and but have the copy in sync with the original array. So like if the original array gets extra elements, the copied array would have those too?
<Spooner_> And on the moon, "self" refers to the King of the Moon.
beiter has quit [Quit: beiter]
<Spooner_> pandawarrior1, You only have references to object.
Es0teric has quit [Quit: Computer has gone to sleep.]
tjbiddle__ has joined #ruby
kazoo has quit []
rouss_ has joined #ruby
tjbiddle has quit [Ping timeout: 248 seconds]
tjbiddle__ is now known as tjbiddle
havenn has quit [Remote host closed the connection]
<pandawarrior1> right, like pointers to a value
<pandawarrior1> but an array is a reference to a collection of values/objects
beiter has joined #ruby
<Spooner_> Yeah, so just by putting a reference in another variable, you have multiple ways to access the exact same object.
Morkel has quit [Quit: Morkel]
<pandawarrior1> umm i'm thinking too linear
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<Spooner_> An Array is a collection of references. A variable can be a reference to an Array, but an Array is not itself a reference (depending on how you see it).
<Spooner_> If you are thinking in C/C++ terms, there are only references in Ruby. No pointers or values.
<pandawarrior1> yeh i get what you are saying
tjbiddle_ has quit [Ping timeout: 252 seconds]
<pandawarrior1> so, if i have a class and it launches new numbers
jpfuentes2 has joined #ruby
<Spooner_> Into outer space?
weddingcakes has quit [Client Quit]
<pandawarrior1> lol, not quite
<pandawarrior1> i mean instantiates new numbers
mneorr has quit [Read error: Connection timed out]
<Spooner_> Numbers are Objects. Everything is objects, so everything is referenced.
<pandawarrior1> i want a way to ask the object, what number are you, little fella?
<dmonjo> Thread.start(dts.accept) do |s| <-------------------------- does this thread get created as soon as a new connection is established or is it created and listens before a connection is established?>
fedza has quit [Ping timeout: 260 seconds]
tjbiddle_ has joined #ruby
zodiak has quit [Ping timeout: 245 seconds]
* pandawarrior1 goes away and rethinks what i am trying to actually solve
<Spooner_> (If we look at implementation, some things can be immediate values in reality, but they act, to the programmer, as though they were normal objects).
iamjarvo has quit [Quit: Leaving.]
mneorr has joined #ruby
<Spooner_> dmonjo, It would not be created until the server accepted a connection.
<interactionjaxsn> pandawarrior1: is object id
<interactionjaxsn> his*
kristofers has quit []
<Spooner_> Since it needs to do dts.accept before the result of that can be passed to Thread.start)
reppard has joined #ruby
tjbiddle has quit [Ping timeout: 252 seconds]
tjbiddle_ is now known as tjbiddle
<dmonjo> what happens if i do manually 10 dts.accept but i dont have any connections?
<Spooner_> Krakatoa will explode.
<dmonjo> lol
<Spooner_> You won't be able to do more than one, since the first one will block.
<pandawarrior1> interactionjaxsn: looking into that
<dmonjo> loving ruby
<Spooner_> interactionjaxsn, What about object ID?
cantonic_ has joined #ruby
zodiak has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
love_color_text has joined #ruby
<interactionjaxsn> Spooner_: pando asked "what number are you, lil fella?" I'm asking if he wants the object id of the number or the value that 'number' holds
dannluciano has quit [Quit: dannluciano]
Animawish has joined #ruby
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
<Spooner_> Oh yes, I see. The number in object id should not be looked at though, since it is magic.
tenmilestereo[aw has quit [Quit: Leaving]
<Spooner_> Like a fairy.
theFirstMohican has quit [Quit:]
elaptics is now known as elaptics`away
m104 has quit [Quit: Bye!]
skipper has joined #ruby
<pandawarrior1> Spooner_: interactionjaxsni i'm not interested in the object id, i'm actually interested in the value
<pandawarrior1> i want a method called 'is_number?' to return my a value
<pandawarrior1> but this value is different for every new instance of my Number class
<pandawarrior1> so num_1 = Num.new, num_2 = Num.new
<shevy> Readline.completion_append_character <-- does this even work?
atmosx has joined #ruby
<pandawarrior1> num_1.is_number?.should == 10
<interactionjaxsn> pandawarrior1: array[i] ?
hadees has quit [Quit: hadees]
bawigga has quit [Quit: Textual IRC Client: www.textualapp.com]
<pandawarrior1> yeah, I was thinking an array on the class level?
gabrielrotbart has joined #ruby
M- has joined #ruby
<apeiros_> pandawarrior1: foo? methods usually return true or false
wmoxam has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
<pandawarrior1> wait, i think I have it
<bean__> makes me rage when people don't have ? methods return t/f
maligree has joined #ruby
<Spooner_> pandawarrior1, You could do def number; self.class.instances.index(self); end (not efficient, but you could always just do @number = self.class.instances.size; self.class.instances << self in initialize instead.
<interactionjaxsn> pandawarrior1: if we go back to the Fish is is Fish.instances.first?
backjlack has quit [Read error: Connection reset by peer]
v0n has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
tommyvyo has joined #ruby
dallasm has quit [Remote host closed the connection]
skyee has joined #ruby
codecop has quit [Remote host closed the connection]
<skyee> hello, anyone here?
Slivka has quit [Ping timeout: 272 seconds]
<shevy> skyee yeah
<apeiros_> no
<shevy> skyee we are the ruby experts
mneorr has quit [Read error: Connection timed out]
<skyee> sup shevy... nice to hear
pettsson has quit [Remote host closed the connection]
<shevy> but if you don't have a question about ruby
<shevy> we must slay one kitten :(
<interactionjaxsn> not the kittens
<skyee> i totally do, i just wasn't sure what the etiquette was for asking questions
<skyee> never been here before
<shevy> skyee you need to dance for a few hours, then you may ask one but only one question
<pandawarrior1> interactionjaxsn: Spooner_: https://gist.github.com/anonymous/5042958
<shevy> one question per year, remember that
<pandawarrior1> this is what i'm trying to achive
<skyee> i just danced in my seat for a few seconds, that will have to suffice!
<interactionjaxsn> skyee: unless you dance some more. rinse and repeat
hadees has joined #ruby
banjara has quit [Quit: Leaving.]
re75 has joined #ruby
<re75> !list
banjara has joined #ruby
<skyee> can i just copy and paste code to this chat or is there another way
re75 has left #ruby [#ruby]
<pandawarrior1> how can number_generator keep track of the numbers assigned so that it assigns a different number
banjara has quit [Client Quit]
<pandawarrior1> and how can i get is_number? to return me back the specific number it was assigned
PragCypher has quit [Quit: Leaving]
banjara has joined #ruby
<apeiros_> pandawarrior1: if you don't mind huge numbers, you can use uuids
<skipper> skyee: For multiple lines, gist.github.com is best!
<skyee> im dumb. ok here it goes. anyone know what i'm doing wrong with this code? it's supposed to let the user enter in numbers in one string, divide it up to an array, then output the sum of the array.
<apeiros_> pandawarrior1: otherwise, use a Set or a Hash
banjara has quit [Client Quit]
<skyee> lol cant c/p code here, of course not
banjara has joined #ruby
<apeiros_> skyee: don' forget - multiple lines of code not in here, but on a paste service, like gist.github.com
<skipper> skyee: People do. :P
<skyee> ty apeiros!
<shevy> skyee WHAT CODE
banjara has quit [Client Quit]
<shevy> I CAN NOT SEE IT I AM BLIND
<interactionjaxsn> wanna see me one line that?
<shevy> lol
banjara has joined #ruby
<shevy> interactionjaxsn you are funny
sepp2k1 has joined #ruby
dallasm has joined #ruby
mneorr has joined #ruby
<shevy> skyee and what input do you give
banjara has quit [Client Quit]
sepp2k has quit [Ping timeout: 248 seconds]
<shevy> skyee also you dont assign to array
banjara has joined #ruby
harumph has joined #ruby
nomenkun has quit [Remote host closed the connection]
<shevy> array.split(",") <--
<skyee> shevy, what do you mean? i don't give any input, i ask the user to input numbers
<apeiros_> skyee: array.split does not change array, it returns an array
<shevy> skyee yes. this is what I am asking. I am asking what the user does. give example input.
<apeiros_> and you have to assign that to a variable
banjara has quit [Client Quit]
<skyee> oh like 1,2,3
_nitti has quit [Remote host closed the connection]
<shevy> good
banjara has joined #ruby
hck89 has quit [Ping timeout: 240 seconds]
<shevy> now assign it to array variable and you are done. array = array.split(",")
<interactionjaxsn> array << gets.chomp ?
banjara has quit [Client Quit]
Hydroxide has joined #ruby
<interactionjaxsn> shevy: sorry for that
<shevy> interactionjaxsn hmm he wants to .split I think, also array doesnt exist yet
<apeiros_> skyee: also, don't name variables after their type. name them after their semantical content. like 'numbers'
banjara has joined #ruby
<skyee> well i wanted to let the user input whatever numbers. i can do this if i give the input, but i want the user to input
<interactionjaxsn> shevy: right
<shevy> yes. like ... numbers = ['cat','dog','horse'] :D
banjara has quit [Client Quit]
<shevy> skyee he inputs a string via gets() though
banjara has joined #ruby
<skyee> yes. so where exactly is this wrong? i'm not seeing it
dmerrick has quit [Quit: dmerrick]
<shevy> skyee you do not store what you want to store in the variable array
banjara has quit [Client Quit]
<Hydroxide> hi. still working in ruby 1.9.x-land... is it better style to do File.open("/blah/blah") {|f| f.read}, File.open("/blah/blah", &:read), or File.open("/blah/blah").read assuming you're sure that it's a short-lived script and open file descriptors won't be a concern?
<shevy> I mean you store it, right. but then you .split
banjara has joined #ruby
<shevy> and you believe that array is .split, but this isn't true
<skyee> oh i see. but then doesn't the variable "array" turn INTO an array, values separated by commas?
<shevy> print array outputs the original line, before .split
jlast has quit [Remote host closed the connection]
<shevy> skyee...
banjara has quit [Client Quit]
<shevy> do you know what .split does
<skyee> i thought it splits into array values
banjara has joined #ruby
jlast has joined #ruby
<shevy> "abc,def,ghi".split(',') # => ["abc", "def", "ghi"]
<shevy> yeah
<shevy> so the question is
<shevy> do you want an array or do you want a string :P
banjara has quit [Client Quit]
<apeiros_> Hydroxide: just File.read(path)
banjara has joined #ruby
<skyee> array! but ... i dunno. the output just has to be a sum of the arrays
<skyee> so what is the best soltuion to do that
<shevy> skyee good, then assign to array
<shevy> skyee I showed you above!!! array = array.split(",")
banjara has quit [Client Quit]
<skyee> ohh i see
<skipper> skyee: Is this what you want?: https://gist.github.com/havenwood/5043049
<shevy> btw your layout is strange skyee
<Hydroxide> apeiros_: ah, nice. it's of course not in the File docs, only in the IO superclass - but now I know. thanks!
banseljaj is now known as imami|afk
banjara has joined #ruby
<shevy> skyee you should indent within method definitions
<shevy> def sum
<shevy> # <-- continue here
wtee has quit [Quit: wtee]
gabrielrotbart has quit [Remote host closed the connection]
<interactionjaxsn> shevy: i think his hangup is on the user input? i could be off
pandawarrior1 has quit [Quit: Leaving.]
banjara has quit [Client Quit]
<Hydroxide> apeiros_: is there an equivalent for writing all at once? (again, it's small enough that this is okay)
<skyee> skipper that looks pretty complicated. probably? lol
banjara has joined #ruby
<shevy> interactionjaxsn dunno, I think he is thinking too complicated
<Hydroxide> apeiros_: IO.write seems to want the stream to be opened for writing already
<shevy> skyee, you understand that array.split() is not the same as array = array.split() ?
<skipper> skyee: If you want a string of numbers separated by commas to be summed?
banjara has quit [Client Quit]
<shevy> skyee I mean you called the variable array, but it is a string initially right? :P
<skipper> skyee: #split(',').map(&:to_i).inject(:+)
banjara has joined #ruby
<shevy> array = gets.chomp
jlast has quit [Remote host closed the connection]
adamjleonard has quit [Quit: Leaving...]
<skyee> yes i do now. you have assigned the value of variable array to now be split as an array, instead of just holding it in memory.. correct?
<shevy> ^^^ this is a string!
postmodern has joined #ruby
ner0x has quit [Quit: Leaving]
<shevy> skyee yes, but array is just a name of the variable, you tricked yourself
banjara has quit [Client Quit]
<skyee> yes i coulda made it clearer lol
<shevy> string = gets.chomp
<shevy> this is a string indeed
banjara has joined #ruby
<shevy> array = gets.chomp # also a string
<skipper> skyee: Funny you named your string array. Also, the array.split isn't modifying the receiver.
ph^ has joined #ruby
<shevy> your own code lies to you man :(
banjara has quit [Client Quit]
wtee has joined #ruby
banjara has joined #ruby
banjara has quit [Client Quit]
<interactionjaxsn> shevy: i see what you did there
<dmonjo> are thread killed automatically by GC after some time?
<dmonjo> any timeouts?
banjara has joined #ruby
ryanneufeld has quit [Quit: Adios]
banjara has quit [Client Quit]
Retistic has joined #ruby
<interactionjaxsn> Hydroxide: does file.read take a block?
banjara has joined #ruby
linguini has joined #ruby
ryanneufeld has joined #ruby
zaphod has joined #ruby
banjara has quit [Client Quit]
gyre008 has quit [Ping timeout: 244 seconds]
zaphod has quit [Client Quit]
<dmonjo> my first threaded networking socket http://pastebin.com/1SpkGtnN
<dmonjo> :)
banjara has joined #ruby
pasties has quit [Ping timeout: 244 seconds]
banjara has quit [Client Quit]
<skipper> skyee: Here, I used smaller variable names so it seems less complicated :O https://gist.github.com/havenwood/5043049
jacktrick has joined #ruby
banjara has joined #ruby
zaphod has joined #ruby
tish has quit [Quit: Leaving.]
zaphod is now known as LiquidInsect
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
<skipper> skyee: All that does is split on commas, convert the array to integers, and add them.
banjara has quit [Client Quit]
<skyee> thanks skipper... looks so simple and elegant the way you did it. i haven't learned map or inject yet though
banjara has joined #ruby
pasties has joined #ruby
jerius has quit []
ph^ has quit [Ping timeout: 252 seconds]
banjara has quit [Client Quit]
Shadow_S has joined #ruby
banjara has joined #ruby
<skipper> skyee: [1,2,3].map(&:to_s); #=> ["1","2","3"]
<skipper> skyee: #map is a commonly used method on Enumerable
<dmonjo> how do you read that map(&:to_i) ?
kirun has quit [Quit: Client exiting]
banjara has quit [Client Quit]
banjara has joined #ruby
dallasm has quit [Remote host closed the connection]
<skipper> dmonjo: Syntactic sugar for: #map { |e| e.to_i }
<skyee> im trying to figure out why this code is returning a strange output: https://gist.github.com/anonymous/c3f5b507b596f10601ac
<skipper> dmonjo: Or you mean how to say in English?
pandawarrior1 has joined #ruby
<skyee> i expected it to output 1+2+3+ but there's more
__BigO__ has quit [Remote host closed the connection]
dougireton has quit [Quit: Leaving.]
<dmonjo> syntactic sugar first time i hear of that looks neat
khismetix has quit [Quit: Computer has gone to sleep.]
<skyee> it gives
<skyee> 1+2+3+1
<skyee> 2
<skyee> 3
dougireton has joined #ruby
<whitequark> because `numbers.each' returns `numbers'
<whitequark> and if you puts an array, it prints out each element on its own line
<linguini> Is this a bug in ruby: https://gist.github.com/jonhfa/5043138 ?
Kuifje has quit [Ping timeout: 276 seconds]
<skipper> dmonjo: Actually, that is an old article from back when to_proc & notation was Rails only. Ruby 1.9+ it works out-of-the box.
<linguini> (defining C.to_str changes behavior of Range)
<skyee> hmm interesting, thanks whitequark. do you know how i can edit this so that the only output i'd get is 1+2+3+ ?
threesome has quit [Quit: Leaving]
atmosx has quit [Quit: And so the story goes…]
threesome has joined #ruby
<apeiros_> Hydroxide: File.write(path, content)
horofox_ has joined #ruby
Animawish has quit [Quit: Animawish]
mneorr has quit [Read error: Connection timed out]
mneorr has joined #ruby
<skyee> oh. i just had to take out the last "puts". hooray
dougireton has quit [Quit: Leaving.]
breakingthings has quit []
tobor_one has left #ruby [#ruby]
forrest has quit [Quit: Leaving]
blacktulip has quit [Remote host closed the connection]
AndChat| has joined #ruby
alanp_ has joined #ruby
tcstar has joined #ruby
Animawish has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
dallasm has joined #ruby
mneorr has quit [Remote host closed the connection]
jarred has joined #ruby
<jarred> hi all
baphled has joined #ruby
robwerks has left #ruby ["Leaving"]
mneorr has joined #ruby
Banistergalaxy has quit [Ping timeout: 255 seconds]
alanp has quit [Ping timeout: 245 seconds]
jonahR has quit [Quit: jonahR]
gaahrdner has quit [Remote host closed the connection]
<dmonjo> array is a subclass of enumator?
dougireton has joined #ruby
<dmonjo> enumerator
<dmonjo> vice versa
wargasm has quit [Ping timeout: 255 seconds]
<Spooner_> No, Array includes the Enumerable module.
<apeiros_> and Enumerator is its own class
wargasm has joined #ruby
<apeiros_> no inheritance relation either way with Array
<shevy> they look like brothers
<dmonjo> goes Object>Enumeraable>Array
<shevy> what is Enumeraable, is that ancient egypt... raaaa
Al__ has joined #ruby
zoonfafer has joined #ruby
<skipper> dmonjo: Array.ancestors; #=> [Array, Enumerable, Object, PP::ObjectMixin, Kernel]
mikepack has quit []
baphled has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
<skipper> oops, Pry...
hadees has quit [Read error: Connection reset by peer]
<dmonjo> hashes have same ancestors as of array?
<skipper> dmonjo: Shoulda said: [Array, Enumerable, Object, Kernel]
mneorr has quit [Ping timeout: 264 seconds]
<Spooner_> dmonjo, Why not try Hash.ancestors and find out?
<skipper> ^
<dmonjo> cool
ninp0 has quit [Read error: Operation timed out]
jeffreybaird has joined #ruby
mmitchell has quit [Remote host closed the connection]
<jarred> I'm trying to include a module within a Proc. Am I misunderstanding the intended purpose of a Proc, or am I doing something wrong?
<shevy> jarred how do you try that?
<shevy> hmm perhaps you want extend
<Spooner_> linguini, I think you mean to implement to_s. adding to_str means that C can be considered to be a string.
Quebert has joined #ruby
<jarred> that worked
dallasm has quit [Remote host closed the connection]
<linguini> Spooner_: Thanks. I was intentionally trying to overwrite to_s and to_str. It surprised me that "can be considered a string" had the effect I observe.
<jarred> shevy: p = Proc.new { }; p.instance_eval { include ModuleName }, was what I was trying to do
<shevy> ah
<shevy> evals scare me
<LiquidInsect> ^
<LiquidInsect> and including/extending a module outside of a class definition as well
h4mz1d has joined #ruby
mercwithamouth has quit [Ping timeout: 256 seconds]
<Spooner_> linguini, The reason is that the Range is actually "8".."6" in the end, so there is nothing to iterate.
<LiquidInsect> what is self there? you're including the module into something... if it's Object you're going to have a bad time
baphled has joined #ruby
malkomalko has quit [Remote host closed the connection]
<jarred> self is an instance of Proc, right?
<jarred> (that instance, to be specific)
ninp0 has joined #ruby
<Spooner_> linguini, (C.new(4)..C.new(2)).to_a => ["6", "7", "8"] (C.new(2)..C.new(2)).to_a => []
tish has joined #ruby
rocket has quit [Ping timeout: 260 seconds]
enroxorz has quit [Disconnected by services]
hadees has joined #ruby
huoxito has quit [Quit: Leaving]
anonymuse has joined #ruby
enroxorz-work has joined #ruby
<linguini> Spooner_: Yes, I know; thanks. What surprised me was (a..b) # a and b changed to strings?
<LiquidInsect> Proc.new{puts self.inspect}.call
<LiquidInsect> main
<Spooner_> Oops, I meant: (C.new(2)..C.new(4)).to_a => []
<LiquidInsect> hm
<LiquidInsect> that
schaerli has quit [Read error: Connection reset by peer]
schaerli_ has joined #ruby
alanp_ is now known as alanp
<LiquidInsect> that's just in irb so it depends on where the proc is being called I think...
<jarred> oh
<jarred> hmmm
<Spooner_> linguini, But anything with to_str _is_ interchangable with a String.
mockra has quit [Remote host closed the connection]
<linguini> interchangeable at any time? That makes to_str seem fairly dangerous.
etcetera has quit [Ping timeout: 256 seconds]
<Spooner_> to_s, however, is just used for printing stuff out. Doesn't mean that the string == the Object.
<Spooner_> linguini, Not really, because they are interchangeable. If they aren't, you don't implement to_str on it.
<linguini> class Url; def to_str; # oops, now Url methods may now be gone on objects of Url
bryanjswift has joined #ruby
rouss_ has quit [Ping timeout: 260 seconds]
<linguini> Do I misunderstand?
<LiquidInsect> yes
<vabenjamin> hi all
philcrissman has quit [Remote host closed the connection]
<LiquidInsect> just because you can use something like a string doesn't mean it loses the methods it already implements
samphippen has joined #ruby
arya has quit [Ping timeout: 248 seconds]
<LiquidInsect> but methods that expect to receive <something that can be turned into a string with to_str> can use it like a String
adamjleonard has joined #ruby
philcrissman has joined #ruby
harumph has quit [Ping timeout: 248 seconds]
schaerli_ has quit [Remote host closed the connection]
<skyee> can ruby evaluate 1+2+3+ ? or do i have to remove the last + ?
<Spooner_> skyee, Run it in IRB or pry an see.
bean__ has quit [Quit: Computer has gone to sleep.]
<linguini> LiquidInsect: (urla..urlb) # so urla and urlb will retain their class, but the Range class can (for some reason) treat them like strings?
<skyee> ive tried running it and all it does is give me the same line, with no errors
m8 has quit [Quit: Sto andando via]
<whitequark> skyee: it's an unfinished statement
stopbit has quit [Quit: Leaving]
<whitequark> why would it evaluate?
<whitequark> $ ruby -e "p 1+2+3+"
<Spooner_> linguini, url wouldn't implement to_str. Not many things at all do (not sure I could name one other than String).
Quebert has quit [Ping timeout: 255 seconds]
<skyee> all righty, thanks
<dmonjo> if i do an inject :method1 it means i am passing no arguments as first iteration then the first return will go into the second iteration then the 2nd return will go to the sum of second iteration+return of the method correct? how can i track in the method which iteration is being done on it? use class variables to store the iteration umber?
<linguini> Spooner_: gem addressable does
<Spooner_> skyee, It is waiting for you to enter the last value so it can complete the expression.
<LiquidInsect> linguini: no
philcrissman has quit [Remote host closed the connection]
<LiquidInsect> "Ranges can be constructed using any objects that can be compared using the <=> operator."
<LiquidInsect> no it's not to_str you would want to implement, but <=>
<LiquidInsect> ...which, I don't know how you'd define that urla < urlb or vice versa
<Spooner_> LiquidInsect, linguini had already implemented <=> and succ which was fine.
<linguini> LiquidInsect: Well, in my case, I was implementing to_str so that 'hi' + url # would work
<aedornm> I'm making dynamic constants!
<Spooner_> It was adding to_str (rather than to_s or inspect) for no particular reason that caused it to fail.
gabrielrotbart has joined #ruby
<LiquidInsect> Ah, ok. Kind of came into the middle there.
rickmasta has joined #ruby
baphled has quit [Read error: Connection reset by peer]
<linguini> 'hi' + url # to_s is an insufficient spell
<Spooner_> linguini, "hi#{url}"
binaryplease has joined #ruby
<Spooner_> Which calls to_s for you.
Virunga has joined #ruby
arturaz has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
binaryplease has quit [Client Quit]
takeru has joined #ruby
<linguini> Spooner_: Right; thanks. My mental note will be: don't define to_str; it's useless.
<linguini> https://gist.github.com/jonhfa/5043138 # updated gist to illustrate surprise [to me] conversion to String
generalissimo has quit [Remote host closed the connection]
<Spooner_> It isn't useless. It just isn't for what you were using it for.
the_mentat has quit [Quit: Computer has gone to sleep.]
toekutr has quit [Read error: Connection reset by peer]
<linguini> What is to_str possibly useful for?
arya has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
ndngvr has quit [Read error: Connection reset by peer]
<Spooner_> Say I had wrapped a C string. It isn't a String, but it is effectively one.
gregor3005 has left #ruby [#ruby]
<Spooner_> It isn't there to just avoid needing to type "to_s"
<Spooner_> I have to admit that I've never had occasion to use it myself.
mercwithamouth has joined #ruby
<linguini> Spooner_: So, you're saying, it's potentially useful for classes that consider conversion to String an "upgrade"...
<aedornm> Dir["/*.yml"].each {|f| self.class.const_set File.basename(f).split('_').collect {|n| n.capitalize}.join, YAML::load_file(f)}
adeponte has joined #ruby
<Spooner_> linguini, Oh, there is a Symbol.to_str, because that is pretty stringy ;)
reppard has quit [Ping timeout: 256 seconds]
<Spooner_> Oh no there isn't. Noobs telling me that on the blogosphere...bah!
takeru has quit [Ping timeout: 252 seconds]
ddd has quit [Ping timeout: 245 seconds]
beiter has quit [Quit: beiter]
<linguini> If adding a method to a class results in objects of that class /changing type/ to a String willy-nilly, it seems like a useless method because by defining that method you're effectively throwing away the class and replacing it with String.
<Spooner_> When the user does something with it that wouldn't make sense unless it was a string, yes, but in other situations it doesn't convert it.
<linguini> Perhaps I shouldn't say "changing type".
end_guy has quit [Remote host closed the connection]
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
Progster has quit [Remote host closed the connection]
end_guy has joined #ruby
v0n has quit [Ping timeout: 255 seconds]
<Spooner_> If I do "hi" + url, then it wants a string, because you can only add a string to another string. You can convert it yourself with to_s or if you are happy for Ruby to do it, you implement to_str to say, "yeah, if you need a string, I am one".
Stilo has joined #ruby
ddd has joined #ruby
ddd is now known as Guest90390
mneorr has joined #ruby
<Spooner_> But pointless arguing it any more. Just don't use to_str and use interpolation (with to_s) for joining things that are stringish.
Progster has joined #ruby
<dmonjo> anything easier than using multi dimensional hashes? i am finding a bit hard to understand them
<linguini> Spooner_: I will. Thanks.
<linguini> Spooner_: One last gist, illustrating a stringy class: https://gist.github.com/jonhfa/5043138
xardas has quit [Ping timeout: 255 seconds]
huoxito has joined #ruby
<linguini> Oops
lele has quit [Ping timeout: 256 seconds]
dv_ has quit [Quit: No Ping reply in 180 seconds.]
* linguini putting to_s as needed in his real code
<Spooner_> I barely ever explicitly to_s. Often implicitly in an interpolation.
<linguini> hmm. Right.
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
<Spooner_> Though I would still use x.to_s over "#{x}" (that is, a string with nothing but a single interpolation.
lele has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
frem has quit [Ping timeout: 246 seconds]
h4mz1d has quit [Ping timeout: 256 seconds]
enebo has quit [Quit: enebo]
forced_request has joined #ruby
tish has quit [Quit: Leaving.]
dv_ has joined #ruby
mikepack has quit [Remote host closed the connection]
Bosox20051 has joined #ruby
llaskin has joined #ruby
ph^ has joined #ruby
mockra has joined #ruby
danblack has joined #ruby
miked__ has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
miked__ has quit [Quit: miked__]
mfletcher has joined #ruby
brum has joined #ruby
dustint has quit [Ping timeout: 272 seconds]
wtee has quit [Ping timeout: 248 seconds]
etcetera has joined #ruby
ph^ has quit [Ping timeout: 248 seconds]
mockra_ has joined #ruby
Quebert has joined #ruby
mockra has quit [Ping timeout: 264 seconds]
Emplitz has joined #ruby
gaahrdner has joined #ruby
zoonfafer has quit [Ping timeout: 240 seconds]
willob has quit [Quit: Leaving.]
tomzx_mac has joined #ruby
fir_ed has joined #ruby
Animawish has left #ruby [#ruby]
nari has joined #ruby
skipper has quit [Remote host closed the connection]
geekbri has joined #ruby
[[johnonymous]] has quit [Quit: Computer has gone to sleep.]
Al__ has quit [Quit: Al__]
__BigO__ has joined #ruby
Virunga has quit [Remote host closed the connection]