pwnz0r has quit [Remote host closed the connection]
roamingdog has joined #ruby-lang
roamingdog has quit [Ping timeout: 245 seconds]
aeze has quit [Quit: aeze]
roamingdog has joined #ruby-lang
roamingdog has quit [Client Quit]
casshern2 has quit [Ping timeout: 246 seconds]
LMity2 has quit [Ping timeout: 272 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
rebel has quit []
amystephen has joined #ruby-lang
aghalarp has joined #ruby-lang
tosbourn has joined #ruby-lang
LMity has joined #ruby-lang
MagicHat has joined #ruby-lang
tosbourn has quit [Ping timeout: 246 seconds]
gix has quit [Ping timeout: 264 seconds]
MagicHat has quit [Ping timeout: 245 seconds]
aghalarp has quit [Read error: Connection reset by peer]
aghalarp has joined #ruby-lang
gix has joined #ruby-lang
amystephen has quit [Quit: amystephen]
LMity has quit [Ping timeout: 248 seconds]
Torrieri has quit [Quit: Be back later ...]
tkuchiki has quit [Read error: Connection reset by peer]
kfpratt has quit [Remote host closed the connection]
Zen-Zen has joined #ruby-lang
tkuchiki has joined #ruby-lang
kfpratt has joined #ruby-lang
hendranata_ has quit [Remote host closed the connection]
duderonomy has joined #ruby-lang
matp has quit [Remote host closed the connection]
matp has joined #ruby-lang
hendranata_ has joined #ruby-lang
weaksauce has joined #ruby-lang
djbkd has joined #ruby-lang
djbkd has quit [Ping timeout: 250 seconds]
fedexo has joined #ruby-lang
fedexo has quit [Client Quit]
fedexo has joined #ruby-lang
MXfive has joined #ruby-lang
pd has quit [Ping timeout: 264 seconds]
MXfive has quit [Client Quit]
pjaspers has quit [Ping timeout: 276 seconds]
pjaspers has joined #ruby-lang
michaeldeol has joined #ruby-lang
MagicHat has joined #ruby-lang
pd has joined #ruby-lang
pjaspers has quit [Ping timeout: 250 seconds]
MagicHat_ has joined #ruby-lang
duderonomy has quit [Read error: Connection reset by peer]
dellavg_ has joined #ruby-lang
aeze has joined #ruby-lang
MagicHat has quit [Ping timeout: 245 seconds]
duderonomy has joined #ruby-lang
pjaspers has joined #ruby-lang
hahuang61 has joined #ruby-lang
kfpratt has quit [Remote host closed the connection]
MagicHat_ has quit [Remote host closed the connection]
kfpratt has joined #ruby-lang
Mark-6ma has joined #ruby-lang
lytol has joined #ruby-lang
nedp has joined #ruby-lang
lytol has quit [Remote host closed the connection]
lytol has joined #ruby-lang
lytol has quit [Client Quit]
lytol has joined #ruby-lang
ruby-lang625 has joined #ruby-lang
ruby-lang625 has quit [Client Quit]
x44x45x41x4E has joined #ruby-lang
dellavg_ has quit [Ping timeout: 264 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tosbourn has joined #ruby-lang
pjaspers has quit [Ping timeout: 245 seconds]
pjaspers has joined #ruby-lang
tosbourn has quit [Ping timeout: 256 seconds]
amclain has quit [Quit: Leaving]
[ace] has joined #ruby-lang
Iskarlar has joined #ruby-lang
lytol has quit [Remote host closed the connection]
michaeldeol has joined #ruby-lang
aghalarp has quit [Max SendQ exceeded]
aghalarp has joined #ruby-lang
Bertg has joined #ruby-lang
michaeldeol has quit [Client Quit]
dhjondoh has joined #ruby-lang
x44x45x41x4E is now known as [Away]x44x45x41x
[Away]x44x45x41x has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
|jemc| has joined #ruby-lang
x44x45x41x4E has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
tkuchiki has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby-lang
davispuh has quit [Remote host closed the connection]
dhjondoh has quit [Remote host closed the connection]
tkuchiki_ has joined #ruby-lang
Averna has quit [Quit: Leaving.]
tkuchiki has quit [Read error: Connection reset by peer]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fedexo has quit [Ping timeout: 245 seconds]
riotjones has joined #ruby-lang
dhjondoh has joined #ruby-lang
tkuchiki has joined #ruby-lang
doppler has joined #ruby-lang
tkuchiki_ has quit [Read error: Connection reset by peer]
<doppler>
hey, i'm new to Ruby and was hoping you guys could shed some light. ive created this script (a simple calculator). it splits the user input into an array and bla bla bla. its probably a dumb question, but could someone please explain as to why i dont need to define the array before "gets.chomp.split". heres the source: https://gist.github.com/anonymous/029ce03a604887665849
<doppler>
oh dear god. actually, that was a stupid question. the array was already defined as "str". shoot.... :P
<doppler>
if you guys (and gals?) could ignore my almost idiotic question, that'd be greaaaaat. =)
<doppler>
any improvements to the code is much appreciated though
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tsujp has joined #ruby-lang
lytol has joined #ruby-lang
<alxndr>
doppler: check out exercism.io, it has a bunch of exercises in the form of ruby (and other languages) test specs which you can practice on, and a community of folks to help refactor and discuss each other's code
kfpratt has quit []
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
hahuang65 has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
hahuang65 has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
solars has joined #ruby-lang
RobertBirnie has joined #ruby-lang
SylarRuby has joined #ruby-lang
hahuang65 has quit [Ping timeout: 245 seconds]
kerunaru has joined #ruby-lang
RobertBirnie has quit [Client Quit]
Asher has quit [Quit: Leaving.]
Asher has joined #ruby-lang
Asher is now known as Guest40258
Guest40258 has quit [Client Quit]
aghalarp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
djellemah_ has joined #ruby-lang
yfeldblu_ has quit [Ping timeout: 246 seconds]
nedp has quit [Remote host closed the connection]
nedp has joined #ruby-lang
djellemah has quit [Ping timeout: 246 seconds]
nedp has quit [Remote host closed the connection]
x44x45x41x4E has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nedp has joined #ruby-lang
zeroasterix has left #ruby-lang ["Leaving"]
hahuang65 has joined #ruby-lang
chinmay_dd has joined #ruby-lang
fujimura has quit [Remote host closed the connection]
mattyohe has quit [Quit: Connection closed for inactivity]
bruno- has joined #ruby-lang
hahuang65 has quit [Ping timeout: 245 seconds]
Mark-6ma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fujimura has joined #ruby-lang
bruno- has quit [Ping timeout: 255 seconds]
Mark-6ma has joined #ruby-lang
Torrieri has joined #ruby-lang
Torrieri has joined #ruby-lang
djbkd has quit []
stan has joined #ruby-lang
Torrieri has quit [Quit: Be back later ...]
djellemah_ is now known as djellemah
arBmind has quit [Quit: Leaving.]
chussenot has joined #ruby-lang
chussenot has quit [Client Quit]
Mark-6ma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
|jemc| has quit [Ping timeout: 252 seconds]
fujimura has quit [Remote host closed the connection]
cornerma1 has joined #ruby-lang
cornerman has quit [Ping timeout: 264 seconds]
cornerma1 is now known as cornerman
ur5us has quit [Remote host closed the connection]
lytol has quit [Remote host closed the connection]
Mark-6ma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pico-pete has quit [Ping timeout: 252 seconds]
pico-pete has joined #ruby-lang
kerunaru has joined #ruby-lang
djbkd has joined #ruby-lang
Mark-6ma has joined #ruby-lang
<yorickpeterse>
For somebody who's supposed to do Ruby I write an awful lot of Javascript lately
<yorickpeterse>
now if only this language wasn't so retarded
<workmad3>
yorickpeterse: heh :) I know that feeling
djbkd has quit [Ping timeout: 252 seconds]
<yorickpeterse>
stupid JS libraries are all asynchronous, and I actually need them to be synchronous for PhantomJS
<yorickpeterse>
and sadly just overwriting setTimeout seems to cause hell to erupt
<yorickpeterse>
Although I do appreciate Chromium's debugging/perf tools
<yorickpeterse>
beats any existing Ruby tools by a mile
Mark-6ma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<workmad3>
yeah chrome/chromium developer tools is a pretty awesome setup
<universaL>
yorickpeterse: why do you need them to be synchronous for phantomjs?
<workmad3>
and it's nice that you can extend it too (recently got around to install Rails Panel, so I can now pull a bunch of rails info into dev tools :) )
<workmad3>
*installing
<yorickpeterse>
universaL: this particular app uses Phantom to render HTML, which uses some JS to build SVG based graphs
<yorickpeterse>
I need Phantom to wait with exiting until the graphs are all there
<yorickpeterse>
But since it's done in an asynchronous manner Phantom can't know (out of the box) when that is
<universaL>
yorickpeterse: i see :-) maybe look at how capybara/poltergeist does it
<yorickpeterse>
So what happens is that _sometimes_ your output doesn't show any graphs
ArchRogem has joined #ruby-lang
<yorickpeterse>
universaL: most just use setTimeout(..., 5000)
<yorickpeterse>
which is disgusting
<workmad3>
yorickpeterse: oh, bleh... but you can ask Phantom if certain elements exist, yes?
<yorickpeterse>
workmad3: the list of elements can be infinite
<yorickpeterse>
Right now I'm hacking in sort of a counter and have phantom wait until it reaches 0, not sure yet if this is going to work for larger outputs
<universaL>
hmm, why not have a status attribute on the body tag, and check if it's set? if not wait for another second and check again? ;)
<workmad3>
yorickpeterse: well, I was thinking more that you're likely to have a finite set of container elements knowable in-advance... or the ability to insert a hidden div with a specific ID at the end of a chain
<yorickpeterse>
universaL: that's effectively the same
<yorickpeterse>
workmad3: No, the phantom code itself doesn't really know anything about what it's rendering
<universaL>
somewhat yeah, but soudns simpler ;)
<workmad3>
yorickpeterse: or maybe even the ability to insert a phantomjs based callback into the end of the pipe so it only gets called when stuff is ready
<yorickpeterse>
it just knows it's rendering something
<workmad3>
yorickpeterse: you can inspect the HTML using CSS and xpath selectors (otherwise capybara couldn't use a phantomjs driver)
<yorickpeterse>
As in, this is literally all Phantom itself does:
<yorickpeterse>
workmad3: I know that, but having Phantom watch dozens of elements isn't very convenient either
<yorickpeterse>
and the presence of a certain element doesn't mean it's completely finished
<yorickpeterse>
e.g. I could check the outer most <svg> element of a graph, but that one is inserted first so there still would not be a guarantee everything was finished by the time Phantom exits
<workmad3>
yorickpeterse: ah, I'm suggesting that the page itself should be modified to emit a particular element when it's finished
<workmad3>
yorickpeterse: not that you can do the detection entirely from the outside without modifying (slightly) the page behaviour
<yorickpeterse>
That's basically what I have now but using a counter
<yorickpeterse>
which means I don't have to abuse the DOM
<yorickpeterse>
testing this is a bit of a PITA because this particular chunk of HTML takes a few minutes to render
fujimura_ has quit [Remote host closed the connection]
tkuchiki_ has quit [Remote host closed the connection]
AlexAltea has joined #ruby-lang
tkuchiki has joined #ruby-lang
LMity has joined #ruby-lang
fujimura has joined #ruby-lang
hahuang65 has joined #ruby-lang
nedp has quit [Ping timeout: 244 seconds]
fujimura_ has joined #ruby-lang
bruno- has joined #ruby-lang
fujimura has quit [Ping timeout: 276 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
haraoka_ has quit [Ping timeout: 240 seconds]
bruno- has quit [Ping timeout: 248 seconds]
skade has joined #ruby-lang
yfeldblum has quit [Ping timeout: 245 seconds]
Lloyd has quit [Quit: Bye]
elia has joined #ruby-lang
Lloyd has joined #ruby-lang
Lloyd is now known as Lloyd
LMity has quit [Ping timeout: 250 seconds]
Vivex has joined #ruby-lang
hendranata_ has quit [Ping timeout: 244 seconds]
nedp has joined #ruby-lang
Bertg has quit [Remote host closed the connection]
Bertg has joined #ruby-lang
brushbox has quit [Ping timeout: 248 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mathie has quit [Quit: Quitting...]
mathie has joined #ruby-lang
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fujimura has joined #ruby-lang
fujimura_ has quit [Ping timeout: 252 seconds]
fujimura has quit [Read error: No route to host]
fujimura has joined #ruby-lang
<doppler>
if anyone got an idea, let me know. im practicing ruby by playing around with a calculator. i understand how to handle input and split the array and how to do case-when statements. ive been able to get the script to calculate stuff like 3 * 4. but now i want my calculator to also be able to calculate something like: 3 * 4 / 3. but i cant get my head around this one. https://gist.github.com/d0ppler/f7ab7df326aae21e4f21
stef204 has joined #ruby-lang
solars has quit [Ping timeout: 252 seconds]
jefus__ has joined #ruby-lang
jefus_ has quit [Ping timeout: 276 seconds]
symm- has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
Sgeo_ has joined #ruby-lang
Sgeo has quit [Ping timeout: 250 seconds]
tkuchiki has quit [Ping timeout: 264 seconds]
tosbourn has joined #ruby-lang
gix has quit [Ping timeout: 276 seconds]
arBmind has left #ruby-lang [#ruby-lang]
hahuang65 has joined #ruby-lang
adude has joined #ruby-lang
tosbourn has quit [Ping timeout: 244 seconds]
gix has joined #ruby-lang
hahuang65 has quit [Ping timeout: 264 seconds]
gwendall has joined #ruby-lang
fujimura has quit [Ping timeout: 272 seconds]
ldnunes has joined #ruby-lang
<jhass>
doppler: do you know reverse polish notation?
<darix>
yorickpeterse: saw the new cloudflare blog post?
dellavg_ has joined #ruby-lang
b_hoffman has joined #ruby-lang
smeriwether has quit [Client Quit]
rcvalle has quit [Quit: rcvalle]
<yorickpeterse>
Yeah, skimmed through it
rcvalle has joined #ruby-lang
gwendall has quit [Ping timeout: 272 seconds]
djbkd has quit [Remote host closed the connection]
chouhoulis has joined #ruby-lang
Bertg has joined #ruby-lang
riotjones has quit [Ping timeout: 252 seconds]
cartothemax has quit [Remote host closed the connection]
joshs has quit [Remote host closed the connection]
joaomdmoura has quit [Remote host closed the connection]
sankaber has quit [Ping timeout: 264 seconds]
djbkd has joined #ruby-lang
rcvalle has quit [Quit: rcvalle]
rcvalle has joined #ruby-lang
baweaver has joined #ruby-lang
momomomomo has joined #ruby-lang
chinmay_dd has quit [Remote host closed the connection]
sgharms has joined #ruby-lang
<sgharms>
Hey people. Does ruby support #try on Object yet?
<sgharms>
srry wrong window
sgharms has quit [Client Quit]
<jhass>
I truly wonder what the right window would've been
<apeiros>
that one to the left of #ruby-lang
<jhass>
heh
joaomdmoura has joined #ruby-lang
yfeldblum has joined #ruby-lang
lz1irq has joined #ruby-lang
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cartothemax has joined #ruby-lang
kfpratt has quit [Read error: Connection reset by peer]
A124 has joined #ruby-lang
kfpratt has joined #ruby-lang
<lz1irq>
Hi. I have a very stupid question with regular expressions that I can't figure out. I have a script that matches strings like "a:b" (gives me a and b), but when I try to make it parse "a->b" it doesn't work. The regexp is "/(?<name>\w+):(?<type>\w+)/". Why doesn't it work when I replace the : with -> ?
baweaver has quit [Remote host closed the connection]
CaptainCibai has quit [Remote host closed the connection]
Boondox has quit []
pullphinger has quit []
dagda1 has quit [Read error: Connection reset by peer]
phrozen77 has quit [Ping timeout: 252 seconds]
dagda1 has joined #ruby-lang
cengizIO has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
phrozen77 has joined #ruby-lang
setanta_ has quit [Quit: Leaving]
RobertBirnie has joined #ruby-lang
gix has quit [Ping timeout: 244 seconds]
|jemc| has joined #ruby-lang
riotjones has joined #ruby-lang
yfeldblum has joined #ruby-lang
momomomomo has joined #ruby-lang
robbyoconnor has quit [Read error: Connection reset by peer]
CaptainCibai has joined #ruby-lang
gix has joined #ruby-lang
riotjones has quit [Ping timeout: 265 seconds]
|jemc| has quit [Ping timeout: 245 seconds]
havenwood has joined #ruby-lang
joaomdmoura has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
ianseyer has joined #ruby-lang
<ianseyer>
hi all. can i get some information how to use 'pass' in ruby? i've tried to google in all sorts of ways, but pass happens to be a very common word in the vernacular...
<jhass>
"Pass control to the next matching route. If there are no more matching routes, Sinatra will return a 404 response."
<ianseyer>
well i'll be damned
<ianseyer>
never heard of omniref
<ianseyer>
thank you sir
baweaver has joined #ruby-lang
<jhass>
yw
<jhass>
btw symbolhound.com if you ever need to search for ||=
wallerdev has joined #ruby-lang
wallerdev has quit [Client Quit]
cengizIO has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nathanstitt has quit [Ping timeout: 250 seconds]
<ianseyer>
jhass: haha, thanks
|jemc| has joined #ruby-lang
elia has joined #ruby-lang
wallerdev has joined #ruby-lang
alessandro has joined #ruby-lang
joaomdmoura has joined #ruby-lang
baweaver has quit [Remote host closed the connection]
cartothemax has joined #ruby-lang
<alessandro>
Hi there, i have a small code: http://dpaste.com/3A7456M, and in shell when I call ruby name_file.rb name_file.txt, the result is: reading.rb:3:in `initialize': No such file or directory - reading_demo.txt (Errno::ENOENT)
<alessandro>
from reading.rb:3:in `open'
<alessandro>
from reading.rb:3:in `<main>'
cartothemax has quit [Client Quit]
<alessandro>
any ideas are..welcome, thanks guyz
LMity has joined #ruby-lang
enebo has quit [Quit: enebo]
<jhass>
"reading.demo.txt" does not exist in the current directory
<jhass>
just read the error message like english
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
also always use the block form of open or helper methods such as File.read and File.write
<alessandro>
i am stupid!
<alessandro>
i haven't created reading_demo.txt before
<alessandro>
thanks jhass
<jhass>
yw
malconis has quit [Ping timeout: 256 seconds]
LMity has quit [Ping timeout: 244 seconds]
ianseyer has quit [Ping timeout: 265 seconds]
momomomomo_ has joined #ruby-lang
lytol has quit [Remote host closed the connection]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]