ljarvis changed the topic of #ruby-lang to: Ruby 2.1.2; 2.0.0-p481; 1.9.3-p547: http://ruby-lang.org || Paste code on http://gist.github.com
sharpmachine has quit [Remote host closed the connection]
heavyhorse has quit [Read error: Connection reset by peer]
heavyhorse has joined #ruby-lang
omosoj has quit [Client Quit]
mosoj has joined #ruby-lang
luiz_ has joined #ruby-lang
luiz_ is now known as Guest65314
saarinen has quit [Quit: saarinen]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
luiz_lha has quit [Ping timeout: 250 seconds]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
maruchan4 has quit [Quit: Leaving.]
RobertBirnie has quit [Ping timeout: 244 seconds]
katlogic has left #ruby-lang [#ruby-lang]
nathanstitt has quit [Quit: I growing sleepy]
nathanstitt has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 240 seconds]
znz_jp has quit [Quit: kill -QUIT $$]
tkuchiki has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
ddv has quit [Ping timeout: 260 seconds]
znz_jp has joined #ruby-lang
havenwood has joined #ruby-lang
sarkyniin has quit [Quit: Quitte]
ddv has joined #ruby-lang
nofxx_ has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
seanosaur has quit [Remote host closed the connection]
spastorino has joined #ruby-lang
Bwild has joined #ruby-lang
nofxx__ has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 255 seconds]
elia has quit [Quit: Computer has gone to sleep.]
arooni-mobile has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
stardiviner has joined #ruby-lang
Mandros has left #ruby-lang [#ruby-lang]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Averna has joined #ruby-lang
djbkd has quit [Ping timeout: 255 seconds]
tkuchiki has joined #ruby-lang
djbkd has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
gix has quit [Ping timeout: 264 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
gix has joined #ruby-lang
heavyhorse has quit [Quit: Computer has gone to sleep]
heavyhorse has joined #ruby-lang
gix has quit [Quit: Client exiting]
heavyhorse has quit [Ping timeout: 250 seconds]
diegoviola has quit [Remote host closed the connection]
michaeldeol has quit [Ping timeout: 250 seconds]
hahuang65 has joined #ruby-lang
gix has joined #ruby-lang
amsi has quit [Quit: Leaving]
Nix_ has quit [Quit: Page closed]
hahuang65 has quit [Ping timeout: 244 seconds]
bantic has joined #ruby-lang
sepp2k has joined #ruby-lang
zbunde has quit [Ping timeout: 246 seconds]
dpatel has quit [Quit: dpatel]
torrieri has joined #ruby-lang
mosoj has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
davispuh has quit [Ping timeout: 245 seconds]
Miphix has joined #ruby-lang
shinnya has quit [Ping timeout: 255 seconds]
hellome has quit [Ping timeout: 250 seconds]
agrinb_ has joined #ruby-lang
michaeldeol has joined #ruby-lang
agrinb has quit [Ping timeout: 255 seconds]
jbardin has quit [Quit: jbardin]
agrinb_ has quit [Ping timeout: 255 seconds]
kuanding has quit [Quit: kuanding]
kuanding has joined #ruby-lang
torrieri has quit [Quit: Linkinus - http://linkinus.com]
torrieri has joined #ruby-lang
johnpclaus has joined #ruby-lang
torrieri has quit [Client Quit]
torrieri has joined #ruby-lang
charliesome has joined #ruby-lang
hahuang65 has joined #ruby-lang
charliesome has quit [Client Quit]
s1kx has quit [Quit: Leaving]
arooni-mobile has quit [Ping timeout: 256 seconds]
wallerdev has joined #ruby-lang
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 264 seconds]
DEac- has quit [Ping timeout: 264 seconds]
DEac- has joined #ruby-lang
bantic has quit [Quit: bantic]
RobertBirnie has joined #ruby-lang
InfraRuby has joined #ruby-lang
|jemc| has joined #ruby-lang
InfraRuby has left #ruby-lang [#ruby-lang]
djbkd has quit [Quit: My people need me...]
havenwood has quit [Remote host closed the connection]
arooni-mobile has joined #ruby-lang
havenwood has joined #ruby-lang
Cakey has joined #ruby-lang
tectonic has joined #ruby-lang
torrieri_ has joined #ruby-lang
dwknoxy has quit [Quit: Textual IRC Client: www.textualapp.com]
torrieri has quit [Ping timeout: 264 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Sgeo_ has joined #ruby-lang
Sgeo has quit [Ping timeout: 255 seconds]
Forgetful_Lion has quit [Remote host closed the connection]
brianpWins has quit [Ping timeout: 240 seconds]
toretore has quit [Ping timeout: 255 seconds]
toretore has joined #ruby-lang
agrinb has joined #ruby-lang
|jemc|_ has joined #ruby-lang
torrieri_ has quit [Read error: Connection reset by peer]
|jemc| has quit [Ping timeout: 255 seconds]
torrieri has joined #ruby-lang
RobertBirnie has quit [Ping timeout: 255 seconds]
RobertBirnie has joined #ruby-lang
amystephen has quit [Quit: amystephen]
RobertBirnie has quit [Client Quit]
bnagy has quit [Ping timeout: 250 seconds]
bnagy has joined #ruby-lang
charliesome has joined #ruby-lang
charliesome has quit [Read error: Connection reset by peer]
InfraRuby has joined #ruby-lang
charliesome has joined #ruby-lang
charliesome has quit [Read error: Connection reset by peer]
charliesome has joined #ruby-lang
charliesome has quit [Client Quit]
cantonic has joined #ruby-lang
weems|mac has joined #ruby-lang
agrinb has quit [Remote host closed the connection]
agrinb has joined #ruby-lang
charliesome has joined #ruby-lang
agrinb has quit [Ping timeout: 264 seconds]
pixelhandler has joined #ruby-lang
RobertBirnie has joined #ruby-lang
johnpclaus has quit []
lsegal has joined #ruby-lang
pixelhandler has quit [Quit: pixelhandler]
zz_anildigital is now known as anildigital
michaeldeol has joined #ruby-lang
vintik has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
nathanstitt has quit [Quit: I growing sleepy]
lcdhoffman has joined #ruby-lang
djbkd has joined #ruby-lang
mistym has joined #ruby-lang
willmarshall has joined #ruby-lang
gix has quit [Ping timeout: 240 seconds]
rhizome has joined #ruby-lang
<rhizome> what's the concept name for foo = bar = baz, evaluated RTL?
gix has joined #ruby-lang
agrinb has joined #ruby-lang
crankharder has quit [Quit: leaving]
crankharder has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hahuang61 has joined #ruby-lang
hahuang65 has quit [Ping timeout: 256 seconds]
anildigital is now known as zz_anildigital
charliesome has quit [Ping timeout: 260 seconds]
koderok has joined #ruby-lang
spastorino has quit [Quit: Connection closed for inactivity]
charliesome has joined #ruby-lang
<ari-_-e> rhizome: what concept?
kaiwren has joined #ruby-lang
pr0ton has joined #ruby-lang
agrinb has quit [Remote host closed the connection]
vintik has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
charliesome has quit [Ping timeout: 240 seconds]
gnufied has quit [Ping timeout: 240 seconds]
weems|mac has quit [Quit: weems|mac]
charliesome has joined #ruby-lang
zz_anildigital is now known as anildigital
anildigital is now known as zz_anildigital
gnufied has joined #ruby-lang
<rhizome> say baz = "four", it then gets assigned to bar, then foo
charliesome_ has joined #ruby-lang
<rhizome> multiple assignment is foo,bar = "baz","quux" # foo == "baz"; bar == "quux"
<ari-_-e> that's sometimes called "parallel assignment" as well
<ari-_-e> in any case, I don't think there's really a name for foo = bar = baz
<ari-_-e> maybe chained assignment? I probably just made that up though
charliesome has quit [Ping timeout: 250 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
brianpWins has joined #ruby-lang
charliesome has joined #ruby-lang
vintik has joined #ruby-lang
charliesome has quit [Max SendQ exceeded]
charliesome has joined #ruby-lang
charliesome_ has quit [Ping timeout: 250 seconds]
|jemc|_ has quit [Ping timeout: 260 seconds]
amclain has quit [Quit: Leaving]
arooni-mobile has quit [Ping timeout: 245 seconds]
<pipework> drbrain: In DRBObject.new, when will I ever want the obj to not be nil? I can't brain out why.
<ari-_-e> brainz
tectonic has quit [Read error: Connection reset by peer]
tectonic has joined #ruby-lang
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
InfraRuby has left #ruby-lang [#ruby-lang]
RobertBirnie has joined #ruby-lang
charliesome has quit [Ping timeout: 255 seconds]
_ht has joined #ruby-lang
willmarshall has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
relix has joined #ruby-lang
hahuang61 has quit [Ping timeout: 244 seconds]
willmarshall has joined #ruby-lang
|jemc| has joined #ruby-lang
|jemc| has quit [Client Quit]
apeiros has quit [Remote host closed the connection]
zz_anildigital is now known as anildigital
apeiros has joined #ruby-lang
sepp2k1 has quit [Read error: Connection reset by peer]
kyb3r_ has joined #ruby-lang
apeiros has quit [Ping timeout: 250 seconds]
havenwood has quit []
heftig has quit [Ping timeout: 250 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
hahuang61 has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Ping timeout: 245 seconds]
jackyalcine is now known as jacky
fragamus has joined #ruby-lang
chaos7theory has joined #ruby-lang
Atttwww has quit [Ping timeout: 255 seconds]
tectonic has quit []
dangerousdave has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby-lang
tectonic has joined #ruby-lang
relix has joined #ruby-lang
michaeldeol has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
tectonic has quit []
AKASkip has joined #ruby-lang
apeiros has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
wallerdev has quit [Quit: wallerdev]
jsaak_ has quit [Ping timeout: 260 seconds]
AKASkip has quit [Ping timeout: 256 seconds]
InfraRuby has joined #ruby-lang
solars has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
tbuehlmann has joined #ruby-lang
yfeldblum has joined #ruby-lang
hahuang61 has quit [Ping timeout: 255 seconds]
pr0ton has quit [Quit: pr0ton]
Averna has quit [Quit: Leaving.]
vintik has quit [Remote host closed the connection]
skade has joined #ruby-lang
clauswitt has joined #ruby-lang
AKASkip has joined #ruby-lang
gix has quit [Quit: Client exiting]
futilegames has joined #ruby-lang
gix has joined #ruby-lang
elia has joined #ruby-lang
clauswit_ has joined #ruby-lang
clauswitt has quit [Ping timeout: 264 seconds]
yxhuvud has quit [Remote host closed the connection]
yxhuvud has joined #ruby-lang
ta has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
futilegames has quit [Quit: futilegames]
sMecKs has quit [Read error: Connection reset by peer]
koderok has quit [Quit: koderok]
hellangel7 has joined #ruby-lang
hellangel7 has quit [Max SendQ exceeded]
hellangel7 has joined #ruby-lang
mikecmpbll has joined #ruby-lang
stardiviner has joined #ruby-lang
<yorickpeterse> morning
AKASkip has quit [Ping timeout: 250 seconds]
Forgetful_Lion has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gamov has joined #ruby-lang
vintik has joined #ruby-lang
AKASkip has joined #ruby-lang
qba73 has joined #ruby-lang
vintik has quit [Ping timeout: 240 seconds]
chaos7theory has quit [Quit: Leaving]
danijoo has quit [Read error: Connection reset by peer]
joelmheim_ is now known as joelmheim
danijoo has joined #ruby-lang
willmarshall has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vintik has joined #ruby-lang
InfraRuby has left #ruby-lang [#ruby-lang]
ssam2 has joined #ruby-lang
koderok has joined #ruby-lang
arBmind has joined #ruby-lang
skade has joined #ruby-lang
jhass|off is now known as jhass
skade has quit [Client Quit]
ur5us has joined #ruby-lang
Forgetful_Lion has quit [Ping timeout: 250 seconds]
unsymbol has quit [Ping timeout: 264 seconds]
Forgetful_Lion has joined #ruby-lang
unsymbol has joined #ruby-lang
benlovell has joined #ruby-lang
vintik has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
marr has joined #ruby-lang
nofxx_ has quit [Ping timeout: 245 seconds]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
Blaguvest has joined #ruby-lang
stamina has joined #ruby-lang
kek has joined #ruby-lang
fullybaked has joined #ruby-lang
stef_204 has joined #ruby-lang
Miphix has quit [Quit: Leaving]
kyb3r_ has joined #ruby-lang
faces has joined #ruby-lang
face has quit [Ping timeout: 245 seconds]
gamov has quit [Quit: gamov]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
dangerou_ has joined #ruby-lang
dangerousdave has quit [Ping timeout: 260 seconds]
heavyhorse has joined #ruby-lang
elia has quit [Read error: Connection reset by peer]
elia has joined #ruby-lang
davispuh has joined #ruby-lang
heavyhorse has quit [Quit: Computer has gone to sleep]
arBmind has quit [Quit: Leaving.]
heavyhorse has joined #ruby-lang
koderok has quit [Quit: koderok]
heavyhorse has quit [Ping timeout: 250 seconds]
koderok has joined #ruby-lang
heftig has joined #ruby-lang
Cakey has joined #ruby-lang
sarkyniin has joined #ruby-lang
banister_ has quit [Read error: Connection reset by peer]
tkuchiki_ has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
arBmind has joined #ruby-lang
toretore has quit [Read error: No route to host]
amystephen has joined #ruby-lang
tkuchiki has quit [Ping timeout: 250 seconds]
diegoviola has joined #ruby-lang
tkuchiki_ has quit [Ping timeout: 255 seconds]
toretore has joined #ruby-lang
bin7me has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
ldnunes has joined #ruby-lang
ur5us has joined #ruby-lang
tkuchiki has joined #ruby-lang
hellangel7 has quit [Read error: Connection reset by peer]
DEac- has quit [Quit: leaving]
DEac- has joined #ruby-lang
ur5us has quit [Ping timeout: 256 seconds]
agrinb has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyb3r_ has quit [Read error: Connection reset by peer]
riffraff has joined #ruby-lang
spastorino has joined #ruby-lang
skade has joined #ruby-lang
setmeaway has joined #ruby-lang
agrinb has quit [Remote host closed the connection]
agrinb has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
agrinb has quit [Ping timeout: 244 seconds]
karamazov has joined #ruby-lang
stef_204 has quit [Remote host closed the connection]
Cakey has quit [Ping timeout: 260 seconds]
ironhide_604 has joined #ruby-lang
Sgeo_ has quit [Read error: Connection reset by peer]
weems|mac has joined #ruby-lang
weems|mac has quit [Client Quit]
hahuang61 has joined #ruby-lang
elia has joined #ruby-lang
jds has quit [Quit: Connection closed for inactivity]
stamina has quit [Ping timeout: 250 seconds]
agrinb has joined #ruby-lang
hellangel7 has joined #ruby-lang
diegovio1 has joined #ruby-lang
koderok has quit [Quit: koderok]
diegoviola has quit [Ping timeout: 255 seconds]
agrinb has quit [Ping timeout: 260 seconds]
symm- has joined #ruby-lang
setmeaway has quit [Quit: Leaving]
diegovio1 has quit [Ping timeout: 256 seconds]
dangerou_ has quit []
stef_204 has joined #ruby-lang
malconis has joined #ruby-lang
ur5us has joined #ruby-lang
malconis has quit [Remote host closed the connection]
malconis has joined #ruby-lang
ur5us has quit [Ping timeout: 264 seconds]
marr has quit [Ping timeout: 250 seconds]
diegoviola has joined #ruby-lang
miqui has joined #ruby-lang
hahuang61 has quit [Ping timeout: 256 seconds]
jgpawletko has joined #ruby-lang
Forgetful_Lion has quit [Remote host closed the connection]
<yorickpeterse> Refactoring code from early 2012
<yorickpeterse> awww yiss
<yorickpeterse> I was supposed to simply add some dotenv stuff to this project
<yorickpeterse> ^ this is why I suck at planning, I always find stuff my brain thinks I have to do
kaiwren has quit [Quit: kaiwren]
banister has joined #ruby-lang
Atttwww has joined #ruby-lang
koderok has joined #ruby-lang
torrieri has quit [Ping timeout: 250 seconds]
vondruch has quit [Ping timeout: 244 seconds]
fullybak_ has joined #ruby-lang
rcvalle has joined #ruby-lang
fullybaked has quit [Ping timeout: 240 seconds]
workmad3 is now known as wm3|away
<henrikhodne> Is there a method on Hash that works similar to Hash#fetch, but it's using the block to "modify" the value?
meizaps has quit [Ping timeout: 260 seconds]
<henrikhodne> That is, I would like something like this: hsh.the_method(:a_key) { |str| " --something=#{str}" } where " --something=#{hsh[:a_key]}" is returned if :a_key is in the hash, or nil otherwise.
<jhass> no, but you can write (str = hash[:a_key]) && "--something=#{str}"
<henrikhodne> I suppose that would work too. Right now I'm doing hsh[:a_key] ? " --something=#{hsh[:a_key]}" : "", which is slightly different, but returning nil would work too since I interpolate it into a string again later.
znz_jp has quit [Ping timeout: 250 seconds]
karamazov has quit []
<jhass> so you're building an argument list for a command invocation?
meizaps has joined #ruby-lang
jgpawletko has quit [*.net *.split]
stef_204 has quit [*.net *.split]
elia has quit [*.net *.split]
fragamus has quit [*.net *.split]
crankharder has quit [*.net *.split]
btiefert has quit [*.net *.split]
duderonomy has quit [*.net *.split]
hlowe has quit [*.net *.split]
joevandyk has quit [*.net *.split]
Mon_Ouie has quit [*.net *.split]
samuelkadolph has quit [*.net *.split]
GaelanAintAround has quit [*.net *.split]
yalue has quit [*.net *.split]
MichD has quit [*.net *.split]
yliu has quit [*.net *.split]
ItSANgo has quit [*.net *.split]
levifig has quit [*.net *.split]
Mellett68_ has quit [*.net *.split]
eval-in has quit [*.net *.split]
saltsa has quit [*.net *.split]
seanhagen has quit [*.net *.split]
Jamo has quit [*.net *.split]
jayne has quit [*.net *.split]
Mopman has quit [*.net *.split]
jeaye has quit [*.net *.split]
pabs has quit [*.net *.split]
cout has quit [*.net *.split]
Xney has quit [*.net *.split]
closer has quit [*.net *.split]
drbrain has quit [*.net *.split]
nfsnobody has quit [*.net *.split]
jgpawletko has joined #ruby-lang
crankharder has joined #ruby-lang
samuelkadolph has joined #ruby-lang
hlowe has joined #ruby-lang
stef_204 has joined #ruby-lang
MichD has joined #ruby-lang
yalue has joined #ruby-lang
joevandyk has joined #ruby-lang
closer has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
elia has joined #ruby-lang
btiefert has joined #ruby-lang
fragamus has joined #ruby-lang
yliu has joined #ruby-lang
duderonomy has joined #ruby-lang
Mellett68_ has joined #ruby-lang
levifig has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
eval-in has joined #ruby-lang
seanhagen has joined #ruby-lang
jayne has joined #ruby-lang
Jamo has joined #ruby-lang
saltsa has joined #ruby-lang
ItSANgo has joined #ruby-lang
nfsnobody has joined #ruby-lang
jeaye has joined #ruby-lang
Mopman has joined #ruby-lang
pabs has joined #ruby-lang
Xney has joined #ruby-lang
drbrain has joined #ruby-lang
cout has joined #ruby-lang
<henrikhodne> Yes, but only for one argument. Here's the full method: https://gist.github.com/henrikhodne/d98aaf69e2069509da6e
znz_jp has joined #ruby-lang
|stef_204| has joined #ruby-lang
weems|mac has joined #ruby-lang
nisstyre has quit [Ping timeout: 250 seconds]
banister has quit [Read error: Connection reset by peer]
banister_ has joined #ruby-lang
znz_jp has quit [Ping timeout: 250 seconds]
anildigital is now known as zz_anildigital
fullybak_ has quit []
stef_204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
marr has joined #ruby-lang
znz_jp has joined #ruby-lang
kirin` has quit [Quit: leaving]
|stef_204| has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
kirin` has joined #ruby-lang
Miphix has joined #ruby-lang
charliesome has joined #ruby-lang
danromano has joined #ruby-lang
<Kero> henrikhodne: modifying ssh settings without user consent (in any way) is bad practice
rmcafee has joined #ruby-lang
centrx has joined #ruby-lang
charliesome has quit [Ping timeout: 264 seconds]
jgoetze has joined #ruby-lang
charliesome has joined #ruby-lang
jgoetze has quit [Client Quit]
stef_204 has joined #ruby-lang
jgoetze has joined #ruby-lang
zz_anildigital is now known as anildigital
pglombardo has joined #ruby-lang
<jgoetze> Hey guys,
<jgoetze> i created a facebook page called "Your Daily Dose Of Ruby"! There you will get every day a random method of a random class of the ruby library. A post contains the description of everything related, the links and an image showing an example. So if you are ready to get your daily dose, check it out and you might learn some stuff you didnt know.
<jgoetze> Greetz
<jgoetze> Link: fb.com/672461062828915
<jgoetze>
nisstyre has joined #ruby-lang
lcdhoffman has joined #ruby-lang
shinnya has joined #ruby-lang
jgoetze has quit [Client Quit]
momomomomo has joined #ruby-lang
danromano has quit [Quit: Leaving]
<tbuehlmann> facebook? not gonna happen.. :\
Taranis has joined #ruby-lang
loincloth has joined #ruby-lang
ta has quit [Remote host closed the connection]
weems|mac has quit [Quit: weems|mac]
znz_jp has quit [Ping timeout: 250 seconds]
momomomomo has quit [Quit: momomomomo]
hahuang61 has joined #ruby-lang
znz_jp has joined #ruby-lang
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
johnpclaus has joined #ruby-lang
Boohbah has quit [Remote host closed the connection]
Boohbah has joined #ruby-lang
momomomomo has joined #ruby-lang
fullybaked has joined #ruby-lang
malconis has joined #ruby-lang
Missphoenix has joined #ruby-lang
clauswit_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cmhobbs has joined #ruby-lang
cmhobbs has joined #ruby-lang
Miphix has quit [Ping timeout: 250 seconds]
stardiviner has quit [Ping timeout: 255 seconds]
koderok has quit [Quit: koderok]
ari-_-e has quit [Quit: Leaving]
Miphix has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
mistym has joined #ruby-lang
wm3|away is now known as workmad3
Missphoenix has quit [Ping timeout: 244 seconds]
weems|mac has joined #ruby-lang
nathanstitt has joined #ruby-lang
fullybaked has quit []
fullybaked has joined #ruby-lang
stardiviner has joined #ruby-lang
mistym has quit [Remote host closed the connection]
stardiviner has quit [Client Quit]
hahuang61 has quit [Ping timeout: 245 seconds]
Mandros has joined #ruby-lang
hahuang61 has joined #ruby-lang
fullybaked has quit []
Cakey has joined #ruby-lang
Cakey has quit [Ping timeout: 255 seconds]
solars has quit [Ping timeout: 240 seconds]
tbuehlmann has quit [Quit: Leaving]
fullybaked has joined #ruby-lang
mistym has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
AKASkip has quit [Ping timeout: 250 seconds]
Miphix has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 245 seconds]
koderok has joined #ruby-lang
pixelhandler has joined #ruby-lang
stardiviner has joined #ruby-lang
|jemc| has joined #ruby-lang
stamina has joined #ruby-lang
ruby-lang828 has joined #ruby-lang
hramrach has joined #ruby-lang
<hramrach> hello
sepp2k has quit [Quit: Konversation terminated!]
<jhass> hi
skade has quit [Quit: Computer has gone to sleep.]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby-lang
koderok_ has joined #ruby-lang
koderok has quit [Write error: Connection reset by peer]
koderok_ is now known as koderok
emmesswhy has joined #ruby-lang
weems|mac has joined #ruby-lang
<gregf_> function recurseSanitize(&$data) { foreach ( $data as $key => $val ){ if ( is_array($val) ){ recurseSanitize($val); } else { $data[$key] = htmlentities($val, ENT_QUOTES); } } }
<gregf_> bah :/ sorry
<ericwood> nice code there
<hramrach> how do I make a string containing the bytes 0..255?
satman has joined #ruby-lang
<jhass> (0..255).to_a.pack("C*")
<yorickpeterse> def magic_start_time; 1100000000; end # wat
<yorickpeterse> that's like `def random_number; 4; end`
<jhass> it's magic!
<yorickpeterse> it's magic in that I have no idea what it's based on
<yorickpeterse> clearly this code is self documenting
<jhass> you forgot the # chosen by fair dice roll
<yorickpeterse> maybe I should use the Git history as the documentation
<hramrach> yes, that looks good. thanks
<hramrach> pack is magic ;-)
<yorickpeterse> Commit: "untested intermittant commit"
<yorickpeterse> such docs
<yorickpeterse> very wow
charliesome has joined #ruby-lang
anildigital is now known as zz_anildigital
stamina has quit [Ping timeout: 250 seconds]
<hramrach> how do I add encoding support to Ruby?
<jhass> already in
<hramrach> I need new encoding
<jhass> which one?
<hramrach> I have a table which defines how it translates to UTF-8
momomomomo_ has joined #ruby-lang
<ericwood> UTF-8 outta be enough for anyone
<hramrach> the data is not in it
<jhass> in what is it?
centrx has quit [Quit: Mead error: Connection reset by beer]
<hramrach> result of bogus encoding
<dacamp> zenspider: found my etcutils bug. I'm an idiot and didn't register those variables with the ruby gc.
<jhass> in what way bogus? encode has a number of parameters to deal with invalid stuff
<hramrach> somebody translated Latin2 to UTF-8. twice
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has quit [Ping timeout: 245 seconds]
momomomomo_ is now known as momomomomo
<jhass> can't you reverse that by assuming it's UTF-8, encode it to Latin2 then assume it's UTF-8 again?
<hramrach> it does not seem to work just reverse-encoding it twice
<jhass> do you have some example data to play with?
<hramrach> or once
<hramrach> I can artifically break some random web page if need be
rippa has joined #ruby-lang
<hramrach> but the data produced by simply reverse-encoding is invalid
<hramrach> a tool says it's doubly-encoded but there is no tool that reverses the effect
sharpmachine has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
<yorickpeterse> One does not simply "create an encoding"
<jhass> "fööbär".encode(Encoding::ISO8859_2).encode("UTF-8").force_encoding(Encoding::ISO8859_2).encode("UTF-8").encode(Encoding::ISO8859_2).force_encoding("UTF-8") returns the original string for me
<yorickpeterse> it's not a matter of Encodings['my_encoding'] << something
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
<hramrach> yes, it seems to work on the web page. So either the tool saying it's doubly encoded is wrong or it fails in some corner cases
tbuehlmann has joined #ruby-lang
zz_anildigital is now known as anildigital
apeiros has quit [Remote host closed the connection]
nofxx_ has joined #ruby-lang
vintik has joined #ruby-lang
hellangel7 has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
ascarter has joined #ruby-lang
michaeldeol has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
charliesome has quit [Client Quit]
<hramrach> either way, how do you decode a file in arbitrary encoding?
ascarter has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<jhass> File.open('foo', encoding: 'UTF-16:UTF-8') to open a UTF-16 file and transparently convert it to UTF-8 iirc
<hramrach> that only works for encodings Ruby supports
<jhass> which one is missing?
<hramrach> the broken one
<jhass> well, I'd read it as UTF-8 or ASCII-8bit and throw encode/force_encoding stuff to fix it ontop
Blaguvest has quit []
Mon_Ouie has quit [Remote host closed the connection]
RobertBirnie has joined #ruby-lang
<hramrach> that does not seem to work. It produces something invalid somewhere
vintik has quit [Remote host closed the connection]
<jhass> I mean you could try to fix it at the byte level by iterating over the bytes and map them to others
wallerdev has joined #ruby-lang
<jhass> and since you can't provide a sample to toy with...
<hramrach> and how do you reasonably iterate over bytes?
<hramrach> it's actually substrings
<jhass> read as ASCII_8BIT and use .bytes or .each_byte on the resulting string
<hramrach> if you translate latin2 to utf8 twice you get all valid byte sequences for the 'encoding'
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
__butch__ has joined #ruby-lang
qba73 has quit [Remote host closed the connection]
Squarepy has joined #ruby-lang
riffraff has quit [Quit: This computer has gone to sleep]
mistym has joined #ruby-lang
toastynerd has joined #ruby-lang
michaeldeol has joined #ruby-lang
mikecmpbll has quit [Ping timeout: 255 seconds]
stamina has joined #ruby-lang
omosoj has joined #ruby-lang
fullybaked has quit [Ping timeout: 260 seconds]
stef_204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
benlovell has quit [Ping timeout: 264 seconds]
wallerdev has quit [Quit: wallerdev]
rue has quit [Remote host closed the connection]
maruchan4 has joined #ruby-lang
sepp2k has joined #ruby-lang
musl has quit [Quit: WeeChat 0.4.3]
riffraff has joined #ruby-lang
stevednd has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
brianpWins has joined #ruby-lang
riffraff has quit [Ping timeout: 264 seconds]
dwknoxy has joined #ruby-lang
dwknoxy is now known as dknox-bbib
tbuehlmann has quit [Remote host closed the connection]
hahuang61 has quit [Ping timeout: 255 seconds]
apeiros has joined #ruby-lang
Guest65314 has quit [Remote host closed the connection]
Guest65314 has joined #ruby-lang
riffraff has joined #ruby-lang
clauswitt has joined #ruby-lang
arooni-mobile has joined #ruby-lang
alexju has joined #ruby-lang
jbardin has joined #ruby-lang
<darix> hramrach: doesnt ruby have a scrub method for this reason? (For older ruby versions you can use the one from active record)
vintik has joined #ruby-lang
malconis has quit [Quit: Textual IRC Client: www.textualapp.com]
arBmind has quit [Quit: Leaving.]
dorei has joined #ruby-lang
<hramrach> ri does not seem to know about scrub
<hramrach> ruby 1.9.3p194 (2012-04-20 revision 35410)
<darix> hramrach: then use the stuff that comes with activesupport
<apeiros> String#scrub is 2.1
maruchan4 has left #ruby-lang [#ruby-lang]
rsl has quit [Ping timeout: 245 seconds]
<darix> later
hahuang61 has joined #ruby-lang
musl has joined #ruby-lang
<hramrach> ruby 2.1.2p95 (2014-05-08)
<hramrach> still no scrub
musl has quit [Client Quit]
<darix> mine does
<darix> you are sure you really called 2.1?
saarinen has joined #ruby-lang
<hramrach> how can I know?
musl has joined #ruby-lang
djbkd has joined #ruby-lang
InfraRuby has joined #ruby-lang
<apeiros> >> String.method_defined?(:scrub)
<eval-in> apeiros => true (https://eval.in/175743)
yfeldblum has quit [Remote host closed the connection]
<apeiros> hramrach: ^ seem you're doing it wrong
<apeiros> *seems
yfeldblum has joined #ruby-lang
<apeiros> `ruby -v` prints the ruby version. RUBY_VERSION gives you the information in code.
<hramrach> yes, the method is defined and ri does no know about it
<hramrach> looks like the package is broken
<apeiros> looks like you didn't install the docs
<hramrach> yes, it does not know about scan either
torrieri has joined #ruby-lang
yfeldblum has quit [Ping timeout: 260 seconds]
ssam2 has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 240 seconds]
sarkyniin has quit [Quit: Quitte]
arBmind has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 264 seconds]
banister_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stamina has quit [Quit: WeeChat 0.4.3]
anjen has joined #ruby-lang
anjen has quit [Read error: Connection reset by peer]
<hramrach> anyway, scrub is not exactly what I am looking for
<hramrach> hmm, dependency problem
<hramrach> still might be nice for some other cases
<hramrach> thanks for help
<darix> hramrach: what are you looking for?
torrieri has quit [Quit: Leaving...]
<darix> by definition bytes can only be 0-255. ... from what i gathered "remove all codepoints > 255"
<darix> although transliterate might be better
<darix> though you still need some assumption what kind of characterset is supposed to be in your string.
<hramrach> I looked into repairing a broken string
AKASkip has joined #ruby-lang
<darix> hramrach: so force encoding on what you think is in it
<hramrach> and I can't seem to figure out how exactly it is broken
<darix> and scrub the rest
<apeiros> scrubbing should be a last resort
<darix> apeiros: got better suggestion?
<apeiros> not having seen his original problem - no
<darix> true
<darix> with more details a better solution might be viable ... but generic solution would still be force_encoding+scrub :p
<darix> later
<apeiros> generic "better solution" is: ensure your sources play nice and deliver strings in the correct encoding. if you can't, ensure you know the encoding and transcode. if neither, you're already quite fucked.
<darix> apeiros: that sounds so hard. cant you say that more nicely?:p
charliesome has joined #ruby-lang
sarkyniin has joined #ruby-lang
benlovell has joined #ruby-lang
<apeiros> darix: sure
kek has quit [Remote host closed the connection]
anjen has joined #ruby-lang
dknox-bbib is now known as dknox
anjen has quit [Client Quit]
momomomomo has joined #ruby-lang
<hramrach> hmm, seems í is translated to \xC3 by the broken conversion
<hramrach> \xC3\x84 more precisely
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
bjessbrown has joined #ruby-lang
banister has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
alexju has quit [Remote host closed the connection]
* hramrach wants hiew with encoding support
torrieri has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
<bjessbrown> Hello, can someone help with a question about yaml and ruby hashes?
<bjessbrown> Ruby 2.1.2
<bjessbrown> —————————
<bjessbrown> h = {a: "lskdjf", b: "lskdjf"}
<bjessbrown> => {:a=>"lskdjf", :b=>"lskdjf"}
<bjessbrown> h.to_yaml
<bjessbrown> => "---\n:a: lskdjf\n:b: lskdjf\n"
<bjessbrown> y = h.to_yaml
<bjessbrown> => "---\n:a: lskdjf\n:b: lskdjf\n"
<bjessbrown> YAML.load y
dangerousdave has joined #ruby-lang
<bjessbrown> => {":a"=>"lskdjf", ":b"=>"lskdjf"}
<bjessbrown> Ruby 2.1.1
<bjessbrown> ——————————
<bjessbrown> h = {a: "lskdjf", b: "sldkjf"}
<bjessbrown> => {:a=>"lskdjf", :b=>"sldkjf"}
<bjessbrown> h.to_yaml
<bjessbrown> => "---\n:a: lskdjf\n:b: sldkjf\n"
<bjessbrown> y = h.to_yaml
<bjessbrown> => "---\n:a: lskdjf\n:b: sldkjf\n"
<bjessbrown> YAML.load(y)
<bjessbrown> => {:a=>"lskdjf", :b=>"sldkjf"}
<bjessbrown> checkout the hash from 2.1.2
<apeiros> bjessbrown: be so gentle to use a paste service, like gist.github.com
InfraRuby has left #ruby-lang [#ruby-lang]
<bjessbrown> aperios: thanks, I'm not a big IRC user, so didn't realize it would come out that way
<bjessbrown> here's the gist...little easier to read https://gist.github.com/jess/a858a133fe832f3e25c0
<apeiros> bjessbrown: you'll be happy to learn about tab completion then. makes you not typo nicks :-p
<bjessbrown> apeiros: got it :-)
sharpmachine has joined #ruby-lang
<apeiros> I can't reproduce your problem on 2.1.2
havenwood has joined #ruby-lang
deathwishdave has joined #ruby-lang
yfeldblum has joined #ruby-lang
<momomomomo> >> puts "we have a bot"
<eval-in> momomomomo => we have a bot ... (https://eval.in/175756)
<momomomomo> cool
elia has joined #ruby-lang
<hramrach> I can't reproduce it either wit the freshly installed ruby 2.1.2p95 (2014-05-08)
<hramrach> bjessbrown: what exact 2.1.2 version?
<apeiros> there's only one, hramrach
<bjessbrown> thanks guys, maybe something wrong with my ruby...if I load outside the rails env, I'm now getting undefined method `to_yaml' for {:a=>"lskdjf", :b=>"lskdjf"}:Hash
<apeiros> bjessbrown: you have to `require 'yaml'` first
Guest65314 has quit [Read error: Connection reset by peer]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hramrach> like "irb -r yaml"
<bjessbrown> ok, strange, didn't have to in 2.1.1
Guest65314 has joined #ruby-lang
<bjessbrown> ok, I'm getting expected result now, must be something in my rails app
<apeiros> bjessbrown: yes, you did have to
<apeiros> unless you've had RUBYOPT set, but since that'd affect 2.1.2 too, it's rather unlikely.
dangerousdave has quit []
loincloth has quit [Remote host closed the connection]
<bjessbrown> apeiros: ah, maybe pry loads it? (don't have to with pry but do with irb)
dangerousdave has joined #ruby-lang
<apeiros> quite possible. I have it in my pryrc, so no idea whether pry reads it on its own already
torrieri has quit [Quit: Linkinus - http://linkinus.com]
rsl has joined #ruby-lang
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
dangerou_ has joined #ruby-lang
<bjessbrown> any offhand suggestions on how this behavior could be changed in the rails app?
torrieri has joined #ruby-lang
ruby-lang828 has quit [Ping timeout: 246 seconds]
<momomomomo> bjessbrown: changed to what?
|jemc| has quit [Ping timeout: 250 seconds]
<bjessbrown> momomomomo: unexpected hash in from YAML load: https://gist.github.com/jess/a858a133fe832f3e25c0
dangerou_ has quit [Client Quit]
dangerousdave has quit []
dangerousdave has joined #ruby-lang
dangerousdave has quit [Client Quit]
sharpmachine has quit [Remote host closed the connection]
dangerousdave has joined #ruby-lang
sharpmachine has joined #ruby-lang
gpg_ has joined #ruby-lang
<bjessbrown> apeiros: FYI, I believe it was coming from safe_yaml which was required by jekyll. Thanks for help and the IRC tips!
<apeiros> yw
<apeiros> bad safe_yaml, bad. curious why it'd change that.
<apeiros> ah
<apeiros> because Symbol generation is a potential memory leak
<gpg_> hello i am trying to map over a nested array, but only map through the outer array item? here https://gist.github.com/ggeorgiev1/7bd08ae5a8d55a6ac06d
<gpg_> thanks alot
<jhass> gpg_: .each do |modifiers| puts "category_modifiers:#{modifiers.inspect}" end ?
|jemc| has joined #ruby-lang
<jhass> you're iterating over it btw, we say map when you call .map
monees has joined #ruby-lang
<gpg_> *iterate sorry
<gpg_> jhass: thanks
mikecmpbll has joined #ruby-lang
loincloth has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
elia has quit [Quit: Computer has gone to sleep.]
torrieri_ has joined #ruby-lang
torrieri has quit [Ping timeout: 250 seconds]
InfraRuby has joined #ruby-lang
palar has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
emmesswhy has quit [Quit: This computer has gone to sleep]
lcdhoffman has quit [Quit: lcdhoffman]
skade has joined #ruby-lang
chouhoul_ has joined #ruby-lang
benlovell has quit [Ping timeout: 264 seconds]
hahuang61 has quit [Ping timeout: 245 seconds]
sepp2k has quit [Read error: Connection reset by peer]
alexju has joined #ruby-lang
skade_ has joined #ruby-lang
benlovell has joined #ruby-lang
relix has quit [Read error: Connection reset by peer]
chouhoulis has quit [Ping timeout: 264 seconds]
relix has joined #ruby-lang
bjessbrown has quit [Remote host closed the connection]
alexju has quit [Remote host closed the connection]
skade has quit [Ping timeout: 255 seconds]
chouhoul_ has quit [Remote host closed the connection]
skade_ has quit [Ping timeout: 255 seconds]
skade has joined #ruby-lang
JohnFord has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
bin7me has quit [Read error: Connection reset by peer]
sharpmachine has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
tkuchiki has joined #ruby-lang
tectonic has joined #ruby-lang
solars has joined #ruby-lang
monees has quit [Ping timeout: 256 seconds]
havenwood has quit [Remote host closed the connection]
tectonic has quit [Client Quit]
torrieri_ has quit [Quit: Leaving...]
<gpg_> jhass: i suppose i didnt explain it well. i am renderig json and want to iterate through each "category_modifiers" attribute and assign to it each array item ie [#<ProductCategory category_modifiers: [7, [5, 4, 54, 55]], #<ProductCategory category_modifiers: [8, [6]] ] etc
Rylee has quit [Changing host]
Rylee has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cleopatra has joined #ruby-lang
havenwood has joined #ruby-lang
<cleopatra> ff
riffraff has quit [Quit: Leaving]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
<gpg_> hello
ascarter has joined #ruby-lang
<gpg_> need help here :)
ascarter has quit [Max SendQ exceeded]
<gpg_> noone is at their pcs
ascarter has joined #ruby-lang
<toretore> stop begging
<gpg_> i can say anything i want righ now
<gpg_> oops
<toretore> you already have the data in the array
<toretore> gist the code rendering the json too
<gpg_> i know this one has a hash was thinking rendering an array inside an array is acceptable?
sharpmachine has quit [Remote host closed the connection]
<toretore> is your attribute called category_modifiers or cat_modifiers?
<gpg_> category_modifiers
<toretore> i don't see it in the code
Guest65314 has quit [Read error: Connection reset by peer]
bjessbrown has joined #ruby-lang
bjessbrown has quit [Remote host closed the connection]
<gpg_> ah ok then cat_modifiers its a non persistent attribute , not in db, so can call it whatever. i am also using active model serializers gem to populate the non persistent attribute on the fly.
<toretore> sigh
<toretore> what is your actual question?
<toretore> you need to explain better what it is you want to do
benlovell has quit [Ping timeout: 255 seconds]
<gpg_> how to iterate through model.category_modifiers and assign each array item to each iteration?
torrieri has joined #ruby-lang
<toretore> what is model.category_modifiers ?
<toretore> it's not in your code
elia has joined #ruby-lang
<gpg_> it must be something like model.category_modifiers.each {|i| i.category_modifiers = array[i]} ?
<toretore> what is model.category_modifiers ?
<gpg_> category_modifiers is only defined in model with attr_accessor :category_modifiers
<gpg_> i am populating this attribute in controller
nathanstitt has quit [Read error: Connection reset by peer]
<jhass> with?
ironhide_604 has quit [Ping timeout: 240 seconds]
<gpg_> with each array value from array d from this gist https://gist.github.com/ggeorgiev1/7bd08ae5a8d55a6ac06d
desmondHume has joined #ruby-lang
<toretore> i still have no idea what you're doing, and what that "json" and other crap is doing there
<gpg_> ha
nathanstitt has joined #ruby-lang
<jhass> yeah me too
<gpg_> ok man no worries
<gpg_> jeez
<jhass> you're confusing as hell
<havenwood> gpg_: you're much more likely to get a quick answer if you simplify questions by removing the irrelevant parts
<desmondHume> asd
<toretore> you need to reduce your problem and the explanation of your problem to a minimal case
<havenwood> gpg_: not having JSON problems? show Ruby not JSON. etc.
tkuchiki has quit [Remote host closed the connection]
<havenwood> gpg_: if the problem is a Rails issue, try #rubyonrails
<jhass> gpg_: also choose domain relevant variable names, we can cope with that better than d and ab
tkuchiki has joined #ruby-lang
<gpg_> ok guys :)10x 4 creative criticismz
<gpg_> alright
<jhass> also make desired outputs either ruby literals/inspect like outputs. Otherwise we think you want to write that bunch of text to stdout
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
saarinen has quit [Quit: saarinen]
<desmondHume> does anybody know how to connect to #rubyonrails channel with textual?
fragamus has quit [Quit: Computer has gone to sleep.]
bunk__ has joined #ruby-lang
<jhass> desmondHume: tried /join #RubyOnRails
<jhass> ?
<desmondHume> i think I need some sort of authentication
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass> yes, run /msg NickServ help
fragamus has joined #ruby-lang
bunk__ has quit [Remote host closed the connection]
bunk__ has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
dangerousdave has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
desmondHume is now known as greset
sharpmachine has joined #ruby-lang
saarinen has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
hahuang61 has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
cmhobbs has quit [Read error: Connection reset by peer]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
cmhobbs has joined #ruby-lang
cmhobbs has joined #ruby-lang
cmhobbs has quit [Changing host]
bunk__ has quit [Ping timeout: 245 seconds]
cklee has joined #ruby-lang
ascarter has joined #ruby-lang
loincloth has quit [Remote host closed the connection]
toastynerd has joined #ruby-lang
<greset> wat
<greset> myemail has too many accounts registered.
fragamus has quit [Quit: Computer has gone to sleep.]
koderok has quit [Quit: koderok]
<greset> can't i just flush accounts connected to my email?
<greset> i don't even remember last time i used it
<jhass> you can try asking in #freenode
<jhass> at least you can get pw reset mails that way
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<crankharder> anyone know what Array#- or Array#uniq calls internally to compare objects? it appears to be something other than === or ==
chouhoulis has joined #ruby-lang
<apeiros> crankharder: .eql?
<apeiros> and .hash
<apeiros> since it uses a hash internally
<crankharder> "It compares elements using their #hash and #eql? methods for efficiency."
<crankharder> yea
<crankharder> how does it use both? do I just redefine eql?
palar_ has joined #ruby-lang
<apeiros> crankharder: read the docs for Hash
rsl has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> #hash is used to calculate the bucket. #eql? is used to determine whether two objects in the same bucket are equal.
cantonic has quit [Read error: Connection reset by peer]
saarinen has quit [Quit: saarinen]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<crankharder> Object#hash then?
saarinen has joined #ruby-lang
<apeiros> no. Hash.
rsl has joined #ruby-lang
<apeiros> the class.
palar has quit [Ping timeout: 260 seconds]
Squarepy has quit [Quit: Leaving]
loincloth has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
ascarter has quit [Ping timeout: 256 seconds]
danijoo has joined #ruby-lang
saarinen has quit [Client Quit]
palar_ has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
shinnya has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
__butch__ has quit [Read error: Connection reset by peer]
__butch__ has joined #ruby-lang
michaeldeol has joined #ruby-lang
jbardin has quit [Quit: jbardin]
<crankharder> sorry, i don't follow. what part of Hash?
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
monees has joined #ruby-lang
ascarter has joined #ruby-lang
torrieri has quit [Quit: Linkinus - http://linkinus.com]
ascarter has quit [Max SendQ exceeded]
_ht has quit [Remote host closed the connection]
ascarter has joined #ruby-lang
torrieri has joined #ruby-lang
torrieri has quit [Changing host]
torrieri has joined #ruby-lang
saarinen has joined #ruby-lang
mistym has quit [Quit: Leaving...]
gpg_ has quit [Ping timeout: 246 seconds]
mistym has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 240 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jbardin has joined #ruby-lang
greset has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fullybaked has joined #ruby-lang
emmesswhy has joined #ruby-lang
<cmhobbs> i'm working on a class that should instantiate subclasses of itself based on the class of the object passed in, is there a good way to do this other than using strings?
<cmhobbs> that's word soup
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<cmhobbs> if this imaginary class is Foo, and I hand the constructor a Bar object (say Foo.new(Bar.new)), i'd like to build a Foo::Bar object as the result
<cmhobbs> the only way i can think of doing that is calling class on the object passed in and making a constant out of "Foo + #{bar_object.class}"
<cmhobbs> that feels pretty gross
<cmhobbs> well, "Foo::#{bar_object.class}"
<cmhobbs> sorry
<cmhobbs> and turn that into a constant
<cmhobbs> is there a better way to build constants?
vintik has quit [Remote host closed the connection]
fullybaked has quit []
arooni-mobile has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JohnFord has joined #ruby-lang
saarinen has quit [Quit: saarinen]
pr0ton has joined #ruby-lang
<jhass> inside Foo you can do const_get(bar_object.class.name)
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
bjh13 has joined #ruby-lang
ur5us has joined #ruby-lang
skade has quit [Ping timeout: 255 seconds]
bjh13 has quit [Client Quit]
banister has joined #ruby-lang
skade has joined #ruby-lang
skade has quit [Client Quit]
bunk__ has joined #ruby-lang
<cmhobbs> jhass, the issue there is that if, say, i pass in Baz
<cmhobbs> and Foo::Baz does not exist
<cmhobbs> Foo.const_get(:Baz) is going to return Baz
<cmhobbs> rather than screaming at me
<cmhobbs> const_get will crawl up the object tree
<cmhobbs> is there a way to scope const_get, for lack of better words?
cleopatra has quit [Ping timeout: 255 seconds]
tectonic has joined #ruby-lang
<jhass> docs say const_get(bar_object.class.name, false)
djbkd has quit [Read error: Connection reset by peer]
ldnunes has quit [Quit: Leaving]
InfraRuby has left #ruby-lang [#ruby-lang]
djbkd has joined #ruby-lang
monees has quit [Remote host closed the connection]
saarinen has joined #ruby-lang
anildigital is now known as zz_anildigital
sharpmachine has quit [Remote host closed the connection]
NemesisD has joined #ruby-lang
Squarepy has joined #ruby-lang
saarinen has quit [Ping timeout: 255 seconds]
<cmhobbs> brilliant! thanks!
loincloth has quit [Remote host closed the connection]
saarinen has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
DEac- has quit [Quit: leaving]
DEac- has joined #ruby-lang
ihme-TTilus is now known as TTilus
loincloth has joined #ruby-lang
AlJaMa has joined #ruby-lang
ascarter has quit [Ping timeout: 255 seconds]
dangerousdave has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
<NemesisD> hey folks. forgive the cross post but i'm experiencing an issue in a rails app and i'm not sure if the problem lies in rails
ascarter has joined #ruby-lang
<AlJaMa> Hi All. Have a quick question about how I should go about overriding methods. I've done a small example http://pastebin.com/DL2B2gQN
ascarter has quit [Max SendQ exceeded]
<jhass> NemesisD: as long as you tell and share back, crossposting is fine
<AlJaMa> Basicly, I'm trying to call a method in parent class from a diffrent method in a child class
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<NemesisD> every few hours or so my app servers will seemingly get poisoned, activerecord's connection pooling uses MonitorMixin for locking. my app servers begin failing to serve requests because an instance variable in monitor mixin (@mon_mutex) is nil or in some weirder state
<jhass> AlJaMa: seems like broken OOP, but you need to save a reference to the original method with alias_method before overriding it
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
<jhass> AlJaMa: also class names need to start with an uppercase letter ;)
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
<AlJaMa> jhass: thanks :)
<NemesisD> so internally on initialize, monitor mixin sets @mon_mutex to a Mutex, but when these errors start cropping up, @mon_mutex must be nil because i get undefined method lock for nilClass. or even *weirder*, i start getting "TypeError: wrong argument type mutex (expected mutex)" when lock is called
<NemesisD> i've done some research and have found very little, but that this can happen if you include monitormixin and don't call super immediately, but rails' abstractadapter does that
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
<NemesisD> i don't know how it could enter this corrupted state, so to keep my stuff alive right now i'm restarting my app servers once an hour :/
james has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
james is now known as jamesfordummies
ascarter has joined #ruby-lang
<jhass> NemesisD: hard to debug stuff. I'd look out for assignments to @mon_mutex and usages of instance_variables, instance_variable_set and the like
brianpWins has quit [Ping timeout: 245 seconds]
toastynerd has quit []
<NemesisD> jhass hmm, yeah, i only ever see it set in the initializer, but MonitorMixin overrides initialize to do super; mon_initialize
tectonic has quit []
<NemesisD> so i wonder if its like someone calls AbstractAdapter.new, mon calls super *first*, that blows up, but it gets caught further down and someone has a reference to that AbstractAdapter?
<NemesisD> i don't know if throwing exceptions during initialize can still leave you with a partially-initialized object
symm- has quit [Ping timeout: 260 seconds]
vintik has joined #ruby-lang
pr0ton has joined #ruby-lang
cfkoch has joined #ruby-lang
<NemesisD> jhass: i wish i could just pry into the server when this happens but it happens randomly after some amount of time and then completely brings my servers to their knees
<jhass> yeah, pry-rescue on the exception probably won't work either
<NemesisD> nah. especially not with passenger
x0f_ has quit [Ping timeout: 240 seconds]
<NemesisD> i almost want a state of the world type dump when this happens
pr0ton has quit [Ping timeout: 264 seconds]
yfeldblum has quit [Remote host closed the connection]
crdpink has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
x0f has joined #ruby-lang
cfkoch has left #ruby-lang [#ruby-lang]
luiz_lha has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
saarinen has quit [Quit: saarinen]
banister_ has joined #ruby-lang
banister has quit [Ping timeout: 240 seconds]
mykoweb has joined #ruby-lang
yfeldblum has joined #ruby-lang
solars has quit [Ping timeout: 255 seconds]
diegoviola has quit [Quit: WeeChat 0.4.3]
sharpmachine has joined #ruby-lang
DivineEntity has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
llakey has quit [Ping timeout: 245 seconds]
willmarshall has joined #ruby-lang
paul_k has quit [Ping timeout: 245 seconds]
arBmind has quit [Quit: Leaving.]
banister_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pglombardo has quit []
llakey has joined #ruby-lang
cmhobbs has quit [Remote host closed the connection]
havenwood has quit []
loincloth has quit [Remote host closed the connection]
paul_k has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
elia has joined #ruby-lang
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
willmarshall has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__butch__ has quit [Quit: Leaving.]
dangerousdave has quit [Quit: Textual IRC Client: www.textualapp.com]
InfraRuby has joined #ruby-lang
Sgeo has joined #ruby-lang
AKASkip has quit [Ping timeout: 250 seconds]
sMecKs has joined #ruby-lang
hahuang61 has quit [Ping timeout: 240 seconds]
momomomomo has quit [Quit: momomomomo]
weems|mac has joined #ruby-lang
NemesisD has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
someone___ has joined #ruby-lang
<someone___> HI
yfeldblum has quit [Remote host closed the connection]
<someone___> I'm new to ruby, and I was wondering if there's a better way to write this function:
yfeldblum has joined #ruby-lang
<someone___> def resourceExists (resource)
<someone___> File.open(sources_file, 'r') do |file|
<someone___> file.each_line do |line|
<someone___> index = line.index(resource)
<someone___> return index if index == 0
<someone___> end
<someone___> end
<someone___> return nil
<someone___> end
<zenspider> don't do that
<zenspider> use a paste service if it is > 4 lines
<someone___> soory
<someone___> sorry
<zenspider> return system %(grep -q "#{sources_file}" "#{resource}")
yfeldblum has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby-lang
<someone___> thanks
<someone___> I was expecting something ... different
<zenspider> I don't seriously recommend that, but it's better in almost every way
<someone___> but that helps
<zenspider> prolly egrep and put a ^ in the pattern
<zenspider> oops, I got the args backwards too... I'm tired.
<zenspider> return system %(grep -q "^#{resourec}" "#{sources_file}")
<zenspider> not File.readlines(sources_file).grep(/^#{resource)/).empty?
<zenspider> man I wish we had a proper english antonym for empty. :(
wallerdev has joined #ruby-lang
palar has joined #ruby-lang
palar has quit [Remote host closed the connection]
<someone___> I like the second one better
palar has joined #ruby-lang
palar has quit [Remote host closed the connection]
palar has joined #ruby-lang
<someone___> Thanks zenspider
<zenspider> you shouldn't like the second one better
<zenspider> it reads the whole file in first
<someone___> why?
<zenspider> the system call will be the fastest and cleanest and relies on old well maintained code
<someone___> I was trying to avoid it, but your explanation sounds fair
<someone___> gotta go now
<someone___> Thanks again
<someone___> and
<someone___> I hope to know a little bit more when I come back here again
<someone___> cheers
tlr_464 has joined #ruby-lang
arooni-mobile has quit [Remote host closed the connection]
elia has quit [Quit: Computer has gone to sleep.]
someone___ has quit [Quit: Page closed]
jhass is now known as jhass|off
elia has joined #ruby-lang
Squarepy has quit [Quit: Leaving]
symm- has joined #ruby-lang
jmeeuwen has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
charliesome has joined #ruby-lang
toretore has quit [Quit: This computer has gone to sleep]
jamesfordummies has quit [Remote host closed the connection]
sharpmachine has quit [Remote host closed the connection]
cmhobbs has joined #ruby-lang
cmhobbs has joined #ruby-lang
dorei has quit []
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robbyoconnor has joined #ruby-lang
chouhoulis has quit [Ping timeout: 264 seconds]
Jaood has joined #ruby-lang
sarkyniin has quit [Quit: Quitte]