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
sepp2k has quit [Ping timeout: 240 seconds]
sepp2k1 has joined #ruby-lang
sarkyniin has quit [Quit: Quitte]
mister_integer has quit [Remote host closed the connection]
__butch__ has quit [Quit: Leaving.]
|jemc| has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby-lang
ledestin has joined #ruby-lang
kyb3r_ has quit [Ping timeout: 240 seconds]
adaleigh has quit [Remote host closed the connection]
kyb3r_ has joined #ruby-lang
AncientAmateur has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #ruby-lang
elia has quit [Client Quit]
toastynerd has quit [Remote host closed the connection]
lewix has quit [Ping timeout: 240 seconds]
AncientA_ has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
kalehv has joined #ruby-lang
cored has quit [Ping timeout: 245 seconds]
marr has quit [Ping timeout: 272 seconds]
nathanstitt has joined #ruby-lang
MikaAK1 has joined #ruby-lang
dm78 has joined #ruby-lang
MichD is now known as michd
imperator has joined #ruby-lang
MikaAK2 has joined #ruby-lang
kalehv has quit [Remote host closed the connection]
MikaAK2 has quit [Client Quit]
AncientA_ has joined #ruby-lang
yubrew has joined #ruby-lang
AncientAmateur has quit [Ping timeout: 264 seconds]
yubrew has quit [Ping timeout: 264 seconds]
MikaAK2 has joined #ruby-lang
MikaAK2 has quit [Client Quit]
x0f has quit [Ping timeout: 272 seconds]
x0f has joined #ruby-lang
MikaAK1 has quit [Quit: node-irc says goodbye]
MikaAK has quit []
croe93 has joined #ruby-lang
hellow1 has joined #ruby-lang
Cakey has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
hellow1 has quit [Remote host closed the connection]
thmzlt has joined #ruby-lang
kek has joined #ruby-lang
RobertBirnie has quit [Quit: Textual IRC Client: www.textualapp.com]
croe93 has quit [Ping timeout: 240 seconds]
dm78 has quit [Remote host closed the connection]
kek has quit [Ping timeout: 244 seconds]
AncientAmateur has joined #ruby-lang
AncientA_ has quit [Ping timeout: 260 seconds]
mistym has quit [Remote host closed the connection]
|jemc| has joined #ruby-lang
mistym has joined #ruby-lang
mister_integer has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<imperator> evenin'
AncientAmateur has quit [Remote host closed the connection]
akerl has left #ruby-lang ["valete"]
dm78 has joined #ruby-lang
pixelhandler has quit [Quit: pixelhandler]
Cakey has quit [Ping timeout: 240 seconds]
AncientAmateur has joined #ruby-lang
lewix has joined #ruby-lang
Cakey has joined #ruby-lang
sepp2k1 has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
diegoviola has joined #ruby-lang
x0f has quit [Ping timeout: 272 seconds]
x0f has joined #ruby-lang
yfeldblum has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
MikaAK1 has joined #ruby-lang
kek has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
nathanstitt has quit [Quit: I growing sleepy]
AncientAmateur has quit [Remote host closed the connection]
nathanstitt has joined #ruby-lang
mister_integer has quit [Remote host closed the connection]
adaleigh has joined #ruby-lang
MikaAK1 has quit [Ping timeout: 245 seconds]
spajus has joined #ruby-lang
thmzlt has quit []
Cakey has quit [Ping timeout: 255 seconds]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
gix has quit [Ping timeout: 255 seconds]
yfeldblum has quit [Remote host closed the connection]
mistym has joined #ruby-lang
gix has joined #ruby-lang
dsaint-pierre has quit [Remote host closed the connection]
cnivolle has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
mistym_ has joined #ruby-lang
dgaffney has quit [Ping timeout: 240 seconds]
kek has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
dgaffney has joined #ruby-lang
tkuchiki has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
adaleigh has quit [Read error: Connection reset by peer]
alexju has joined #ruby-lang
adaleigh has joined #ruby-lang
AncientAmateur has joined #ruby-lang
karamazov has joined #ruby-lang
MikaAK has joined #ruby-lang
AncientAmateur has quit [Ping timeout: 264 seconds]
AncientA_ has joined #ruby-lang
lewix has quit [Remote host closed the connection]
lewix has joined #ruby-lang
lewix has quit [Changing host]
lewix has joined #ruby-lang
<adaleigh> Hello Ruby friends, I have a question. I have a function that returns 1 or 0. I have instances in if statements when I am doing !function and it is always returning false. How could this be happening?
<adaleigh> Besides the always returning 1 of course. :P I have that it is returning 0 in instances.
diegovio1 has joined #ruby-lang
diegovio1 is now known as diegovio1a
lewix has quit [Ping timeout: 240 seconds]
AncientA_ has quit [Remote host closed the connection]
dgaffney has quit [Remote host closed the connection]
<whitequark> adaleigh: both 1 and 0 are "true" in Ruby
<whitequark> in fact, everything except false and nil is considered truthful
<whitequark> >> [!1, !0]
<eval-in> whitequark => [false, false] (https://eval.in/165434)
<adaleigh> whitequark: really? D:
<whitequark> yea. conflating booleans and numerics are a side of C that I would rather not see dragged all around.
<adaleigh> Wow. Interesting.
<adaleigh> I can't believe I haven't run across that.
<adaleigh> That's crazy. Okay I know now to use the #zero? function
<adaleigh> Thanks for your help
<freedrull> uhh did YAML.load always return a string? i thought it was a hash
x0f has quit [Ping timeout: 244 seconds]
ledestin has quit [Quit: ledestin]
simoz111118 has quit [Ping timeout: 245 seconds]
<freedrull> ah waait this isnt yaml crap
x0f has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
dsaint-pierre has quit [Ping timeout: 244 seconds]
x0f has quit [Ping timeout: 272 seconds]
x0f has joined #ruby-lang
kek has joined #ruby-lang
diegovio1a has quit [Remote host closed the connection]
GBrawl_ has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
GBrawl_ has quit [Client Quit]
kek has quit [Ping timeout: 245 seconds]
dsaint-pierre has joined #ruby-lang
dsaint-pierre has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Remote host closed the connection]
mndoci has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
MikaAK has quit [Ping timeout: 272 seconds]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
lsegal has joined #ruby-lang
karamazov has quit []
dsaint-pierre has joined #ruby-lang
x0f has quit [Ping timeout: 272 seconds]
x0f has joined #ruby-lang
lcdhoffman has joined #ruby-lang
yfeldblum has joined #ruby-lang
kek has joined #ruby-lang
djbkd has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
jg_ has joined #ruby-lang
spastorino has quit [Quit: Connection closed for inactivity]
karamazov has joined #ruby-lang
djbkd has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
majjoha has joined #ruby-lang
yubrew has joined #ruby-lang
nofxx has quit [Ping timeout: 245 seconds]
dgaffney has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby-lang
x0f has quit [Ping timeout: 272 seconds]
ledestin has joined #ruby-lang
x0f has joined #ruby-lang
mndoci has quit [Remote host closed the connection]
mndoci has joined #ruby-lang
|jemc| has quit [Ping timeout: 264 seconds]
mndoci has quit [Remote host closed the connection]
mndoci has joined #ruby-lang
mndoci has quit [Remote host closed the connection]
Cakey has quit [Ping timeout: 244 seconds]
Cakey has joined #ruby-lang
GaelanAintAround is now known as Gaelan
dgaffney has quit [Remote host closed the connection]
dgaffney has joined #ruby-lang
mistym_ has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
Cakey has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
karamazov has quit [Remote host closed the connection]
dc5ala has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
Cakey has quit [Ping timeout: 244 seconds]
dm78 has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
dsaint-pierre has quit [Remote host closed the connection]
jarto has joined #ruby-lang
kek has joined #ruby-lang
Miphix has joined #ruby-lang
adaleigh has quit [Remote host closed the connection]
kek has quit [Ping timeout: 272 seconds]
yubrew has joined #ruby-lang
toastynerd has joined #ruby-lang
mister_integer has joined #ruby-lang
yubrew has quit [Ping timeout: 244 seconds]
mistym has joined #ruby-lang
Cakey has quit [Ping timeout: 264 seconds]
Cakey has joined #ruby-lang
AncientAmateur has joined #ruby-lang
AncientAmateur has quit [Remote host closed the connection]
ledestin has quit [Quit: ledestin]
Cakey has quit [Ping timeout: 245 seconds]
Cakey has joined #ruby-lang
ledestin has joined #ruby-lang
x0f has quit [Ping timeout: 240 seconds]
dm78 has joined #ruby-lang
x0f has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
dsaint-pierre has quit [Remote host closed the connection]
dm78 has quit [Ping timeout: 244 seconds]
robbyoconnor has quit [Remote host closed the connection]
dgaffney has quit [Remote host closed the connection]
lcdhoffman has quit [Quit: lcdhoffman]
robbyoconnor has joined #ruby-lang
shinnya has quit [Ping timeout: 244 seconds]
yubrew has joined #ruby-lang
tbuehlmann has joined #ruby-lang
Gaelan is now known as GaelanAintAround
Cakey has quit [Ping timeout: 264 seconds]
kek has joined #ruby-lang
Cakey has joined #ruby-lang
roelof has joined #ruby-lang
yubrew has quit [Ping timeout: 244 seconds]
<roelof> How can I make a def which can do this : calculate(-10, 2, 3, add: true) and this calculate(4, 5, subtract: true)
<roelof> I tried calculate ( *numbers, options = {} ) and (options={} , *numbers) but then I see error messages
kek has quit [Ping timeout: 264 seconds]
<roelof> also calculate (*numbers) does not work because I cannot do *numbers.include?(add) because of the splash
<roelof> anyone a tip ?
mister_integer has quit [Remote host closed the connection]
Cakey has quit [Ping timeout: 240 seconds]
dgaffney has joined #ruby-lang
dgaffney has quit [Remote host closed the connection]
Miphix has quit [Quit: Leaving]
relix has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
dm78 has joined #ruby-lang
dnewkerk-keyz has quit [Quit: dnewkerk-keyz]
__JokerDoom has quit [Ping timeout: 240 seconds]
<roelof> no one who has a tip ?
toastynerd has quit [Remote host closed the connection]
dm78 has quit [Ping timeout: 264 seconds]
<roelof> another question : how can I check if the last argument is a hash in calculate ( 2,5, add => true) ?
_ht has joined #ruby-lang
<freedrull> roelof: you can use is_a?(Hash)
<roelof> freedrull: and then something like .each to check all items ??
<freedrull> uhm
AKASkip has joined #ruby-lang
<roelof> freedrull: I only know that is the latest argument. I only do not know how many items are before it
<freedrull> you cant do def calculate(options={}, *numbers) ?
<roelof> I do not think so because the function is called this way calculate ( 2,5, add => true)
x0f has quit [Ping timeout: 264 seconds]
apeiros has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
aero224 has quit [Read error: Connection reset by peer]
aero224 has joined #ruby-lang
x0f has joined #ruby-lang
wallerdev has joined #ruby-lang
ritek has quit [Quit: Connection closed for inactivity]
<roelof> someone who can help me with this : http://pastebin.com/5JzH9M9X
diegoviola has quit [Remote host closed the connection]
<apeiros> roelof: what ruby version are you using / do you need to support?
<roelof> apeiros: I have to look.Im working now with RubyMonk
<apeiros> if calculation = "add"
<apeiros> this is always true
<apeiros> you probably wanted ==
<apeiros> also note that {add: true} is never == "add"
<apeiros> numbers = array.select{ |i| i.is_a? Integer} --> numbers = array[0..-2] # all but the last
<roelof> oke, I think I have to find out what the contents of calculation is
Boohbah has quit [Quit: Lost terminal]
<apeiros> >> calculation = {add: true}; calculation[:add]
<eval-in> apeiros => true (https://eval.in/165469)
<apeiros> >> calculation = {add: true}; calculation[:subtract]
<eval-in> apeiros => nil (https://eval.in/165470)
<roelof> apeiros: I have now this but I see this error : Array can't be coerced into Fixnum and this one undefined method `[]=' for 5:Fixnum
<apeiros> as always gist your code. I can't read it from your mind.
<roelof> sorry, I forgot that part
<roelof> moment
<apeiros> :)
<roelof> here you are : http://pastebin.com/1vQxaBUK
<apeiros> roelof: def add(*numbers) # says you expect multiple arguments
<apeiros> yet: add(numbers) # line 18, you only pass a single argument, an array
<apeiros> you need `add(*numbers)` there too, so that single array argument becomes multiple arguments
<apeiros> >> def demo(*args); args; end; values = [1,2,3]; demo(values)
<eval-in> apeiros => [[1, 2, 3]] (https://eval.in/165471)
<apeiros> >> def demo(*args); args; end; values = [1,2,3]; demo(*values)
<eval-in> apeiros => [1, 2, 3] (https://eval.in/165472)
<apeiros> notice how the first one is [[, i.e. an array in an array
<apeiros> also, don't put spaces in front of argument parenthesis. add(…), not add (…)
<apeiros> they're not identical.
dm78 has joined #ruby-lang
<apeiros> and another note: line 14 will fail (`calculation [:add] = true`) a) because of the space and b) because if calculation is not a Hash, you can't use []= on it.
toastynerd has joined #ruby-lang
dm78 has quit [Ping timeout: 255 seconds]
<roelof> oke, how can I set add as default then ?
toastynerd has quit [Ping timeout: 240 seconds]
rramphal has joined #ruby-lang
<roelof> apeiros: this one is working : http://pastebin.com/RG2MQnuQ
<roelof> but I think the ruby experts finds a lot of things that are not the ruby way
<apeiros> roelof: you can't set a default on something which isn't there :)
<apeiros> so what you do is you don't set a default. you create the full thing
<apeiros> calculation = {add: true}
rramphal has quit [Client Quit]
<roelof> oke, and then if defaults to add when nothing is given
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
roelof has quit [Quit: Page closed]
kyb3r_ has quit [Read error: Connection reset by peer]
mister_integer has joined #ruby-lang
stamina has joined #ruby-lang
mister_integer has quit [Ping timeout: 272 seconds]
michd is now known as MichD
mistym has quit [Remote host closed the connection]
mikecmpbll has joined #ruby-lang
matp has quit [Quit: ZZZzzz…]
numdig has quit [Ping timeout: 244 seconds]
alexju has quit [Remote host closed the connection]
jg_ has quit [Ping timeout: 245 seconds]
x0f has quit [Ping timeout: 264 seconds]
dm78 has joined #ruby-lang
sarkyniin has joined #ruby-lang
dm78 has quit [Read error: Connection reset by peer]
dm78 has joined #ruby-lang
toastynerd has joined #ruby-lang
bin7me has joined #ruby-lang
arBmind has joined #ruby-lang
x0f has joined #ruby-lang
dorei has joined #ruby-lang
dm78 has quit [Ping timeout: 272 seconds]
toastynerd has quit [Ping timeout: 264 seconds]
centrx has joined #ruby-lang
sarkyniin has quit [Ping timeout: 240 seconds]
centrx has quit [Remote host closed the connection]
toastynerd has joined #ruby-lang
yubrew has joined #ruby-lang
toastynerd has quit [Ping timeout: 240 seconds]
allomov_ has quit [Remote host closed the connection]
nrk has quit [Quit: WeeChat 0.3.2]
allomov has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yubrew has quit [Ping timeout: 264 seconds]
allomov has quit [Ping timeout: 255 seconds]
x0f has quit [Ping timeout: 264 seconds]
wallerdev has quit [Quit: wallerdev]
x0f has joined #ruby-lang
mister_integer has joined #ruby-lang
freedrull has quit [Ping timeout: 245 seconds]
freedrull has joined #ruby-lang
vivekrai has joined #ruby-lang
x0f has quit [Ping timeout: 240 seconds]
mister_integer has quit [Ping timeout: 244 seconds]
x0f has joined #ruby-lang
Malwurf has joined #ruby-lang
Cakey has joined #ruby-lang
Malwurf has left #ruby-lang [#ruby-lang]
Cakey has quit [Ping timeout: 272 seconds]
dgaffney has joined #ruby-lang
Malwurf has joined #ruby-lang
dgaffney has quit [Ping timeout: 240 seconds]
Malwurf has quit []
Malwurf has joined #ruby-lang
x0f has quit [Ping timeout: 244 seconds]
Malwurf has left #ruby-lang [#ruby-lang]
rramphal has joined #ruby-lang
x0f has joined #ruby-lang
Malwurf has joined #ruby-lang
Fushi has joined #ruby-lang
rramphal has quit [Client Quit]
firstdayonthejob has joined #ruby-lang
centrx has joined #ruby-lang
dm78 has joined #ruby-lang
dm78 has quit [Ping timeout: 255 seconds]
toastynerd has joined #ruby-lang
toastynerd has quit [Ping timeout: 272 seconds]
JoL1hAHN has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
AKASkip has quit [Ping timeout: 245 seconds]
Malwurf has quit []
An63r_X3r0 has joined #ruby-lang
mister_integer has joined #ruby-lang
allomov has joined #ruby-lang
mister_integer has quit [Ping timeout: 272 seconds]
Asher has quit [Quit: Leaving.]
Asher has joined #ruby-lang
stamina has quit [Ping timeout: 255 seconds]
firstdayonthejob has quit [Quit: WeeChat 0.4.3]
An63r_X3r0 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
cnivolle has joined #ruby-lang
yubrew has joined #ruby-lang
sarkyniin has joined #ruby-lang
symm- has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
dm78 has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Client Quit]
dm78 has quit [Ping timeout: 244 seconds]
toastynerd has joined #ruby-lang
Tn6o has joined #ruby-lang
Tn6o has quit [Client Quit]
tbuehlmann has joined #ruby-lang
toastynerd has quit [Ping timeout: 240 seconds]
sepp2k has joined #ruby-lang
alexju has joined #ruby-lang
imperator has quit [Quit: Valete!]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tbuehlmann has quit [Remote host closed the connection]
mister_integer has joined #ruby-lang
araujo has quit [Quit: Leaving]
araujo has joined #ruby-lang
shinnya has joined #ruby-lang
mister_integer has quit [Ping timeout: 244 seconds]
GBrawl has joined #ruby-lang
yfeldblu_ has quit [Ping timeout: 272 seconds]
ari-_-e has quit [Ping timeout: 264 seconds]
bantic has joined #ruby-lang
jarto has quit [Ping timeout: 245 seconds]
alexju has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
bantic has quit [Quit: bantic]
dm78 has joined #ruby-lang
pskosinski has joined #ruby-lang
kfpratt has joined #ruby-lang
ari-_-e has joined #ruby-lang
kfpratt has quit [Remote host closed the connection]
dm78 has quit [Ping timeout: 272 seconds]
MichD is now known as michd
toastynerd has joined #ruby-lang
toastynerd has quit [Ping timeout: 244 seconds]
cnivolle has quit [Remote host closed the connection]
johnny_rugger has joined #ruby-lang
relix has joined #ruby-lang
rahul_j has joined #ruby-lang
relix has quit [Read error: Connection timed out]
relix has joined #ruby-lang
t4nk136 has joined #ruby-lang
<t4nk136> Hi I need help using VCR gem
<t4nk136> I have 2 services A and B. When I enable VCR it'll record interactions with service A but any interactions between service A and service B VCR cannot see? Why is that?
mister_integer has joined #ruby-lang
<t4nk136> I'm sure I've had this working before in another project
<t4nk136> All calls are made using RestClient
<t4nk136> and I'm telling VCR to fake with WebMock
mister_integer has quit [Read error: Connection reset by peer]
mister_integer has joined #ruby-lang
JoL1hAHN has quit [Quit: WeeChat 0.4.3]
mister_integer has quit [Ping timeout: 272 seconds]
JoL1hAHN has joined #ruby-lang
cnivolle has joined #ruby-lang
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cnivolle has quit [Client Quit]
benlovell has joined #ruby-lang
sarkyniin has quit [Ping timeout: 255 seconds]
yubrew has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
yubrew has quit [Ping timeout: 255 seconds]
t4nk136 has quit [Ping timeout: 246 seconds]
cnivolle has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Ping timeout: 255 seconds]
benlovell has joined #ruby-lang
dm78 has joined #ruby-lang
dm78 has quit [Ping timeout: 245 seconds]
toastynerd has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
toastynerd has quit [Ping timeout: 240 seconds]
relix has quit [Ping timeout: 245 seconds]
lcdhoffman has joined #ruby-lang
kalehv has joined #ruby-lang
relix has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
jhass|off is now known as jhass
jg_ has joined #ruby-lang
mister_integer has joined #ruby-lang
allomov has quit [Remote host closed the connection]
mister_integer has quit [Ping timeout: 264 seconds]
benlovell has quit [Ping timeout: 264 seconds]
yubrew has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
stamina has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
dsaint-pierre has quit [Remote host closed the connection]
karamazov has joined #ruby-lang
nofxx has joined #ruby-lang
yfeldblum has joined #ruby-lang
lewix has joined #ruby-lang
allomov has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
vick_ has joined #ruby-lang
saarinen has joined #ruby-lang
allomov has quit [Remote host closed the connection]
dm78 has joined #ruby-lang
pskosinski_ has joined #ruby-lang
pskosinski has quit [Disconnected by services]
dm78 has quit [Ping timeout: 264 seconds]
pskosinski_ is now known as pskosinski
heftig has quit [Quit: Quitting]
toastynerd has joined #ruby-lang
spajus has quit [Quit: Leaving]
<vick_> I just had an interesting discussion about Perl (http://www.perlmonks.org/?node_id=1090606, conserning Perl's Latin-1 encoding shenanigans) and decided that this language is hopeless and i shold abandon Perl... like many others have. So I need to learn some other language for my scripting purposes. Basically, is Ruby anything like Python in regards to Unicode, typing etc? Does it allow to mix binary and unicode strings?
allomov has joined #ruby-lang
toastynerd has quit [Ping timeout: 255 seconds]
<whitequark> it does
<vick_> And what encoding does it use implicitly?
<jhass> what your system has set, the fallback is UTF-8 since 2.0, ASCII before that
<centrx> Ruby is happy
<vick_> It uses locale? That's not ideal.... thanks.
ari-_-e has quit [Ping timeout: 240 seconds]
nathanstitt has joined #ruby-lang
bin7me has quit [Remote host closed the connection]
djinni` has quit [Ping timeout: 240 seconds]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
zastern has quit [Ping timeout: 240 seconds]
Gate has quit [Ping timeout: 264 seconds]
benlovell has joined #ruby-lang
justinmcp has joined #ruby-lang
rahul_j has joined #ruby-lang
saarinen has quit [Read error: Connection reset by peer]
saarinen has joined #ruby-lang
benlovell has quit [Ping timeout: 240 seconds]
yubrew has joined #ruby-lang
mister_integer has joined #ruby-lang
vick_ has quit [Ping timeout: 246 seconds]
allomov has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
yubrew has quit [Ping timeout: 245 seconds]
mister_integer has quit [Ping timeout: 264 seconds]
ari-_-e has joined #ruby-lang
zastern has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
saarinen has quit [Quit: saarinen]
djinni` has joined #ruby-lang
Gate has joined #ruby-lang
Gate has joined #ruby-lang
mhabibi has joined #ruby-lang
<mhabibi> I install 2.1.2 version of ruby with rbenv. but when I try "ruby -v" in terminal, I get this : "ruby 1.9.3p484 (2013-11-22 revision 43786) [i686-linux]"
yfeldblum has joined #ruby-lang
<whitequark> jhass: it does not use locale
<whitequark> 1.9 is ASCII, 2.0 and later use UTF-8
<whitequark> e.g. $ LANG=ru_RU.KOI8-R ruby -e 'p __ENCODING__'
<whitequark> #<Encoding:US-ASCII>
allomov has joined #ruby-lang
<whitequark> actually nevermind, it does O_o. without LANG that'd be UTF-8
<whitequark> TIL
<mhabibi> I used rbenv local and fixed it
mhabibi has left #ruby-lang [#ruby-lang]
<whitequark> oh, it's only for -e.
Guest73738 has quit [Read error: Connection reset by peer]
Guest73738 has joined #ruby-lang
<jhass> that seems unlikely
<jhass> I'm pretty sure it does for reading files
cored has quit [Ping timeout: 244 seconds]
<whitequark> I just checked.
toastynerd has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
<jhass> doing along for internal strings would make sense but maybe they pick up the file encoding
<whitequark> echo "p __ENCODING__" >t.rb; LANG=LANG=ru_RU.KOI8-R ruby t.rb
<whitequark> #<Encoding:UTF-8>
<whitequark> so basically, at 2.0 with -e you get either UTF-8 or US-ASCII, in irb you get your locale, and in files you get UTF-8.
rahul_j has quit [Quit: rahul_j]
<jhass> yep, internal strings pick up file encoding
<whitequark> sure, that's the point of file encoding
<jhass> so you don't automatically get UTF-8 there
<whitequark> in files you do
<whitequark> in -e and irb you don't
<jhass> are you even listening to yourself? or am I just deeply misunderstanding you?
<jhass> in -e you get the system locale because that's what ARGV is in, in irb you get that because that's what stdin is in
<whitequark> let me rephrase. in 2.0 and newer, files are UTF-8, or whatever is specified by magic encoding comment. in pre-2.0, it's US-ASCII or whatever's in the magic encoding. locale doesn't affect encoding of sources require'd or passed as files to the `ruby' command, but it does affect encoding of strings in -e or irb
<jhass> I guess what we're fighting over is that fallback means automatically to you, for me it doesn't
<jhass> well, fallback/default
jg_ has quit [Ping timeout: 240 seconds]
lewix has quit [Remote host closed the connection]
stulzer has joined #ruby-lang
AKASkip has joined #ruby-lang
dm78 has joined #ruby-lang
GaelanAintAround is now known as Gaelan
dm78 has quit [Ping timeout: 255 seconds]
x0f has quit [Ping timeout: 255 seconds]
x0f has joined #ruby-lang
snoopybbt has joined #ruby-lang
mister_integer has joined #ruby-lang
saarinen has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
saarinen has quit [Client Quit]
shinnya has quit [Ping timeout: 264 seconds]
matled has joined #ruby-lang
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 240 seconds]
kek has joined #ruby-lang
allomov has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
jarto has joined #ruby-lang
<epitron> loll, "it uses locale, ruby is not for me"
<epitron> what a maroon
allomov has joined #ruby-lang
<whitequark> epitron: that's not nice.
<epitron> i know, but he left :)
<epitron> now forever a python user
<epitron> someone should've asked what problem he was trying to solve
allomov has quit [Ping timeout: 272 seconds]
toastynerd has joined #ruby-lang
<jhass> I think his problem was Perl
spastorino has joined #ruby-lang
erichmenge has quit [Ping timeout: 252 seconds]
nirix has quit [Ping timeout: 240 seconds]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
dm78 has joined #ruby-lang
x0nic has quit [Ping timeout: 240 seconds]
crazysim has quit [Ping timeout: 252 seconds]
djinni` has quit [Ping timeout: 240 seconds]
justinmcp has joined #ruby-lang
chrisseaton has joined #ruby-lang
rdavila has joined #ruby-lang
dgaffney has joined #ruby-lang
dm78 has quit [Ping timeout: 240 seconds]
x0nic has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
erichmenge has joined #ruby-lang
<rdavila> Hi guys, I’m just trying to do some code reading this weekend and I have a question regarding this line: https://github.com/rails/rails/blob/master/railties/railties.gemspec#L18
nirix has joined #ruby-lang
<rdavila> why use this pattern 'lib/**/{*,.[a-z]*}' instead of only 'lib/**/*’
GBrawl has quit [Quit: Computer has gone to sleep.]
<bougyman> picks up dotfiles
djinni` has joined #ruby-lang
<rdavila> oh! makes sense, thanks bougyman !
roelof has joined #ruby-lang
crazysim has joined #ruby-lang
<roelof> Can some one explain these RSpec error messages from Rubymonk ; http://pastebin.com/XNHDTSXB
kek has quit [Remote host closed the connection]
<jhass> roelof: what don't you understand about "returns only the values present in the array passed to the method"
rdavila has quit [Quit: rdavila]
<roelof> I understand that but according to my knowlegde my script does that
<jhass> no it doesn't
<jhass> it picks n random numbers between 0 and array.length
<roelof> jhass: I do not understand the part expected [696, 1311, 1107, 598] to include 3
yubrew has joined #ruby-lang
<jhass> well, the expectation will be array.include? numbers.first
<jhass> or something like that
<roelof> jhass it schould do that. See http://pastebin.com/GkZN2Qhz
<jhass> so [696, 1311, 1107, 598] is the input array
<jhass> 3 is (part of) what your method returns
<roelof> jhass: as far as I understand it it schould return 696 or 1311 or 1107 or 598
<roelof> there is no 3 in the array
<jhass> yes but your method returns a number between 0 and array.length
<jhass> it doesn't return the corresponding element
<jhass> you're just printing the corresponding element
<roelof> oke, so I have to change puts to range
<jhass> what get's returned is the return value of .each, which is the array it's called on
nofxx has quit [Ping timeout: 272 seconds]
yubrew has quit [Ping timeout: 240 seconds]
heftig has joined #ruby-lang
banister has joined #ruby-lang
saarinen has joined #ruby-lang
<roelof> jhass: I still have one problem : http://pastebin.com/JtXWWdhm
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
<jhass> ah well, it expects you to call Kernel#rand not Random::rand, so just strip the Random.
<roelof> jhass : that is the only thing I m not allowed to use sample. I have to write my own sample
justinmcp has joined #ruby-lang
<roelof> but it succeed now
<roelof> jhass: thanks
<jhass> now you can make that one line by writing n.times.map { array[rand(array.size)]
<jhass> }
charliesome has joined #ruby-lang
<jhass> might want to dig a bit into the edge cases though
<jhass> ah, nvm
<jhass> rand already does the -1
allomov has joined #ruby-lang
yfeldblum has joined #ruby-lang
<roelof> jhass : I miss you on which part I have to change ?
<jhass> the whole method is just n.times.map { arrray[rand(array.size)] }
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jarto has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<jhass> or Array.new(n) { array[rand(array.size)] }
yfeldblum has quit [Ping timeout: 240 seconds]
x0f has quit [Ping timeout: 240 seconds]
<roelof> jhass thanks
x0f has joined #ruby-lang
Parrot has joined #ruby-lang
<Parrot> Hi there. anyone with sinatra experience on, who can help me out with a few questions?
<jhass> try to find solutions, not the people that have them
<jhass> (just ask your question, if somebody has the answer he'll respond)
<Parrot> that sounded so zen
dc5ala has joined #ruby-lang
<Parrot> basically I'm trying to figure out how to have multiple different forms on a page. so, a few different list to which you can add words. do you use a seperate post request for each?
allomov has quit [Remote host closed the connection]
<jhass> if they're not related, sure
<jhass> different <form> tags in any case
<jhass> might hit the same route, but I'd only would do that if that route wouldn't need to differentiate between the requests
<jhass> if you need different code to handle them, give them their own route
<jhass> now see, that didn't even involve any sinatra knowledge
<Parrot> a valid point. Thanks for your help! I'm sure I'll have more questions soon
roelof has quit [Quit: Page closed]
simoz111118 has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
simoz111119 has joined #ruby-lang
ritek has joined #ruby-lang
simoz111118 has quit [Ping timeout: 245 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
dm78 has joined #ruby-lang
lsegal has joined #ruby-lang
chrisseaton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dm78 has quit [Ping timeout: 240 seconds]
karamazov has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
mistym has joined #ruby-lang
yubrew has quit [Ping timeout: 244 seconds]
elia has joined #ruby-lang
Fushi has quit [Quit: Connection closed for inactivity]
elia has quit [Client Quit]
mister_integer has quit [Remote host closed the connection]
mister_integer has joined #ruby-lang
yfeldblum has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
mister_integer has quit [Ping timeout: 255 seconds]
AncientAmateur has joined #ruby-lang
yfeldblum has quit [Ping timeout: 244 seconds]
sepp2k has quit [Read error: Connection reset by peer]
ritek has quit [Changing host]
ritek has joined #ruby-lang
ritek has joined #ruby-lang
ritek has left #ruby-lang [#ruby-lang]
AncientAmateur has quit [Remote host closed the connection]
nescio has joined #ruby-lang
nescio has left #ruby-lang [#ruby-lang]
nescio has joined #ruby-lang
benlovell has joined #ruby-lang
chrisseaton has joined #ruby-lang
sarkyniin has joined #ruby-lang
mister_integer has joined #ruby-lang
mister_integer has quit [Client Quit]
simoz111119 has quit [Ping timeout: 264 seconds]
Parrot has quit [Quit: Page closed]
sarkyniin has quit [Quit: Quitte]
symm- has quit [Ping timeout: 244 seconds]
toastynerd has joined #ruby-lang
stamina has quit [Ping timeout: 240 seconds]
elliotec has joined #ruby-lang
elliotec has quit [Client Quit]
x0f has quit [Ping timeout: 244 seconds]
benlovell has quit [Read error: Connection reset by peer]
benlovel1 has joined #ruby-lang
toastynerd has quit [Ping timeout: 264 seconds]
havenwood has joined #ruby-lang
x0f has joined #ruby-lang
lolmaus has quit [Ping timeout: 255 seconds]
benlovel1 has quit [Ping timeout: 272 seconds]
havenwood has quit [Ping timeout: 264 seconds]
lcdhoffman has joined #ruby-lang
simoz111119 has joined #ruby-lang
dm78 has joined #ruby-lang
simoz1111110 has joined #ruby-lang
simoz1111111 has joined #ruby-lang
simoz111119 has quit [Ping timeout: 272 seconds]
sarkyniin has joined #ruby-lang
dm78 has quit [Ping timeout: 240 seconds]
simoz1111110 has quit [Ping timeout: 244 seconds]
x0f has quit [Ping timeout: 240 seconds]
benlovell has joined #ruby-lang
x0f has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
simoz1111112 has joined #ruby-lang
simoz1111113 has joined #ruby-lang
simoz1111111 has quit [Ping timeout: 244 seconds]
simoz1111112 has quit [Ping timeout: 244 seconds]
kek has joined #ruby-lang
toastynerd has joined #ruby-lang
yfeldblum has joined #ruby-lang
simoz1111114 has joined #ruby-lang
kek has quit [Ping timeout: 244 seconds]
simoz1111113 has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Ping timeout: 245 seconds]
lolmaus has joined #ruby-lang
havenwood has joined #ruby-lang
simoz1111114 has quit [Ping timeout: 240 seconds]
Gaelan is now known as GaelanAintAround
chrisseaton has quit [Quit: Textual IRC Client: www.textualapp.com]
yfeldblum has joined #ruby-lang
havenwood has quit [Ping timeout: 264 seconds]
rsl has quit [Quit: Textual IRC Client: www.textualapp.com]
stamina has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby-lang
AncientAmateur has joined #ruby-lang
lolmaus has quit [Ping timeout: 240 seconds]
Coincidental has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby-lang
lolmaus has joined #ruby-lang
sonvu has joined #ruby-lang
<sonvu> hello?
<sonvu> can I ask a question about Rails?
allomov has joined #ruby-lang
<sonvu> class CreateProducts < ActiveRecord::Migration def change create_table :products do |t| t.string :name t.text :description t.timestamps end end end
<sonvu> in this code what |t| is?
<jhass> rails questions go to #rubyonrails, luckily this isn't a Rails question
<jhass> |t| is a block parameter
<sonvu> hi jhass
<sonvu> we met again
<sonvu> thanks for answer my question but #rubyonrails i see nobody in there
<sonvu> if |t| is a block parameter so what "t" is?
<sonvu> a object of somthing?
<jhass> a variable
<jhass> and all variables are references to objects in ruby
<sonvu> ok i got it
<sonvu> but i am a little curious what class "t" of?
benlovell has quit [Ping timeout: 240 seconds]
<jhass> find out: p t.class
yubrew has joined #ruby-lang
djbkd has joined #ruby-lang
<sonvu> and I just started learn Ruby and the "self" method make me confuse
<jhass> self is not a method
<sonvu> they said that "Ruby has no class methods, but it has singleton methods attached to a particular object."
<AncientAmateur> I believe in the case of the create_table method the block parameter references the object representing the table being created
<jhass> self is a keyword that refers to the object you're currently in
lolmaus has quit [Ping timeout: 240 seconds]
<jhass> class Foo; def foo; self; end; end here self refers to an instance of Foo
sarkyniin has quit [Read error: No route to host]
sarkyniin has joined #ruby-lang
<sonvu> when we use self?
havenwood has joined #ruby-lang
<jhass> for example if you want to return the current object, so you can chain method calls: foo.method_of_foo.another_method_of_foo
<jhass> another case is when accessing attribute setters within a class: self.foo = bar, simply doing foo = bar would create a local variable
dm78 has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
<jhass> a third case is to define singleton methods inside a class definition: class Foo; def self.a_singleton_method; end; end
<jhass> the self in the last example refers to the Class instance you're currently defining
<sonvu> " A method given only to a single object is called a singleton method." is it right?
<jhass> yes, though it omits why it's called a singleton method
dm78 has quit [Ping timeout: 244 seconds]
<sonvu> thanks, It help me understand alot
<sonvu> There are many different beetwen Java and Ruby
saarinen has quit [Quit: saarinen]
havenwood has quit [Remote host closed the connection]
jg_ has joined #ruby-lang
sonvu has quit [Quit: Page closed]
pixelhandler has joined #ruby-lang
cerber has joined #ruby-lang
mistym has quit [Ping timeout: 272 seconds]
mistym_ has joined #ruby-lang
_ht has quit [Remote host closed the connection]
malconis has joined #ruby-lang
majjoha has quit [Ping timeout: 244 seconds]
malconis has quit [Quit: Textual IRC Client: www.textualapp.com]
cerber has quit [Ping timeout: 272 seconds]
jg_ has quit [Quit: Leaving]
karamazov has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nescio has quit []
dm78 has joined #ruby-lang
MikaAK1 has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
vivekrai has quit [Quit: Connection closed for inactivity]
dm78 has quit [Ping timeout: 240 seconds]
allomov has quit [Remote host closed the connection]
AncientAmateur has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
snoopybbt has quit [Ping timeout: 245 seconds]
cerber has joined #ruby-lang
ari-_-e has quit [Ping timeout: 272 seconds]
lewix has joined #ruby-lang
<lewix> hi
ari-_-e has joined #ruby-lang
sarkyniin has quit [Quit: Quitte]
snoopybbt has joined #ruby-lang
GBrawl has joined #ruby-lang
stulzer has quit [Quit: leaving]
tkuchiki has joined #ruby-lang
x0f has quit [Ping timeout: 272 seconds]
MikaAK1 has quit [Quit: node-irc says goodbye]
symm- has joined #ruby-lang
x0f has joined #ruby-lang
rdavila has joined #ruby-lang
kyb3r_ has joined #ruby-lang
marr has joined #ruby-lang
yubrew has joined #ruby-lang
havenwood has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
Squarepy has joined #ruby-lang
yubrew has quit [Ping timeout: 245 seconds]
GBrawl has quit [Quit: Lingo - http://www.lingoirc.com]
x0f has quit [Ping timeout: 264 seconds]
rdavila has quit [Quit: rdavila]
yfeldblu_ has joined #ruby-lang
x0f has joined #ruby-lang
shinnya has joined #ruby-lang
dm78 has joined #ruby-lang
yfeldbl__ has joined #ruby-lang
yfeldbl__ has quit [Remote host closed the connection]
yfeldbl__ has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
AncientAmateur has joined #ruby-lang
yfeldblu_ has quit [Ping timeout: 244 seconds]
[dmp] has joined #ruby-lang
[dmp] has quit [Changing host]
[dmp] has joined #ruby-lang
allomov has joined #ruby-lang
dm78 has quit [Ping timeout: 272 seconds]
MikaAK has joined #ruby-lang
skinny_much has quit [Quit: ZNC - http://znc.sourceforge.net]
spastorino has quit [Quit: Connection closed for inactivity]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matp has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
paramg has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
MC__ has joined #ruby-lang
pixelhandler has quit [Quit: pixelhandler]
jasiek_ has quit [Ping timeout: 245 seconds]
jasiek has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
yubrew has joined #ruby-lang
MC__ has quit [Ping timeout: 246 seconds]
arBmind has quit [Quit: Leaving.]
paramg has left #ruby-lang [#ruby-lang]
yubrew has quit [Ping timeout: 264 seconds]
allomov has quit [Remote host closed the connection]
sarkyniin has joined #ruby-lang
benlovell has joined #ruby-lang
benlovell has quit [Ping timeout: 245 seconds]
lewix has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
sarkyniin has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby-lang
ItSANgo has quit [Read error: Connection reset by peer]
ItSANgo_ has joined #ruby-lang
ironhide_604 has quit [Ping timeout: 240 seconds]
djbkd has quit [Ping timeout: 240 seconds]
ari-_-e has quit [Ping timeout: 245 seconds]
ari-_-e has joined #ruby-lang
mistym_ has quit [Remote host closed the connection]
toastynerd has quit [Remote host closed the connection]
dorei has quit []
yubrew has joined #ruby-lang
djbkd has joined #ruby-lang
dm78 has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldbl__ has quit [Read error: Connection reset by peer]
yubrew has quit [Ping timeout: 244 seconds]
closer has quit [Ping timeout: 272 seconds]
closer has joined #ruby-lang
jarto has joined #ruby-lang
AKASkip has quit [Ping timeout: 264 seconds]
djbkd has quit [Ping timeout: 255 seconds]
stamina has quit [Ping timeout: 245 seconds]
shinnya has quit [Ping timeout: 244 seconds]
havenwood has joined #ruby-lang
shinnya has joined #ruby-lang
stulzer has joined #ruby-lang
rdavila has joined #ruby-lang
rdavila has quit [Client Quit]
x0f has quit [Ping timeout: 255 seconds]
MikaAK1 has joined #ruby-lang
MikaAK1 has quit [Client Quit]
x0f has joined #ruby-lang
toastynerd has joined #ruby-lang