apeiros_ changed the topic of #ruby-lang to: Ruby 2.1.2; 2.0.0-p481; 1.9.3-p545: http://ruby-lang.org || Paste >3 lines of text on http://gist.github.com
sepp2k1 has joined #ruby-lang
yubrew has joined #ruby-lang
djbkd has quit [Ping timeout: 264 seconds]
sepp2k has quit [Ping timeout: 245 seconds]
micalexander has quit [Remote host closed the connection]
micalexander has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
yubrew has quit [Ping timeout: 264 seconds]
bantic has joined #ruby-lang
yfeldblum has quit [Quit: Leaving...]
NemesisD has left #ruby-lang ["WeeChat 0.4.3"]
yfeldblum has joined #ruby-lang
micalexander has quit [Ping timeout: 264 seconds]
|jemc| has joined #ruby-lang
_djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
lewix has joined #ruby-lang
lewix has joined #ruby-lang
nathanstitt has joined #ruby-lang
chouhoulis has joined #ruby-lang
jfarmer has quit [Quit: Computer has gone to sleep.]
toastynerd has quit [Remote host closed the connection]
cstrahan has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
jfarmer has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
ddv has quit [Ping timeout: 245 seconds]
alexju has joined #ruby-lang
nathanstitt has joined #ruby-lang
ddv has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby-lang
lewix has quit [Ping timeout: 245 seconds]
bantic has quit [Quit: bantic]
skade has quit [Quit: Computer has gone to sleep.]
<zenspider> anyone currently having problems with rubygems installs atm?
<zenspider> did the API and/or DNS services for rubygems just go down? I'm hanging installs on the call to v1/dependencies but --debug hints it might be timeouts on dns
spastorino has quit [Quit: Connection closed for inactivity]
sepp2k1 has quit [Read error: Connection reset by peer]
benlovell has quit [Ping timeout: 244 seconds]
t_3212 has quit [Ping timeout: 264 seconds]
benlovell has joined #ruby-lang
Averna has joined #ruby-lang
stardiviner has joined #ruby-lang
lewix has joined #ruby-lang
cored has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
CaptainJet has quit [Ping timeout: 255 seconds]
pixelhandler has quit [Quit: pixelhandler]
marr has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 244 seconds]
mistym has quit [Remote host closed the connection]
CodeBunny has quit [Ping timeout: 245 seconds]
diegoviola has joined #ruby-lang
yubrew has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
francisfish has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
benlovell has quit [Ping timeout: 244 seconds]
francisfish has quit [Ping timeout: 240 seconds]
znz_jp has quit [Quit: kill -QUIT $$]
znz_jp has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
lewix has quit [Ping timeout: 255 seconds]
hahuang65 has quit [Ping timeout: 245 seconds]
RobertBirnie has quit [Quit: Textual IRC Client: www.textualapp.com]
jfarmer has quit [Quit: Textual IRC Client: www.textualapp.com]
tkuchiki has joined #ruby-lang
saarinen has quit [Quit: saarinen]
surrounder has quit [Ping timeout: 240 seconds]
spuk_ has joined #ruby-lang
kaihara has joined #ruby-lang
spuk has quit [Ping timeout: 240 seconds]
nathanstitt has joined #ruby-lang
nathanstitt has quit [Client Quit]
danijoo has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby-lang
danijoo has joined #ruby-lang
_djbkd has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby-lang
djbkd has quit [Ping timeout: 240 seconds]
kaihara has left #ruby-lang ["Leaving..."]
mistym has joined #ruby-lang
shinnya has joined #ruby-lang
MikaAK1 has joined #ruby-lang
surrounder has joined #ruby-lang
chouhoulis has joined #ruby-lang
benlovell has joined #ruby-lang
cored has quit [Ping timeout: 245 seconds]
chouhoulis has quit [Ping timeout: 244 seconds]
jsullivandigs has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
CaptainJet has joined #ruby-lang
jarto has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
benlovell has quit [Ping timeout: 244 seconds]
kinesis has quit [Remote host closed the connection]
x0f has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
x0f has joined #ruby-lang
_djbkd has quit [Remote host closed the connection]
Neurexin has left #ruby-lang [#ruby-lang]
x0f has quit [Ping timeout: 245 seconds]
x0f has joined #ruby-lang
knu has quit [Ping timeout: 244 seconds]
btiefert has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
benlovell has joined #ruby-lang
lewix has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
Neurexin has joined #ruby-lang
tjcravey has quit [Quit: Textual IRC Client: www.textualapp.com]
benlovell has quit [Ping timeout: 244 seconds]
kyb3r_ has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
dorei has quit []
shinnya has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby-lang
x0f has quit [Ping timeout: 255 seconds]
x0f has joined #ruby-lang
gix has quit [Ping timeout: 240 seconds]
gix has joined #ruby-lang
yubrew has joined #ruby-lang
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yubrew has quit [Ping timeout: 264 seconds]
ari-_-e has quit [Ping timeout: 272 seconds]
ari-_-e has joined #ruby-lang
naquad has quit [Ping timeout: 240 seconds]
MindfulMonk has quit [Ping timeout: 260 seconds]
surrounder has quit [Ping timeout: 255 seconds]
naquad has joined #ruby-lang
francisfish has joined #ruby-lang
yeltzooo has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby-lang
yeltzooo has joined #ruby-lang
MindfulMonk has joined #ruby-lang
francisfish has quit [Ping timeout: 272 seconds]
duderonomy has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
jarto has joined #ruby-lang
djbkd has quit [Ping timeout: 272 seconds]
surrounder has joined #ruby-lang
ascarter has joined #ruby-lang
Mon_Ouie has quit [Quit: WeeChat 0.4.3]
Cakey has quit [Ping timeout: 245 seconds]
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
yfeldblum has quit [Remote host closed the connection]
thmzlt has quit []
Aleeious has joined #ruby-lang
<Aleeious> hey guys php user here
yfeldblum has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Aleeious> anyone home? :(
benlovell has joined #ruby-lang
<Aleeious> ok guess all 323 of you are afk, no problem
cstrahan has quit [Ping timeout: 240 seconds]
cstrahan has joined #ruby-lang
symm- has quit [Ping timeout: 245 seconds]
mndoci has joined #ruby-lang
x0f has quit [Ping timeout: 244 seconds]
hinbody has joined #ruby-lang
x0f has joined #ruby-lang
lewix has quit [Remote host closed the connection]
lewix has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 0.4.3]
|jemc| has joined #ruby-lang
djbkd has joined #ruby-lang
lewix has quit [Ping timeout: 240 seconds]
ari-_-e has quit [Ping timeout: 245 seconds]
ari-_-e has joined #ruby-lang
hahuang65 has quit [Ping timeout: 264 seconds]
hahuang65 has joined #ruby-lang
yfeldblum has quit [Ping timeout: 252 seconds]
jarto has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<pipework> Aleeious: Just ask your question (no, I don't do PHP.)
<Aleeious> sorry was expecting everyone to help all at once :P
<pipework> Aleeious: You confuse IRC with mechanical turk.
mistym has quit [Remote host closed the connection]
<Aleeious> mechanical turk?
knu has joined #ruby-lang
<xybre> Except mechanical turk ain't free.
Xney has joined #ruby-lang
<Aleeious> oops sorry, i want to know if i can use a simple templating engine i create instead of ruby on rails
<whitequark> /join #rubyonrails
majjoha has joined #ruby-lang
<Aleeious> but i don't want to use ruby on rails :)
<whitequark> oh, instead, not in
jsullivandigs has joined #ruby-lang
<Aleeious> ?
MikaAK1 has quit [Ping timeout: 245 seconds]
yubrew has joined #ruby-lang
x0f has quit [Ping timeout: 240 seconds]
yubrew has quit [Ping timeout: 255 seconds]
x0f has joined #ruby-lang
Aleeious has left #ruby-lang [#ruby-lang]
dsaint-pierre has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
lewix has joined #ruby-lang
toastynerd has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
knu has quit [Ping timeout: 255 seconds]
francisfish has joined #ruby-lang
Miphix has joined #ruby-lang
knu has joined #ruby-lang
francisfish has quit [Ping timeout: 244 seconds]
robbyoconnor has quit [Ping timeout: 272 seconds]
mndoci_ has joined #ruby-lang
robbyoconnor has joined #ruby-lang
mndoci has quit [Ping timeout: 240 seconds]
knu has quit [Ping timeout: 272 seconds]
benlovell has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
mistym has joined #ruby-lang
toastynerd has joined #ruby-lang
__butch__ has joined #ruby-lang
skade has joined #ruby-lang
__butch__ has quit [Client Quit]
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
cstrahan has quit [Ping timeout: 255 seconds]
<xybre> I was gone so long they left!
<xybre> But the answer of course is "yes, you can do whatever you want"
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
|jemc| has quit [Quit: WeeChat 0.4.3]
_ht has joined #ruby-lang
jsullivandigs has joined #ruby-lang
saarinen has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
heftig has quit [Quit: Quitting]
danijoo has quit [Read error: Connection reset by peer]
rahul_j has joined #ruby-lang
danijoo has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
skade has joined #ruby-lang
charliesome has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
[spoiler] has joined #ruby-lang
apeiros has quit [Ping timeout: 240 seconds]
benlovell has quit [Ping timeout: 244 seconds]
saarinen has quit [Quit: saarinen]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
rahul_j has quit [Ping timeout: 240 seconds]
rahul_j has joined #ruby-lang
saarinen has joined #ruby-lang
CaptainJet has quit []
dsaint-pierre has joined #ruby-lang
<igalic> Does anyone know of a gem that parses the apache httpd.conf format? The only thing I can find is the unfinished https://github.com/vleis/apacheconf-parser
yubrew has joined #ruby-lang
ur5us has quit [Ping timeout: 245 seconds]
krasnus has joined #ruby-lang
lewix has quit [Ping timeout: 240 seconds]
yubrew has quit [Ping timeout: 255 seconds]
kwd has joined #ruby-lang
JohnBat26 has joined #ruby-lang
benlovell has joined #ruby-lang
arBmind has joined #ruby-lang
tbuehlmann has joined #ruby-lang
benlovell has quit [Ping timeout: 255 seconds]
apeiros has joined #ruby-lang
lewix has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
wow has joined #ruby-lang
wow is now known as wowXD
x0f has quit [Ping timeout: 240 seconds]
lewix has quit [Remote host closed the connection]
x0f has joined #ruby-lang
lewix has joined #ruby-lang
lewix has quit [Ping timeout: 245 seconds]
nofxx has quit [Remote host closed the connection]
Lumio has joined #ruby-lang
francisfish has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
francisfish has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby-lang
francisfish has joined #ruby-lang
Coincidental has joined #ruby-lang
mistym has quit [Remote host closed the connection]
dm78 has quit [Remote host closed the connection]
mistym has joined #ruby-lang
havenwood has joined #ruby-lang
hannes___ has joined #ruby-lang
yubrew has joined #ruby-lang
mistym has quit [Ping timeout: 272 seconds]
havenwood has quit [Ping timeout: 264 seconds]
hannes___ has left #ruby-lang [#ruby-lang]
yubrew has quit [Ping timeout: 240 seconds]
maloik has joined #ruby-lang
<maloik> I totally messed up my irssi
AKASkip has joined #ruby-lang
solars has joined #ruby-lang
wowXD has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
lolmaus has quit [Remote host closed the connection]
fumduq has quit [Ping timeout: 245 seconds]
djbkd has quit [Remote host closed the connection]
fumduq has joined #ruby-lang
lolmaus has joined #ruby-lang
havenwood has joined #ruby-lang
qba73 has joined #ruby-lang
dm78 has joined #ruby-lang
mehlah has joined #ruby-lang
dm78 has quit [Ping timeout: 264 seconds]
amerine_ has joined #ruby-lang
ur5us has joined #ruby-lang
havenwood has quit [Ping timeout: 264 seconds]
amerine has quit [Ping timeout: 272 seconds]
alexju has quit [Remote host closed the connection]
mndoci_ has quit [Remote host closed the connection]
skade has joined #ruby-lang
mndoci has joined #ruby-lang
mndoci has quit [Ping timeout: 240 seconds]
jhass|off is now known as jhass
kgrz has quit []
arBmind has quit [Quit: Leaving.]
<igalic> I take that as "maybe"
yubrew has joined #ruby-lang
amerine has joined #ruby-lang
mikecmpbll has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
amerine_ has quit [Ping timeout: 240 seconds]
yubrew has quit [Ping timeout: 264 seconds]
dsaint-pierre has quit [Ping timeout: 272 seconds]
dsaint-pierre has joined #ruby-lang
rahul_j has joined #ruby-lang
arBmind has joined #ruby-lang
<yorickpeterse> morning
ironhide_604 has joined #ruby-lang
cnivolle has joined #ruby-lang
Coincidental has quit [Remote host closed the connection]
kek has joined #ruby-lang
francisfish has joined #ruby-lang
dnewkerk-keyz has quit [Quit: dnewkerk-keyz]
elia has joined #ruby-lang
francisfish has quit [Ping timeout: 244 seconds]
michd is now known as MichD
francisfish has joined #ruby-lang
dm78 has joined #ruby-lang
dsaint-pierre has quit [Remote host closed the connection]
Miphix has quit [Remote host closed the connection]
Miphix has joined #ruby-lang
dm78 has quit [Ping timeout: 240 seconds]
diegoviola has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby-lang
fjfish has joined #ruby-lang
francisfish has quit [Ping timeout: 244 seconds]
marr has joined #ruby-lang
workmad3 has joined #ruby-lang
Averna has quit [Quit: Leaving.]
kek_ has joined #ruby-lang
yubrew has joined #ruby-lang
cnivolle_ has joined #ruby-lang
kek has quit [Ping timeout: 264 seconds]
yubrew has quit [Ping timeout: 244 seconds]
knu has joined #ruby-lang
cnivolle has quit [Ping timeout: 240 seconds]
elia has quit [Quit: Computer has gone to sleep.]
Lumio has quit [Quit: Lumio]
kylo has quit [Ping timeout: 264 seconds]
elia has joined #ruby-lang
allomov has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
dsaint-pierre has joined #ruby-lang
allomov has joined #ruby-lang
kylo has joined #ruby-lang
kek_ has quit [Remote host closed the connection]
dsaint-pierre has quit [Ping timeout: 245 seconds]
relix has joined #ruby-lang
danijoo has quit [Quit: Leaving...]
danijoo has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
Cakey has quit [Ping timeout: 264 seconds]
Fushi has joined #ruby-lang
knu has quit [Ping timeout: 240 seconds]
zarubin has quit []
havenwood has joined #ruby-lang
stamina has joined #ruby-lang
havenwood has quit [Ping timeout: 264 seconds]
rahul_j has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
kek has joined #ruby-lang
kek has quit [Remote host closed the connection]
kek has joined #ruby-lang
havenwood has joined #ruby-lang
dm78 has joined #ruby-lang
marr has quit [Ping timeout: 244 seconds]
dm78 has quit [Ping timeout: 240 seconds]
x0f has quit [Ping timeout: 240 seconds]
x0f has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
havenwood has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 244 seconds]
elia has quit [Quit: Computer has gone to sleep.]
Mon_Ouie has quit [Quit: WeeChat 0.4.3]
elia has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
dsaint-pierre has quit [Ping timeout: 255 seconds]
havenwood has joined #ruby-lang
stamina has quit [Quit: WeeChat 0.4.3]
sarkyniin has joined #ruby-lang
havenwood has quit [Ping timeout: 264 seconds]
<ljarvis> moin
allomov has quit [Remote host closed the connection]
allomov_ has joined #ruby-lang
postmodern has quit [Quit: Leaving]
allomov_ has quit [Remote host closed the connection]
dm78 has joined #ruby-lang
marr has joined #ruby-lang
ironhide_604 has quit [Quit: ironhide_604]
x0f has quit [Ping timeout: 264 seconds]
dm78 has quit [Ping timeout: 255 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x0f has joined #ruby-lang
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 244 seconds]
tbuehlmann has quit [Remote host closed the connection]
symm- has joined #ruby-lang
allomov has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
roelof has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
<roelof> Suppose I have a splath like this *names. How can I take the contents of *names one by one. names.each did not do the job
<jhass> roelof: more context
<yorickpeterse> >> def foo(*names); names; end; foo(10, 20, 30)
<eval-in> yorickpeterse => [10, 20, 30] (https://eval.in/166330)
<yorickpeterse> >> def foo(*names); names; end; foo([10, 20, 30])
<eval-in> yorickpeterse => [[10, 20, 30]] (https://eval.in/166331)
<yorickpeterse> ^ note the diff
<yorickpeterse> So if you use a splat, make sure you pass in arguments separately
dsaint-pierre has quit [Ping timeout: 245 seconds]
<roelof> yorickpeterse: and that what I struggeling with
<yorickpeterse> What exactly?
knu has joined #ruby-lang
<matti> Splat all the things.
* matti splats yorickpeterse
<yorickpeterse> []
<roelof> I have to calculate the costs of a order which is a splat . and the costs are this : if the order is {:rice => 1, :noodles => 1}, and the menu is {:rice => 3, :noodles => 2}, then the cost is 5.
<roelof> and there can be more then 1 order
<yorickpeterse> roelof: could you pastie a simple example?
<roelof> pff. then I have to make one up
<yorickpeterse> well right now your case doesn't make much sense
<roelof> oke, lets says this. I still have to calculate the costs of a order and the order exist of this [rice, noodles, rice]
<roelof> yorickpeterse: it's a exercise of ruby monkey
<yorickpeterse> I have no idea what ruby monkey is
<roelof> yorickpeterse: a site where you can learn ruby by doing exercises
<maloik> gist the exercise?
<maloik> I'm not exactly following either
<maloik> (not that I read all of the previous conversation)
<roelof> here is the exercise : http://pastebin.com/yPLrVKTe
<roelof> and I see now one error I make the price is in the arrray
<yorickpeterse> roelof: is there a requirement for using a splat?
<yorickpeterse> That is, order({:rice => 1, :noodles => 1}, {:rice => 2, :noodles => 2}) vs order([{:rice => 1, ...}, ...])
<roelof> yorickpeterse: the exercise starts like this ; http://pastebin.com/sFdtBxsi
<yorickpeterse> Ah right
<yorickpeterse> Ok, so in that case `orders` is always an Array
<yorickpeterse> either empty or with multiple Hash objects in it
<yorickpeterse> For example
ur5us has quit [Remote host closed the connection]
<yorickpeterse> >> def cost(*orders); orders; end; cost({:a => 1, :b => 2})
<eval-in> yorickpeterse => [{:a=>1, :b=>2}] (https://eval.in/166339)
<roelof> and I have to compare it with the menu array so I know what price a item has
<yorickpeterse> >> def cost(*orders); orders; end; cost({:a => 1, :b => 2}, {:a => 2})
<eval-in> yorickpeterse => [{:a=>1, :b=>2}, {:a=>2}] (https://eval.in/166340)
<yorickpeterse> So what you'd do is iterate on `orders` and for each value compare it with the menu
<yorickpeterse> The resulting costs would be written to a new Hash I suppose
<yorickpeterse> So as a starting point...
<roelof> and iterate I can do with .each ??
<yorickpeterse> Note that if the return value should be a number you don't have to use a hash for `costs`
<yorickpeterse> You can just use a number and increment it
<yorickpeterse> (= sum the costs as a whole instead of per "thing" ordered)
<yorickpeterse> Ah, it should return a number
<yorickpeterse> sec
<roelof> yorickpeterse: oke, then yesterday I started a the very wrong patch
<roelof> patch = path
<roelof> yorickpeterse: thanks for pointing me at the right path
<yorickpeterse> np
dm78 has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
yubrew has joined #ruby-lang
skammer has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
rahul_j has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
dm78 has quit [Ping timeout: 244 seconds]
Cakey has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
jgpawletko has quit [Quit: jgpawletko]
jgpawletko has joined #ruby-lang
jgpawletko has quit [Client Quit]
majjoha has quit [Ping timeout: 272 seconds]
rahul_j has quit [Ping timeout: 240 seconds]
rahul_j has joined #ruby-lang
elia has joined #ruby-lang
roelof has quit [Quit: Page closed]
skade has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
ascarter has joined #ruby-lang
havenwood has joined #ruby-lang
elia has joined #ruby-lang
havenwood has quit [Ping timeout: 264 seconds]
<solars> hey, how can I write something like this: arr.push mymethod rescue ''?
yfeldblum has joined #ruby-lang
<solars> it won't work as push is not called here, but I cannot put the rescue in brackets it seems
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Lumio has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
<yorickpeterse> solars: what exactly are you trying to rescue?
<yorickpeterse> Also, it's better to check beforehand if you can push in the first place, instead of just swallowing the error
dsaint-pierre has joined #ruby-lang
<solars> yorickpeterse, it's just a quick little script, an exception can occur inside the method called, and in that case I'd like to just push '' or nil
yfeldblum has quit [Ping timeout: 240 seconds]
<yorickpeterse> arr.push(X) rescue arr.push(nil)
<solars> ok that was obvious :) haha
<solars> thanks
yfeldblu_ has quit [Ping timeout: 244 seconds]
jgpawletko has joined #ruby-lang
dsaint-pierre has quit [Ping timeout: 244 seconds]
rahul_j has quit [Quit: rahul_j]
skammer has quit [Quit: Textual IRC Client: www.textualapp.com]
ldnunes has joined #ruby-lang
jgpawletko has quit [Quit: jgpawletko]
jgpawletko has joined #ruby-lang
allomov has quit [Remote host closed the connection]
relix has joined #ruby-lang
yubrew has joined #ruby-lang
tkuchiki_ has joined #ruby-lang
diegoviola has joined #ruby-lang
egrep has joined #ruby-lang
<egrep> Anybody have any idea why ruby gives me this error? `require': cannot load such file -- OpenSSL (LoadError)
allomov has joined #ruby-lang
<apeiros> because it can't load a file named 'OpenSSL'. you probably want openssl instead.
<egrep> Yes indeed I do. ._. I can be stupid sometimes.
<egrep> Thanks, apeiros.
egrep has left #ruby-lang ["adios, with gratitudes"]
tkuchiki has quit [Ping timeout: 240 seconds]
yubrew has quit [Ping timeout: 244 seconds]
tkuchiki_ has quit [Ping timeout: 245 seconds]
dm78 has joined #ruby-lang
diegovio1 has joined #ruby-lang
diegoviola is now known as Guest32933
diegovio1 is now known as diegoviola
Guest32933 has quit [Ping timeout: 272 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fjfish has quit [Remote host closed the connection]
dm78 has quit [Ping timeout: 264 seconds]
Cakey has quit [Ping timeout: 245 seconds]
relix has joined #ruby-lang
jeffs_ has joined #ruby-lang
francisfish has joined #ruby-lang
skam_ has joined #ruby-lang
lolmaus has quit [Ping timeout: 245 seconds]
cnivolle_ has quit [Ping timeout: 260 seconds]
lolmaus has joined #ruby-lang
lewix has joined #ruby-lang
lewix has quit [Changing host]
lewix has joined #ruby-lang
cnivolle has joined #ruby-lang
tkuchiki has joined #ruby-lang
skam_ has quit [Ping timeout: 246 seconds]
francisfish has quit [Remote host closed the connection]
allomov has quit [Remote host closed the connection]
allomov has joined #ruby-lang
stamina has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
dwknoxy has joined #ruby-lang
elia has joined #ruby-lang
yfeldblum has joined #ruby-lang
lewix has quit [Ping timeout: 244 seconds]
dvorak has quit [Quit: leaving]
yfeldblum has quit [Ping timeout: 240 seconds]
Blaguvest has joined #ruby-lang
dvorak has joined #ruby-lang
vpretzel_ has quit [Remote host closed the connection]
centrx has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
vpretzel has joined #ruby-lang
dsaint-pierre has quit [Remote host closed the connection]
dsaint-pierre has joined #ruby-lang
GBrawl has joined #ruby-lang
cnivolle_ has joined #ruby-lang
diegoviola has quit [Remote host closed the connection]
lewix has joined #ruby-lang
cnivolle has quit [Ping timeout: 245 seconds]
lewix has quit [Client Quit]
diegoviola has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malconis has joined #ruby-lang
_zeedaniel has joined #ruby-lang
<_zeedaniel> hey hey!
<centrx> Ahoy
<_zeedaniel> how's it going?
<centrx> Rubytastic
<apeiros> swell
<_zeedaniel> nice!
<_zeedaniel> I love Rubytastic days.
<_zeedaniel> I'm working on a job queue system and decided to use Resque, but in order for us to be able to queue up jobs from several different applications, I wrote a basic app that just wraps Resque and offers an API with a couple of end-points.
<centrx> Impressive
<_zeedaniel> The fun part though is the gem I'm working on now, which is a light-weight DSL for creating workers.
<_zeedaniel> So, basically I want to be able to have a bunch of *.do files in a /workers/ directory.
<_zeedaniel> and then this gem parses them, creates the end points on the API AND creates a basic class with the appropiate methods for resque to use.
<_zeedaniel> I'm having fun with class_exec right now so the DB is available to the code in the blocks.
cnivolle has joined #ruby-lang
<_zeedaniel> It was driving me a little batty earlier, but I got it sorted out.
<apeiros> nice seeing a happy person for a change :D
<_zeedaniel> :-)
<_zeedaniel> happy is good
<_zeedaniel> in fact...
<_zeedaniel> Rubytastic!
<_zeedaniel> is best
dm78 has joined #ruby-lang
<_zeedaniel> so, i'm curious, i need some input from y'all
<_zeedaniel> variable assignment from if/case/etc
<_zeedaniel> my co-worker and i were arguing about this a couple weeks ago
cnivolle_ has quit [Ping timeout: 240 seconds]
<_zeedaniel> he thinks that assigning variables from if/case/etc and indenting the code becuase of the var name being at the left-most position makes it unreadable and he just hates it. i LOVE it
[spoiler] has quit [Remote host closed the connection]
<_zeedaniel> i love being able write a variable name once and know that whatever returns from the conditional or case statement or whatever, is going INTO that var.
charliesome has joined #ruby-lang
<_zeedaniel> does anyone else have an opinion on this?
<workmad3> _zeedaniel: I don't like using if/then/else like that... I'd prefer to use a ternary for assignment
<ddfreyne> _zeedaniel: Can you give an example of the two styles?
<workmad3> _zeedaniel: 'foo = some_conditional? ? if_true : if_false'
<_zeedaniel> well, if a ternary makes sense, then so be it
<_zeedaniel> k, hold on
<ddfreyne> _zeedaniel: In general, I try to stick to the default Rubocop config as much as possible
<ddfreyne> At work, rubocop is part of the automated test suite. Bad style = failed build
<workmad3> _zeedaniel: I find if it would be readable with a 'some_var = if foobar;...' then it's more readable with a ternary ;)
dm78 has quit [Ping timeout: 244 seconds]
nathanstitt has joined #ruby-lang
<_zeedaniel> well, if there's only an if and else, then ternary is fine. but in some cases there are more cases than that. which is moreso what i'm referring to
<workmad3> _zeedaniel: if there's more than that in the conditional, I don't find assigning from it appropriate, personally
<workmad3> _zeedaniel: and for the case statement, I just added a comment with my preference ;)
<_zeedaniel> bleh, okay
<_zeedaniel> :-)
<ddfreyne> _zeedaniel: I do not like the indent. It messes with the general program structure, and thus makes it hard to analyse the high-level view of the program.
<ddfreyne> (my two cents)
<_zeedaniel> that's really what his issue is too. he doesn't like the indent
<_zeedaniel> i can understand that too
<workmad3> _zeedaniel: end of the day though, what's most important with code style isn't selecting a 'perfect' one, it's *having* one and being consistent with it
<_zeedaniel> but, workmad3: in your example, you don't even need to set language since it's local anyhow and not used again, so you're in accomplishing the same thing as mine, but no indent since it's in the separate method :-)
<_zeedaniel> true
<workmad3> _zeedaniel: I just removed the setting from the method
<_zeedaniel> :-)
<ddfreyne> +1 for consistency
<workmad3> _zeedaniel: and it's not the same because it doesn't have weird indentation and separates the case from the indent ;)
<_zeedaniel> haha
<ddfreyne> I have changed my coding style to be more consistent with other people's style. I don't regret it.
<_zeedaniel> ya
<workmad3> _zeedaniel: your co-worker's preference also achieves the same result ;)
<_zeedaniel> that's what i think i've done most, when you work someplace, you need to make sure everyone else can vibe with the style, so it's just about being consistent
<workmad3> _zeedaniel: achieving the same result is, after all, the point of different styles of doing the same thing... :P
arBmind has quit [Quit: Leaving.]
<_zeedaniel> inddeed :-)
<workmad3> (sorry, just found it kinda amusing that you picked up 'it doesn the same thing' as a 'do it my way' argument in a style discussion ;) )
<workmad3> *does
<_zeedaniel> lol
<_zeedaniel> i'm flexible when it comes to the coding style, unless it's bad code :-)
<_zeedaniel> then i'll put my foot down, *bizaam*
<_zeedaniel> okay, time to make some more binary donuts :-)
<_zeedaniel> bbl
kek_ has joined #ruby-lang
kek_ has quit [Read error: Connection reset by peer]
momomomomo has joined #ruby-lang
kek_ has joined #ruby-lang
pglombardo has joined #ruby-lang
kek has quit [Ping timeout: 264 seconds]
spastorino has joined #ruby-lang
karamazov has joined #ruby-lang
GBrawl has quit [Quit: Computer has gone to sleep.]
bantic has joined #ruby-lang
enebo has joined #ruby-lang
ari-_-e has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby-lang
diegoviola has quit [Ping timeout: 264 seconds]
yubrew has joined #ruby-lang
chouhoulis has joined #ruby-lang
havenwood has joined #ruby-lang
vpretzel_ has joined #ruby-lang
yfeldblum has quit [Ping timeout: 244 seconds]
Squarepy has joined #ruby-lang
Squarepy has quit [Changing host]
Squarepy has joined #ruby-lang
ascarter has joined #ruby-lang
Squarepy has quit [Remote host closed the connection]
Squarepy has joined #ruby-lang
Squarepy has quit [Remote host closed the connection]
diegoviola has joined #ruby-lang
alexju has joined #ruby-lang
loincloth has joined #ruby-lang
Squarepy has joined #ruby-lang
vpretzel has quit [Ping timeout: 244 seconds]
mndoci has joined #ruby-lang
luiz_lha has joined #ruby-lang
skade has quit [Ping timeout: 245 seconds]
tbuehlmann has joined #ruby-lang
skade has joined #ruby-lang
AncientAmateur has joined #ruby-lang
karamazo_ has joined #ruby-lang
mndoci has quit [Remote host closed the connection]
cnivolle_ has joined #ruby-lang
mndoci has joined #ruby-lang
ari-_-e has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
karamazov has quit [Ping timeout: 240 seconds]
jhass is now known as jhass|off
cnivolle has quit [Ping timeout: 240 seconds]
karamazo_ is now known as karamazov
mndoci has quit [Ping timeout: 244 seconds]
kfpratt has joined #ruby-lang
stardiviner has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
ironhide_604 has joined #ruby-lang
momomomomo has joined #ruby-lang
mikecmpbll has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.3]
dm78 has joined #ruby-lang
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
symm- has quit [Ping timeout: 240 seconds]
karamazov has quit [Read error: Connection reset by peer]
karamazov has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
dachi has quit [Quit: ...]
karamazo_ has joined #ruby-lang
mikecmpbll has joined #ruby-lang
<maloik> now i want a donut
GBrawl has joined #ruby-lang
karamazov has quit [Ping timeout: 240 seconds]
dwayhs has joined #ruby-lang
GBrawl_ has joined #ruby-lang
<matti> Me too me too
GBrawl has quit [Ping timeout: 240 seconds]
kfpratt has quit [Remote host closed the connection]
apt-get_ has joined #ruby-lang
miqui_ has joined #ruby-lang
karamazo_ has quit [Read error: Connection reset by peer]
karamazov has joined #ruby-lang
miqui has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby-lang
sarkyniin has quit [Ping timeout: 245 seconds]
kwd has quit [Quit: kwd]
karamazo_ has joined #ruby-lang
bjh13 has joined #ruby-lang
karamazov has quit [Read error: Connection reset by peer]
dik_dak has joined #ruby-lang
mistym has joined #ruby-lang
jsullivandigs has joined #ruby-lang
kek_ has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
AKASkip has quit [Ping timeout: 240 seconds]
shinnya has joined #ruby-lang
miqui_ is now known as miqui
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruurd has joined #ruby-lang
ruurd has quit [Client Quit]
GBrawl_ has quit [Quit: Lingo - http://www.lingoirc.com]
karamazo_ has quit [Remote host closed the connection]
<yorickpeterse> Ah, heavy metal, the best remedy for stress
<yorickpeterse> White people's heavy metal too, even better
danijoo has quit [Read error: Connection reset by peer]
kek has joined #ruby-lang
danijoo has joined #ruby-lang
sduckett has joined #ruby-lang
djbkd has joined #ruby-lang
bantic has quit [Quit: bantic]
mistym has joined #ruby-lang
Squarepy has quit [Remote host closed the connection]
kek has quit [Remote host closed the connection]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
bantic has joined #ruby-lang
saarinen has joined #ruby-lang
micalexander has joined #ruby-lang
apeiros has quit [Ping timeout: 245 seconds]
djbkd has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
karamazov has joined #ruby-lang
benlovell has quit [Quit: leaving]
jxie has quit [Ping timeout: 240 seconds]
elia has quit [Quit: Computer has gone to sleep.]
jxie has joined #ruby-lang
banister has joined #ruby-lang
elia has joined #ruby-lang
qba73 has quit []
saarinen has quit [Quit: saarinen]
momomomomo has joined #ruby-lang
solars has quit [Ping timeout: 272 seconds]
elia has quit [Quit: Computer has gone to sleep.]
francisfish has joined #ruby-lang
lesilu has joined #ruby-lang
elia has joined #ruby-lang
elia has quit [Client Quit]
yfeldblum has joined #ruby-lang
sduckett has quit [Ping timeout: 245 seconds]
stardiviner has quit [Ping timeout: 240 seconds]
apeiros has joined #ruby-lang
kfpratt has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
elia has joined #ruby-lang
jsullivandigs has quit [Quit: Leaving...]
elia has quit [Client Quit]
MikaAK1 has joined #ruby-lang
MikaAK1 has quit [Client Quit]
jsullivandigs has joined #ruby-lang
jhass|off is now known as jhass
micalexander has quit [Remote host closed the connection]
micalexander has joined #ruby-lang
rippa has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
micalexander has quit [Read error: Connection reset by peer]
CaptainJet has joined #ruby-lang
micalexander has joined #ruby-lang
cnivolle_ has quit [Ping timeout: 240 seconds]
Jeticus has joined #ruby-lang
sdouglas has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
pixelhandler has joined #ruby-lang
CaptainJet has quit [Ping timeout: 244 seconds]
krasnus has quit [Ping timeout: 255 seconds]
cnivolle has joined #ruby-lang
stardiviner has joined #ruby-lang
mistym has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
MikaAK has joined #ruby-lang
rahul_j has joined #ruby-lang
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
francisfish has quit [Remote host closed the connection]
francisfish has joined #ruby-lang
diegoviola has joined #ruby-lang
francisfish has quit [Ping timeout: 255 seconds]
jxie has quit [Ping timeout: 255 seconds]
arBmind has joined #ruby-lang
rippa has quit [Ping timeout: 244 seconds]
jxie has joined #ruby-lang
rippa has joined #ruby-lang
mistym has joined #ruby-lang
cmhobbs has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
rahul_j has quit [Quit: rahul_j]
RobertBirnie has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby-lang
mikecmpbll has joined #ruby-lang
karamazov has quit [Read error: Connection reset by peer]
karamazov has joined #ruby-lang
yfeldblum has joined #ruby-lang
elia has joined #ruby-lang
allomov has quit [Remote host closed the connection]
sdouglas has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 255 seconds]
momomomomo has quit [Quit: momomomomo]
hahuang65 has quit [Ping timeout: 264 seconds]
majjoha has joined #ruby-lang
sdouglas_ has joined #ruby-lang
robbyoconnor has quit [Excess Flood]
symm- has joined #ruby-lang
robbyoconnor has joined #ruby-lang
<whitequark> white people's heavy metal?
<matti> LOL
rippa has quit [Ping timeout: 264 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
elia has quit [Quit: Computer has gone to sleep.]
sammas_ has quit [Ping timeout: 276 seconds]
AncientAmateur has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
bahar has quit [Ping timeout: 255 seconds]
cmhobbs has quit [Ping timeout: 244 seconds]
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby-lang
bahar has joined #ruby-lang
brain_shim has joined #ruby-lang
saarinen has joined #ruby-lang
djbkd has joined #ruby-lang
x0f has quit [Ping timeout: 264 seconds]
rahul_j has joined #ruby-lang
stamina has quit [Ping timeout: 272 seconds]
x0f has joined #ruby-lang
Miphix has quit [Quit: Leaving]
stardiviner has joined #ruby-lang
skade has joined #ruby-lang
cnivolle has quit [Ping timeout: 255 seconds]
|jemc| has joined #ruby-lang
aero224_ has joined #ruby-lang
aero224 has quit [Ping timeout: 255 seconds]
stardiviner has quit [Ping timeout: 240 seconds]
Neurexin has quit [Quit: Neurexin]
hahuang65 has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
x0f has quit [Ping timeout: 255 seconds]
roelof has joined #ruby-lang
<roelof> When I have this : http://pastebin.com/TjCHwcRp
x0f has joined #ruby-lang
<roelof> with orders = {:rice => 1, :noodles => 1} and menu = {:rice => 3, :noodles => 2}
MikaAK1 has joined #ruby-lang
<roelof> why when I do Restaurant.cost(*orders) I see this error : undefined method `cost' for Restaurant:Class (NoMethodError)
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
MikaAK1 has quit [Client Quit]
<jhass> because cost is an instance method, not a class method
<havenwood> roelof: You have to instantiate the class to get access to its instance methods.
<roelof> oke, so I have to do Restaurant.new.costs
<havenwood> instantiate an instance of the class*
<roelof> also not
<roelof> ruby can be confusing
<jhass> what error message do you get now?
djbkd has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
<roelof> wrong number of arguments (0 for 1) (ArgumentError)
<havenwood> roelof: initialize(menu)
<jhass> and if you actually read it, what do you think it means?
<roelof> and with Restaurant.new(menu).costs I get a answer 0
<yorickpeterse> whitequark: the somewhat typical scandinavian stuff
<jhass> roelof: yeah sure, without orders you don't have to pay anything
<bougyman> .22
AncientAmateur has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 0.4.3]
<roelof> jhass oke, with Restaurant.new(menu).cost(orders) I see that with @menu.keys I can find the keys of the menu
<roelof> now find a way I can compare order[0] with a menu,key so I can find the costs
|jemc| has joined #ruby-lang
momomomomo has joined #ruby-lang
<jhass> roelof: make sure to paste the whole program when you're done so we can maybe give you some tips ;)
marr has quit [Ping timeout: 272 seconds]
<roelof> I have now this : http://pastebin.com/DEEMe2Ha and see this error: undefined method `key' for {:rice=>3, :noodles=>2}:Hash (NoMethodError)
<whitequark> yorickpeterse: yes, I mean, is there any other kind?
<jhass> roelof: yes, there's no key method on Hash
<jhass> what would you expect it to do?
<roelof> that it would look for the name of the order so rice or noodles on the order and look for the price in the menu hash
melter_ has joined #ruby-lang
<roelof> and count them all up
MikaAK has quit [Ping timeout: 264 seconds]
djbkd has quit [Quit: My people need me...]
djbkd has joined #ruby-lang
<jhass> but how would that work? it would magically read the value of the right hand side and store that somewhere internally so the next access to the hash would magically return the value?
<roelof> frustating : when I do this : costs = costs + @menu[order] * order[0] I see this error : undefined method `*' for nil:NilClass (NoMethodError)
|jemc| has quit [Quit: WeeChat 0.4.3]
<jhass> that means there's no order key in @menu
<jhass> roelof: use p to assert that the variables contain what you think they do
<roelof> jhass : order[0] contains the name. So that one I have to look up in menu and then find the value
<jhass> then do that
<jhass> @menu[order[0]]
<roelof> :in `+': nil can't be coerced into Fixnum (TypeError)
<jhass> so order[1] returns nil
<jhass> back to using p to check it's what you think it is
mehlah has quit [Quit: Leaving...]
Johz has joined #ruby-lang
<roelof> order is a hash
<roelof> and order.keys gives both entries :(
<roelof> I need only 1
GBrawl has joined #ruby-lang
<jhass> how about iterating over the hash?
GBrawl has quit [Client Quit]
<roelof> chips I do that I do orders.each
<jhass> didn't you just find out that yields you a hash in order?
yfeldblum has joined #ruby-lang
dsaint-pierre has quit [Ping timeout: 245 seconds]
<jhass> so apparently orders is not what you think it is
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
karamazo_ has joined #ruby-lang
<roelof> wierd. when I do order.is_a? Hash I see true. When I do puts "Order 1 has this key #{order.keys}" I see this output: Order 1 has this key ricenoodles
<roelof> Apperantly I do not seem to now how I can get the key of only one entries
<roelof> Apperantly I do not seem to now how I can get the key of only one entrie
<jhass> you would iterate over the hash
diegoviola has quit [Ping timeout: 245 seconds]
karamazov has quit [Ping timeout: 264 seconds]
spastorino has quit [Quit: Connection closed for inactivity]
diegoviola has joined #ruby-lang
<roelof> oke, so also iterate over order where I also iterate over *orders ???
<jhass> what do you think *orders in a method definition does
<jhass> ?
<roelof> that contains all orders
<roelof> where order schould contain only 1 order
djbkd has quit [Remote host closed the connection]
<jhass> that's what you think the result is, but answer my question, what is the difference between def foo(orders) and def foo(*orders)
rippa has joined #ruby-lang
djbkd has joined #ruby-lang
lolmaus has quit [Read error: Connection reset by peer]
<roelof> def foo(orders) orders has only 1 value so one order
Neurexin has joined #ruby-lang
<roelof> def foo(*orders) orders has more then 1 value
<jhass> no that's not what it does
<roelof> ???
jeffs_ has quit [Ping timeout: 264 seconds]
<roelof> jhass: now im totally confused
<jhass> >> def foo(orders); p orders; end; foo(1)
<eval-in> jhass => 1 ... (https://eval.in/166436)
<jhass> >> def foo(orders); p orders; end; foo(1, 2)
<eval-in> jhass => wrong number of arguments (2 for 1) (ArgumentError) ... (https://eval.in/166437)
<jhass> >> def foo(*orders); p orders; end; foo(1)
<eval-in> jhass => [1] ... (https://eval.in/166438)
<jhass> >> def foo(*orders); p orders; end; foo(1, 2)
<eval-in> jhass => [1, 2] ... (https://eval.in/166439)
arBmind has quit [Quit: Leaving.]
<roelof> I always thougt the * means that there are 1 or more values
lolmaus has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
<jhass> it means "collect all remaining arguments in an array and assign it to this name"
<jhass> >> def foo(a, *orders); p a, orders; end; foo(1, 2, 3)
<eval-in> jhass => 1 ... (https://eval.in/166440)
karamazo_ is now known as karamazov
jeffs_ has joined #ruby-lang
<jhass> note that "a value" is any object
<jhass> a number, a string, a hash, an array, your own class
<roelof> yep, almost everything is a object in ruby except the lamba
<jhass> you pass a value as an argument to a method
<jhass> no, lambda is an object too
<jhass> >> a = lambda {}; a.class
<eval-in> jhass => Proc (https://eval.in/166442)
<jhass> >> a = lambda {}; a.is_a? Object
<eval-in> jhass => true (https://eval.in/166443)
<roelof> I think I will hit the books again about hashes
<roelof> and arrays. This exercise confuse me a lot
djbkd has quit [Remote host closed the connection]
<roelof> as far as I understand it *orders is appearently a array containing all the orders.
spastorino has joined #ruby-lang
<roelof> So when I iterate over it with orders.each do |order| the order varaible contains only 1 order which contains two thing rice and the amount and noodles and the amount
djbkd has joined #ruby-lang
<jhass> you're still thinking about this wrong
<jhass> def foo(*orders) is to tell ruby to _do_ something
diegoviola has quit [Read error: Connection reset by peer]
<jhass> similar foo(*orders) (when calling a method) is to tell ruby to _do_ something. It's not the same as in the method definition though
<jhass> that _do_ is "collect all remaining arguments in an array" in the first case and "treat this as an array and pass the elements as individual arguments" in the second
cored_ has joined #ruby-lang
<roelof> yep, put all the orders in a variable called orders which contains all the orders so for example : {:rice => 1, :noodles => 1}
sdouglas_ has quit [Remote host closed the connection]
<roelof> so orders schould contain [{:rice => 1, :noodles => 1}]
cored has quit [Ping timeout: 240 seconds]
<jhass> {:rice => 1, :noodles => 1} is one value (a hash) and one value
<roelof> and that is correct
<roelof> yes, there is only 1 order here
<roelof> I start with a simple example
<jhass> so how do you pass that to the method?
tris has joined #ruby-lang
<roelof> which method are we talking about. This is the value of *orders when order = {:rice => 1, :noodles => 1}
<jhass> again, *orders is not a variable name
dwayhs has quit [Read error: Connection reset by peer]
stamina has joined #ruby-lang
<jhass> * is an action and orders is the variable name (that is affected by that action)
dwayhs has joined #ruby-lang
<jhass> so *orders can't have a value, only orders can
Xney has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
Xney has joined #ruby-lang
mistym has joined #ruby-lang
sdouglas has joined #ruby-lang
sdouglas has quit [Remote host closed the connection]
<roelof> oke, so I can itereate over order which gives this : order contains rice1noodles1
<roelof> So order.each is not doing what I expect
<jhass> again, use p order for example
<jhass> that gives better output
sepp2k has joined #ruby-lang
Olipro has quit [*.net *.split]
thmzlt has joined #ruby-lang
allomov has joined #ruby-lang
<roelof> jhass : p order gives this ; {:rice=>1, :noodles=>1}
<jhass> and inside the each?
<roelof> so order.each do not give not only rice and noodles
<jhass> p loopvariable
<roelof> did that :orders.each do |order|
<roelof> p order
<roelof> end
AKASkip has joined #ruby-lang
<roelof> which is wierd because orders is containing this : [{:rice=>1, :noodles=>1}]
<roelof> and order : {:rice=>1, :noodles=>1}
<jhass> no it's totally expected
<jhass> [ ] is an array
<roelof> I think I have to iterate again
<jhass> [ ].each gives the arrays elements
<jhass> in this case there's only on element, the hash {:rice=>1, :noodles=>1}
havenwood has quit []
marr has joined #ruby-lang
<roelof> yes, now im getting all the items seperatly [:rice, 1] and [:noodles, 1]
<roelof> and p @menu[item[0]] gives me the price
momomomomo has joined #ruby-lang
<apeiros> roelof: you do `def cost(*orders)` and `cost({:some => "hash"})`
<apeiros> right?
<apeiros> if so, why do you have * in the def?
rippa has quit [Ping timeout: 272 seconds]
<roelof> because in thr order the value is the amount so the costs are the amount multiplied by the price
tbuehlmann has quit [Remote host closed the connection]
heftig has joined #ruby-lang
aero224 has joined #ruby-lang
emptyflask has joined #ruby-lang
<roelof> jhass: thanks. this one solves the problem : http://pastebin.com/95pAZg3b
dsaint-pierre has joined #ruby-lang
<jhass> roelof: you can write order.each do |name, times|
<jhass> hm, times is bad. order.each do |name, amount|
<jhass> and a = a + (b) can be written as a += b
<jhass> you don't need the return keyword at the end, just writing costs will work
<roelof> oke, thanks for the remarks. The exercises of rubymonk at the end are hard
aero224_ has quit [Ping timeout: 272 seconds]
AncientAmateur has quit [Quit: Leaving...]
<roelof> but on simple one you do not learn anything
<roelof> I call it a day. This exercise cost me the whole day
_zeedaniel has quit []
<roelof> Tomorrow one last on to go
Fushi has quit [Quit: Connection closed for inactivity]
karamazov has quit [Remote host closed the connection]
jsullivandigs has quit [Read error: Connection reset by peer]
jsullivandigs has joined #ruby-lang
Olipro has joined #ruby-lang
amerine has quit [Quit: Textual IRC Client: www.textualapp.com]
mehlah has joined #ruby-lang
roelof has quit [Quit: Page closed]
skade has quit [Quit: Computer has gone to sleep.]
shinnya has quit [Read error: Connection reset by peer]
djbkd has quit [Remote host closed the connection]
dm78 has quit [Remote host closed the connection]
sduckett has joined #ruby-lang
diegoviola has joined #ruby-lang
djbkd has joined #ruby-lang
bin7me has joined #ruby-lang
shinnya has joined #ruby-lang
sdouglas has joined #ruby-lang
dsaint-pierre has quit [Read error: Connection reset by peer]
dsaint-pierre has joined #ruby-lang
arBmind has joined #ruby-lang
pabs has quit [Ping timeout: 245 seconds]
pabs has joined #ruby-lang
dwknoxy is now known as dknox-bbib
skade has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
zenojis has quit [Read error: Connection reset by peer]
thmzlt_ has joined #ruby-lang
thmzlt has quit [Read error: Connection reset by peer]
hachiya has quit [Ping timeout: 240 seconds]
skade has quit [Client Quit]
GBrawl has joined #ruby-lang
GBrawl has quit [Client Quit]
hachiya has joined #ruby-lang
cmhobbs has joined #ruby-lang
charliesome has joined #ruby-lang
funnel has quit [Remote host closed the connection]
deg-_ has quit [Ping timeout: 264 seconds]
pglombardo is now known as areu
dknox-bbib has quit [Quit: Computer has gone to sleep.]
solars has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 240 seconds]
zz_dlu has quit [Ping timeout: 240 seconds]
torrieri has joined #ruby-lang
areu is now known as pglombardo
zz_dlu has joined #ruby-lang
deg- has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
hellome has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.3]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Remote host closed the connection]
sduckett has quit [Ping timeout: 264 seconds]
railzForDaiz has joined #ruby-lang
_djbkd has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
funnel has joined #ruby-lang
karamazov has joined #ruby-lang
majjoha has quit [Ping timeout: 255 seconds]
mistym has joined #ruby-lang
dwknoxy has joined #ruby-lang
solars has quit [Ping timeout: 245 seconds]
dorei has joined #ruby-lang
_ht has quit [Remote host closed the connection]
kyb3r_ has joined #ruby-lang
_djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
jhass is now known as jhass|off
railzForDaiz has quit []
hahuang65 has quit [Quit: WeeChat 0.4.3]
sdouglas has quit [Remote host closed the connection]
t4nk757 has joined #ruby-lang
hahuang65 has joined #ruby-lang
<t4nk757> hello, could someone take a loon on this http://stackoverflow.com/questions/24394688/ruby-on-rails-validation ? i'll be very.very grateful
djbkd has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
elia has joined #ruby-lang
karamazov has quit [Read error: Connection reset by peer]
karamazov has joined #ruby-lang
cstrahan has joined #ruby-lang
djbkd has joined #ruby-lang
karamazov has quit [Read error: Connection reset by peer]
karamazov has joined #ruby-lang
MichD is now known as michd
<apeiros> t4nk757: the title alone already suggests that this is the wrong, and #rubyonrails the right channel…
<t4nk757> thanks :)
ur5us has joined #ruby-lang
anjen has joined #ruby-lang
alexju has quit [Remote host closed the connection]
karamazov has quit []
luiz_ has joined #ruby-lang
luiz_ is now known as Guest76341
t4nk757 has quit [Ping timeout: 246 seconds]
symm- has quit [Read error: Connection reset by peer]
symm- has joined #ruby-lang
luiz_lha has quit [Ping timeout: 264 seconds]
Cakey has quit [Ping timeout: 240 seconds]
MindfulMonk has quit [Remote host closed the connection]
sduckett has joined #ruby-lang
anjen has quit [Quit: anjen]
mistym has quit [Remote host closed the connection]
zenojis has joined #ruby-lang
|jemc| has joined #ruby-lang
ldnunes has quit [Quit: Leaving]
aero224_ has joined #ruby-lang
sduckett has quit [Ping timeout: 255 seconds]
face has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
faces has quit [Ping timeout: 272 seconds]
Johz has quit [Quit: Leaving]
aero224 has quit [Ping timeout: 245 seconds]
wallerdev has joined #ruby-lang
jgpawletko has quit [Quit: jgpawletko]
postmodern has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
Neurexin has quit [Quit: Neurexin]
dwayhs has quit [Read error: Connection reset by peer]
dwayhs has joined #ruby-lang
mistym has joined #ruby-lang
dwayhs has quit [Read error: Connection reset by peer]
dwayhs has joined #ruby-lang
amerine has joined #ruby-lang
cnivolle has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #ruby-lang
elia has quit [Client Quit]
ledestin has quit [Quit: ledestin]
AncientAmateur has joined #ruby-lang
AncientAmateur has quit [Remote host closed the connection]
AncientAmateur has joined #ruby-lang
dwayhs has quit [Read error: Connection reset by peer]
dwayhs has joined #ruby-lang
Olipro has quit [Ping timeout: 246 seconds]
skade has joined #ruby-lang
dwayhs has quit [Client Quit]
bjh13 has quit [Quit: leaving]
djbkd has quit [Remote host closed the connection]
GBrawl has joined #ruby-lang
aero224 has joined #ruby-lang
djbkd has joined #ruby-lang
devgiant has joined #ruby-lang
aero224_ has quit [Ping timeout: 272 seconds]
kith has joined #ruby-lang
allomov has quit [Remote host closed the connection]
devgiant has quit [Quit: Leaving]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x0f has quit [Ping timeout: 272 seconds]
GBrawl has quit [Ping timeout: 240 seconds]
x0f has joined #ruby-lang
sduckett has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nathanstitt has quit [Quit: I growing sleepy]
bin7me has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
momomomomo has joined #ruby-lang
sduckett has quit [Ping timeout: 244 seconds]
Lumio has quit [Quit: Lumio]
priodev has quit [Quit: out.]
AncientAmateur has quit [Remote host closed the connection]
miqui has quit [Remote host closed the connection]
elia has joined #ruby-lang
kfpratt has quit [Remote host closed the connection]
stamina has quit [Ping timeout: 272 seconds]
kfpratt has joined #ruby-lang
Pyrotecnix has quit [Quit: Leaving]
Pyrotecnix has joined #ruby-lang
hlowe has joined #ruby-lang
Neurexin has joined #ruby-lang
Pyrotecnix has quit [Client Quit]
Pyrotecnix has joined #ruby-lang
micalexander has quit [Ping timeout: 264 seconds]
ledestin has joined #ruby-lang
Pyrotecnix has quit [Client Quit]
elia has quit [Client Quit]
Lumio has joined #ruby-lang
Pyrotecnix has joined #ruby-lang
kfpratt has quit [Ping timeout: 255 seconds]
Pyrotecnix has quit [Client Quit]
Pyrotecnix has joined #ruby-lang
aero224_ has joined #ruby-lang
Pyrotecnix has quit [Client Quit]
Pyrotecnix has joined #ruby-lang
jeffs_ has quit [Ping timeout: 272 seconds]
aero224 has quit [Ping timeout: 245 seconds]
Pyrotecnix has quit [Client Quit]
Pyrotecnix has joined #ruby-lang
priodev has joined #ruby-lang
Olipro has joined #ruby-lang
cmhobbs has quit [Ping timeout: 240 seconds]
loincloth has quit [Remote host closed the connection]
torrieri has quit [Quit: Linkinus - http://linkinus.com]
pixelhandler has quit [Quit: pixelhandler]
aero224 has joined #ruby-lang
bantic has quit [Quit: bantic]
RobertBirnie has quit [Read error: Connection reset by peer]
RobertBirnie has joined #ruby-lang
aero224_ has quit [Ping timeout: 272 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
momomomomo has quit [Quit: momomomomo]
tylersmith has joined #ruby-lang
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
Jeticus has quit []
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby-lang
micalexander has joined #ruby-lang
kfpratt has joined #ruby-lang
diegoviola has joined #ruby-lang
dsaint-pierre has quit [Read error: Connection reset by peer]
dsaint-pierre has joined #ruby-lang
sduckett has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
kfpratt has quit [Remote host closed the connection]
sduckett has quit [Ping timeout: 272 seconds]
kfpratt has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
kfpratt has quit [Ping timeout: 240 seconds]
wallerdev has quit [Quit: wallerdev]
djbkd has joined #ruby-lang
pglombardo has quit []
dsaint-pierre has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
AKASkip has quit [Ping timeout: 272 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
djbkd has joined #ruby-lang
emptyflask has quit [Ping timeout: 272 seconds]
pixelhandler has joined #ruby-lang
mehlah has quit [Quit: Leaving...]
vpretzel_ is now known as vpretzel
earthquake has joined #ruby-lang
apt-get_ has quit [Quit: Quitte]
CaptainJet has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegoviola has quit [Quit: WeeChat 0.4.3]
dvarrui has joined #ruby-lang
|jemc| has quit [Ping timeout: 255 seconds]
dvarrui has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
saarinen has joined #ruby-lang
mikecmpbll has quit [Quit: ciao.]
diegoviola has joined #ruby-lang
enebo has quit [Quit: enebo]
vintik has joined #ruby-lang
pixelhandler has quit [Quit: pixelhandler]
nathanstitt has joined #ruby-lang
saarinen has quit [Quit: saarinen]
Lumio has quit [Quit: Lumio]
tris has quit [Quit: Leaving]
tris has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.3]
djbkd has quit [Remote host closed the connection]
diegoviola has joined #ruby-lang
emptyflask has joined #ruby-lang