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 !
<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]
<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]
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?
<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
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!
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]
<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]
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) }
<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
<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]
<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 :)
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>
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
<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]
<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)
<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)
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.
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
<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.]
<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.
<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_>
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}/)
<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?
<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]
<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)
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?
<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? :/
<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 ?
<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?
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
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]
<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.
<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
<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)
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]
<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.
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.]
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?
<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
<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
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]
<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]
<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]
<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]
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