matchaw_ has quit [Quit: No Ping reply in 180 seconds.]
jackyalcine has quit [Ping timeout: 252 seconds]
matchaw has joined #ruby
jduan1981 has quit [Ping timeout: 248 seconds]
<kenneth>
although shouldn't this work?
<kenneth>
item.tap(&:finalize_logic).to_hash
<yfeldblum>
why?
mengu_ has joined #ruby
<Eiam>
kenneth: if you have finalize_logic defined as a proc symbol sure?
<Eiam>
kenneth: maybe you mean .tap(&finalize)
<Eiam>
err .tap(&finalize_logic
<Eiam>
)
Nisstyre-laptop has quit [Quit: Leaving]
mengu__ has joined #ruby
kristofers has quit []
<yfeldblum>
kenneth, wouldn't `item.finalize_logic ; item.to_hash` be clearer in most cases?
<kenneth>
Eiam: finalize_logic is a method on item
<Eiam>
(I was reading about tap two days ago and so far I'm not very impressed, it seems like being clever at the cost of clarity, plenty of other ways to handle debugging too)
<Eiam>
ah
<kenneth>
yfeldblum: the reason is that it's all in an inline if statement, item.tap(&:finalize_logic).sanitized_hash if item.should_render?
<kenneth>
the one liner makes sense to me, not unclear, versus the 4 lines it'd take otherwise
<yfeldblum>
kenneth, "for the purpose of one-lining it" :D
mengu has quit [Ping timeout: 248 seconds]
<kenneth>
if item.should_render?; item.finalize_logic; item.sanitized_hash; end
<workmad3>
kenneth: the one thing that doesn't make sense to me there is the disconnect between the action and the guard :)
blaines has quit [Ping timeout: 256 seconds]
h4mz1d has joined #ruby
samuel02 has joined #ruby
horofox has quit [Quit: horofox]
blaines has joined #ruby
aaronmcadam has quit [Quit: aaronmcadam]
radic has quit [Ping timeout: 245 seconds]
jackyalcine has joined #ruby
dankest has quit [Quit: Leaving...]
slyv has joined #ruby
kpwz has quit [Ping timeout: 252 seconds]
kpwz has joined #ruby
<kenneth>
oh i figured it out, silly me
<kenneth>
contagious private statement, damnit
Kuifje has quit [Ping timeout: 248 seconds]
<kenneth>
i really hate that when private/public/etc applies to everything below it
va_guy has joined #ruby
<yfeldblum>
kenneth, why not just mark an individual method private then?
pskosinski has quit [Quit: Learn Life's Little Lessons]
Takehiro has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
aytch is now known as DOUCHE
warb0 has quit [Read error: Connection reset by peer]
DOUCHE is now known as DOUCHE_ALONG_THE
DOUCHE_ALONG_THE is now known as aytch
carloslopes has quit [Remote host closed the connection]
greenarrow has quit [Read error: Connection reset by peer]
greenarrow has joined #ruby
uris has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 252 seconds]
yshh_ has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
<baordog>
Someone said that I needed to obtain the wx bindings
mando_ has quit [Remote host closed the connection]
dankest has joined #ruby
fgro has quit [Quit: leaving]
yshh has quit [Ping timeout: 264 seconds]
internetishard1 has left #ruby [#ruby]
michaelmartinez has quit [Quit: michaelmartinez]
dallasm has joined #ruby
<havenn>
baordog: Are you doing something wxruby specific, or just want a gui?
<baordog>
I just want a gui, but this is infuriating me to be honest. I tried installing tk and that didn't want to work either (and it reset my path variable)
<havenn>
baordog: I was gunno recommend tk >.>
the_mentat has joined #ruby
cpruitt has quit [Quit: cpruitt]
<baordog>
I used the automated installer binary for windows
mengu_ has quit [Remote host closed the connection]
<havenn>
baordog: From irb do you get any errors with?: require 'tk'
<baordog>
cannot load
mengu_ has joined #ruby
CLUSTERfoo has quit [Ping timeout: 264 seconds]
innohero has quit [Quit: Leaving]
punk_ has joined #ruby
punk_ has quit [Client Quit]
mando has joined #ruby
<baordog>
Maybe i should find somewhere to download it from?
mengu__ has quit [Quit: This computer has gone to sleep]
mando_ has joined #ruby
dallasm has quit [Ping timeout: 255 seconds]
<havenn>
baordog: I wonder if you'd have more luck with a windows port of Gtk+?
the_mentat has quit [Quit: Computer has gone to sleep.]
axiak has joined #ruby
hackerdude has quit [Remote host closed the connection]
Evixion has joined #ruby
maletor has joined #ruby
cheese1756 has joined #ruby
ffranz has quit [Read error: No route to host]
elico has quit [Ping timeout: 240 seconds]
mockra has quit [Remote host closed the connection]
rakl has quit [Quit: sleeping]
itsdavem has joined #ruby
krawchyk has joined #ruby
statarb3 has quit [Ping timeout: 240 seconds]
NihilistDandy has joined #ruby
DrShoggoth has joined #ruby
axiak has quit [Client Quit]
axiak has joined #ruby
mcqueenorama has quit [Remote host closed the connection]
Danskersen has quit [Remote host closed the connection]
crackfu has joined #ruby
unsay has quit [Ping timeout: 248 seconds]
itsdavem has quit [Ping timeout: 245 seconds]
adeponte has quit [Remote host closed the connection]
jackyalcine has quit [Quit: Quit]
maletor has quit [Quit: Computer has gone to sleep.]
mneorr has quit [Remote host closed the connection]
jduan1981 has quit [Ping timeout: 252 seconds]
<breakingthings>
So, I'm writing a little script to create a batch of svg files from a source… I've gotten as far as opening the file, and editing the xml with Nokogiri, but how can I write to a new file? Am I best off with `newfile = File.new; newfile.write(xml);` or something?
mneorr has joined #ruby
<Paradox>
yup
<Paradox>
but you dont need the file new
<breakingthings>
File.write() has an arg for destination?
<breakingthings>
or...
<breakingthings>
?
<Paradox>
IO.write(filename, string)
cableray_ has joined #ruby
<breakingthings>
hmm, alright.
jackyalcine has joined #ruby
markalanevans has quit [Ping timeout: 252 seconds]
Michael_ has quit [Remote host closed the connection]
arya has joined #ruby
S1kx has quit [Quit: Leaving]
<banisterfiend>
jokke: 1. that code sample is not complete, you have an unattached 'when' at the start. 2. You didnt even show the specific exception that was raised or give any kind of backtrace 3. Learn how to ask decent questions and provide the appropriate information, and come back again.
gwillickers has joined #ruby
gwillickers has quit [Client Quit]
mercwithamouth has quit [Ping timeout: 256 seconds]
techhelp has joined #ruby
<breakingthings>
Oh boy… Pango can't find the font I'm using in the svg… crap.
ner0x has joined #ruby
vinax has quit [Ping timeout: 245 seconds]
gavinhug_ has quit [Remote host closed the connection]
asteve has quit [Quit: Computer has gone to sleep.]
techhelp has quit [Quit: This computer has gone to sleep]
DarthGandalf has quit [Ping timeout: 245 seconds]
phantasm66 has quit [Client Quit]
alanjc has quit [Quit: alanjc]
dallasm has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
chimkan___ has quit [Ping timeout: 245 seconds]
cardoni has quit [Quit: cardoni]
jonathanwallace has quit [Ping timeout: 246 seconds]
DarthGandalf has joined #ruby
SCommette has joined #ruby
jonathanwallace has joined #ruby
zeade has joined #ruby
pu22l3r has joined #ruby
f0ster has quit [Ping timeout: 256 seconds]
Konboi has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
ffranz has quit [Quit: Leaving]
yshh has quit [Remote host closed the connection]
krawchyk has quit [Remote host closed the connection]
mockra has joined #ruby
cardoni has joined #ruby
radic has joined #ruby
alanjc has joined #ruby
joofsh has quit [Remote host closed the connection]
the_mentat has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
tcstar has joined #ruby
<xk_id>
Is 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' a typical http accept header? Or does it vary a lot across browsers?
<xk_id>
I'm trying to hide my crawler's identity
taoru has quit [Remote host closed the connection]
Umren has joined #ruby
adeponte has joined #ruby
josh_keith has quit [Ping timeout: 240 seconds]
Bosma has joined #ruby
pu22l3r has quit [Remote host closed the connection]
skcin7 has quit [Quit: Computer has gone to sleep.]
skcin7 has joined #ruby
chrishough has quit [Quit: chrishough]
Takehiro has quit [Remote host closed the connection]
ryanf has quit [Quit: leaving]
allaire has quit []
hemanth_ has joined #ruby
<razieliyo>
havenn: yes, you're right, it was just matter of curiosity
<razieliyo>
havenn: thanks
krz has joined #ruby
Takehiro has joined #ruby
crackfu_ has joined #ruby
<havenn>
razieliyo: hmm, yeah would be nice to have a way to reference the hash you're operating on without referring to the variable, dunno how though!
miso1337 has quit [Quit: afk]
subbyyy_ has joined #ruby
<razieliyo>
havenn: yes, that would give you pretty more understandable code for example, although that's just my opinion
NobbZ has joined #ruby
jcrawfor- has joined #ruby
beilabs has quit [Ping timeout: 276 seconds]
wookiehangover has quit [Ping timeout: 276 seconds]
justinabrahms has quit [Ping timeout: 276 seconds]
arusso has quit [Ping timeout: 276 seconds]
hashtree has quit [Ping timeout: 276 seconds]
SeanTAllen has quit [Ping timeout: 276 seconds]
Spaceghost|cloud has quit [Ping timeout: 276 seconds]
Guest85414 has quit [Ping timeout: 276 seconds]
kn330 has quit [Excess Flood]
jrajav has quit [Ping timeout: 276 seconds]
crackfu has quit [Ping timeout: 276 seconds]
SeySayux has quit [Ping timeout: 276 seconds]
jcrawford has quit [Quit: Will Be Back]
fasta has quit [Read error: Connection reset by peer]
jbpros has quit [Quit: May the Cuke be with you!]
NobbZ|wech has quit [Read error: Connection reset by peer]
jcrawfor- is now known as jcrawford
jcrawford has quit [Changing host]
jcrawford has joined #ruby
kn330_ has joined #ruby
Takehiro has quit [Remote host closed the connection]
subbyyy has quit [Ping timeout: 276 seconds]
hemanth has quit [Ping timeout: 276 seconds]
<razieliyo>
NilClass are the ruby's segfaults
hashtree has joined #ruby
fasta has joined #ruby
jbpros has joined #ruby
arusso has joined #ruby
wookiehangover has joined #ruby
SeySayux has joined #ruby
itsdavem has joined #ruby
krainboltgreene has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
radic has quit [Disconnected by services]
radic_ has joined #ruby
justinlilly has joined #ruby
josh_keith has joined #ruby
miso1337 has joined #ruby
jrajav has joined #ruby
Michael_ has quit [Remote host closed the connection]
<razieliyo>
I'm losing myself in the bunch of methods that an array has to find what I want
<razieliyo>
is there any way to apply a block to each array element?
itsdavem has quit [Ping timeout: 264 seconds]
ner0x has quit [Quit: Leaving]
beilabs has joined #ruby
<razieliyo>
I mean for example, my_array.each_apply { |x| Integer(x) } to return an equivalent Integer array of my_array
<razieliyo>
each_apply has been deliberately invented by me, lol
<razieliyo>
just to ilustrate what I'm asking
Choobie has quit [Ping timeout: 255 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<Boohbah>
maybe you should get a book about ruby, too
<razieliyo>
Boohbah: yes, I'm reading the pickaxe, but I'm over the first 50 pages, I just swam into something
<razieliyo>
but you're right
<razieliyo>
I should read it before I ask so basic questions here
daslicious has quit [Quit: daslicious]
beneggett has joined #ruby
sepp2k1 has joined #ruby
jfl0wers has quit [Quit: jfl0wers]
sarkis has joined #ruby
sepp2k has quit [Ping timeout: 248 seconds]
slainer68 has joined #ruby
unsay has joined #ruby
<sarkis>
hey guys, i am confused how the ./vendor/ directory actually works? i am planning on packaging a ruby library and like the fact that running bundle install --deployment results in a "self-contained package"
<sarkis>
it is a rack app, what do i have to do for the app the know to look in ./vendor?
jaywastaken has quit [Ping timeout: 240 seconds]
k3rn3lito has joined #ruby
<Gate>
sarkis: that information is stored in .bundle/config
<Gate>
sarkis: You can pull it off. Beware of arch dependent gems and compiled C extensions.
adeponte has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<Gate>
sarkis: what you *really* want to do, in my opinion, is use the "cache" option in bundler
cauffe has joined #ruby
<Gate>
sarkis: that stores the gem sources in vendor/cache, then on any arbitrary system running bundle install with the proper options will pull the gems from the cache
jaywastaken has joined #ruby
jaywastaken has quit [Changing host]
jaywastaken has joined #ruby
<sarkis>
i see and i can still run bundle install --deployment?
beilabs has joined #ruby
<Gate>
sarkis: yep. I think there is an --only-cache option to enforce the cache, as well
apoch632 has quit [Quit: Leaving.]
<cauffe>
ruby is a sexy language
<cauffe>
just syaing
<Gate>
sarkis: that option is --local
<Gate>
not --only-cache
ablegreen has joined #ruby
ebarendt has joined #ruby
<Gate>
cauffe: not only that, but it loves us, too
dareign85 has quit []
oinkon has quit [Ping timeout: 264 seconds]
jfl0wers has joined #ruby
benlieb has joined #ruby
pu22l3r has joined #ruby
razieliyo has quit [Remote host closed the connection]
meoblast001 has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
cparen has joined #ruby
cparen has quit [Client Quit]
techhelp has joined #ruby
heckler has joined #ruby
cparen has joined #ruby
TDJACR has quit [Quit: Restart]
<heckler>
how do i convert a datetime of this type "2013-01-31 21:37:07 -0600" to a unix timestamp?
murilo_fs has left #ruby ["Konversation terminated!"]
shammancer has quit [Quit: Leaving.]
unsay has quit [Ping timeout: 248 seconds]
shammancer has joined #ruby
tjbiddle has quit [Ping timeout: 248 seconds]
tjbiddle_ is now known as tjbiddle
SCommette has quit [Quit: SCommette]
uris has quit [Quit: Leaving]
a_a_g has joined #ruby
sarkis has quit [Ping timeout: 246 seconds]
jaywastaken has quit [Read error: Connection reset by peer]
jaywastaken has joined #ruby
jaywastaken has quit [Changing host]
jaywastaken has joined #ruby
rippa has joined #ruby
cha1tanya has joined #ruby
cparen has quit [Quit: cparen]
mikepack has joined #ruby
tommyvyo has joined #ruby
dhruvasagar has joined #ruby
ossareh has quit [Ping timeout: 276 seconds]
the_mentat has quit [Quit: Computer has gone to sleep.]
noop has joined #ruby
arya has quit [Ping timeout: 248 seconds]
ryanf has joined #ruby
v0n has quit [Quit: WeeChat 0.4.0]
lusory has joined #ruby
arya has joined #ruby
JohnBat26 has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
mahmoudimus has joined #ruby
bradleyprice has joined #ruby
kenneth has quit [Quit: kenneth]
<shevy>
making games is not easy
<ddilinger>
any good methods for lint checking your recipes? for example i tried "foo = data_bag('some_bag')<return> .map {|id| ... }<return> .select {|item| ... } i thought i was supposed to use ruby -c <filename> for lint check, but that things the preceding is 'Syntax OK' even though running it fails with 'unexpected '.', expecting $end'
carlzulauf has quit [Ping timeout: 240 seconds]
<ddilinger>
s/things/thinks
jackyalcine has quit [Quit: Quit]
<ddilinger>
i know i can escape the <return>, just wondering how i can get faster feedback from the interpreter without having to fire up a new instance
thinkclay has joined #ruby
statarb3 has quit [Ping timeout: 264 seconds]
maletor has joined #ruby
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
abionic has joined #ruby
Spaceghost|cloud has joined #ruby
SeanTAllen has joined #ruby
Guest85414 has joined #ruby
pu22l3r has quit [Remote host closed the connection]
cableray has joined #ruby
ossareh has joined #ruby
robbyoconnor has joined #ruby
guns has joined #ruby
banisterfiend has joined #ruby
unsay has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
ABK has quit [Ping timeout: 255 seconds]
wmoxam has joined #ruby
dhruvasagar has joined #ruby
subbyyy_ has quit [Ping timeout: 248 seconds]
itsdavem has quit [Remote host closed the connection]
decoponio has joined #ruby
banisterfiend has quit [Ping timeout: 248 seconds]
jaywastaken has quit [Read error: Connection reset by peer]
jaywastaken has joined #ruby
jaywastaken has quit [Changing host]
jaywastaken has joined #ruby
blacktulip has quit [Ping timeout: 245 seconds]
girija_ has quit [Ping timeout: 248 seconds]
blacktulip has joined #ruby
quest88_ has quit [Quit: quest88_]
sayan has quit [Read error: Connection reset by peer]
bandu has quit [Quit: Leaving]
guns has quit [Quit: guns]
jonathanwallace has quit [Ping timeout: 252 seconds]
dhruvasa1ar has joined #ruby
ABK_ has joined #ruby
aryatosh has joined #ruby
freezway has quit [Ping timeout: 264 seconds]
abionic has quit [Ping timeout: 252 seconds]
Myconix has joined #ruby
joeycarmello has quit [Remote host closed the connection]
Retistic has joined #ruby
joeycarmello has joined #ruby
shock_one has joined #ruby
nomenkun has quit [Remote host closed the connection]
xandy is now known as xAndy
<Retistic>
is there a way to do some_long_var = some_long_var.to_i without writing some_long_var twice?
lolmaus has joined #ruby
nomenkun has joined #ruby
Takehiro has joined #ruby
jamescarr_ has joined #ruby
<jamescarr_>
shouldn't methods ending in ? return true or false???
<shevy>
Retistic hmm dont think so
<jamescarr_>
yeah
<jamescarr_>
dude's shit is broke
<shevy>
jamescarr_ ruby does not enforce any particular style. a method "foo" is valid, a method "foo?" is equally valid. you can use those methods to return whatever you like
<Retistic>
shevy: :-( should be a to_i! method
josh_keith has quit [Quit: Leaving]
<shevy>
Retistic hmm... I think there may be a reason why there is no .to_i!
<jamescarr_>
reokay
<Retistic>
shevy: yeah, i'm sure there is… its just unfortunate
<shevy>
yeah I agree... in many of these situations though, there were reasons... like why there is no ++ operator in ruby
<shevy>
I just could not tell you what the reason for no .to_i! is :\
aganov has joined #ruby
tfittsy has joined #ruby
joeycarmello has quit [Ping timeout: 260 seconds]
Bry8Star has joined #ruby
<shevy>
hmm
<shevy>
.to_i
<shevy>
"Returns the result of interpreting leading characters in str as a decimal integer."
nomenkun has quit [Ping timeout: 246 seconds]
<shevy>
"Extraneous characters past the end of a valid number are ignored."
<shevy>
"If there is not a valid number at the start of str, 0 is returned."
<shevy>
"The method never raises an exception."
<shevy>
aha
<shevy>
there is a .to_a method but no .to_a! method for strings
<shevy>
Retistic it could be that self might change and this may not be allowed
thinkclay has quit [Quit: Leaving.]
ryanf has quit [Ping timeout: 264 seconds]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
n1x has joined #ruby
<Retistic>
shevy: ah that could be
<Retistic>
shevy: yeah there are a bunch of to_x methods and none with bangs
himsin has quit [Remote host closed the connection]
<shevy>
but to be honest... less metamagic is often more...
girija_ has joined #ruby
icole has quit [Remote host closed the connection]
<tfittsy>
I'm trying to get a number value from a string that I then want to % 6. It doesn't really matter what the string number adds up to as long as it is random across different strings and always the same for the same string. Is there a better way than just adding up the ascii value of each character?
generalissimo has quit [Ping timeout: 245 seconds]
whowantstolivefo has quit [Read error: Connection reset by peer]
Liothen has quit [Read error: Connection reset by peer]
whowantstolivefo has joined #ruby
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
dcwu has quit [Read error: Connection reset by peer]
dcwu has joined #ruby
sayan has joined #ruby
mmitchell has quit [Read error: Connection reset by peer]
mmitchell has joined #ruby
sc_raptor has joined #ruby
james__ has quit [Remote host closed the connection]
chendo_ has quit [Ping timeout: 248 seconds]
chendo_ has joined #ruby
yshh has quit [Remote host closed the connection]
codespectator has quit [Quit: Computer has gone to sleep.]
Morkel_ has joined #ruby
M- has quit [Quit: This computer has gone to sleep]
Morkel has quit [Ping timeout: 264 seconds]
Morkel_ is now known as Morkel
unsay has quit [Ping timeout: 248 seconds]
yshh has joined #ruby
clocKwize has joined #ruby
Raboo has quit [Read error: Connection reset by peer]
Raboo has joined #ruby
pavilionXP has quit [Ping timeout: 248 seconds]
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
itsdavem has joined #ruby
mengu has joined #ruby
dcwu has quit [Read error: Connection reset by peer]
IrishGringo_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
dcwu has joined #ruby
ferdev has quit [Quit: ferdev]
oerrze has joined #ruby
aryatosh has quit [Ping timeout: 264 seconds]
mockra has quit [Read error: Connection reset by peer]
IrishGringo has quit [Ping timeout: 252 seconds]
gutsiest60 has quit [Ping timeout: 252 seconds]
mockra has joined #ruby
joeycarmello has joined #ruby
heckler has left #ruby ["Leaving"]
itsdavem has quit [Ping timeout: 252 seconds]
slainer68 has joined #ruby
arya has joined #ruby
aryatosh has joined #ruby
jduan1981 has quit [Quit: jduan1981]
gutsiest60 has joined #ruby
timeout has joined #ruby
joeycarmello has quit [Ping timeout: 252 seconds]
samuel02 has joined #ruby
dr_bob has joined #ruby
mengu has quit [Quit: Leaving]
mafolz has joined #ruby
anderse has joined #ruby
robbyoconnor has quit [Ping timeout: 245 seconds]
mockra has quit [Remote host closed the connection]
sayan has quit [Ping timeout: 248 seconds]
Solnse has quit [Ping timeout: 244 seconds]
cha1tanya has quit [Remote host closed the connection]
aryatosh_ has joined #ruby
arya_ has joined #ruby
noxoc has joined #ruby
mahmoudimus has joined #ruby
hyperboreean has quit [Ping timeout: 245 seconds]
bartj3 has joined #ruby
Hypn has joined #ruby
samlt has joined #ruby
markalanevans has joined #ruby
arya has quit [Ping timeout: 248 seconds]
aryatosh has quit [Ping timeout: 245 seconds]
jprovazn has joined #ruby
markalanevans has quit [Client Quit]
zommi has joined #ruby
zigomir has joined #ruby
codespectator has joined #ruby
stormetrooper has joined #ruby
dr_bob has quit [Quit: Leaving.]
hyperboreean has joined #ruby
chussenot has joined #ruby
buscon has joined #ruby
aryatosh_ has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
unsay has joined #ruby
eldariof has joined #ruby
dmerrick has joined #ruby
<shevy>
guys
mikepack has quit [Remote host closed the connection]
<shevy>
def foo; return [1,2] end
<shevy>
is the same as:
<shevy>
def foo; return 1,2 end
<shevy>
(I forgot a ; but nevermind, it is spaced on 3 lines anyway)
<shevy>
which one of the two do you prefer, and why?
aryatosh has joined #ruby
altamic has joined #ruby
altamic has quit [Changing host]
altamic has joined #ruby
<havenn>
shevy: I'd prefer: def foo; [1, 2] end
<shevy>
hehe
<shevy>
ok
osaut has joined #ruby
<havenn>
shevy: 1, 2 seems overly clever, possibly. not sure implicit arrays are easy to grok
noxoc has quit [Quit: noxoc]
dmerrick has quit [Client Quit]
perun_ has quit [Ping timeout: 256 seconds]
roadt_ has quit [Ping timeout: 248 seconds]
noxoc has joined #ruby
roadt_ has joined #ruby
lkba has quit [Ping timeout: 264 seconds]
Elhu has joined #ruby
rburton- has joined #ruby
zeade has quit [Quit: Leaving.]
gosshedd has joined #ruby
tfittsy has quit [Ping timeout: 264 seconds]
razibog has joined #ruby
goraxe has quit [Ping timeout: 276 seconds]
ngoldman has quit [Remote host closed the connection]
<shevy>
I concur
Vainoharhainen has joined #ruby
unsay has quit [Ping timeout: 276 seconds]
wchun has joined #ruby
recycle has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
noxoc has quit [Quit: noxoc]
workmad3 has quit [Ping timeout: 245 seconds]
ferdev has joined #ruby
Giorgio has joined #ruby
dhruvasa1ar has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 255 seconds]
miso1337 has joined #ruby
jonahR has quit [Quit: jonahR]
nipara is now known as nipar
bluOxigen has joined #ruby
dhruvasagar has joined #ruby
mockra has joined #ruby
arya has joined #ruby
dhruvasa1ar has joined #ruby
chussenot has quit [Quit: chussenot]
beliveyourdream has joined #ruby
lkba has joined #ruby
hoelzro|away is now known as hoelzro
yshh has quit [Remote host closed the connection]
timeout has quit [Quit: "I'll be back..."]
ryanf has quit [Quit: leaving]
mockra has quit [Ping timeout: 244 seconds]
timeout has joined #ruby
eka has joined #ruby
mneorr has quit [Remote host closed the connection]
dcwu has quit [Quit: Leaving.]
freeayu__ has quit [Ping timeout: 255 seconds]
yshh has joined #ruby
beilabs has quit [Ping timeout: 252 seconds]
chussenot has joined #ruby
nomenkun has joined #ruby
chimkan__ has joined #ruby
skcin7 has quit [Quit: Computer has gone to sleep.]
acriax has joined #ruby
jaywastaken has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 248 seconds]
jaywastaken has joined #ruby
jaywastaken has quit [Changing host]
jaywastaken has joined #ruby
afd___ has quit [Quit: No Ping reply in 180 seconds.]
maxmanders has joined #ruby
afd__ has joined #ruby
skcin7 has joined #ruby
miso1337 has quit [Quit: afk]
kristofers has joined #ruby
chimkan_ has quit [Ping timeout: 244 seconds]
poga has joined #ruby
<acriax>
Hi, I'm attempting to learn Ruby, and it's going well, but I have trouble with expecting when to use symbols and when to use symbols, and when to use other variables. Is there some kind of logical system I'm not seeing?
tfittsy has joined #ruby
<acriax>
Like here, why is :name in the attr_accessor a symbol when it isn't anywhere else in the class?: https://gist.github.com/4690158
arya has joined #ruby
<hoelzro>
acriax: symbols tend to be used in metaprogramming (like attr_accessor)
<hoelzro>
they are also commonly used as hash keys
<acriax>
but like, strings CAN be used in attr_accessor (but with worse performance)?
pavilionXP has joined #ruby
<hoelzro>
honestly, I've not tried strings with attr_accessor
zeade has joined #ruby
<hoelzro>
and they probably wouldn't be slower
aryatosh has quit [Ping timeout: 244 seconds]
<hoelzro>
well, the call to attr_accessor might
<hoelzro>
but the difference would be negligible
<acriax>
Ok
unsay has joined #ruby
w3pm has quit []
buibex has joined #ruby
buibex has quit [Client Quit]
ngoldman has joined #ruby
<acriax>
The part in that code which has me confused is really why it isn't @name = :name instead of @name = name
main_ has joined #ruby
jbw has joined #ruby
itsdavem has joined #ruby
<acriax>
Or rather, how ruby manages to couple :name with name
beilabs has joined #ruby
lormn has joined #ruby
<acriax>
I guess it's something happening behind the curtains of attr_accessor
<hoelzro>
acriax: name is a variable
<hoelzro>
:name is a value
<hoelzro>
attr_accessor isn't actually that complex; you could implement it yourself
aryatosh has joined #ruby
<lormn>
hi, i tried gem install arcadia on my fedora laptop and keep getting this error: "Arcadia require ruby-tk extension and tcl/tk run-time you must install before run .." I tried to install all tk packages I found in the repos but still same error.. please advice
<hoelzro>
oh, another use for symbols is as flags for methods
pavilionXP has quit [Read error: Connection timed out]
adeponte has joined #ruby
noxoc has joined #ruby
willbradley has joined #ruby
clooth has joined #ruby
wallerdev has quit [Quit: wallerdev]
shock_one has joined #ruby
adeponte has quit [Client Quit]
Konboi has joined #ruby
itsdavem has joined #ruby
robotmay has joined #ruby
love_color_text has quit [Remote host closed the connection]
<lormn>
i tried gem install arcadia on my fedora laptop and keep getting this error: "Arcadia require ruby-tk extension and tcl/tk run-time you must install before run .." I tried to install all tk packages I found in the repos but still same error.. please advice
grzywacz has joined #ruby
<shevy>
lormn you must have tcl and tk installed, and the ruby bindings to these
<shevy>
since you use fedora, you need to ask fedora how they packaged up those things
yshh has quit [Remote host closed the connection]
<shevy>
otherwise, if you would have compiled from source, in the ruby ext/ directory should be the tcl/ or tk/ directory, which you could go into, and run extconf.rb there. this would give you the specific error
love_color_text has joined #ruby
beilabs has joined #ruby
yshh has joined #ruby
<lormn>
shevy: i installed tcl and tk already. and ran gem search tk and installed everything i found there.. not sure if its a fedora issue
aryatosh has joined #ruby
adeponte has joined #ruby
<shevy>
acriax usually when you need flexibility, you use strings, but when you need unique identifiers, that are fast and always the same, you use symbols
<shevy>
reactormonk, sorry, this is over my head...
itsdavem has joined #ruby
<shevy>
but it looks very cool
<reactormonk>
shevy, yeah, I preferred the previous interface
<shevy>
hehe
beilabs has quit [Ping timeout: 245 seconds]
mockra has joined #ruby
hakunin_ has quit [Remote host closed the connection]
<shevy>
hoelzro I am not sure... whenever I tried to use those kind of WMs, I felt as if they were getting into my way more than i.e. fluxbox, and they seemed super minimalistic rather than integrative
<shevy>
but I shall give awesomeWM another try!
aryatosh has joined #ruby
arya has joined #ruby
recycle has joined #ruby
<shevy>
the thing is, I love tabs, but not in the same window
<hoelzro>
well, it's a lot of work to set up, I'm not going to lie
<hoelzro>
but to me, it's worth it
hakunin has joined #ruby
<shevy>
ok
<hoelzro>
shevy: what do you mean by "tabs, but not in the same window"?
<reactormonk>
shevy, currently trying to hack some tiling into kwin ;-)
<shevy>
I'll give it a try again... I think the last try was like... 4 years ago or something like that...
<shevy>
hoelzro well, this modal interface, it splits up the current window into sub-parts, right? I can't work with something like that
<hoelzro>
well, in Awesome, the entire screen is split up into tiles
<shevy>
I think for my editor and my browser I need a 100% view
<hoelzro>
each window is given a tile
<hoelzro>
you can do that
<hoelzro>
my browser is always full screened
<shevy>
aha, ok
banjara has quit [Quit: Leaving.]
<hoelzro>
there's also a WM called subtle
<hoelzro>
which, as I understand it, is AwesomeWM =~ s/Lua/Ruby/
JonnieCache has quit [Quit: leaving]
itsdavem has quit [Ping timeout: 264 seconds]
Ralt has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 260 seconds]
greenarrow has quit [Ping timeout: 255 seconds]
greenarrow has joined #ruby
recycle has quit [Ping timeout: 264 seconds]
aryatosh has quit [Ping timeout: 256 seconds]
unsay has quit [Ping timeout: 264 seconds]
yshh has joined #ruby
cha1tanya has joined #ruby
<poseid>
shevy: Ok, now I have it: it's C.class_eval("def bar; 1; end")
ablegreen has quit [Quit: Page closed]
beilabs has joined #ruby
chussenot has joined #ruby
aryatosh has joined #ruby
itsdavem has joined #ruby
elaptics`away is now known as elaptics
<shevy>
aaaah the good old eval way
fyolnish has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
dekronin1 has quit [Quit: leaving]
<poseid>
yes... it's rather new to me ;-)
nari has quit [Ping timeout: 245 seconds]
anderse has quit [Quit: anderse]
aryatosh has quit [Client Quit]
<poseid>
looks like meta-programming, which shouldn't be good for maintainable code
vinax has joined #ruby
horofox has joined #ruby
<poseid>
but maybe for quick-and-dirty experiments it's nice
rezzack has quit [Quit: Leaving.]
M-- has joined #ruby
liquid-silence has quit [Ping timeout: 260 seconds]
itsdavem has quit [Ping timeout: 264 seconds]
shock_one has quit [Ping timeout: 255 seconds]
beilabs has quit [Ping timeout: 276 seconds]
buibex has joined #ruby
Elhu_ has joined #ruby
browndawg1 has left #ruby [#ruby]
browndawg has joined #ruby
fflush has quit [Ping timeout: 240 seconds]
mahmoudimus has joined #ruby
guns has joined #ruby
fflush has joined #ruby
mneorr has quit [Remote host closed the connection]
reinaldob has quit [Remote host closed the connection]
sulaco_ has quit [Read error: Connection reset by peer]
sulaco has joined #ruby
chiel`afk is now known as chiel
JohnBat26 has joined #ruby
beilabs has joined #ruby
Konboi has quit [Ping timeout: 276 seconds]
yshh has quit [Remote host closed the connection]
poikon has joined #ruby
cardoni has quit [Quit: cardoni]
aaronmacy has quit [Quit: Leaving.]
<shevy>
dunno
<shevy>
I hate every line that has eval in it
<shevy>
when I came to a project weeks lateron and I saw an eval, it took me longer than other parts of the code to understand what and why I did it that way
beilabs has quit [Ping timeout: 248 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
unsay has joined #ruby
<shevy>
hey guys
<shevy>
if you have a class in a module
arya has quit [Ping timeout: 256 seconds]
ossareh has quit [Ping timeout: 276 seconds]
<shevy>
would you rather do this:
<shevy>
module Foo
<shevy>
class Bar
<shevy>
def test
<shevy>
or rather
<shevy>
module Foo
<shevy>
class Bar
<shevy>
def test
angusigu1ss has joined #ruby
<shevy>
IF it is the only class in the .rb file in question?
<havenn>
indentation only difference?
<shevy>
in the first example, I feel I need so much indent
<shevy>
yeah havenn
<havenn>
the former
<shevy>
ok
poikon has quit [*.net *.split]
adeponte has quit [*.net *.split]
dhruvasagar has quit [*.net *.split]
whowantstolivefo has quit [*.net *.split]
jamescarr_ has quit [*.net *.split]
wookiehangover has quit [*.net *.split]
Eiam has quit [*.net *.split]
[Neurotic] has quit [*.net *.split]
angusiguess has quit [*.net *.split]
CorpusCallosum has quit [*.net *.split]
x0F has quit [*.net *.split]
billy_ran_away has quit [*.net *.split]
robert_ has quit [*.net *.split]
yeltzooo has quit [*.net *.split]
Skelz0r has quit [*.net *.split]
coaster has quit [*.net *.split]
earthquake has quit [*.net *.split]
thomasfedb has quit [*.net *.split]
pcboy_ has quit [*.net *.split]
darkc0met has quit [*.net *.split]
kanzure has quit [*.net *.split]
mtfk has quit [*.net *.split]
bier has quit [*.net *.split]
pietr0 has quit [*.net *.split]
scrr has quit [*.net *.split]
Sp4rKy has quit [*.net *.split]
mnemon has quit [*.net *.split]
michele has quit [*.net *.split]
rcsheets has quit [*.net *.split]
jhowarth has quit [*.net *.split]
timmow has joined #ruby
hikariHe has quit [Read error: Connection reset by peer]
reinaldob has joined #ruby
reinaldob has quit [Read error: Connection reset by peer]
<havenn>
then if you end up adding other classes, already g2g, and just 'looks right' i think
hikariHe has joined #ruby
jamescarr has joined #ruby
aaronmcadam has joined #ruby
<workmad3>
shevy: I'm with havenn... however, if you can ensure that module Foo will already exist, I'm also perfectly happing with 'class Foo::Bar'
poikon has joined #ruby
adeponte has joined #ruby
dhruvasagar has joined #ruby
whowantstolivefo has joined #ruby
wookiehangover has joined #ruby
[Neurotic] has joined #ruby
Eiam has joined #ruby
CorpusCallosum has joined #ruby
billy_ran_away has joined #ruby
x0F has joined #ruby
yeltzooo has joined #ruby
Skelz0r has joined #ruby
robert_ has joined #ruby
pietr0 has joined #ruby
coaster has joined #ruby
earthquake has joined #ruby
thomasfedb has joined #ruby
bier has joined #ruby
pcboy_ has joined #ruby
darkc0met has joined #ruby
mtfk has joined #ruby
mnemon has joined #ruby
Sp4rKy has joined #ruby
michele has joined #ruby
rcsheets has joined #ruby
jhowarth has joined #ruby
scrr has joined #ruby
aef has quit [Excess Flood]
[Neurotic] has quit [Excess Flood]
whowantstolivefo has quit [Max SendQ exceeded]
kanzure has joined #ruby
whowantstolivefo has joined #ruby
aef has joined #ruby
ossareh has joined #ruby
jamescarr has quit [Quit: jamescarr]
[Neurotic] has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
KillerFox has quit [Ping timeout: 248 seconds]
horofox has quit [Quit: horofox]
KillerFox has joined #ruby
itsdavem has joined #ruby
blueOxigen has joined #ruby
dr_bob has joined #ruby
beliveyourdream_ has joined #ruby
beliveyourdream has quit [Ping timeout: 255 seconds]
JohnBat26 has quit [Ping timeout: 276 seconds]
havenn has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 260 seconds]
seich- has joined #ruby
itsdavem has quit [Ping timeout: 252 seconds]
beilabs has joined #ruby
unsay has quit [Ping timeout: 276 seconds]
JohnBat26 has joined #ruby
Elhu_ has quit [Read error: Connection reset by peer]
arkiver has joined #ruby
horofox has joined #ruby
beliveyourdream_ has quit [Read error: Connection reset by peer]
JumpMast3r has joined #ruby
beliveyourdream has joined #ruby
traph has quit [Quit: Lost terminal]
arya has joined #ruby
arturaz has joined #ruby
anderse has joined #ruby
TomJ_ has joined #ruby
beilabs has quit [Ping timeout: 255 seconds]
<shevy>
hmm
browndawg has quit [Quit: Leaving.]
<shevy>
how would you arrange on the latter?
<shevy>
class Foo::Bar
<shevy>
def test
<shevy>
or?
<shevy>
I dunno, the :: disturbs me somewhat :\
TomJ has quit [Ping timeout: 248 seconds]
TomJ_ is now known as TomJ
<shevy>
I am going to look at some popular gems to see what the people do there
browndawg has joined #ruby
arya has quit [Ping timeout: 264 seconds]
dhruvasa1ar has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 244 seconds]
dhruvasagar has joined #ruby
dhruvasa1ar has joined #ruby
Xeago has joined #ruby
mockra has joined #ruby
horofox has quit [Quit: horofox]
banjara has joined #ruby
yacks has quit [Ping timeout: 248 seconds]
Retistic has quit [Quit: Retistic]
dekroning has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
mockra has quit [Ping timeout: 248 seconds]
mklappstuhl has joined #ruby
jprovazn has quit [Quit: Leaving]
banisterfiend has joined #ruby
arya has joined #ruby
wargasm1 has quit [Ping timeout: 248 seconds]
statarb3 has quit [Client Quit]
robotmay_ has joined #ruby
hikariHe has quit [Ping timeout: 255 seconds]
TheFuzzball has joined #ruby
robotmay has quit [Ping timeout: 264 seconds]
banjara has quit [Ping timeout: 256 seconds]
suf has quit [Read error: Connection reset by peer]
<shevy>
can you give me the command you would use in bash?
unsay has quit [Ping timeout: 244 seconds]
<TotalEvil>
i trought it would be easilly modify that
<shevy>
the FULL command
<shevy>
perhaps for tobiasvl
<shevy>
but I find this to be a complete mess
<jokke>
TotalEvil: hm okay, i just got it to work kind of.. my problem: my command defined in a Command instance won't be executed. or maybe it is, but not as intended. I tried defining a Command with the command urxvt -e Bla but nothing happened when i selected it.
<TotalEvil>
))
<TotalEvil>
mb better i start with explain what it must to do
<shevy>
TotalEvil, I generate this string right now:
<shevy>
-a add -w -l mysql -s computer -t "10.0.0.1":3306 -e "inter 3000 rise 2 fall 3 maxconn 1"
<shevy>
TotalEvil, please correct this string ^^^
Michael_ has quit [Remote host closed the connection]
<shevy>
tell me what is wrong, so I can correct it
<TotalEvil>
this script must run after backend server boot and add it into loadbalancer (haproxy) via ssh access run command on LoadBalancer server with options from BackEnd
<shevy>
...
<TotalEvil>
competely at remote
rakuN has joined #ruby
<TotalEvil>
it must be haproxy_config_server.rb -a add -w -l mysql -s computer -t "10.0.0.1":3306 -e "inter 3000 rise 2 fall 3 maxconn 1"
<TotalEvil>
in current script problem is
liquid-silence has joined #ruby
liquid-silence has quit [Max SendQ exceeded]
<TotalEvil>
i get not 10.0.0.1:3306 just part from command hostname -I so i get -I:3306 which is incorrect
liquid-silence has joined #ruby
rakuN has quit [Client Quit]
Dreamer3 has joined #ruby
<shevy>
TotalEvil, why
<shevy>
why must it include haproxy_config_server.rb
horofox has joined #ruby
<TotalEvil>
haproxy_config_server.rb it's run on remote
<shevy>
TotalEvil ok the solution is
<TotalEvil>
from backend we run that script with own parameters
<shevy>
-t \"#{server_ip}\":#{port}
itsdavem_ has joined #ruby
<shevy>
^^^ server_ip is not added
<shevy>
you must find out why it is not added
<shevy>
no wait
<shevy>
where from does the -I come?
<shevy>
oh yeah
<TotalEvil>
server_ip=`hostname -I`
<shevy>
server_ip=`hostname -I`
<TotalEvil>
from this must
<TotalEvil>
but 1 more thing
<shevy>
this returns a wrong result
<TotalEvil>
i tried server_ip="1.1.1.1"
<TotalEvil>
and get same
<shevy>
not possible
<TotalEvil>
how it can be possible>
atno has joined #ruby
<shevy>
you must have done something wrong
<shevy>
no, not possible
<shevy>
you made something else in addition to that
<tobiasvl>
jokke: i don't understand what your current problem is. "nothing happened" is not a good error report. what do you mean you "selected" it?
<shevy>
TotalEvil try it now. set server_ip="1.1.1.1" again.
<TotalEvil>
same
<TotalEvil>
hmm
<TotalEvil>
how it can be
<shevy>
TotalEvil no, not possible. you lie. show the code.
<tobiasvl>
jokke: help me help you! explain your problem as shortly and succintly as possible. be to the point and specific. i don't have the time to troubleshoot a lot of stuff for you (and i don't want to either). when you hit a specific and concrete problem, please let us know so we can assist with our knowledge of ruby, but don't make us learn new knowledge about something totally unrelated to be able to help you
<shevy>
hehehe
<TotalEvil>
bro
<shevy>
I think newbies often need short sentences
<TotalEvil>
it's show correct only at puts
<shevy>
TotalEvil what do you mean "only at puts". do not lie. if you run system(_) it will run the command as shown.
ABK_ has quit [Ping timeout: 264 seconds]
Takehiro has joined #ruby
<TotalEvil>
yeap system return ok
<shevy>
perfect
<TotalEvil>
and if i run puts args
<TotalEvil>
also ok
<shevy>
if you need the return value, do:
decoponio is now known as decoponio_
<shevy>
result = `#{_}`
ABK_ has joined #ruby
adeponte has quit [Ping timeout: 276 seconds]
<shevy>
rather than system(_)
decoponio_ is now known as decoponio
<TotalEvil>
but when 74-75 line runs
<shevy>
understand?
<TotalEvil>
it bad
<shevy>
no line 74 no line 75
<TotalEvil>
ohh
<shevy>
this script is fucking shit
IdlePhD has quit [Ping timeout: 276 seconds]
zigomir has quit [Quit: zigomir]
<shevy>
kill it. throw it away. start from zero. kill the guy who wrote it.
<TotalEvil>
#{_hostname -I}
<TotalEvil>
?
<shevy>
what the fuck are you doing here
a_a_g has quit [Quit: Leaving.]
<shevy>
throw the script away
<TotalEvil>
it's not related to script
reinaldob has joined #ruby
<shevy>
yes it is
<shevy>
all your problems are because of that fucking script
<TotalEvil>
hostname -I
<shevy>
empty your brain. remove that script.
carloslopes has quit [Remote host closed the connection]
<TotalEvil>
it;s just command which i need
<shevy>
TotalEvil, listen. Start irb
<shevy>
have you started irb?
<TotalEvil>
irb?
<shevy>
why do you not know what irb is
hybris has joined #ruby
<shevy>
come back when you do.
unsay has joined #ruby
shtirlic has joined #ruby
<TotalEvil>
i haven't it
<shevy>
then install it
Kuifje has joined #ruby
<TotalEvil>
i have only clean console
<shevy>
that is sad. in the ukraine people have no irb :(
<TotalEvil>
okay looking
<TotalEvil>
)) bcz not many people work with ruby)
<TotalEvil>
before this only bash))
<shevy>
so what
<shevy>
and?
<shevy>
I use bash all the time too
<shevy>
so what?
<TotalEvil>
so it wasn't needed
abionic has quit [Ping timeout: 252 seconds]
<shevy>
good. you dont need ruby :)
<shevy>
write shell scripts
<shevy>
they are MUCH better than ruby
<TotalEvil>
must be a ruby(
<TotalEvil>
bcz of that .... company
RonScagz has joined #ruby
<TotalEvil>
which write that script)
<shevy>
do you use linux
<shevy>
do you know how I start irb in bash?
<shevy>
I type:
<shevy>
irb
<shevy>
then I hit enter
<shevy>
then I am in irb.
<shevy>
awesome, isn't it?
<shevy>
anyway, install irb, start it, then do this:
<shevy>
x = `hostname -I`
horofox has quit [Quit: horofox]
<shevy>
and tell me what x has
<shevy>
irb will give you the output, which you can copy paste to irc
elico has joined #ruby
renanoronfle has quit [Quit: This computer has gone to sleep]
<TotalEvil>
i get irb
<shevy>
GOOD
<TotalEvil>
yeap sure)
<shevy>
THERE IS HOPE FOR YOU MAN
<TotalEvil>
i just haven't irb package)) before
<shevy>
yeah, distributions suck
<TotalEvil>
=> "192.168.7.101 \n"
<shevy>
ok good
<shevy>
now you know that it will try to insert this string
<shevy>
if you look at it, you see it has a newline
<shevy>
the \n
<shevy>
you can get this away via .chomp or .strip
<whitequark>
as you can see he's somewhere from latin america. torture my search box further if you're that interested.
chiel has quit [Quit: leaving]
banjara has joined #ruby
AndChat| has joined #ruby
itsdavem_ has quit [Remote host closed the connection]
chiel has joined #ruby
malkomalko has joined #ruby
Banistergalaxy has quit [Ping timeout: 264 seconds]
<shevy>
hehe
<shevy>
that's quite excessive
<atmosx>
shevy: can you help me?
<atmosx>
shevy: query
<shevy>
I use "ok" rather often though, it gives the other person the notice that I have "acknowledged" or "read" something
<shevy>
atmosx sure
<whitequark>
shevy: where are you from?
Squarepy has joined #ruby
<shevy>
whitequark Europe, Austria, Vienna
Squarepy has quit [Changing host]
Squarepy has joined #ruby
buibex has joined #ruby
<whitequark>
hm. well, you also don't use "ok" that much
<whitequark>
no data points compromised!
<jokke>
okay, so. Here's my problem: i use my script to build a menu based on dmenu. When i select a menu item that's an instance of Comand (a class i've declarated) it doesn't seem to execute the command. I get no errors or anything.
<shevy>
whitequark yeah, it depends on the setup. when I ask a question and someone else is trying to help, I try to use "ok" more often... but that guy is quite insane, like every 2nd sentence is "ok" hehe
<shevy>
jokke whatever dmenu is, it sounds awful
<whitequark>
shevy: there was a second one from the same (iirc) country, with the same habit
<shevy>
make a puts menu.class after menu = add_menu
RurouniJones has joined #ruby
guns has quit [Quit: guns]
mockra has joined #ruby
<jokke>
you mean mean this line? menu.add_item(Command.new name, gets)
<jokke>
the menu is displayed correctly
<jokke>
the problem is with the Command
<jokke>
also sub menues are executed correctly (they open themselves up)
banjara has quit [Ping timeout: 246 seconds]
<jokke>
hm i added a puts before the `` in Commands execute method. it outputs the correct string
unsay has quit [Ping timeout: 248 seconds]
zeade has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
pavilionXP has joined #ruby
arya has quit [Ping timeout: 276 seconds]
yshh has joined #ruby
shtirlic_ has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 252 seconds]
a_a_g has joined #ruby
dhruvasa1ar has quit [Ping timeout: 252 seconds]
arya has joined #ruby
dhruvasagar has joined #ruby
dhruvasa1ar has joined #ruby
girija_ has quit [Ping timeout: 248 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
ananthakumaran has quit [Quit: Leaving.]
ananthakumaran has joined #ruby
pskosinski has joined #ruby
carloslopes has joined #ruby
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
ananthakumaran has quit [Ping timeout: 264 seconds]
nyuszika7h has quit [Remote host closed the connection]
adambeynon has quit [Quit: Computer has gone to sleep.]
noop has quit [Remote host closed the connection]
zeade has quit [Quit: Leaving.]
oreo has joined #ruby
razieliyo has joined #ruby
<razieliyo>
hi
Drager has quit [Changing host]
Drager has joined #ruby
arya_ has joined #ruby
<tobiasvl>
hi
<oreo>
Hello. I am wondering how I can ad parameters to a Proc that I am giving as a callback parameter. For example: ssh.process(0.1, &condition), how could I specify parameters to "condition"?
nyuszika7h has joined #ruby
Udom0 has joined #ruby
<heftig>
ssh.process(0.1) { condition.(3,4,5) }
vlad_starkov has joined #ruby
<Xeago>
heftig: with the dot?
<oreo>
heftig, could you explain the role of the dot?
<Xeago>
never seen that syntax before
arya has quit [Ping timeout: 246 seconds]
<heftig>
it's a short form of condition.call(3,4,5)
arya has joined #ruby
<Xeago>
ah, thanks!
<oreo>
heftig, thanks. so if process yields with parameters, they would be added after mine?
haxrbyte has quit [Remote host closed the connection]
<SQLDarkly>
Hey All. I have the following json im writing to mongo, but im not sure how to tackle the classes array I have. http://pastebin.com/2bsrUZQV
<SQLDarkly>
classes keeps getting written like "mathscienceenglish"
jonathanwallace has joined #ruby
chussenot has joined #ruby
<SQLDarkly>
Any pointers would be appreciated.
banjara has quit [Ping timeout: 260 seconds]
tommyvyo has joined #ruby
mjolk has joined #ruby
x0F has quit [Disconnected by services]
xAndy is now known as xandy
x0F_ has joined #ruby
dawkirst has joined #ruby
x0F_ is now known as x0F
cha1tanya has quit [Quit: Leaving]
shtirlic has joined #ruby
miso1337 has quit [Quit: unplugging]
subbyyy_ has joined #ruby
enroxorz-work has joined #ruby
cohwsw has joined #ruby
cardoni has joined #ruby
AsgardBSD_ has quit [Read error: Connection reset by peer]
Hanmac_ has quit [Quit: Page closed]
yshh has quit [Remote host closed the connection]
yalue has joined #ruby
cardoni has quit [Ping timeout: 248 seconds]
banister_ has joined #ruby
dhruvasagar has quit [Ping timeout: 264 seconds]
dhruvasa1ar has quit [Ping timeout: 260 seconds]
jfl0wers has quit [Quit: jfl0wers]
buibex has quit [Remote host closed the connection]
<shevy>
SQLDarkly you did not say what is the problem
stopbit has joined #ruby
enroxorz-work has joined #ruby
<Spooner>
shevy, The problem is that 1.8.7 to_s writes strings out poorly. But also that SQLDarkly didn't realiuse that Array maps directly to JSON anyway.
<Spooner>
shevy, Array#to_s that is.
<shevy>
I think he died in front of his computer
<SQLDarkly>
yeah im a lowly unix admin not a programmer so im going through some exercises to learn a bit more. I write shell scripts heh
<shevy>
SQLDarkly are you still alive
mockra has quit [Ping timeout: 260 seconds]
<SQLDarkly>
yeah sorry I was working a change control @ work. Finished now though.
coder_neo has quit [Ping timeout: 248 seconds]
<Spooner>
SQLDarkly, You should never need to do "#{var}" either. Either use var directly or use var.to_s.
<shevy>
"mathscienceenglish" is cool output. where is the problem
reinaldob has quit [Remote host closed the connection]
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<SQLDarkly>
Should be "math" \n "science" \n "english"
<Spooner>
SQLDarkly, Use #{} when you have more than just a single variable in a string.
<shevy>
you can use .join on your array SQLDarkly
<Spooner>
SQLDarkly, Are you sure it wouldn't be better as an array?
<Spooner>
There isn't any reason to convert it into a single string.
<shevy>
SQLDarkly, array = %w( math science english ); array.map(&:capitalize).join("\n") # => "Math\nScience\nEnglish"
<SQLDarkly>
ah I was under the impression #{} is used like $var in say "hi my name is $name "
bigkevmcd has joined #ruby
<Spooner>
SQLDarkly, It is, but no reason to do "$name" if you can $name (In Perl) ;)
<shevy>
$var is a global variable in ruby
<shevy>
#{} in a string works on everything
<shevy>
"#{foo}"
<shevy>
"$#{foo}"
<shevy>
hmmmmm
<shevy>
haha
<shevy>
"#{$foo}"
<shevy>
there. but this is awful...
<Spooner>
shevy, Yes, but I often see newbies doing "#{var}" when var would do.
<shevy>
yeah
<shevy>
even I failed with $ just now
<Spooner>
And by that I mean just "#{var}" not "#{var} likes pie". The latter makes sense.
<SQLDarkly>
im a newb for sure :) Im mean on a unix cli, but programming..... not so much.
Liothen has quit [Remote host closed the connection]
<TotalEvil>
xDD
geekbri has joined #ruby
<TotalEvil>
i got it work))
<shevy>
SQLDarkly, you write shell scripts, you can program.
jonathanwallace has quit [Ping timeout: 252 seconds]
banjara has joined #ruby
<Spooner>
Anyway, SQLDarkly You can just do "classes" => classes - the Array will be converted to JSON for you.
<SQLDarkly>
trying to bridge that gap shevy :) I understand constructs like for loops while if case etc, but there are a lot of ways to do things in ruby so im finding it difficult to say this is how X is done. Maybe im overthinking
the_mentat has joined #ruby
<Spooner>
You only need to know one way.
<shevy>
SQLDarkly well you have most of the basics already
<SQLDarkly>
i suppose that is true Spooner
<shevy>
most of the programming in ruby happens in methods
alanjc has joined #ruby
<shevy>
the rest is just storing data somewhere
<shevy>
and some way to access or query or modify that
<shevy>
SQLDarkly, you can ignore all other ways as long as you have found one way
bean__ has joined #ruby
<Spooner>
Yeah, programming is just about moving data around with code. Simple ;)
bean__ is now known as bean|work
<shevy>
I ignore lambdas for instance
<shevy>
Spooner it is! I once had an awful array residing in a huge hash residing in a fat array
<shevy>
I was trying to make it look better
tommyvyo has joined #ruby
<shevy>
then I started again, and simply made it just one hash
<shevy>
and things worked magically from that point!
sailias has joined #ruby
<shevy>
I let the smart folks write smart code
<shevy>
I bring everything down to my level
<workmad3>
Spooner: code is itself data though :D
<Spooner>
shevy, If you'd used lambdas, it would have been better ;)
<workmad3>
Spooner: or so lisp would have us believe
<Spooner>
workmad3, That is a good point, but since you can't read code in Ruby (only manipulate lambda/methods), that is less true.
<Spooner>
Though I suppose there are AST tools that can read Ruby code properly.
yfeldblum has quit [Ping timeout: 256 seconds]
<shevy>
Spooner, yeah I heard that about lambdas before. someone on #ruby-lang told me "use them, you can learn something that way and become better", but I never got them. it seems that in all the ruby code I wrote so far, I somehow manage to avoid consciously *needing* them
<Spooner>
shevy, I can't imagine there is a Ruby app that actually _needs_ lambdas.
slainer68 has joined #ruby
<Spooner>
But then we don't need most things in Ruby. We just like to have stuff in case ;)
jaywastaken has quit [Read error: Connection reset by peer]
jaywastaken has joined #ruby
workmad3_ has joined #ruby
<shevy>
hmm
<shevy>
I want to have good reasons for using something and not using something else
<shevy>
like subclassing, vs. including
fenak has quit [Quit: Page closed]
workmad3 has quit [Ping timeout: 245 seconds]
ngoldman has joined #ruby
xbayrockx has quit []
acrocity has quit [Read error: Connection reset by peer]
horofox has joined #ruby
banjara has quit [Ping timeout: 252 seconds]
acrocity has joined #ruby
n1x has quit [Quit: Ex-Chat]
horofox has quit [Client Quit]
browndawg has quit [Quit: Leaving.]
<SQLDarkly>
thanks for the help gentlemen. Going to crack away at this and see if I can get it working.
Skylab has joined #ruby
yshh has joined #ruby
SQLDarkly has quit [Quit: Page closed]
subbyyy_ has quit [Ping timeout: 256 seconds]
jfl0wers has joined #ruby
ngoldman has quit [Ping timeout: 252 seconds]
girija_ has quit [Ping timeout: 245 seconds]
zigomir has quit [Quit: zigomir]
arietis has joined #ruby
samphippen has joined #ruby
renanoronfle has joined #ruby
huoxito has joined #ruby
elico has quit [Quit: elico]
abcdefg_ has joined #ruby
mjolk has quit [Quit: Leaving]
mjolk has joined #ruby
joofsh has joined #ruby
teriyakis has joined #ruby
breakingthings has joined #ruby
buibex has joined #ruby
codecop has quit [Remote host closed the connection]
kn330 has quit [Remote host closed the connection]
luk3 has joined #ruby
afd__ has quit [Quit: No Ping reply in 180 seconds.]
jrajav has joined #ruby
afd__ has joined #ruby
jerius has joined #ruby
TotalEvil has quit [Quit: ChatZilla 0.9.89 [Firefox 18.0.1/20130116073211]]
teriyakis has quit [Remote host closed the connection]
workmad3 has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
binaryplease has joined #ruby
lunarjar has joined #ruby
workmad3_ has quit [Ping timeout: 255 seconds]
yshh has quit [Remote host closed the connection]
zph has joined #ruby
quest88_ has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
ij has quit [Ping timeout: 256 seconds]
buibex has quit [Ping timeout: 276 seconds]
carlyle has joined #ruby
Konboi has quit [Remote host closed the connection]
yshh has joined #ruby
vlad_starkov has joined #ruby
segv- has joined #ruby
jaywastaken has quit [Remote host closed the connection]
tomzx_mac has joined #ruby
tekacs has quit [Quit: Disappearing... *poof*]
rippa has joined #ruby
DrShoggoth has quit [Ping timeout: 248 seconds]
tekacs has joined #ruby
tekacs has quit [Client Quit]
quest88_ has quit [Quit: quest88_]
elico has joined #ruby
xk_id has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
a_a_g has quit [Quit: Leaving.]
Virunga has joined #ruby
ondrejr has joined #ruby
solidoodlesuppor has joined #ruby
zph has quit [Quit: Computer has gone to sleep.]
unsay has quit [Ping timeout: 245 seconds]
banjara has joined #ruby
banseljaj is now known as imami|afk
jtharris has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
tekacs has joined #ruby
ondrejr has left #ruby ["Leaving"]
DaltonUS has joined #ruby
<Xeago>
reused or re-used?
jrist-afk is now known as jrist
browndawg has joined #ruby
<Xeago>
The existing instance has been re-used to put the system in a mode of reduced redundancy but fully operational.
jpfuentes2 has joined #ruby
cardoni has joined #ruby
tekacs has quit [Read error: Connection reset by peer]
tekmaster has joined #ruby
tekmaster is now known as tekacs
binarypl1 has joined #ruby
kold has joined #ruby
yfeldblum has joined #ruby
jaywastaken has joined #ruby
jaywastaken has joined #ruby
jaywastaken has quit [Changing host]
dpbus has joined #ruby
elico has quit [Remote host closed the connection]
pu22l3r has joined #ruby
huoxito has quit [Quit: Leaving]
renanoronfle has quit [Quit: This computer has gone to sleep]
binaryplease has quit [Ping timeout: 245 seconds]
s1n4 has joined #ruby
freeayu has quit [Remote host closed the connection]
generalissimo has joined #ruby
cardoni has quit [Ping timeout: 264 seconds]
mmitchell has joined #ruby
s1n4 has quit [Client Quit]
stormetrooper has quit [Ping timeout: 246 seconds]
banjara has quit [Ping timeout: 248 seconds]
unsay has joined #ruby
jgarvey has joined #ruby
workmad3_ has joined #ruby
mockra has joined #ruby
tomzx_mac has quit [Ping timeout: 256 seconds]
nkr has joined #ruby
samphippen has joined #ruby
buibex has joined #ruby
segv-_ has joined #ruby
rismoney has joined #ruby
segv- has quit [Ping timeout: 245 seconds]
shtirlic has quit [Read error: Connection reset by peer]
segv-_ is now known as segv-
kold has quit [Remote host closed the connection]
shtirlic has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
unsay has quit [Ping timeout: 276 seconds]
jgarvey has quit [Ping timeout: 245 seconds]
mockra has quit [Ping timeout: 260 seconds]
osaut has quit [Read error: Operation timed out]
blaxter has quit [Quit: foo]
Beoran__ has joined #ruby
buibex has quit [Ping timeout: 276 seconds]
generalissimo has quit [Remote host closed the connection]
timeout has quit [Quit: leaving]
Beoran_ has quit [Ping timeout: 264 seconds]
stormetrooper has joined #ruby
browndawg1 has joined #ruby
maycon has joined #ruby
maycon has quit [Changing host]
maycon has joined #ruby
acies has joined #ruby
browndawg has quit [Ping timeout: 245 seconds]
<acies>
Is there an Array method for doing '.pop!' ?
<acies>
That is, returning the array instead of the popped item
<banister_>
acies: array.tap(&:pop)
<heftig>
ew
buibex has joined #ruby
<acies>
Poor question, sorry. Thanks
samuel02 has quit [Remote host closed the connection]
clocKwize has quit [Quit: clocKwize]
jonathanwallace has quit [Ping timeout: 264 seconds]
dpbus has quit []
workmad3_ has quit [Ping timeout: 276 seconds]
shock_one has quit [Read error: Connection reset by peer]
cousine has quit [Remote host closed the connection]
bdnelson has joined #ruby
lunarjar has quit [Client Quit]
atno has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
mmitchel_ has joined #ruby
nimred has quit [Quit: leaving]
jesfre has joined #ruby
mando has joined #ruby
jesfre has quit [Client Quit]
banjara has joined #ruby
__BigO__ has joined #ruby
mmitchell has quit [Ping timeout: 252 seconds]
cousine has joined #ruby
segv- has quit [Read error: Connection reset by peer]
segv-_ has joined #ruby
reinaldob has joined #ruby
flyinprogramer has joined #ruby
pu22l3r has quit [Remote host closed the connection]
punkrawkR has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
_nitti has joined #ruby
joofsh has quit [Remote host closed the connection]
IrishGringo_ has quit [Quit: ChatZilla 0.9.89 [Firefox 18.0.1/20130116073211]]
ferdev_ has joined #ruby
cpruitt has joined #ruby
fmcgeough has joined #ruby
IrishGringo has joined #ruby
blazes816 has quit [Quit: blazes816]
michaelmartinez has joined #ruby
DrShoggoth has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
atno has quit [Quit: Leaving]
aedornm has quit [Quit: Leaving]
niklasb has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
<flyinprogramer>
has anyone done any performance testing on the difference between directly using/calling an instance variable in code vs using the class' reader method to access it ? ex. using @variable instead of a call to a method like: def variable @variable; end
asteve has joined #ruby
vlad_starkov has joined #ruby
atno has joined #ruby
ferdev_ has quit [Client Quit]
bradleyprice has joined #ruby
unsay has joined #ruby
elkclone has quit [Ping timeout: 248 seconds]
ferdev_ has joined #ruby
elkclone has joined #ruby
zph has joined #ruby
banjara has quit [Ping timeout: 255 seconds]
Aenigma has joined #ruby
ferdev_ has quit [Client Quit]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
nateberkopec has joined #ruby
<bean|work>
flyinprogramer: I'd imagine the performance differences would be negligible.
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
<hoelzro>
I would favor the accessor methods
alanjc has quit [Quit: alanjc]
<hoelzro>
no need to prematurely optimize
clocKwize has quit [Quit: clocKwize]
cousine has quit [Remote host closed the connection]
<flyinprogramer>
i would completely agree, but for giggles i did the swap and i swear things are running faster...
eldariof has quit [Ping timeout: 248 seconds]
<flyinprogramer>
if we could just fit Gigs of L2 cache on our procs it wouldn't matter for sure :P
jrajav has quit [Quit: I tend to be neutral about apples]
<bean|work>
I like attr_accessor
<bean|work>
personally
<Aenigma>
i have a bit of a newbie question. if i wanted to make a class that extends Array but add a definition for an extra data type for the already existing methods, how should I do it since ruby doesn't have method overloading?
<tobiasvl>
Aenigma: ruby doesn't have method overloading?
JarJar has quit [Quit: Leaving]
<tobiasvl>
oh yeah like that
<tobiasvl>
nvm
<Aenigma>
tobiasvl: like object.doStuff(int) and object.doStuff(String)
zph has quit []
<flyinprogramer>
oh i do too - especially if you're going to reach for things inside the object from the outside, but when you're inside, i would think it would be terribly inefficient -- unless some how the interpreter is like a compiler, and that it was smarter than mere mortals
<heftig>
flyinprogramer: for MRI, the method calls make it more than twice as slow
nomenkun has quit [Remote host closed the connection]
<heftig>
in RBX, the method call version is actually faster
<flyinprogramer>
hoelzro: you're absolutely correct, i just have some what of a systems background, i'm type A, it's a friday, so why not go on a quest for knowledge
<lectrick>
Anyone from rubygems.org on here?
pavilionXP has quit [Read error: Connection reset by peer]
<hoelzro>
oh, fair enough. I'm all for curiosity =)
vlad_starkov has quit [Read error: Connection reset by peer]
jerikl has joined #ruby
vlad_starkov has joined #ruby
michaelmartinez has joined #ruby
t0rc has joined #ruby
Mission-Critical is now known as MissionCritical
noxoc has quit [Quit: noxoc]
Virunga has quit [Remote host closed the connection]
banisterfiend has joined #ruby
clooth has quit [Quit: clooth]
decoponi_ has joined #ruby
stopbit has quit [Quit: Leaving]
joofsh has quit [Remote host closed the connection]
decoponio has quit [Ping timeout: 260 seconds]
lunarjar has joined #ruby
jaequery has joined #ruby
lunarjar has quit [Client Quit]
maxmanders has quit [Quit: Computer has gone to sleep.]
generalissimo has joined #ruby
<breakingthings>
How can I convert a string date in the format "%Y-%m-%d" into a Date object?
elico has joined #ruby
banjara has quit [Ping timeout: 255 seconds]
decoponi_ is now known as decoponio
miskander has joined #ruby
maxmanders has joined #ruby
maz-dev has quit [Read error: Connection reset by peer]
supergiantrobot_ has joined #ruby
tvw has quit [Remote host closed the connection]
maxmanders has quit [Client Quit]
jrafanie has joined #ruby
dougireton has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
decoponio is now known as decoponi_
maxmanders has joined #ruby
theRoUS has quit [Ping timeout: 272 seconds]
d2dchat has joined #ruby
<breakingthings>
nevermind, got it.
chussenot has quit [Quit: chussenot]
decoponi_ is now known as decoponyo
ananthakumaran has joined #ruby
decoponyo is now known as decoponio
elico has quit [Remote host closed the connection]
elico has joined #ruby
chussenot has joined #ruby
dmiller has joined #ruby
dhruvasagar has joined #ruby
dhruvasa1ar has joined #ruby
poikon has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
poikon_work has quit [Ping timeout: 245 seconds]
noxoc has joined #ruby
techhelp has joined #ruby
murilo_fs has joined #ruby
jonahR has joined #ruby
jfl0wers has quit [Read error: Connection reset by peer]
ckrailo has joined #ruby
jfl0wers has joined #ruby
axl_ has joined #ruby
michaelmartinez_ has joined #ruby
mneorr has joined #ruby
apenneba has joined #ruby
michaelmartinez has quit [Ping timeout: 245 seconds]
michaelmartinez_ is now known as michaelmartinez
<apenneba>
Where can I find a gem for printing diff-format differences between two arrays? Diffy doesn't work on Windows without manual installation of the Unix diff tool :(
Umren has joined #ruby
<bean|work>
in general windows sucks for ruby work, apenneba
mklappstuhl has quit [Ping timeout: 248 seconds]
cy43 has joined #ruby
chrishunt has quit [Quit: Leaving...]
recycle has joined #ruby
flyinprogramer has quit [Quit: flyinprogramer]
cy43 has left #ruby ["Ex-Chat"]
the_mentat has quit [Quit: Computer has gone to sleep.]
BizarreCake has joined #ruby
alanjc has joined #ruby
joofsh has joined #ruby
mklappstuhl has joined #ruby
elico has quit [Quit: elico]
elico has joined #ruby
AndChat| has quit [Ping timeout: 245 seconds]
poseid has quit [Quit: Page closed]
banjara has joined #ruby
inokenty has joined #ruby
reinaldob has quit [Remote host closed the connection]
sayan has joined #ruby
gosshedd has quit [Ping timeout: 246 seconds]
hoelzro is now known as hoelzro|away
elico has quit [Client Quit]
elico has joined #ruby
albakry has joined #ruby
albakry has joined #ruby
browndawg1 has quit [Ping timeout: 245 seconds]
elico has quit [Client Quit]
elico has joined #ruby
elico has quit [Client Quit]
elico has joined #ruby
miskander has quit [Quit: miskander]
sc_raptor has quit [Quit: Leaving]
chrishough has joined #ruby
shashin has joined #ruby
miskander has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
miskander has quit [Client Quit]
alanjc has quit [Ping timeout: 245 seconds]
Xeago has quit [Remote host closed the connection]
girija_ has quit [Ping timeout: 255 seconds]
pu22l3r has quit [Ping timeout: 252 seconds]
apenneba has quit [Quit: Page closed]
alanjc has joined #ruby
ogamita has joined #ruby
Vainoharhainen has joined #ruby
brimil01 has joined #ruby
slainer68 has quit [Remote host closed the connection]
Takehiro has quit [Remote host closed the connection]
michaelmartinez_ has joined #ruby
renanoronfle has joined #ruby
buibex has quit [Remote host closed the connection]
miskander has joined #ruby
<ogamita>
Hi! I'm trying to load cucumber and frank-cucumber on 1.8.7-p370 (version is imposed). Unfortunately, frank-cucumber requires sim_launcher (0.4.6 installed), which requires cgi.rb from ruby 1.8, and it breaks on line 781 because of DelegateClass(Array) which raises: ~/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/cgi.rb:781: undefined method `Class' for CGI:Class (NoMethodError)
<ogamita>
What can I do to resolve this problem?
hybris has quit [Read error: Connection reset by peer]
tjbiddle has joined #ruby
michaelmartinez has quit [Read error: Connection reset by peer]
<ogamita>
Sorry, it wasn't the right error message. Here is the right message: ~/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/cgi.rb:781: invalid identifier 만약 (NameError)
<ogamita>
Notice the Korean characters. There's no non-ascii character in cgi.rb.
michaelmartinez_ has quit [Ping timeout: 264 seconds]
mengu_ has quit [Quit: Konversation terminated!]
banjara has quit [Ping timeout: 246 seconds]
angusigu1ss has quit [Ping timeout: 260 seconds]
nazty has quit [Ping timeout: 248 seconds]
theRoUS has joined #ruby
<jerikl>
ogamita: I think you're gonna have to dig into the libraries to figure out what's really going on
dougireton has quit [Quit: Leaving.]
<ogamita>
Even in the implementation I'm afraid.
<jerikl>
Have you done a diff on the two cgi libraries?
<ogamita>
which other?
<jerikl>
Oh I thought it was expecting cgi.rb from another version of ruby
<ogamita>
I have one installed by the system yes.
<ogamita>
No diff.
<ogamita>
System ruby is: ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
<ogamita>
rvm ruby is ruby 1.8.7 (2012-06-29 patchlevel 370) [i686-darwin12.2.0]
Banistergalaxy has joined #ruby
mockra has joined #ruby
<ogamita>
With system ruby, the error message is: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/cgi.rb:774: invalid identifier Eğerki (NameError)
uris has joined #ruby
<ogamita>
It loads the same rvm-installed gems.
carloslopes has quit [Remote host closed the connection]
odyssey4me has joined #ruby
<jerikl>
Yeah it's hard to say without debugging / I don't have any experience with those gems in 1.8.7
murilo_fs has left #ruby ["Konversation terminated!"]
<ogamita>
To me it looks like a bug in ruby 1.8 that existed at least [1.8-358 .. 1.8-370]
jgrevich has joined #ruby
<ogamita>
1.8.7 yes.
<ogamita>
ok, let's try to debug that …
girija_ has joined #ruby
andrewh has quit [Quit: leaving]
<ogamita>
at work, 15 min before the start of the week end…
<jerikl>
Is there a diff in cgi.rb between 1.8 and 1.9?
dougireton has joined #ruby
andrewh has joined #ruby
<ogamita>
Well, I'd diff Delegate.rb rather, the problem must be there I think. it's the call to DelegateClass(Array) that raise the error.
browndawg has joined #ruby
mklappstuhl has quit [Ping timeout: 264 seconds]
sn0wb1rd has quit [Quit: sn0wb1rd]
mockra has quit [Ping timeout: 252 seconds]
razibog has quit [Ping timeout: 252 seconds]
<jerikl>
Ah okay. I wonder if it has something to do with the way 1.9 handles Unicode over 1.8 .... Maybe one of the gems is doing something 1.8 doesn't support
Vainoharhainen has quit [Quit: Leaving...]
kpshek has joined #ruby
<ogamita>
Well, so far I didn't install other ruby version here, so normally everything's matching.
banisterfiend has quit [Remote host closed the connection]
noxoc has quit [Quit: noxoc]
<ogamita>
The fact is that cucumber and frank-cucumber load correctly when running tests. I'm trying to load them with irb to connect to the application from irb.
mklappstuhl has joined #ruby
dmiller has quit [Ping timeout: 255 seconds]
<jerikl>
Ooh okay. I thought the gems weren't working in 1.8.7
<ogamita>
Well, rvm doesn't seem to have any problem. :-)
oreo has quit []
<ogamita>
Probably it uses old gems.
Takehiro has joined #ruby
tcstar has joined #ruby
carlyle has quit [Remote host closed the connection]
dr_bob has quit [Read error: Connection reset by peer]
<jerikl>
So you want to run this from system ruby irb?
mahmoudimus has joined #ruby
<ogamita>
no, just with the rvm ruby. I wrote a script concatenating chunks from cucumber and irb scripts and frank-cucumber.rb.
mercwithamouth has joined #ruby
<ogamita>
It fails on require 'frank-cucumber' because of this DelegateClass(Array) call in cgi.rb.
* ogamita
brew installing ruby 1.9.3
mephux has quit [Excess Flood]
Stilo has joined #ruby
osaut has quit [Read error: Operation timed out]
grendlme has quit [Quit: grendlme]
chimkan___ has joined #ruby
mephux has joined #ruby
<jerikl>
So it works on system ruby 1.8.7 but not rvm ruby 1.8.7?
alvaro_o has joined #ruby
<ogamita>
No, it doesn't work on neither. Just a small variation in the error message (the garbage characters are not the same).
otters has quit [Ping timeout: 252 seconds]
<ogamita>
delegate.rb didn't change between the two 1.8.7; it change in 1.9.3
rakm has joined #ruby
mklappstuhl has quit [Ping timeout: 264 seconds]
<jerikl>
But they are both loaded successfully in both when running tests?
<jerikl>
And you are requiring the gems in the same fashion as the tests do and it fails?
DarthGandalf has quit [Ping timeout: 245 seconds]
_nitti has quit [Remote host closed the connection]
<ogamita>
Yep, DelegateClass changed a lot in 1.9.3, the creation of methods doesn't goes thru module_eval anymore. It's module_eval that raise the SyntaxError at the origin of the NameError.
<ogamita>
jerikl: Well, I hoped to do the necessary require, that's probably the problem. On the other hand, I want to avoid requiring the files that will run the tests non-interactively.
<ogamita>
Anyways, work time ends, week end starts, we'll see that later. Thanks for the help. (I'll probably patch DelegateClass to make it like in 1.9).
<ogamita>
Bye.
tvw has joined #ruby
<jerikl>
Sorry I wasn't much of it /enjoy the weekend!
carloslopes has joined #ruby
_nitti has joined #ruby
mikeycgto has joined #ruby
DarthGandalf has joined #ruby
binarypl1 has quit [Quit: WeeChat 0.4.0]
chimkan has quit [Ping timeout: 244 seconds]
binaryplease has joined #ruby
timmow has quit [Remote host closed the connection]
codespectator has quit [Ping timeout: 252 seconds]
renanoronfle has quit [Ping timeout: 244 seconds]
timmow has joined #ruby
banjara has joined #ruby
snorb has joined #ruby
banisterfiend has joined #ruby
swex_ has quit [Ping timeout: 255 seconds]
girija_ has quit [Ping timeout: 256 seconds]
goraxe has joined #ruby
nazty has joined #ruby
dmiller has joined #ruby
sn0wb1rd has joined #ruby
dmiller has quit [Client Quit]
acriax has quit [Remote host closed the connection]
davidcel- has joined #ruby
erichmenge_ has joined #ruby
mythical has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
davidcelis has quit [Ping timeout: 252 seconds]
davidcel- is now known as davidcelis
davidcelis has quit [Changing host]
davidcelis has joined #ruby
rakl has joined #ruby
nga4 has joined #ruby
mythical has quit [Client Quit]
erichmenge has quit [Ping timeout: 245 seconds]
erichmenge_ is now known as erichmenge
mythical has joined #ruby
codespectator has joined #ruby
snorb has left #ruby [#ruby]
snorb has joined #ruby
snorb has left #ruby [#ruby]
tjbiddle has quit [Quit: tjbiddle]
aaronmacy has joined #ruby
zommi has quit [Quit: Leaving.]
skcin7 has joined #ruby
DarthGandalf has quit [Ping timeout: 245 seconds]
ffranz has joined #ruby
joofsh has quit [Remote host closed the connection]
shashin has quit [Quit: shashin]
mythical has quit [Quit: mythical]
dmiller has joined #ruby
chrishunt has joined #ruby
ahokaomaeha has joined #ruby
mythical has joined #ruby
DarthGandalf has joined #ruby
Malgorath has joined #ruby
mythical has quit [Remote host closed the connection]
zastern has joined #ruby
<Malgorath>
Is this a place I can ask questions about Ruby on Rails?
dustint has quit [Remote host closed the connection]
<KevinSjoberg>
Hi, guys. I've got this idea of a project I want to create. It's open source. Mostly to improve in programming and learn something along the way. I'm looking for someone that want to help me build this, so we can share ideas and work on it together. The project is a simple markup language (similar to Markdown).
jrist is now known as jrist-afk
<Hanmac>
i_s only one of ? and ! is supported and only at the end ... so abc! and abc? is valid, abc?! is not (but you can still define it with define_method)
mythical has quit [Quit: mythical]
dougireton has quit [Remote host closed the connection]
s1n4 has joined #ruby
yacks has quit [Quit: Leaving]
chimkan_ has quit [Quit: chimkan_]
mneorr has quit [Remote host closed the connection]
grendlme has quit [Quit: grendlme]
girija_ has quit [Ping timeout: 264 seconds]
spacemilk is now known as spacekitten
woolite64_ has joined #ruby
spacekitten is now known as Spacehost
woolite64 has quit [Ping timeout: 276 seconds]
Spacehost is now known as Space6host|cloud
buibex has quit [Remote host closed the connection]
sayan has quit [Quit: Leaving]
Space6host|cloud is now known as spacemjolk
dougireton has joined #ruby
green_leaf has quit [Quit: Leaving]
dmiller has joined #ruby
mcqueenorama has joined #ruby
mneorr has joined #ruby
cakehero has joined #ruby
chrishough has joined #ruby
woolite64_ has quit [Ping timeout: 256 seconds]
apok has joined #ruby
Mission-Critical has joined #ruby
otters has joined #ruby
carloslopes has quit [Remote host closed the connection]
otters has quit [Client Quit]
jgrevich_ has joined #ruby
cantonic has quit [Ping timeout: 245 seconds]
<nate_h_>
how come I can't add stuff to a hash at two levels at once?
hemanth_ has quit [Read error: Connection reset by peer]
<kenneth>
hey all
hemanth_ has joined #ruby
Raboo has quit [Read error: Connection reset by peer]
radic has joined #ruby
Raboo has joined #ruby
dyrot has quit [Ping timeout: 252 seconds]
oposomme has quit [Ping timeout: 245 seconds]
<kenneth>
imagine i have a class which wraps around a connection object. the class has a bunch of methods that use this connection. any of the methods on that connection can throw a "socket exception" exception, which i'd like to catch and use to trigger a reconnect
benlieb has quit [Quit: benlieb]
s1n4 has quit [Quit: leaving]
<kenneth>
how would you do this? i'm thinking of doing it this way:
<pietr0>
kenneth: when you wrap the connection object rescue the class of the socket exception and retry
klip has joined #ruby
hadees has quit [Read error: Connection reset by peer]
hadees has joined #ruby
soulcake has joined #ruby
<kenneth>
creating a proxy object for the connection intercepts every method call and forwards to the connection, catching the exception and re-constructing it
sullenel has joined #ruby
<kenneth>
pietr0: well no, i want to avoid having to catch the same exception everywhere i use the connection
<kenneth>
because there's like dozens of places
<graft>
hey is there a shorthand way to link an instance method to a class method?
<kenneth>
graft: you mean the equivalent of doing def method; self.class.method; end
<graft>
kenneth: exactly
grzywacz has quit [Quit: :wq]
moos3 has quit [Ping timeout: 245 seconds]
adkron has joined #ruby
chrishunt has quit [Ping timeout: 260 seconds]
pu22l3r has quit [Remote host closed the connection]
<kenneth>
graft: it's not that long to type out :) but there isn't a way that i know of, though it'd be easy to build one
<graft>
yeah, i guess i can just build one, that's probably easiest in the end
jduan1981 has quit [Ping timeout: 264 seconds]
b1rkh0ff has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
freakazoid0223 has joined #ruby
atmosx has joined #ruby
sullenel has quit [Quit: WeeChat 0.4.0]
arturas_ has quit [Ping timeout: 252 seconds]
Banistergalaxy has joined #ruby
<atmosx>
hello
johndouthat has joined #ruby
<Hanmac>
"Canada joined the map »Pirates of Mali« and is searching for Gold"
mahmoudimus has quit [Read error: Connection reset by peer]
alex__c2022 has quit [Ping timeout: 245 seconds]
alex__c2022_ is now known as alex__c2022
haxrbyte has joined #ruby
CaptainKnots has quit [Ping timeout: 260 seconds]
moos3 has joined #ruby
CaptainKnots has joined #ruby
CaptainKnots has quit [Changing host]
CaptainKnots has joined #ruby
sharpobject has quit [Ping timeout: 260 seconds]
sharpobject has joined #ruby
nimred has joined #ruby
nimred has quit [Changing host]
nimred has joined #ruby
dpn` has quit [Ping timeout: 260 seconds]
benlieb has joined #ruby
breakingthings has joined #ruby
Goles has joined #ruby
mahmoudimus has joined #ruby
Skaag has left #ruby [#ruby]
<benlieb>
something has happened to my gem command. I can use it to uninstall, and I can run bundle install, but `gem install x` fails => 'Could not find rubygems-bundler' https://gist.github.com/4693695 help?
chrishough has quit [Quit: chrishough]
faulkner has quit [Read error: Connection reset by peer]
frem has joined #ruby
<atmosx>
Hanmac, oh the words kind
_JamieD_ has joined #ruby
moos3 has quit [Ping timeout: 248 seconds]
theoros has quit [Ping timeout: 260 seconds]
<atmosx>
s/words/worst
theoros has joined #ruby
pu22l3r has joined #ruby
faulkner has joined #ruby
dpn` has joined #ruby
stkowski has quit [Quit: stkowski]
moshef has joined #ruby
_JamieD_ has quit [Client Quit]
moos3 has joined #ruby
dallasm has joined #ruby
joshcheek has joined #ruby
nate_h_ has quit [Ping timeout: 245 seconds]
TDJACR has quit [Remote host closed the connection]
ananthakumaran has quit [Quit: Leaving.]
codecop has quit [Remote host closed the connection]
skcin7 has quit []
Virunga has joined #ruby
codecop has joined #ruby
Takehiro has joined #ruby
<joshcheek>
Hi, I want to invoke a program and give it a stream for its stdin. But reading the docs isn't making it clear to me how to hook the streams together. http://pastie.org/6020628
dmiller has joined #ruby
bigkevmcd has joined #ruby
bigkevmcd_ has joined #ruby
carlzulauf has quit [Read error: Connection reset by peer]
bigkevmcd_ has quit [Read error: Connection reset by peer]
io_syl has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby
moos3_ has joined #ruby
moos3 has quit [Ping timeout: 264 seconds]
jduan1981 has joined #ruby
io_syl has joined #ruby
jakecamara has joined #ruby
moshef has quit [Quit: moshef]
Takehiro has quit [Ping timeout: 248 seconds]
johnpcamara has joined #ruby
dmiller has quit [Ping timeout: 264 seconds]
eldariof has quit []
chrishough has joined #ruby
jduan1981 has quit [Ping timeout: 246 seconds]
generalissimo has joined #ruby
pu22l3r has quit [Ping timeout: 264 seconds]
<waxjar>
joshcheek, i'm guessing puts :)
workmad3 has quit [Read error: Operation timed out]
mneorr has joined #ruby
johnpcamara has left #ruby [#ruby]
banisterfiend has quit [Remote host closed the connection]
jduan1981 has joined #ruby
Catbuntu has quit [Quit: Auf wiedersehen]
<joshcheek>
waxjar: I want to connect the streams together, puts writes to the stream.
jamescarr has joined #ruby
michaelmartinez has joined #ruby
<Hanmac>
joshcheek .reopen ?
moos3_ is now known as moos3
clooth has quit [Remote host closed the connection]
Goles has quit [Quit: Computer has gone to sleep.]
jonahR has quit [Remote host closed the connection]
<theoros>
method(:p).owner #=> Kernel
jfelchner has joined #ruby
jonahR has joined #ruby
<Hanmac>
mehwork it maybe means pint it with a method of your choice
dallasm has quit []
Monie has joined #ruby
jrist-afk is now known as jrist
<mehwork>
when you make a public ruby gem does it have to work on windows? I really don't wanna spend the time to make it work on that crap
<Mon_Ouie>
y comes from require 'yaml'
<mehwork>
ah thanks Mon
<mehwork>
though in this case puts $LOAD_PATH would be easier and more readable
i_s has quit [Quit: i_s]
<jokke>
Hanmac: not sure.. You know i just want to print out a long multiline static string.
sullenel has joined #ruby
tspike has joined #ruby
<theoros>
jokke: heredocs? %Q{}?
<theoros>
jokke: or are you talking about printing a string you already have?
sullenel has quit [Client Quit]
bigkevmcd has quit [Quit: Ex-Chat]
<jokke>
i already have it
<theoros>
and what's wrong with puts
<jokke>
its just a short license declaration
<Hanmac>
mehwork you you could say in the gem description that you only support unixoid systems, like i says in the description that only 1.9.* is supported
<mehwork>
cool
<jokke>
theoros: well, all the \n's or puts are kinda annoying
Takehiro has joined #ruby
<theoros>
jokke: if you have a multiline string, why is there not just one puts?
<theoros>
puts my_string
<jokke>
theoros: yes well, but then i have to add all the \n's in there
<theoros>
jokke: maybe you should stop trying to describe code and just paste some example code
<jokke>
i thought there was some way to make part of the file just output as is.
jakecamara has quit [Quit: jakecamara]
phantasm66 has quit [Quit: *poof*]
havenn is now known as havenwood
sullenel has joined #ruby
<jokke>
i don't know what's so hard to understand.. :/ I just want to output a license declaration. I also want my code to look neat, so i'd like to have the declaration in the file the way it's gonna output. not with \n's or puts
pewter_tao has joined #ruby
<theoros>
okay, so you want to make a multiline string easily
<theoros>
you don't want to print a multiline string
<pewter_tao>
ok, I install a bunch of gems by doing "gem install .../*.gem"
<jokke>
yes i wan't to print it
<jokke>
too
<pewter_tao>
The problem is I get: ERROR: While executing gem... (ArgumentError) invalid byte sequence in US-ASCII
<jokke>
i think in python or so you can just make some weird TEXT>>> write your long ass text here <<<TEXT or something
<pewter_tao>
at random times during the install of all of the gems... How do I make them install one after the other so it is always the same one causing the error?
<swarley>
I'm trying to decide on whether to use Treetop or parslet
elaptics`away is now known as elaptics
<bawigga>
I'm writing a gem to consume content from an API. Should that gem return objects or hashes? What's best practice?
<bawigga>
hashes seem more generic, but with objects i could add business logic
bawigga has left #ruby [#ruby]
bawigga has joined #ruby
<bawigga>
back sorry
<bawigga>
accidentally quit the room
chiel`afk is now known as chiel
cmyers has joined #ruby
colonolGron has joined #ruby
<swarley>
bawigga, it depends on what you will be doing with the content
<bawigga>
well it's a gem, so hopefully it could be used by any project depending on our api
<swarley>
If you know the keys and you will be accessing it independantly, then you may want to use an object. However if you are going to iterate you may want a hash
Nisstyre has quit [Ping timeout: 255 seconds]
frankkany has quit [Remote host closed the connection]
abcdefg_ has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
chrishunt has quit [Quit: Leaving...]
<soulisson>
Hi, i would like to learn about distributed programming concepts while using the ruby, can you guys give some advice on where to begin (books, videos, ...)
<soulisson>
?
ryanjh has joined #ruby
alex__c2022 has quit [Remote host closed the connection]
ryanh has quit [Read error: Connection reset by peer]
ryanjh is now known as ryanh
Retistic has quit [Quit: Retistic]
carloslopes has joined #ruby
alex__c2022 has joined #ruby
mengu_ has joined #ruby
sailias has quit [Ping timeout: 245 seconds]
rezzack has joined #ruby
dmerrick has quit [Remote host closed the connection]
icole has joined #ruby
dmerrick has joined #ruby
__BigO__ has quit [Remote host closed the connection]
dbck has quit [Quit: Be back later]
grendlme has quit [Remote host closed the connection]
<cmyers>
I am trying to shim into an activerecord mysql adapter. Sometimes it is defined, and sometimes it isn't. How do I adjust this code to work all the time? https://gist.github.com/4694419
the_mentat has quit [Quit: Computer has gone to sleep.]
sn0wb1rd has quit [Quit: sn0wb1rd]
<cmyers>
I feel like I need to do an `if responds_to?(...)` or something like that but I can't find an example or anything that works
thone has joined #ruby
blacktulip has quit [Remote host closed the connection]
luckyruby has quit [Remote host closed the connection]
<cmyers>
hmm, now I am getting superclass mismatch. is there a way to reopen a class without knowing what it inherrits?
luckyruby has joined #ruby
Mchl has joined #ruby
jonahR has quit [Ping timeout: 260 seconds]
reinaldob has joined #ruby
<Hanmac>
“If you’re out walking, we’re going to stop you, ask why you’re out walking, and check for your ID,” police chief Todd Stovall told a December town hall meeting. <<< wtf?
chrishunt has quit [Quit: Leaving...]
Skylab has joined #ruby
<havenwood>
fuck the police?
chrishunt has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
DaltonUS has quit [Quit: DaltonUS]
chrishunt has quit [Client Quit]
maletor has joined #ruby
<lectrick>
Is there a way to ask an object whether it extends a module?
malkomalko has quit [Read error: Connection reset by peer]
malkomalko has joined #ruby
i_s has joined #ruby
<Hanmac>
havenwood: it seems that is totally unnatural for americans to walk with their own foot ... it seems that they drive even its only a few meters :P
chrishunt has joined #ruby
reinaldob has quit [Remote host closed the connection]
_nitti has quit [Remote host closed the connection]
<JJMalina>
nateberkopec: thanks
keymone has quit [Client Quit]
<workmad3>
Hanmac: #rubygems
<workmad3>
Hanmac: there's also a few others at the moment... #rubygems-aws for people working on the aws infrastructure rebuild
<havenwood>
#rubygems for general matters, #rubygems-verification (kinda moot since verified but still active), #rubygems-trust for future looking validations, #rubygems-aws for new platform
maletor has quit [Quit: Computer has gone to sleep.]
<workmad3>
havenwood: what about #rubygems-exploit ?
* workmad3
just checked the #rubygems topic, they're all there
bricker`work is now known as bricker
rakl has joined #ruby
<Hanmac>
hm i need to publish and develop more C++ gems :P
breakingthings has quit []
dougireton has quit [Quit: Leaving.]
<havenwood>
If you've got expertise in X509 or GPG join #rubygems-trust and chime in!
oy has joined #ruby
CLUSTERfoo has quit [Quit: Leaving]
<Hanmac>
havenwood ... hm not yet, but i am good in studing C(++) code ...
jaygen has quit [Remote host closed the connection]
<jokke>
i get the error dynmenu.rb:120:in `to_s': undefined method `keys' for nil:NilClass (NoMethodError)
<Hanmac>
the only code i am not willed to understand is php code ... specially when its ecommerce shit
jrist is now known as jrist-afk
MrPunkin has joined #ruby
<jokke>
so this is something like a null pointer exception
<jokke>
it seems that the object i'm trying to call keys on is nil
<MrPunkin>
Okay folks, I'm looking at trying to do some sorting / grouping in my app that can't be done at the DB level. What would be the most efficient method to sort an array of hashes by one of the hash values for ~100k objects?
<MrPunkin>
Trying to just get some benchmarks to know if it's even doable routinely
<jokke>
i just don't understand, why to_s is called at all. I didn't call the function anywhere
<jokke>
Can anyone help?
elvikingo has joined #ruby
aquaranto has quit [Remote host closed the connection]
jrafanie has quit [Quit: jrafanie]
joshcheek_ has joined #ruby
<poikon>
jokke: you're creating a string
moshee has quit [Ping timeout: 255 seconds]
joshcheek has quit [Ping timeout: 240 seconds]
joshcheek_ is now known as joshcheek
<poikon>
.join does that
<Hanmac>
jokke you miss a super
moshee has joined #ruby
ham1 has quit [Ping timeout: 252 seconds]
chussenot has joined #ruby
rudiX has joined #ruby
<havenwood>
Too bad HN etc get no attention for: "TL;DR: We were able to verify that all gems served by rubygems.org are tamper-free."
angusiguess has quit [Ping timeout: 248 seconds]
<jokke>
poikon: ah ok
statarb3 has quit [Ping timeout: 245 seconds]
<jokke>
havenwood: what do you mean?
<workmad3>
jokke: also string interpolation
RagingDave has quit [Quit: Ex-Chat]
<jokke>
where do i miss one?
<workmad3>
jokke: this - '" #{@colors}" ' calls .to_s on @colors
<poikon>
you could try a .reject(:nil?) before the join
oy has left #ruby [#ruby]
<workmad3>
jokke: and inserts the result into the string
<havenwood>
Maybe postmortems will get more attention.
havenwood has quit [Remote host closed the connection]
<workmad3>
poikon: .compact ;)
ffranz has quit [Ping timeout: 245 seconds]
<poikon>
workmad3: thanks :)
whowantstolivef1 has quit [Ping timeout: 245 seconds]
<Hanmac>
jokke: Editor::initialize does NOT call Menu::initialize, so @items is NOT set
reinaldob has joined #ruby
<jokke>
ah
<jokke>
i get it ok
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
<jokke>
makes sense
ner0x has quit [Quit: Leaving]
<Hanmac>
jokke: YAML::load File.open(file) is wrong: YAML::load File.read(file) is better, or File.open(file) {|f| YAML::load f}
<Hanmac>
join calls to_s on entry objects in entries
<jokke>
no
<Hanmac>
wrong it does
<jokke>
i pass entry.keys
<jokke>
i mean @items.keys
mikepack has quit [Remote host closed the connection]
<jokke>
which are simple strings
chrishough has joined #ruby
arya has quit [Ping timeout: 248 seconds]
<Hanmac>
jokke wrong line, i mean entries.join on Line 133
<Hanmac>
its an Array of Editor objects
bean|work has quit [Quit: Computer has gone to sleep.]
<jokke>
AH!
<jokke>
finally!
<Hanmac>
THIS join calls to_s on the Editor objects ... which is the Menu#to_s
<jokke>
yes, all makes sense now. thanks for working with this shit brain of mine :D
<TomJ>
I'm using Pry as an IRB replacement and it's lovely. But one annoying issue - I can't do Control-Left / C-Right to go back/forward a work. This works in my shell and every other readline app I have, e.g. mysql client. The only reference to a similar issue I can find via Google is someone who had the issue only when running Pry in a particular Rails project, and that was caused by a conflicted readline Gem. But for me it happens in all Pry sessions, and I h
<TomJ>
no rb-readline or similar gems
<TomJ>
I need to search a hash many tens of thousands of times in a method: what is the most performant way to do so? I just need to know if a key exists, I dont need to know the value. Currently I'm doing: unless myhash[integer_key].nil? … - is there any faster method, like a search or anything?
_nitti has joined #ruby
<TomJ>
in fact it will be searched close to a million times
TheFuzzball has joined #ruby
pu22l3r_ has joined #ruby
LKiS has left #ruby ["Leaving"]
stkowski has quit [Quit: stkowski]
mando has quit [Remote host closed the connection]
cauffe has quit [Read error: Connection reset by peer]
codecop has quit [Quit: Išeinu]
JJMalina has quit [Quit: JJMalina]
supergiantrobot_ has quit [Quit: supergiantrobot_]
<Spooner>
TomJ : And you don't need to search in a Hash. It is super-fast lookup.
<lectrick>
who is searching in a hash?
SCommette has joined #ruby
<lectrick>
TomJ: and what they said, it's Hash#has_key? or just hash_var[:keyname] not being nil
chimkan_ has joined #ruby
<TomJ>
I need to check a hash to see if a key exists in it, about a million times. so I wanted to know what was the absolutely fastest way - like whether anything would be faster than my current unless myhash[key].nil?
<TomJ>
ok thanks guys, I might benchmark to see if there's a difference between those two but guess there won't be
<lectrick>
i would guess has_key? might be fractionally faster than just trying to index by the key
pu22l3r_ has quit [Remote host closed the connection]
<lectrick>
TomJ: You can also just do hash.key? ... I think they're aliased
<TomJ>
and if I do: if ( hash.key?(key) || other_exp … ) - it doesn't evaluate other_exp unless hash.key? is true, correct?