apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
sbanwart has joined #ruby
replore_ has joined #ruby
maccosmo has quit [Ping timeout: 260 seconds]
maccosmo_ is now known as maccosmo
Sheehan has quit [Quit: Sheehan]
joch_n_ has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
c0rn has quit [Quit: Computer has gone to sleep.]
freeayu has joined #ruby
digitalcakestudi has quit [Quit: Leaving.]
shtirlic_ has joined #ruby
shtirlic has quit [Ping timeout: 260 seconds]
joch_n has quit [Ping timeout: 252 seconds]
rmascarenhas has joined #ruby
chico_chicote has joined #ruby
Progster has joined #ruby
bfig has joined #ruby
replore_ has quit [Remote host closed the connection]
stephenjudkins has quit [Quit: stephenjudkins]
iocor has quit [Quit: Computer has gone to sleep.]
eywu has joined #ruby
eywu has quit [Client Quit]
iamjarvo has quit [Quit: Leaving.]
ZachBeta has joined #ruby
fukushim_ has joined #ruby
fukushima has quit [Ping timeout: 265 seconds]
siksia has quit [Read error: Connection reset by peer]
Tomasso has joined #ruby
siksia has joined #ruby
eywu has joined #ruby
eywu has quit [Client Quit]
albemuth has quit [Quit: Computer has gone to sleep.]
kenperkins has quit [Ping timeout: 245 seconds]
eywu has joined #ruby
eywu has quit [Client Quit]
counterbeing has joined #ruby
eywu has joined #ruby
eywu has quit [Client Quit]
elake has joined #ruby
elake has quit [Client Quit]
banisterfiend has quit [Remote host closed the connection]
eywu has joined #ruby
eywu has quit [Client Quit]
eywu has joined #ruby
eywu has quit [Client Quit]
simao has joined #ruby
oooPaul has quit [Quit: Ciao for now!]
itnomad has joined #ruby
td123 has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
jedmtnman has joined #ruby
simao has quit [Ping timeout: 265 seconds]
jimeh2 has joined #ruby
iamjarvo has joined #ruby
shtirlic_ has quit [Read error: Connection reset by peer]
shtirlic has joined #ruby
counterbeing has quit [Read error: Connection timed out]
eywu has joined #ruby
mengu has quit [Remote host closed the connection]
eywu has quit [Client Quit]
[Neurotic] has joined #ruby
bosphorus has quit [Read error: Connection reset by peer]
peregrine81 has joined #ruby
hasrb has quit [Remote host closed the connection]
shadoi has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
mneorr has quit [Ping timeout: 248 seconds]
kah_ has joined #ruby
iamjarvo has quit [Quit: Leaving.]
eywu has joined #ruby
eywu has quit [Client Quit]
tayy has quit [Remote host closed the connection]
mneorr has joined #ruby
chienpo1 has joined #ruby
nlc has quit [Quit: Leaving]
chienpo has quit [Ping timeout: 244 seconds]
chienpo1 has left #ruby [#ruby]
gtuckerkellogg has joined #ruby
dbgster has joined #ruby
maccosmo has quit [Quit: maccosmo]
Konboi has joined #ruby
mikeycgto has quit [Ping timeout: 245 seconds]
perryh_away is now known as perryh
pdtpatrick has quit [Quit: pdtpatrick]
mrck has quit [Remote host closed the connection]
bigoldrock has quit [Quit: Leaving.]
benatwork has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
gtuckerkellogg has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
keanehsiao has joined #ruby
gtuckerkellogg has joined #ruby
jimeh2 has quit [Ping timeout: 240 seconds]
joch_n_ has quit [Quit: Leaving...]
davidpk has quit [Quit: Computer has gone to sleep.]
Clordio has joined #ruby
cbuxton has quit [Read error: Connection reset by peer]
piglittlepuffpuf has quit [Read error: Connection reset by peer]
cbuxton has joined #ruby
Clordio has quit [Client Quit]
punkrawkR has quit [Read error: Connection reset by peer]
eywu has joined #ruby
eywu has quit [Client Quit]
Clordio has joined #ruby
Clordio has quit [Client Quit]
taterbas_ has joined #ruby
taterbas_ has left #ruby [#ruby]
mikeycgto has joined #ruby
rvmeier has joined #ruby
adamkittelson has quit [Remote host closed the connection]
trend has joined #ruby
kenperkins has joined #ruby
nai has joined #ruby
graspee has quit [Quit: night night]
akem has joined #ruby
akem has quit [Read error: Connection reset by peer]
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
balki_ is now known as balki
chson has joined #ruby
kenichi has quit [Remote host closed the connection]
alexim has quit [Quit: sleep]
carlyle has joined #ruby
test34- has quit [Ping timeout: 265 seconds]
kah_ has quit [Quit: Leaving]
mikeg has quit [Quit: Leaving]
ringotwo has quit [Remote host closed the connection]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
akem has joined #ruby
L-----D has joined #ruby
akem has quit [Read error: Connection reset by peer]
savage-_ has quit [Ping timeout: 245 seconds]
c0rn has joined #ruby
berserkr has quit [Quit: Leaving.]
qwerxy has joined #ruby
carlyle has quit [Remote host closed the connection]
iamjarvo has joined #ruby
nai has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
adeponte has joined #ruby
true_techie has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0/20120531155942]]
axl_ has quit [Quit: axl_]
alexim has joined #ruby
shevy has quit [Ping timeout: 244 seconds]
seanstickle has joined #ruby
adeponte has quit [Ping timeout: 250 seconds]
trend has quit [Read error: No route to host]
trend has joined #ruby
ericcoleman has joined #ruby
cbuxton1 has joined #ruby
cbuxton1 has quit [Client Quit]
fumduq has quit [Ping timeout: 244 seconds]
joshman_ has quit [Quit: Computer has gone to sleep.]
KazW has quit [Ping timeout: 248 seconds]
Ripp___ has joined #ruby
cbuxton has quit [Ping timeout: 260 seconds]
CannedCorn has quit [Ping timeout: 244 seconds]
Ripp__ has quit [Ping timeout: 244 seconds]
davidpk has joined #ruby
nisstyre has quit [Quit: Leaving]
iori has joined #ruby
zizzyx has quit [Quit: Lost terminal]
uris has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
shevy2 has joined #ruby
nfluxx_ has joined #ruby
benatwork has joined #ruby
dtang has joined #ruby
KazW has joined #ruby
Gavilan has joined #ruby
ianbishop has quit []
nfluxx has quit [Ping timeout: 244 seconds]
dnyy has quit [Remote host closed the connection]
nfluxx_ has quit [Ping timeout: 244 seconds]
iori has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
iori has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
axl_ has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
myndzi has quit [Ping timeout: 244 seconds]
bricker88 has quit [Quit: Leaving.]
siksia has quit [Ping timeout: 244 seconds]
bricker88 has joined #ruby
iori has quit [Ping timeout: 265 seconds]
shtirlic_ has joined #ruby
andrewhl has joined #ruby
savage- has joined #ruby
emmanuelux has quit [Read error: No route to host]
artOfWar_ has quit [Remote host closed the connection]
itnomad has quit [Quit: Leaving]
shtirlic has quit [Ping timeout: 260 seconds]
emmanuelux has joined #ruby
Sgeo has quit [Read error: Connection reset by peer]
Sgeo has joined #ruby
meescha has joined #ruby
yannis has joined #ruby
fearoffish has quit [Quit: Computer has gone to sleep.]
meescha has left #ruby [#ruby]
true_techie has joined #ruby
meescha has joined #ruby
<true_techie> :method => :delete is the same as hash = {:method => :delete} ?
siksia has joined #ruby
<jedmtnman> true_techie: in the rails context?
<true_techie> jedmtnman, yes
<jedmtnman> I guess if it depends how you use instance var `hash`
savage- has quit [Remote host closed the connection]
<jedmtnman> probably this is not the same in the rails context
yannis has quit [Quit: Bye!]
darkf_ has joined #ruby
stkowski_ has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
simao has joined #ruby
stkowski_ has quit [Client Quit]
darkf has quit [Ping timeout: 260 seconds]
noodletraveler has joined #ruby
simao has quit [Ping timeout: 265 seconds]
dbgster has quit [Quit: dbgster]
darkf_ is now known as darkf
noodletraveler has quit [Ping timeout: 260 seconds]
apok has quit [Ping timeout: 248 seconds]
noodletraveler has joined #ruby
sbanwart has quit [Ping timeout: 248 seconds]
peregrine81 has quit [Quit: Computer sleeping.]
stephenjudkins has joined #ruby
zizzyx has joined #ruby
RangerMauve has joined #ruby
<zizzyx> what type of db column is generally used if i want to store video in my model?
Karmaon has quit [Ping timeout: 276 seconds]
<zizzyx> for rails
<RangerMauve> Hey, is there a way to make some code run when a ruby program exits?
noodletraveler has quit [Ping timeout: 244 seconds]
<stephenjudkins> RangerMauve: atexit
<stephenjudkins> but what you actually want to do is just run code before your program quits.
peregrine81 has joined #ruby
<stephenjudkins> if you're having random parts of code calling "exit" you have a bigger problem.
<RangerMauve> Well, basically I have a simple sinatra app running and I jsut want to save something when it stops
noodletraveler has joined #ruby
<stephenjudkins> what stops the app?
<RangerMauve> Pressing ctrl+c on my console
<stephenjudkins> do you plan to ever deploy this application anywhere?
<RangerMauve> Nope
<RangerMauve> This is just to help me learn some ajax
<stephenjudkins> so, you have an in-memory data structure. you want to persist it. am I correct?
<RangerMauve> I've made a little chat program and I want to save the current messages to a yaml file when I stop the program. So I can reload them on startup
<RangerMauve> Yes
<stephenjudkins> if so, you should just persist it every time a request is made that alters it.
<RangerMauve> Bleh, I was hoping to avoid something like that. =\
peregrine81 has quit [Client Quit]
Karmaon has joined #ruby
<RangerMauve> But if that's the only not convoluted way then I guess I can suck it up
digitalcakestudi has joined #ruby
Karmaon has quit [Excess Flood]
chico_chicote has quit [Remote host closed the connection]
radic has quit [Disconnected by services]
radic_ has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
Karmaon has joined #ruby
radic_ is now known as radic
<RangerMauve> Thanks for the advice, eh.
noodletraveler has quit [Ping timeout: 260 seconds]
RangerMauve has left #ruby [#ruby]
noodletraveler has joined #ruby
dr_diamond has quit [Quit: Bye !]
c0rn has quit []
test34 has quit [Ping timeout: 252 seconds]
luke3321 has joined #ruby
bwlang has joined #ruby
joast has joined #ruby
Karmaon has quit [Ping timeout: 276 seconds]
noodletraveler has quit [Ping timeout: 248 seconds]
noodletraveler has joined #ruby
paf0 has joined #ruby
qwerxy has quit [Quit: offski]
dnyy has joined #ruby
CheeToS has joined #ruby
looopy has joined #ruby
rmascarenhas has quit [Quit: leaving]
Karmaon has joined #ruby
Guedes has quit [Read error: Connection reset by peer]
adeponte has joined #ruby
td123 has quit [Read error: Connection reset by peer]
td123 has joined #ruby
stefanp_ has joined #ruby
tommyvyo has joined #ruby
jgrevich has quit [Read error: Connection reset by peer]
stefanp has quit [Ping timeout: 265 seconds]
jgrevich has joined #ruby
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
Sgeo_ has joined #ruby
Proggy has joined #ruby
billiamii| has joined #ruby
chson_ has joined #ruby
dphase- has joined #ruby
benatwor_ has joined #ruby
meescha_ has joined #ruby
seanstickle_ has joined #ruby
bbttxu_ has joined #ruby
mfridh_ has joined #ruby
stefanp_ has quit [Ping timeout: 265 seconds]
erichmeng has joined #ruby
thecreators_ has joined #ruby
krusty_ar_ has joined #ruby
polysics_ has joined #ruby
wagle_ has joined #ruby
jhchabran has joined #ruby
Sgeo has quit [Read error: Connection reset by peer]
Progster has quit [Read error: Connection reset by peer]
billiamii has quit [Read error: Connection reset by peer]
chson has quit [Read error: Connection reset by peer]
benatwork has quit [Read error: Connection reset by peer]
meescha has quit [Read error: Connection reset by peer]
mfridh has quit [Read error: Connection reset by peer]
dphase has quit [Read error: Connection reset by peer]
bbttxu has quit [Read error: Connection reset by peer]
thecreators has quit [Read error: Connection reset by peer]
seanstickle has quit [Read error: Connection reset by peer]
erichmenge has quit [Read error: Connection reset by peer]
tommyvyo has quit [Ping timeout: 260 seconds]
MissionCritical has quit [Ping timeout: 260 seconds]
polysics has quit [Read error: Connection reset by peer]
musl has quit [Read error: Connection reset by peer]
krusty_ar has quit [Quit: No Ping reply in 180 seconds.]
wagle has quit [Remote host closed the connection]
jhchabran_ has quit [Quit: No Ping reply in 180 seconds.]
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
bbttxu_ is now known as bbttxu
seanstickle_ is now known as seanstickle
true_techie has quit [Ping timeout: 260 seconds]
thecreators_ is now known as thecreators
musl has joined #ruby
Mch1 has joined #ruby
Mch1 is now known as Mchl
meescha_ is now known as meescha
true_techie has joined #ruby
uris has quit [Ping timeout: 260 seconds]
Chryson has quit [Ping timeout: 260 seconds]
omry has quit [Ping timeout: 260 seconds]
neersight[d] is now known as neersighted
true_techie has quit [Client Quit]
tommyvyo has joined #ruby
Chryson has joined #ruby
uris has joined #ruby
omry has joined #ruby
erichmeng has quit [Client Quit]
wagle_ is now known as wagle
mneorr has quit [Ping timeout: 265 seconds]
KazW has quit [Ping timeout: 260 seconds]
Facefox has quit [Ping timeout: 250 seconds]
<eph3meral> what's a better/more-functional way to write this: http://pastie.org/private/ly2in39zdeuvkjlroe5ia
mneorr has joined #ruby
ben_alman has quit [Excess Flood]
cha1tanya has joined #ruby
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
siksia has quit [Ping timeout: 256 seconds]
Facefox has joined #ruby
siksia has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
akem has quit [Ping timeout: 252 seconds]
<jrajav> eph3meral: Well, #count is an O(N) operation
<jrajav> eph3meral: I don't know if it's the BEST way to do it but a better way would be to replace that whole unless block with occurrences[name] = occurrences[name] ? occurrences[name] + 1 : 1
Mission-Critical has joined #ruby
<jedmtnman> eph3meral: Hash[*entities.uniq.map{|e| [e, entities.count(e)] }.flatten]
<jedmtnman> eph3meral: the entities.uniq.map{} is the important part. the rest is just forcing it into the hash syntax you want
Mission-Critical is now known as MissionCritical
<jrajav> That method still runs count on every unique element
ipoval has joined #ruby
<jrajav> Making a simple O(N) operation into O(N^2)
RudyValencia has quit [Quit: My IRC client doesn't advertise in /quit messages.]
<jedmtnman> jrajav: that doesn't make it less functional...
<jrajav> Well, true
ben_alman has joined #ruby
ipoval has left #ruby [#ruby]
apok has joined #ruby
<jrajav> As long as you know performance won't matter (it usually doesn't), then yes I agree you should go with whatever works best
apok has quit [Client Quit]
<Azure> When grabbing data from an API and outputting it to like say, a terminal or IRC channel, how should I go about dealing with possible choices between available formats from the API, etc.?
paf0 has quit [Quit: paf0]
<Azure> E.G., Celsius and Fahrenheit, mph and kph, etc.
<jedmtnman> jrajav: it would be nice to know at a glance from documentation, how performant it is. like an O rating.
<jrajav> Yeah that would be nice
Bosma has quit [Read error: Operation timed out]
Ripp__ has joined #ruby
<jrajav> They actually do that in Java documentation
Ripp___ has quit [Ping timeout: 244 seconds]
<jedmtnman> jrajav: did you just happen to know it was O(N)?
<jrajav> It's clear from what it does
<Azure> Just do it inline? Have structs/procs/methods for processing?
<Boohbah> Azure: in a terminal, i would check the locale environment variables
<jrajav> It usually is
<Azure> I see. In my case, it is to an irc channel (an irc bot using the Cinch framework.)
iori has joined #ruby
<jrajav> jedmtnman: #count(item) counts the number of items in the enumerable that are equal to item
uris has quit [Quit: leaving]
<jedmtnman> jrajav: I'm not very proficient in algo design, but wouldn't it matter how the count method is written, or is it something about counting that is O(N)?
<jrajav> jedmtnman: That must necessarily run enum[i] == item for each i
<jedmtnman> jrajav: ah, i see
<bnagy> only if there's a block
akem has joined #ruby
b3gott3n has joined #ruby
<jrajav> O() notation sounds complicated but it's pretty intuitive once you know how it works
<eph3meral> jedmtnman, ok cool, so I've used Hash[] before, in fact I'm using it a few lines earlier already in a different chunk of code, but what does * do again? I've read about it before, but even after that it was still kind of hazy
<eph3meral> jedmtnman, seems like * kind of does a lot
<eph3meral> actually I've also tried it out before
<eph3meral> in irb... I did a Hash[] and Hash[*...] on the same data set
<eph3meral> just to see the diff
<eph3meral> but I still don't quite understand the technical detail of exactly what * to cause that
<eph3meral> jedmtnman, ^
<jedmtnman> eph3meral: it turns it into a splat arg
akem has quit [Max SendQ exceeded]
<eph3meral> right, splats
Xyphy has quit [Remote host closed the connection]
<jedmtnman> eph3meral: just a sec
<eph3meral> i've read about splats, still don't understand them :)
<eph3meral> lemme find the thing I read actually
akem has joined #ruby
ananthakumaran has joined #ruby
<eph3meral> jedmtnman, so, this is in my browser history http://endofline.wordpress.com/2011/01/21/the-strange-ruby-splat/
<eph3meral> i feel like there's a more "official" doc in there as well
cha1tanya has quit [Ping timeout: 252 seconds]
<monokrome> Does the do statement not create a function? I am trying to return from inside a do/end block but it seems to just return my whole function or something
emmanuelux has quit [Remote host closed the connection]
cha1tanya has joined #ruby
akem has quit [Max SendQ exceeded]
<jedmtnman> eph3meral: try running that code without the *
akem has joined #ruby
<jedmtnman> empty, right?
<bnagy> entities.each.with_object(Hash.new {|k,v| k[v]=0}) {|e,h| h[e]+=1} is how I would write it btw
luke3321 has quit [Quit: LIKE A BOSS]
hakunin has quit [Remote host closed the connection]
xnm has joined #ruby
huwenfeng has joined #ruby
<jedmtnman> eph3meral: read under the second example: http://apidock.com/ruby/Hash
<eph3meral> k
<huwenfeng> I wonder , which encode function can encode : to %3A?
<bnagy> monokrome: that's one of the block weirdisms, I think it's different between proc and lambda, but I am too pre-coffee to google
mrsolo has quit [Quit: Leaving]
<huwenfeng> I tried CGI.encode() and URI.encode_www_form_component(), but doesn't work!
<bnagy> why would you encode : ?
stephenjudkins has quit [Quit: stephenjudkins]
<monokrome> hmm
Bosma has joined #ruby
<jedmtnman> bnagy: i think functional programmers would dislike using each, but i agree its more intuitive to write it the way you did
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<eph3meral> jedmtnman, so Hash[entities.uniq.map{|e| [e, entities.count(e)] }] seems to do the same thing
<eph3meral> jedmtnman, so why not do that? why add the extra * and then flatten?
<bnagy> also faster, I'd bet
<jedmtnman> eph3meral: might be a ruby version thing
<eph3meral> jedmtnman, 1.9.3 here
<jedmtnman> without splat my hash came back empty
cha1tanya has quit [Ping timeout: 250 seconds]
<eph3meral> jedmtnman, indeed it does
<eph3meral> jedmtnman, until you also take off the .flatten
<jedmtnman> eph3meral: that might be true
<eph3meral> i thought that data structure (when you take off .flatten) was the definition of what Hash requires
<eph3meral> like, from the docs
<eph3meral> that's how I've always used it anyway
<jedmtnman> eph3meral: that is what i went off too.
<jedmtnman> seems that it also takes an array of arrays though
<eph3meral> Hash[[["key", "value"],["key2","val2"]]]
<eph3meral> yeah, array of arrays, that's what i'm talking about, that's how I usually do it
<eph3meral> jedmtnman, so basically splat, groups by two on an array?
<eph3meral> cuz if *.....flatten is equivalent to just the thing itself
seanstickle has quit [Quit: Nihil sub sole novum]
mutewinter has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<eph3meral> that makes it seem like that's what splat does?
<Azure> from what I understand: the splat takes an object and breaks it down into arguments.
<eph3meral> ahh, "arguments"
<jedmtnman> no
<eph3meral> ala the command line
<eph3meral> ?
<bnagy> no splat splats the inner array
<jedmtnman> right
<jedmtnman> what bnagy said
<eph3meral> uh... that's a circular definition, sorry
<bnagy> turns it from Hash[ [a,b,c,d] ] to Hash[a,b,c,d]
<eph3meral> i don't understand
<eph3meral> ahh, so it just strips off the outer array shell
<jedmtnman> sooo array is an arr of arrs, right
<jedmtnman> flatten removes the inner array args, but keeps the order
<eph3meral> removes the inner array args?
<jedmtnman> but Hash[] expects an arguments list, not an array
<eph3meral> from what bnagy just said it looks like it removes the outermost array container
<eph3meral> jedmtnman, er, Hash[] accepts an array of arrays just fine...
<bnagy> no, the innermost :)
mohits has quit [Remote host closed the connection]
<jedmtnman> flatten : [[a,b],[c,d]]
<jedmtnman> to [a, b, c, d]
<eph3meral> yes i understand flatten
<bnagy> in the first example you are passing one Array to .[] in the second you are passing 4
<jedmtnman> eph3meral: right, but i wasn't looking at the doc for [], just at the example which shows a simple args list http://apidock.com/ruby/Hash
<bnagy> if you pass 1 Array it assumes it's an array of pairs
hemanth has quit [Read error: Connection reset by peer]
<jedmtnman> so i didnt remember about the arr of arrs syntax
looopy has quit [Remote host closed the connection]
<jedmtnman> you had to go here to see it: http://apidock.com/ruby/v1_9_3_125/Hash/%5B%5D/class
<eph3meral> oh right [] is actually a method right?
<jedmtnman> yes
<eph3meral> and you're passing arguments to said method?
<jedmtnman> yes
tommyvyo has joined #ruby
<eph3meral> so * makes it one argument vs 4 arguments to the method
polysics_ has quit [Remote host closed the connection]
<bnagy> Hash[*(entities.uniq.map{|e| [e, entities.count(e)] }.flatten)] 4 args
meescha has left #ruby [#ruby]
<bnagy> Hash[(entities.uniq.map{|e| [e, entities.count(e)] }.flatten).each_slice(2).to_a] array of pairs
nfk has joined #ruby
<jedmtnman> its a notation to tell ruby not to treat the array as a single arg, but each element in the array as an arg to the method
<eph3meral> jedmtnman, gotcha
<eph3meral> ok I get it now
<eph3meral> thanks guys
Haydos has left #ruby ["Leaving"]
<jrajav> So O(N^2) it is, in the end
<jrajav> :(
<bnagy> ?
<bnagy> entities.each.with_object(Hash.new {|k,v| k[v]=0}) {|e,h| h[e]+=1} <-- n
looopy has joined #ruby
<jrajav> I missed that
<jrajav> :)
g0bl1n has quit [Quit: Ex-Chat]
igotnolegs has joined #ruby
<jedmtnman> jrajav: buy more cores :)
akem has quit [Read error: Connection timed out]
<jrajav> I have 8
<jrajav> Not sure I can stuff any more in
<jrajav> I can try!!
<bnagy> pff, I got 48 on the work boxes ;)
kevinbond has quit [Quit: kevinbond]
<bnagy> you're not trying hard enough!
savage- has joined #ruby
billiamii| is now known as billiamii
<jedmtnman> jrajav, bnagy so the reason that stays n is that the lookup only goes through the array once? (to make sure i understand it correctly)
<bnagy> the first one is slightly faster, looks like
<jrajav> O(N) over a collection of N elements means that a constant number of operations (with respect to N) are run per element
<jrajav> O(N^2) means that up to N operations may be run per element
<bnagy> bm(b) {|entities| Hash[entities.uniq.map{|e| [e, entities.count(e)] }] } 3.26477
<bnagy> bm(b) {|entities| entities.each.with_object(Hash.new {|k,v| k[v]=0}) {|e,h| h[e]+=1} } 3.406875
<jrajav> So running count(item) for each unique item in an array is N^2. Incrementing a variable per item in the array is N
<jrajav> Make sense?
<bnagy> which is (yet another) compellig case for 'stfu and write the code you like'
<jedmtnman> jrajav: yes. thanks
<jrajav> bnagy: I already agreed with that sentiment at the start
<jrajav> bnagy: I still think it's valuable to know about time complexity
<bnagy> yeah, but it's clearly not n**2
<bnagy> although I have no idea how
<jrajav> It IS, in a pseudocode sense
vitor-br has quit [Quit: Saindo]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<jrajav> You're bringing any number of other Ruby operations into it
<jrajav> Besides, time complexity hides constant factors
rvmeier_ has joined #ruby
rvmeier_ has quit [Read error: Connection reset by peer]
<jrajav> An O(N) algorithm can easily run much slower than a O(N^2) one for certain inputs
<bnagy> ahhh I see, no it's not n**2 at all
<bnagy> it's uniq.size * n
<jrajav> Which can be N^2 if every element is unique
<jrajav> You round up to the worst case
<bnagy> if we gave it a more varied input set we'd see a difference
mneorr has quit [Ping timeout: 252 seconds]
<jedmtnman> i've learned more in the last 5 minutes than my entire data structures course
<jrajav> hehe
<eph3meral> bnagy, very nice each_with_object
<eph3meral> i need to get better at using that one
nfk has quit [Quit: yawn]
<bnagy> just train yourself to always think of it when you would otherwise think inject
<jedmtnman> bnagy: but inject is fun to type
rvmeier has quit [Ping timeout: 244 seconds]
<eph3meral> bnagy, I don't normally think inject :P
<eph3meral> inject = reduce right?
<bnagy> yeah
<eph3meral> here's the start of one I was working on http://pastie.org/private/9kzbxzkheueskq9r40oduw
<eph3meral> that I was trying to think of how to use each_with_object
<eph3meral> as you can so, I have failed :P
baroquebobcat has joined #ruby
<eph3meral> lol, the each part is still there, doesn't hurt basically and I'm lazy XD
<eph3meral> bnagy, ^
<eph3meral> how would I write something like that using each_with_object
IrishGringo has joined #ruby
<eph3meral> or at least in a more "functional" style
<jedmtnman> well if you want functional you gotta get rid of intermediate objects, right?
<eph3meral> indeed
<bnagy> cat_entr=matches.each.with_object(Hash.new {|k,v| k[v]=[] ) {|match, hsh| hsh[match.first.downcase]=match.last}
EstanislaoStanis has joined #ruby
<eph3meral> bnagy, thanks i'll go toy with that
<bnagy> you could also do this with group_by and map
<bnagy> which might be easier to read
<EstanislaoStanis> Hello, everyone. ^-^.
parzo has joined #ruby
<jedmtnman> bnagy: good call
<bnagy> then again maybe not...
<eph3meral> bnagy, cool I'll look in to those next
<eph3meral> bnagy, can you explain a little more detail exactly what the block that you provide to Hash.new is doing?
<bnagy> eph3meral: but matches.group_by {|match| match,first,downcase} is noce
<bnagy> nice
<eph3meral> is that a block that's used for later initialization any time a nil member is accessed?
<bnagy> but your values will be the whole match
ryanf has joined #ruby
<bnagy> yes
<eph3meral> ok cool, didn't know you could do that on a Hash, good to know thx
<bnagy> it's a very handy trick for things like hashes of object counts etc
<eph3meral> yeah, actually just knowing that
<eph3meral> how to use each_with_object
<eph3meral> has become immensely more clear now
<bnagy> also, note the big diff to Hash.new([])
simao has joined #ruby
<eph3meral> ok, what is the big diff, I mean I wouldn't have assumed they were the same
<eph3meral> but, what does [] initialize?
<bnagy> read the docs :D
<eph3meral> k
<EstanislaoStanis> Anyone have time to answer a couple of my noob questions?
<jedmtnman> EstanislaoStanis: just ask
<jedmtnman> if no one answers, ask again
tomb_ has quit [Quit: Computer has gone to sleep.]
<bnagy> preferably after a pause
<EstanislaoStanis> Ok, thanks. First, is the channel #ruby-lang supposed to be set to where people can't talk unless they're given a voice? Because when I tried to it said "Cannot send to channel".
<bnagy> you just need to be registered
L-----D has quit [Quit: Leaving]
<EstanislaoStanis> I suspected as much, but I read around and it didn't seem to tell me how...
simao has quit [Ping timeout: 265 seconds]
siksia has quit [Ping timeout: 240 seconds]
mneorr has joined #ruby
<bnagy> try /msg NickServ help register
<bnagy> or something, I can't remember :)
<EstanislaoStanis> And that's just for that channel?
<bnagy> no it's for all of freenode
<EstanislaoStanis> Oh, ok.
bwlang has quit [Quit: bwlang]
krusty_ar_ has quit [Ping timeout: 245 seconds]
davidpk has joined #ruby
polysics has joined #ruby
ghanima has joined #ruby
ghanima has quit [Remote host closed the connection]
tomb_ has joined #ruby
<EstanislaoStanis> Ok, and is there any major difference between this channel and #ruby-lang?
siksia has joined #ruby
dwon has joined #ruby
jenrzzz-mac has joined #ruby
tomb_ has quit [Client Quit]
jedmtnman has quit [Quit: Leaving.]
<bnagy> the answer to that question is political, subjective and controversial
digitalcakestudi has quit [Ping timeout: 245 seconds]
Gekz has joined #ruby
polysics has quit [Remote host closed the connection]
Gekz has quit [Changing host]
Gekz has joined #ruby
<EstanislaoStanis> Somehow I thought that might be the answer. Got a very simple explanation?
mengu has joined #ruby
<bnagy> ruby-lang is 'official' because it's on the website <-- political
<bnagy> they should probably be merged <-- controversial
<bnagy> this channel is better for n00bish questions, and has more noobs in general <-- subjective
jenrzzz-mac has quit [Client Quit]
<EstanislaoStanis> Thanks!
td123 has quit [Read error: Connection reset by peer]
<EstanislaoStanis> Now I have some very noobish code that I'd like someone to look at if they have any time. It's very short, and I just want to know why I get a certain error when I try to run it.
td123 has joined #ruby
<bnagy> ruby already tells you that
<bnagy> :) but go ahead and pastie
poga has joined #ruby
<eph3meral> hmm, forgot that #ruby-lang exists
kenneth has joined #ruby
<kenneth> hey all
seitensei has joined #ruby
poga has quit [Remote host closed the connection]
jenrzzz-mac has joined #ruby
<EstanislaoStanis> Hi! Ok, I think I know what you mean by pastie. http://pastie.org/4035748
jfarmer has joined #ruby
<bnagy> normally we use snake_case for method defs btw
kevinbond has joined #ruby
PragCypher has joined #ruby
michaelmartinez has quit [Quit: Check it, Wreck it http://www.caffeineindustries.com/blog]
<EstanislaoStanis> That sounds familiar...
<bnagy> so the bugs I can see so far are that you forgot to chomp your input, and then you're calling Array#select on a String, which won't work
williamcotton has quit [Quit: williamcotton]
PragCypher has quit [Client Quit]
<eph3meral> how can I write something on multiple lines? like my_array.uniq.flatten.each.with_object so that each thing that begins with a . is on its own line?
williamcotton has joined #ruby
<eph3meral> i'm getting some syntax errors (not super surprisingly
gureg has joined #ruby
<bnagy> eph3meral: you'd need to use intermediate variables
<eph3meral> ahh, hmm, well it seems it works fine if the object operator . is at the end of each line
<EstanislaoStanis> Ok, those two things I'm not sure about. I think I know what chomp means. I know it's a method, right?
<bnagy> eph3meral: also, .uniq.flatten is a weird construction
<eph3meral> just can't be at the beginning, I guess that makes basic sense
<eph3meral> bnagy, yep, it was an out-of-my-arse example
<eph3meral> i didn't care to actually do much thinking
<eph3meral> so, the weirder the better
<bnagy> EstanislaoStanis: chomp will get rid of the "\n" that comes with the gets
rippa has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
<EstanislaoStanis> Is that \n a new line command?
<bnagy> newline character, yeah. When you go gets you'll get a string that has one at the end
<bnagy> *do
Proggy has quit [Ping timeout: 252 seconds]
<bnagy> EstanislaoStanis: personally, I wouldn't bother checking anything, or defining game_commands etc etc
<bnagy> just do command=gets.chomp;case command;when 'sleep';... when ... when ... else; puts "Bad command"
kenperkins has quit [Quit: Computer has gone to sleep.]
<bnagy> if you get a lot of commands there are other ways of handling them, but we'll leave that for now
<EstanislaoStanis> bnagy: To your second idea about the error, isn't this a case of select using an array? http://pastie.org/4035769
<bnagy> yes, but it's a bad example
ZachBeta has quit [Read error: Connection reset by peer]
<bnagy> use reject, not select with a negative condition
<EstanislaoStanis> Lol, that from my book: Beginning Ruby by Peter Cooper.
<bnagy> really? textB as well?
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
<EstanislaoStanis> It was originally just text.
<bnagy> ok, cause we use snake_case for variables as well
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
<bnagy> brb
CheeToS has quit [Ping timeout: 244 seconds]
<EstanislaoStanis> Ok.
huwenfeng1 has joined #ruby
ryanf_ has joined #ruby
huwenfeng1 has quit [Client Quit]
ryanf has quit [Quit: leaving]
ryanf_ is now known as ryanf
mneorr has quit [Ping timeout: 248 seconds]
huwenfeng has quit [Ping timeout: 245 seconds]
mneorr has joined #ruby
test34 has quit [Ping timeout: 245 seconds]
<kenneth> so i have a rack http app which works great. i'd like to start using socket.io (or equivalent) for real-time communication between my server and html/websocket-supporting client
luxurymode has joined #ruby
cj3kim has joined #ruby
hemanth has joined #ruby
jrajav has quit [Quit: burgermouth]
<kenneth> first question: a rack app is (as far as i understand it) a permanent process. so it could make sense to just launch a new thread to handle the real-time communication, right? it's not going to get killed or anything…
gureg has left #ruby [#ruby]
Sheehan has joined #ruby
mneorr has quit [Ping timeout: 244 seconds]
dwon has quit [Quit: Leaving]
jfarmer has quit [Quit: jfarmer]
<EstanislaoStanis> I wish I could help kenneth. Maybe when bnagy gets back he'll be able to. He said brb a few minutes ago.
dankest has quit [Quit: Linkinus - http://linkinus.com]
<bnagy> hm? Oh I'm back, I just know nothing about web stuff
<bnagy> I would imagine there's a better way to do websockets that that, though
<kenneth> welcome back bnagy. tying to figure out how to integrate real-time streaming of data into my app
<kenneth> i'd love it if i could just get zeromq to work over websockets
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
yannis has joined #ruby
<bnagy> maybe try one of the webby channels
<bnagy> or wait for europe to come online :)
corburn has quit [Quit: Leaving]
<bnagy> imho though I would make your streamy thing a different process, not a thread
<kenneth> maybe that's actually a better idea, come to think of it
* hemanth needs some feedback on Ninja Object Properties in Scripting languages -> http://is.gd/BDnJ65
<EstanislaoStanis> bnagy: I looked up snake_case, and its a formatting, right? I'll try to remember to use that for my method defs. I was using some formatting thing I learned from my dabbling in ActionScript 3.0. Thanks for your help so far!
mneorr has joined #ruby
<bnagy> hemanth: I will never in my life click on a url shortened link in irc
<hemanth> full URL
<bnagy> ok I feel stupider now
<hemanth> :{
Sheehan has quit [Quit: Sheehan]
<bnagy> also, if you're going to talk about someone else's work, you should link to it
joshman_ has joined #ruby
<ryanf> hemanth: i think a better analogy for ruby would be defining methods with spaces
acyed has joined #ruby
nipra has joined #ruby
<ryanf> hash keys are just strings, and ruby doesn't have dot notation for hashes, so it's not even a tiny bit surprising that ' ' could be a hash key
<hemanth> ryanf, nice idea, had tired some unicode methods http://h3manth.com/content/unicode-symbols-function-names
abionic has joined #ruby
Sgeo has joined #ruby
test34- has quit [Ping timeout: 265 seconds]
nfluxx has joined #ruby
ABK_ has joined #ruby
adeponte has quit [Remote host closed the connection]
<acyed> I want to turn this (http://pastebin.com/wKLgd9pS) into a web app... but I don't have the slightest clue on how to get started.
<bnagy> hemanth: what you want to look for are strings that are different to the interpreter but appear identical to the user
<bnagy> hemanth: so see if some of the weird zero-length space chars etc work
<bnagy> otherwise you're not obfuscating anything at all
<hemanth> roger that
Sgeo_ has quit [Ping timeout: 248 seconds]
<bnagy> there are also some glyphs that look a great deal like 'normal' ascii characters, depending on font
* hemanth notes down 'strings that are different to the interpreter but appear identical to the user'
<bnagy> leaving aside the question of the value of obfuscating ruby, versus JS where your code is exposed
TheHunter_1039 has quit [Quit: TheHunter_1039]
Johnny7656 has joined #ruby
<acyed> I wrote it thinking it would be easy to put into a ruby on rails app on Heroku, but then I remembered that 1. I've never written a rails app 2. that was a foolish thought
abionic has quit [Ping timeout: 260 seconds]
<bnagy> acyed: maybe try one of the rails channels, eg #rubyonrails
<hemanth> bnagy, JS needs that...true
<acyed> ah, ok
kenneth has quit [Quit: kenneth]
lkba has quit [Ping timeout: 260 seconds]
cirwim has joined #ruby
replore_ has joined #ruby
<EstanislaoStanis> bnagy: If you have time could you try to explain to me why the book code works when using an .select on an array but mine returns "private method 'select' called for "..":String"?
geekfactor has quit [Remote host closed the connection]
<bnagy> EstanislaoStanis: your code is not calling it on an array
<EstanislaoStanis> How do you mean?
geekfactor has joined #ruby
<bnagy> the object that is receiving the select method in your case is not an array
<bnagy> it's a string
<bnagy> strings are not arrays
<EstanislaoStanis> And the object that is receiving the select method is input?
<bnagy> yes
b1rkh0ff has quit [Ping timeout: 260 seconds]
GeekOnCoffee has quit [Ping timeout: 250 seconds]
fantazo has joined #ruby
<Johnny7656> For permuting a string, would the best way to do it be convert to an array, permute, and then convert the results to a String?
<bnagy> I think that's the only way, Johnny7656
minijupe has joined #ruby
<Johnny7656> Well, you could write your own ruby code, but I'm assuming that would be slower
<bnagy> unless by permute you mean reverse
alanp_ has quit [Remote host closed the connection]
balki has quit [Remote host closed the connection]
minijupe has quit [Client Quit]
<bnagy> which is one possible permutation :P
<Johnny7656> :D Nope, all the permutations. It just seems that join is eating up a lot of CPU
<bnagy> oh, actually... you can do quite a lot with tr as well
Chryson has quit [Quit: Leaving]
<Johnny7656> I still have to figure out what all those columns mean ha ha
<EstanislaoStanis> bnagy: !!!, thanks! Now I at least understand why my code wasn't working and how to make the old stuff work! I think your suggestion was probably better. I originally wanted to store my commands in an array because I thought it would make adding them easier, but I see now that I'd have to add the if, when, when, anyways. Thank you so much.
CheeToS has joined #ruby
alanp has joined #ruby
balki has joined #ruby
justsee has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
<bnagy> Johnny7656: eg rot13 - str.tr 'a-z', 'n-za-m'
justsee has quit [Changing host]
justsee has joined #ruby
* cirwim runs rot13 10 times to make things 10 times securer
cha1tanya has quit [Excess Flood]
A124 has joined #ruby
cha1tanya has joined #ruby
<Johnny7656> Ha ha, just saw something that was using rot13, but I forget what
mikeycgto has quit [Remote host closed the connection]
A124 has left #ruby [#ruby]
<bnagy> Johnny7656: all permutations should probablt be str.split('').permutation.map(&:join) I guess
ryanf_ has joined #ruby
<bnagy> rot13 is like des - the odd numbered compounds, like 3des, are more secure than the even ones
kenneth has joined #ruby
b1rkh0ff has joined #ruby
ryanf has quit [Quit: broken pipes |||]
kenneth has quit [Client Quit]
GeekOnCoffee has joined #ruby
Johnny7656 has quit [Ping timeout: 245 seconds]
Johnny7768 has joined #ruby
cha1tanya has quit [Ping timeout: 248 seconds]
locriani has quit [Remote host closed the connection]
cha1tanya has joined #ruby
ericcoleman has quit [Quit: leaving]
banister_ has joined #ruby
ryanf_ is now known as ryanf
ryanf is now known as ryanf_
ryanf_ is now known as ryanf
EstanislaoStanis has quit []
<Johnny7768> I wonder if concatenating the string manually would be faster
<Johnny7768> Doesn't seem like it
EstanislaoStanis has joined #ruby
Bosma has quit [Ping timeout: 248 seconds]
jrallison has joined #ruby
<bnagy> what's your code?
nipra has quit [Ping timeout: 245 seconds]
adamramadhan has joined #ruby
adamramadhan has left #ruby [#ruby]
cha1tanya has quit [Ping timeout: 244 seconds]
yxhuvud has joined #ruby
<Johnny7768> Right now, it's a naive way of search for all the possible words in say a scrabble hand
mneorr has quit [Ping timeout: 244 seconds]
cha1tanya has joined #ruby
<Johnny7768> That's added to the string class by the way, where the string is all the letters in a scrabble hand
<bnagy> ugh, you're doing all permutations on n!
<Johnny7768> Yeah, it's not the fastest way for sure :D
jcromartie has quit [Read error: Connection reset by peer]
jcromartie has joined #ruby
<Johnny7768> I had thought using a sortedset for WORDS instead of a regular set would help a lot, but it barely sped things up
trend has quit [Disconnected by services]
<eph3meral> is there a way to merge an array of hashes in to a single hash? ala translating [my_hash, some_other_hash, yet_another_hash]; into something like my_hash.merge(some_other_hash).merge(yet_another_hash);
<cirwim> Johnny7768: I found that algorithm was fast-enough up to about 7 letters
jcromartie has quit [Read error: Connection reset by peer]
<cirwim> after that you want proper storage of your dictionary
<bnagy> Johnny7768: no your WORDS lookup is constant time
<cirwim> there are some really cool algorithms out there for scrabble
adamramadhan has joined #ruby
<bnagy> it's n! * n! that's killing you
<Johnny7768> Now why is words lookup constant time?
mneorr has joined #ruby
<bnagy> cause it's a Set or Hash, right?
<Johnny7768> True, but why does it work that way I meant
<bnagy> cause that's how hash tables work
<bnagy> calculate hash of key, get value at corresponding memory address
amacgregor has quit [Ping timeout: 244 seconds]
ConstantineXVI has quit [Read error: Connection reset by peer]
keyvan is now known as kiin
<cirwim> eph3meral: you want .inject(&:merge) or something horrible like that
becom33 has joined #ruby
cha1tanya has quit [Ping timeout: 252 seconds]
ConstantineXVI has joined #ruby
<eph3meral> cirwim, hahah, why is that horrible
<eph3meral> and is there any non-horrible option?
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
nipra has joined #ruby
<cirwim> it's not that horrible, though "inject" is a very complex beast
joshman_ has quit [Quit: Computer has gone to sleep.]
<cirwim> I think the alternatives would probably be just as bad hashes.each_with_object({}) do |h, item| h.update(item); end
<cirwim> that way you avoid some intermediary hash creation
<Johnny7768> Alright sure, hash tables are coming back to me ha ha
<bnagy> Johnny7768: as a quick idea, what if you reverse your permutations (start with permutation(n.size)) and then break at the first match? Least that will ghive you a maximal length word
<bnagy> not the best score though
<bnagy> I think you'd be better off reversing your search though
<Johnny7768> Yeah, I'll probably have to do it some other way
akem has joined #ruby
<EstanislaoStanis> Quick question, is there a difference between the when and if flow controls?
<bnagy> enumerate words and see if the word can be made with those tiles
<Johnny7768> Like if no words start with 'xx'
<cirwim> Johnny7768: look up DAWG and GADDAG
<Johnny7768> Don't do all the permutations with that at the beginning
<cirwim> they are lightening-fast storage solutions for permutation problems
<Johnny7768> DAWG, the old TI app?
<bnagy> if you have a Trie I think this will be fast
<heftig> maybe iterate your list of words and check if each is a possible permutation of your hand
<cirwim> Johnny7768: no, directed acyclic word graphs
<bnagy> cause you can abort all branches where you can't proceed with that tileset
<bnagy> heftig: ha great minds think alike
<heftig> cirwim: making a graph of all words?
<cirwim> heftig: aye
<Johnny7768> cirwim: It actually was a dictionary app type thing - probably got its name from there
<heftig> as in f->o->o->b->a->r
<cirwim> heftig: well, you can be arbitrarily clever
<Johnny7768> Ha ha, sounds like I have some good reading to do
<cirwim> Johnny7768: it's a pretty clever "trick"
<bnagy> and the sweet thing is that the recursive trie search should parallelize
<cirwim> but more basic trees will still be much better than permuting
<cirwim> (that said, permuting is fine if you're not running many searches :p)
Hanmac1 is now known as Hanmac
<Johnny7768> I've actually been doing the udacity 212 course, but in ruby instead of python - I'm wondering what it will end up teaching
cha1tanya has quit [Ping timeout: 245 seconds]
banister_ has quit [Read error: Connection reset by peer]
<eph3meral> is there such a thing as a "deep merge" ?
zommi has joined #ruby
<bnagy> I think I have some of that genre in my iTunes
<cirwim> :)
<Johnny7768> Well, time for me to get some sleep. Thanks for all the great info everyone
<bnagy> that gaddag thing seems like a big space penalty :/
<Johnny7768> Adios
Johnny7768 has quit [Quit: Page closed]
<cirwim> bnagy: I dunno, I've got 15mb spare I think..
<cirwim> maybe 150 if it's in ruby instead of C
<cirwim> should still be easily in RAM
<bnagy> :D
Tricks has quit [Remote host closed the connection]
<heftig> oh, i used a somewhat similar data structure in my neologism generator
<eph3meral> as in like this {a:{foo:1,bar:2}}.merge({a:{baz:3,qux:4}})
<eph3meral> resulting in...
<eph3meral> {a:{foo:1,bar:2,baz:3,qux:4}}
<cirwim> heftig: you are a wiktionary reader!
<eph3meral> or will I have to do that manually?
<heftig> cirwim: i am?
<cirwim> heftig: oh
<cirwim> no
zomgbie has quit [Ping timeout: 256 seconds]
* cirwim got confused
<cirwim> they invented protologism
Tricks has joined #ruby
wallerdev has quit [Quit: wallerdev]
<cirwim> which was a neologism meaning neologism
<cirwim> and therefore had lots of nice estimological properties
banister_ has joined #ruby
<heftig> ah well, i guess it can be used to create protologisms :p
<cirwim> :)
<heftig> hrm, thinking about it, not so similar after all
<heftig> i used markov chains of character-tuples
<heftig> not acyclic at all
daniel_hinojosa has joined #ruby
adeponte has joined #ruby
simao has joined #ruby
simao has quit [Changing host]
simao has joined #ruby
<bnagy> you could combine them I guess
<heftig> hrm
<bnagy> but a dag by itself doesn't seem like it would be any use for generating anything
timonv has joined #ruby
<heftig> well, neologisms are generated by traversing the chain and then looking up the generated word in the set of input words
<bnagy> you could add markov weights to your edges though
d3c has joined #ruby
<heftig> if it's already in that set, try again
<bnagy> yeah but if you do that with a normal dag you'll just get nonsense
<bnagy> you presumably want stuff that appears plausible
JohnBat26 has joined #ruby
JohnBat26 has quit [Client Quit]
<bnagy> hency markov
<eph3meral> any thoughts on that deep merge?
<bnagy> *hence
<eph3meral> does that exist by default in ruby or no?
<eph3meral> I am guessing no
Ripp__ has quit [Ping timeout: 260 seconds]
<bnagy> eph3meral: gotta do it manually
<eph3meral> k
JohnBat26 has joined #ruby
JohnBat26 has quit [Client Quit]
EstanislaoStanis has quit []
<bnagy> but you can look up the docs yourself :)
djdb has joined #ruby
<eph3meral> no big deal, it's a fixed depth anyway
JohnBat26 has joined #ruby
monokrome has quit [Ping timeout: 272 seconds]
<bnagy> it's just walk hash and either create a new key or merge the values if the keys collide
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<bnagy> eph3meral: waaait, I'm high... check out merge with a block
<eph3meral> k
<heftig> synchronisational!
ahuman has quit [Quit: No Ping reply in 180 seconds.]
<bnagy> {a:{foo:1,bar:2}}.merge({a:{baz:3,qux:4}}) {|k,v1,v2| v1.merge v2} => {:a=>{:foo=>1, :bar=>2, :baz=>3, :qux=>4}}
simao has quit [Ping timeout: 265 seconds]
<bnagy> eph3meral: it's not recursive though
ahuman has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<bnagy> as in the inner merge will blobber
<bnagy> *clobber
imami|afk is now known as banseljaj
tectonic has quit [Ping timeout: 246 seconds]
monokrome has joined #ruby
<eph3meral> yeah i'm playin with it now, thanks
<bnagy> eph3meral: also, don't crosspost unless you say you're doing it, otherwise people get mad
<eph3meral> k
<eph3meral> i quit the other chan, figured that'd be enough to let it be known i wasn't trying to cross post
<bnagy> lots of people ignore quits, it's a busy channel
<bnagy> :)
Helius has joined #ruby
<heftig> use a h = Hash.new(&p = proc { |h,k| h[k] = Hash.new(&p) }), recurse through your hashes for non-hash values, and set them on h?
<bnagy> well...busy in terms of irc noise, not so much with the talking
mneorr has quit [Ping timeout: 249 seconds]
perryh has quit [Quit: ZNC - http://znc.in]
<cirwim> which channel is best?
ahuman has quit [Quit: No Ping reply in 180 seconds.]
<heftig> #ubuntu
ahuman has joined #ruby
tectonic has joined #ruby
Yarou_ has joined #ruby
<cirwim> I did kind of mean which channel /\A#ruby(-lang)?\z/
<eph3meral> true, i ignore quits as well
<eph3meral> i usually figure it out when nick completion doesn't work
<eph3meral> so then I don't bother
<eph3meral> anyway
pigoz has quit [Read error: Connection reset by peer]
mucker has joined #ruby
<Hanmac> shevy2: http://ideone.com/ <<< do you like this?
Yarou has quit [Ping timeout: 250 seconds]
zomgbie has joined #ruby
stewart_ has quit [Quit: Leaving.]
mneorr has joined #ruby
vectorshelve has joined #ruby
lockweel has joined #ruby
lockweel has quit [Client Quit]
monokrome has quit [Ping timeout: 272 seconds]
kkiero has joined #ruby
<kkiero> hi, anyidea why sha1 string is dump to binary when I perform .to_yaml on it?
<kkiero> I googled how to prevent it but didn't find anything in particular
Asher has quit [Ping timeout: 244 seconds]
<vectorshelve> hemanth: hai bhai
tectonic has quit [Ping timeout: 265 seconds]
<eph3meral> sweet, i've got results, aight awesome, thanks bnagy
monokrome has joined #ruby
jrallison has quit [Quit: Computer has gone to sleep.]
monokrome has quit [Excess Flood]
ryan0x2 has quit [Remote host closed the connection]
monokrome has joined #ruby
mneorr has quit [Ping timeout: 248 seconds]
perryh_ has joined #ruby
monokrome has quit [Excess Flood]
Asher has joined #ruby
monokrome has joined #ruby
Asher1 has joined #ruby
monokrome has quit [Excess Flood]
cha1tanya has joined #ruby
zomgbie has quit [Read error: Connection reset by peer]
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
monokrome has joined #ruby
Asher has quit [Read error: Operation timed out]
ananthakumaran has joined #ruby
luckyruby has joined #ruby
<kkiero> anyone?
Boohbah has quit [Remote host closed the connection]
<cirwim> kkiero: call .hex_digest on it
<vectorshelve> kkiero: hi
billiamii has quit [Quit: Leaving]
looopy has quit [Remote host closed the connection]
<kkiero> cirwim: I did it while creating the sha1 from string
<kkiero> the point is that while dumping my hash to yaml
<kkiero> 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
<kkiero> goes into that:
<kkiero> !binary |-\n OWY4NmQwODE4ODRjN2Q2NTlhMmZlYWEwYzU1YWQwMTVhM2JmNGYxYjJiMGI4\n MjJjZDE1ZDZjMTViMGYwMGEwOA==
<kkiero> ;/
<cirwim> kkiero: :(
<cirwim> I don't know anything about yaml
timonv has quit [Remote host closed the connection]
williamcotton has quit [Quit: williamcotton]
maesbn has joined #ruby
Asher1 has quit [Quit: Leaving.]
Asher has joined #ruby
eggie5 has joined #ruby
fantazo has quit [Remote host closed the connection]
<hemanth> vectorshelve, hey check it out -> http://h3manth.com/content/html5js-offlineonline-notification
true_techie has joined #ruby
kenneth has joined #ruby
vikhyat has joined #ruby
<eggie5> how can I split up an array into sub arrays of 100 elements?
senny has joined #ruby
<kenneth> okay, so i think i'll be building this part on top of event machine
<cirwim> eggie5: .each_slice(100)
<kenneth> would it make sense to have my rackup (.ru) file fork itself into an event machine process?
<cirwim> kenneth: thin provides its own reacot
<cirwim> *reactor
<eggie5> cirwim: well I almost got that far on the enumerable doc - thanks
<cirwim> eggie5: what would be really cool is a function where you give it the input and the output; and it finds the code you need to make it work
<cirwim> would make IRC a whole lot more dull though I guess
ZachBeta has joined #ruby
eddie has joined #ruby
<eggie5> cirwim: yeah be cool
Konboi has quit [Quit: Leaving...]
eddie is now known as Guest93835
Guest93835 is now known as eddie_
alanp has quit [Remote host closed the connection]
balki has quit [Remote host closed the connection]
<eddie_> Anyone knows how often do Unicode set gets updated?
<cirwim> eddie_: every year or two
<eddie_> ok
<eddie_> i have been staring at unicode chart for sometime
<eddie_> :)
<cirwim> heh
alanp has joined #ruby
balki has joined #ruby
andrewhl has quit [Remote host closed the connection]
<vectorshelve> hemanth: nice will tweet it :)
<hemanth> vectorshelve, :)
<vectorshelve> hemanth: typo -> instead of "As a responsible app, it's a neat if it does so?" it should be "As a responsible app, isn't it neat if it does so ?"
Morkel has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<eph3meral> how should I go about translating two arrays such as
<eph3meral> a = {foo_item:{loc:{ny:3,ca:5},org:{fd:8,pd:6}}}; b = {bar_item:{loc:{ny:9,az:7},org:{fd:2,emt:2}}}
<eph3meral> into something such as
<hemanth> vectorshelve, :)
<eph3meral> {ny:[:foo_item, :bar_item],ca:[:foo_item],az:[:bar_item],fd:[:foo_item,:bar_item],pd:[:foo_item],emt:[:bar_item]}
<vectorshelve> hemanth: tum toh bade techy nikle bhai
<hemanth> As a responsible app, it's neat if it does so?
<eph3meral> bnagy, got one for ya if you're up for it ^
<hemanth> vectorshelve, maytho bachaa hu
<eph3meral> bnagy, I'm sure I can figure out a few ways, but if you have thoughts on that one, I'd be interested
<eph3meral> I'll update you with a pastebin probably in a few mins as I try things out
Ripp__ has joined #ruby
<bnagy> eph3meral: it's going to be gross
<bnagy> and I gotta do some actual work now, sry :)
<eph3meral> heh, ok that's what I thought and no problem, respectively
joch_n has joined #ruby
Solnse has joined #ruby
AxonetBE has joined #ruby
Helius has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
alanp has quit [Remote host closed the connection]
balki has quit [Remote host closed the connection]
dangerousdave has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
dangerousdave has quit [Read error: Connection reset by peer]
alanp has joined #ruby
balki has joined #ruby
dangerousdave has joined #ruby
lolmaus has joined #ruby
xnm has quit [Read error: Connection reset by peer]
wvms has joined #ruby
Gavilan has left #ruby [#ruby]
jprovazn_away is now known as jprovazn
jrallison has joined #ruby
fayimora has joined #ruby
djdb has quit [Remote host closed the connection]
kevinbond has quit [Quit: kevinbond]
replore_ has quit [Remote host closed the connection]
gilead has joined #ruby
socomm has quit [Ping timeout: 245 seconds]
jprovazn has quit [Quit: Leaving]
true_techie has quit [Remote host closed the connection]
Criztian has joined #ruby
socomm has joined #ruby
qwerxy has joined #ruby
jprovazn has joined #ruby
djdb has joined #ruby
<kenneth> does this code look sensible? https://gist.github.com/0d1b9c71e8faa7ed2c96
<kenneth> to run an event machine in parallel with a rack app
cha1tanya has quit [Ping timeout: 250 seconds]
<cirwim> do you really really not want to use thin?
<cirwim> because that will give you a managed event loop more easily
<cirwim> and then you can do whatever you like
mrdtt has joined #ruby
daniel_hinojosa has quit [Ping timeout: 252 seconds]
nirakara has joined #ruby
<kenneth> cirwim: i want this to work with any rack-compatible web server
<kenneth> thin, apache w/ passenger, etc.
<cirwim> ok
ph^ has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
locriani has joined #ruby
Helius has joined #ruby
jrallison has quit [Quit: Computer has gone to sleep.]
mneorr has joined #ruby
dekroning has joined #ruby
ank_ has joined #ruby
Ripp__ has quit [Read error: Operation timed out]
sleetdrop has joined #ruby
nirakara has quit [Ping timeout: 244 seconds]
ank has quit [Ping timeout: 245 seconds]
ank_ is now known as ank
locriani has quit [Ping timeout: 260 seconds]
nikhil_ has joined #ruby
nikhil_ has quit [Max SendQ exceeded]
nikhil_ has joined #ruby
Ripp__ has joined #ruby
hoelzro|away is now known as hoelzro
heftig has quit [Quit: leaving]
darkf has quit [Quit: Leaving]
a_a_g has joined #ruby
Helius has quit [Remote host closed the connection]
Helius has joined #ruby
mengu has quit [Read error: Connection reset by peer]
luckyruby has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
bosphorus has joined #ruby
sparrovv has joined #ruby
maccosmo has joined #ruby
savage- has quit [Remote host closed the connection]
pabloh has joined #ruby
ij has left #ruby ["WeeChat 0.3.7"]
cj3kim has quit [Quit: This computer has gone to sleep]
CheeToS has quit [Ping timeout: 244 seconds]
schovi has joined #ruby
eggie5 has quit [Quit: eggie5]
Eldariof-ru has joined #ruby
mikepack has quit [Read error: No route to host]
nikhil_ has quit [Quit: This computer has gone to sleep]
lopin has quit [Ping timeout: 245 seconds]
apeiros_ has joined #ruby
pu22l3r_ has joined #ruby
<tommylommykins> hmm
* tommylommykins notes pathname#relative and absolute don't work on windows
<tommylommykins> which makes much of pathname broken on windows
<tommylommykins> Is there a canonical solution to this problem?
noodletraveler has quit [Read error: Connection reset by peer]
simao has joined #ruby
<tommylommykins> hmm, actually not erlative, but realpath is broken
pu22l3r has quit [Ping timeout: 244 seconds]
d3c has quit [Quit: Quit]
<Hanmac> tommylommykins: can you pastie your line? ... i heard that ruby uses / on windows too
looopy has joined #ruby
savage- has joined #ruby
qwerxy has quit [Quit: offski]
simao has quit [Ping timeout: 265 seconds]
pabloh has quit [Quit: Ex-Chat]
milestone has joined #ruby
BiHi has joined #ruby
kenneth has quit [Quit: kswizz.com]
nfluxx has quit [Quit: nfluxx]
<milestone> hi all i installed ruby 1.9.3 from source on rhel 6 now i want to do gem install charlock_holmes i keep getting icu required although i installed libicu
blacktulip has joined #ruby
mdw has joined #ruby
jimeh2 has joined #ruby
a_a_g has quit [Quit: Leaving.]
a_a_g has joined #ruby
ryanf has quit [Quit: leaving]
tvw has joined #ruby
<milestone> what am i doing wrong?
<hoelzro> milestone: did you install libicu-devel or whatever it's calle?
<hoelzro> *called
<hoelzro> you need headers to build source
<milestone> hoelzro: i did a yum search icu and only found libicu
<milestone> libicu.x86_64 : International Components for Unicode - libraries
jimeh2 has quit [Client Quit]
<hoelzro> and there's no other packages listed?
simao has joined #ruby
<hoelzro> try searching for libicu-devel
<milestone> no let me check within stellite <-- hoelzro
<milestone> hoelzro: ok found it in another channel
<milestone> hoelzro: adding it to the system
parzo has quit [Quit: Leaving.]
fserb has joined #ruby
jimeh has joined #ruby
QaDeS has joined #ruby
parzo has joined #ruby
IrishGringo has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725]]
thecreators has quit [Quit: thecreators]
ephemerian has joined #ruby
Konboi has joined #ruby
mdw has quit [Remote host closed the connection]
savage- has quit [Remote host closed the connection]
timbuchwaldt has joined #ruby
maccosmo has quit [Quit: maccosmo]
cantonic_ has joined #ruby
mdw has joined #ruby
timonv has joined #ruby
cantonic has quit [Read error: Operation timed out]
cantonic_ is now known as cantonic
timbuchwaldt has quit [Client Quit]
timbuchwaldt has joined #ruby
siksia has quit [Ping timeout: 250 seconds]
linusoleander has joined #ruby
eph3meral has quit [Quit: Leaving]
timbuchwaldt has quit [Client Quit]
timbuchwaldt has joined #ruby
seoaqua has joined #ruby
fyolnish has joined #ruby
fserb has quit [Quit: ttyl]
cirwim has quit [Quit: sleep….ping!]
<seoaqua> https://gist.github.com/2880631 will 'process' be executed on exit?
looopy has quit [Remote host closed the connection]
tomb__ has joined #ruby
kalleth has quit [Ping timeout: 252 seconds]
siksia has joined #ruby
<bnagy> sometimes
vlad_starkov has joined #ruby
<seoaqua> not on exception uncaught?
ajonsson has joined #ruby
<bnagy> test :) I don't use it myself
werdnativ has quit [Quit: werdnativ]
vikhyat has quit [Quit: Leaving.]
<bnagy> if I have stuff that absolutely needs finalizers, which is rare, I trap INT
<seoaqua> trap INT?
<bnagy> sigint, what you get when someone ^C's your script
rcs has quit [Ping timeout: 260 seconds]
<seoaqua> oh
<bnagy> imho classes shouldn't try to finalize behind the user's back - just expose a destroy method
<bnagy> but that's opinion
zz_chrismcg is now known as chrismcg
chrismcg has quit [Changing host]
chrismcg has joined #ruby
vikhyat has joined #ruby
gregorg_taf has quit [Changing host]
gregorg_taf has joined #ruby
gregorg_taf is now known as gregorg
qwerxy has joined #ruby
<seoaqua> i need to write an autosave stuff to put the cache-mem into disk every x secs
milestone has quit [Quit: milestone]
rcs has joined #ruby
vikhyat has left #ruby [#ruby]
<seoaqua> and also save the cache on exit
<bnagy> yeah everyone has some reason they _think_ they know better than the user
<seoaqua> when the program restarts next time, it could restore the cache from disk
<seoaqua> its not for user, its for myself
<bnagy> anyway at_exit won't help if the process is interrupted, and in other cases that I can't remember, because I don't use it :)
<seoaqua> what if the program ended normally?
<bnagy> it sounds like you should be using some kind of real datastore though
<bnagy> if it ends normally then the users can call your explicit destroy method :)
<bnagy> or close or save or whatever
<seoaqua> the 'save' process is in a thread, maybe its not properly executed when the main process ended
<banister_> bnagy: hey nags
<bnagy> yeah that sounds pretty horrible and racy, as well
<bnagy> why can't you just use a datastore that does this for you?
<bnagy> there are lots
timbuchwaldt has quit [Quit: Linkinus - http://linkinus.com]
<bnagy> banister_: whatup sheepshagger?
<seoaqua> datastore? you mean database?
timbuchwaldt has joined #ruby
<bnagy> seoaqua: well datastore is a more general term, in my universe
<seoaqua> bnagy, is there a gem?
<bnagy> which may not be inhabited by anyone else, I'll admit
<banister_> bnagy: what is the significance of this: trap('HUP') { binding.pry }
dhruvasagar has joined #ruby
<banister_> bnagy: what is it likely to do
<banister_> bnagy: in terms of, what is likely to raise that signal and so what is the particular use case he has in mind
<banister_> bnagy: i saw it in a tweet
<bnagy> what signal is hup? is that 1 or 9 ?
<banister_> no idea
<bnagy> cause lots of unix folks use kill -1 pid to get status output
timbuchwaldt has left #ruby [#ruby]
timbuchwaldt has joined #ruby
<bnagy> yeah it's 1
<bnagy> basically you'd use it for a daemon process and if you want to see how it's doing you'd kill -1 and it would drop into the repl
<seoaqua> bnagy, do u know any gem that act as autosaving datastore tool?
<bnagy> then you would have to resume it somehow
friskd has joined #ruby
<bnagy> seoaqua: almost all of the KV stores should do that
<banister_> bnagy: that's cool
<banister_> bnagy: thanks
<seoaqua> bnagy, key value?
<bnagy> seoaqua: google for persistent memory KV store or something?
fayimora has quit [Ping timeout: 260 seconds]
<bnagy> tokyo cabinet / oklahoma_mixer do it, I think memcached can, beanstalkd does (but that's more of a work queue)
<bnagy> I bet redis does, but I haven't checked
<seoaqua> bnagy, thanks
<bnagy> banister_: how do you resume from inside binding.pry?
Aaton is now known as Aaton_off
<banister_> bnagy: ^D
<banister_> bnagy: or exit
<bnagy> k
<DanBoy> Ruby Cookbook vs The Ruby Way
<bnagy> banister_: am I right in thinking that would only block the main thread?
<DanBoy> opinions!
<DanBoy> now!
<bnagy> Ruby Way
<banister_> bnagy: it should do, but some readline implementations cause it to block all threads
<banister_> dont ask me why
<DanBoy> cool thanks
charliesome has joined #ruby
<bnagy> . o O ( I wonder if those are book titles, or what? )
<DanBoy> i figured the ruby way seems like a cook book anyway
<DanBoy> i wanted to blaze through one of them front to back
<bnagy> banister_: ok, then it should be a cute way to get a built in status monitor, and the daemon would keep running
fayimora has joined #ruby
<bnagy> I was thinking of building something similar with drb
swistak35 has quit [Ping timeout: 250 seconds]
heftig has joined #ruby
Sgeo has left #ruby ["Leaving"]
seitensei has quit [Ping timeout: 244 seconds]
d3c has joined #ruby
<banister_> bnagy: have you heard of pry-remote ?
<banister_> bnagy: it uses drb to provide remote pry sessions
tatsuya_o has joined #ruby
<bnagy> yeah I heard of it
<banister_> bnagy: u should join #pry
<banister_> bnagy: then i can harrass you more fully without having to worry about being logged
Tick-Tock has quit [Ping timeout: 272 seconds]
robotmay has joined #ruby
jmcphers has quit [Quit: Leaving]
s0ber has quit [Remote host closed the connection]
<bnagy> meh
<banister_> bnagy: i want to put you inside my house
s0ber has joined #ruby
jmcphers has joined #ruby
<bnagy> o_0
Tick-Tock has joined #ruby
Shahor has joined #ruby
Shahor has quit [Client Quit]
ajonsson has quit [Quit: ajonsson]
<banister_> bnagy: hehe that's actually a line from a john b. hooker song ;)
<bnagy> sounds more like a john wayne gacy song
linusoleander has quit [Quit: linusoleander]
pk1001100011 has joined #ruby
<banister_> bnagy: haha!
<banister_> never though of it that way :)
<banister_> thought
<vectorshelve> HAI ALL !!!
seoaqua has quit [Ping timeout: 245 seconds]
pk1001100011 has quit [Client Quit]
pk1001100011 has joined #ruby
eurek has joined #ruby
bperry has quit [Ping timeout: 245 seconds]
bperry has joined #ruby
ajonsson has joined #ruby
berserkr has joined #ruby
fayimora has quit [Read error: Connection reset by peer]
fayimora has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
fyolnish has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
seoaqua has joined #ruby
jenrzzz-mac has quit [Ping timeout: 252 seconds]
Solnse has quit [Remote host closed the connection]
Solnse has joined #ruby
Foxandxss has joined #ruby
dhruvasagar has quit [Client Quit]
dhruvasagar has joined #ruby
abionic has joined #ruby
arvidkahl has quit [Read error: Connection reset by peer]
rhodesp has joined #ruby
davidw has joined #ruby
arvidkahl has joined #ruby
davidw is now known as Guest10347
rhodesp is now known as withnale
b1rkh0ff has quit [Ping timeout: 260 seconds]
ABK_ has quit [Ping timeout: 240 seconds]
Morkel has quit [Quit: Morkel]
roolo has joined #ruby
joch_n has quit [Quit: Linkinus - http://linkinus.com]
jbw_ has quit [Ping timeout: 265 seconds]
mneorr_ has joined #ruby
mneorr has quit [Ping timeout: 252 seconds]
bosphorus_ has joined #ruby
punkrawkR has joined #ruby
Karmaon has quit [Ping timeout: 276 seconds]
bosphorus has quit [Ping timeout: 260 seconds]
linusoleander has joined #ruby
moshee has quit [Ping timeout: 245 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
zeromodulus has quit [Remote host closed the connection]
Dave has joined #ruby
jbw_ has joined #ruby
Dave is now known as Guest75136
ViperMaul has quit [Ping timeout: 245 seconds]
ViperMaul has joined #ruby
Guest10347 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
dangerousdave has quit [Ping timeout: 265 seconds]
ij has joined #ruby
adeponte has quit [Remote host closed the connection]
<ij> Module's class variable is the same as instance variable, because there's always only one instance of the module, correct?
<heftig> modules aren't instantiated
<shevy2> ij I have not understood the question but what you write here seems totally wrong
blacktulip has quit [Ping timeout: 252 seconds]
pk1001100011 has quit [Ping timeout: 244 seconds]
<AxonetBE> case x; when x == 4 : puts "4"; else puts "not 4"; end;
Solnse has quit [Ping timeout: 265 seconds]
<AxonetBE> the : is not supported anymore in 1.9.2
<AxonetBE> ?
<shevy2> AxonetBE, you dont really use == in a case menu
<shevy2> case x; when 4
<shevy2> but yeah
<shevy2> the : was deprecated
<shevy2> if you want to use it on the same line, I think you can use "then" instead
<AxonetBE> shevy2: ok thanks
shevy2 is now known as shevy
vlad_starkov has quit [Remote host closed the connection]
dnyy has quit [Remote host closed the connection]
blacktulip has joined #ruby
genivf has quit [Read error: Connection reset by peer]
<shevy> there is this nice pdf
<shevy> about ruby's rehash function
arvidkahl has quit [Read error: Connection reset by peer]
<ij> shevy: An instance variable in module would be no different that class variable in module(meaning module's instance)
<ij> Wrong?
adeponte has joined #ruby
<shevy> ij we can find out with code
<ij> I'm changing code, and the tests are working, so I'm assuming yes, I'm just here to check.
<shevy> from this I conclude that module instance variables are not shared into classes
Zolrath has joined #ruby
Zolrath has quit [Client Quit]
<ij> shevy: I don't mean shared, I mean "functions the same".
<shevy> "functions the same" - doing what
<ij> ah, nevermind
<shevy> @foo is never the same as @@foo
poga has joined #ruby
poga has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
cheater__ has joined #ruby
<ij> Not being questioned.
cheater_ has quit [Ping timeout: 245 seconds]
kalleth has joined #ruby
neersighted is now known as neersight[d]
<shevy> "Introducing the new Facebook group for the Ruby Programming Language." Ack
<bnagy> for when #ruby isn't far enough to slide
<shevy> perhaps we can rename it to ... #ruby-on-facebook
siksia has quit [Ping timeout: 256 seconds]
siksia has joined #ruby
cantonic_ has joined #ruby
<vectorshelve> shevy: hai :)
moosya has joined #ruby
twinturbo has joined #ruby
<shevy> or #vectorshelve-on-ruby
cantonic has quit [Ping timeout: 265 seconds]
cantonic_ is now known as cantonic
<shevy> ugh
<shevy> when one does not have libyaml installed, even "gem env" outputs this warning :(
jgrevich has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
<ij> What object are instance variables assigned to in module X's def y?
jgrevich has joined #ruby
AlbireoX`Laptop has joined #ruby
<apeiros_> ij: the object upon which you call 'y'
dr0p_pl has joined #ruby
dr0p_pl is now known as pawdro
<apeiros_> ij: i.e., module X; def y=(v); @y = v; end; end; class Z; include X; def y; @y; end; end; obj = X.new; obj.y = 1; obj.y # => 1
jedmtnman has joined #ruby
Beoran__ has joined #ruby
nfluxx has joined #ruby
Beoran_ has quit [Ping timeout: 245 seconds]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
jgrevich_ has joined #ruby
lopin has joined #ruby
ajonsson has quit [Read error: Connection reset by peer]
jgrevich has quit [Read error: Connection reset by peer]
jgrevich_ is now known as jgrevich
flak has joined #ruby
rippa has quit [Read error: Connection reset by peer]
flak is now known as Guest29062
remmy444 has joined #ruby
jgrevich has quit [Quit: jgrevich]
arturaz has joined #ruby
seitensei has joined #ruby
ronniy has joined #ruby
<shevy> "executable host ruby is required. use --with-baseruby option."
<shevy> hmm
<shevy> seems to continue despite this though
pk1001100011 has joined #ruby
tayy has joined #ruby
mdw has quit [Remote host closed the connection]
BiHi has quit [Quit: Computer has gone to sleep]
pawdro has quit [Quit: Konversation terminated!]
luxurymode has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<shevy> argh
adeponte has quit [Remote host closed the connection]
<shevy> I killed 1.8.7 now :(
<shevy> ruby 1.9.3p194 (2012-04-20) [x86_64-linux]
<ij> Any idea how to make Nokogiri::XML::Builder remove <?xml when #to_s?
flype has joined #ruby
<Hanmac> yeah :P shevy has been beaten by 1.9.3 XD
<shevy> Hanmac yeah ...
jenrzzz-mac has joined #ruby
hoelzro has quit [Ping timeout: 272 seconds]
<shevy> my ruby projects kinda work too
timbuchwaldt has quit [Quit: Linkinus - http://linkinus.com]
hoelzro has joined #ruby
<shevy> so I think I wont really need 1.8.7 per se anymore
<shevy> :(
seitensei has quit [Ping timeout: 245 seconds]
cha1tanya has quit [Ping timeout: 265 seconds]
d3vic3 has quit [Ping timeout: 252 seconds]
seitensei has joined #ruby
d3vic3 has joined #ruby
davidcelis has quit [Read error: Connection reset by peer]
<shevy> only thing annoying me is this so far:
<shevy> menu.rb:18: warning: duplicated when clause is ignored
timbuchwaldt has joined #ruby
timbuchwaldt has quit [Remote host closed the connection]
<shevy> and there are like 100 of those lines, all report at the same number, which is the wrong line number too
allanm has joined #ruby
<Hanmac> ... you could pastie me the file and i try to find whats wrong
davidcelis has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
Criztian has quit [Remote host closed the connection]
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sleetdrop has quit [Remote host closed the connection]
twinturbo has quit [Read error: Operation timed out]
<shevy> hmm that case menu has 1400 lines
* Hanmac has enough time to read it :P
Drewch_ has quit [Ping timeout: 245 seconds]
<Hanmac> PS: i am only intestested in the case / when heads
<Hanmac> what do you use for when clauses?
<shevy> hmm perhaps I would need a class that scans through
<shevy> and outputs the duplicates
Drewch has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
<shevy> the thing I am wondering is, if I would write such a class
<shevy> the when clauses are like this:
<shevy> .
<shevy> when 'colour_wheel','colourwheel','std_colours','stdcolours',
<shevy> 'col'
arvidkahl has joined #ruby
<shevy> so they flow to the next line. now I am not sure how to easily find out when they stop
remmy444 has quit [Remote host closed the connection]
darthdeus has joined #ruby
flype has joined #ruby
keanehsiao has quit [Quit: keanehsiao]
<matled> shevy: you could remove parts of the case in a binary search fashion until you find the problem
geekbri has joined #ruby
tomask has joined #ruby
tomask has quit [Changing host]
tomask has joined #ruby
mdw has joined #ruby
pl_ab has joined #ruby
nanderoo has joined #ruby
<AxonetBE> how can I do in ruby 1.9.2 string to array?
<AxonetBE> seems that "test".to_a is not working anymore
mneorr has joined #ruby
<shevy> AxonetBE one way you could use .split like .split("\n")
<Hanmac> AxonetBE: "string".split or "string".chars or "string".each_char ... (for chars) ... the different between the first and the others is that the others does not make an array if you dont need to store them
<matled> .lines seems to do the same as .to_a, but I never used .to_a
<zizzyx> what's currently considered the best option for javascript runtime in rails environment?
<Hanmac> AxonetBE: you could be also interested in each_line, each_byte, and each_codepoint
<zizzyx> heroku is warning against rubyracer but i thought the runtime was mostly for testing and etc
<AxonetBE> The facts is that I have sometimes 1 brand and sometimes multiple brands, so I do in my view params[:brand].to_a.join(" / "), because when I have 1 brand, the join is not working because it is a string, so I have to convert the string to an array
mneorr_ has quit [Ping timeout: 252 seconds]
<Hanmac> AxonetBE: Array(params[:brand]).join("/")
<burgestrand> zizzyx: heroku is warning against it because the default stack has node installed, so you don’t need rubyracer
<burgestrand> (therubyracer takes quite a bit of space in your node)
dhruvasagar has quit [Ping timeout: 252 seconds]
<shevy> cool didnt know about .lines
<AxonetBE> Hanmac: thanks!
<shevy> x = "abc\ndef" # => "abc\ndef"; x.lines # => #<Enumerator: "abc\ndef":lines>; x.to_a
<shevy> # => ["abc\n", "def"]
<Hanmac> shevy lines and each_line are the same, but i prefer the each_* methods to show what i want the enum stuff
<shevy> aha
burgestrand has quit [Quit: Leaving.]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
mneorr has quit [Ping timeout: 240 seconds]
etehtsea has joined #ruby
medik has joined #ruby
[Neurotic] has quit [Quit: Leaving]
mneorr has joined #ruby
eurek has joined #ruby
bluenemo has quit [Ping timeout: 265 seconds]
jcromartie has joined #ruby
lukaszk has joined #ruby
lukaszk has left #ruby [#ruby]
banister_ has quit [Read error: Connection reset by peer]
nirakara has joined #ruby
ajonsson has joined #ruby
banister_ has joined #ruby
<geekbri> In ruby is there a way to print the full object type? As in, if i had some object that was SomeClass::SomeSubClass and I wanted to literally print to the screen that class of the object. Is it just .class.name ?
franksort has joined #ruby
<franksort> Is there a quick way to print an object in irb so it displays one attribute per line?
<Hanmac> geekbri: you could also print .class directly
<geekbri> Hanmac: ah ok, i will give that a shot, thank you
<Hanmac> franksort i think you are looking for pp (prettyprint)
<shevy> geekbri .class.ancestors and perhaps the first entry of that array
<shevy> oh wait
<shevy> .class alone suffices :)
bluenemo has joined #ruby
<geekbri> :)
tayy has quit [Remote host closed the connection]
<franksort> Hanmac: It looks like pp can wrap at a certain char limit, but I'm looking for one attribute per line
jcromartie has quit [Quit: jcromartie]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
bwlang has joined #ruby
mohits has quit [Ping timeout: 252 seconds]
<Hanmac> franksort: a.tap{|obj|obj.instance_variables.each {|s| p "#{s} => #{obj.instance_variable_get(s)}"}}
banister_ has quit [Read error: Connection reset by peer]
`brendan has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
ZachBeta has joined #ruby
<franksort> Interesting…what's that tap method?
ryan0x2 has joined #ruby
<hoelzro> I just learned about tap myself =)
banister_ has joined #ruby
gentz has quit [Remote host closed the connection]
milestone has joined #ruby
BiHi has joined #ruby
<ij> Is chaining after a multi-line do..end proc heavily frowned upon?
sbanwart has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
<Tasser> ij, I do it, sooo :-)
allanm_ has joined #ruby
tatsuya__ has joined #ruby
tatsuya_o has quit [Read error: Connection reset by peer]
allanm has quit [Read error: Connection reset by peer]
Guest29062 has quit [Read error: Connection reset by peer]
robotmay_ has joined #ruby
Guest29062 has joined #ruby
milestone_ has joined #ruby
ajonsson is now known as ajonsson|away
krusty_ar has joined #ruby
burgestrand has joined #ruby
<Hanmac> franksort: currently i use it because i need obj twice in my code, and i dont want to use the a variable again
Axsuul has quit [Ping timeout: 240 seconds]
robotmay has quit [Ping timeout: 260 seconds]
mneorr_ has joined #ruby
allanm_ has quit [Read error: Connection reset by peer]
fayimora has quit [Ping timeout: 260 seconds]
mneorr has quit [Ping timeout: 265 seconds]
milestone has quit [Ping timeout: 245 seconds]
milestone_ is now known as milestone
ajonsson|away has quit [Quit: ajonsson|away]
banister_ has quit [Read error: Connection reset by peer]
banseljaj is now known as imami|afk
bwlang has quit [Ping timeout: 244 seconds]
iocor has joined #ruby
banister_ has joined #ruby
bfig has quit [Ping timeout: 240 seconds]
rizzylt has joined #ruby
tommyvyo has joined #ruby
Konboi has quit [Remote host closed the connection]
adamkittelson has joined #ruby
nfluxx has quit [Quit: nfluxx]
<franksort> ah, thanks
banister_ has quit [Read error: Connection reset by peer]
chrismcg is now known as zz_chrismcg
yonggu_ has joined #ruby
banisterfiend has joined #ruby
yonggu has quit [Ping timeout: 252 seconds]
siksia has quit [Ping timeout: 252 seconds]
Criztian has joined #ruby
<shevy> ij it can be useful. I usually do it via {} though. exit_game { do_cleanup_tasks } if @game_over
fayimora has joined #ruby
test34 has joined #ruby
bfig has joined #ruby
siksia has joined #ruby
xjiujiu_ has joined #ruby
hakunin has joined #ruby
adamkittelson has quit [Remote host closed the connection]
fayimora has quit [Ping timeout: 252 seconds]
Jackneill has joined #ruby
DuoSRX has quit [Remote host closed the connection]
fayimora has joined #ruby
DuoSRX has joined #ruby
bbttxu has quit [Quit: bbttxu]
fayimora has quit [Client Quit]
cdempsey has joined #ruby
mneorr_ has quit [Remote host closed the connection]
xaxisx has joined #ruby
geekfactor has quit [Remote host closed the connection]
nipra has quit [Read error: Operation timed out]
geekfactor has joined #ruby
fbernier has joined #ruby
jdripper has joined #ruby
FND has joined #ruby
pu22l3r_ has quit [Remote host closed the connection]
pu22l3r has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
fmcgeough has joined #ruby
tommyvyo_ has joined #ruby
ajonsson has joined #ruby
banisterfiend has joined #ruby
wangr has joined #ruby
peregrine81 has joined #ruby
vectorshelve has quit [Quit: Page closed]
mneorr has joined #ruby
fermion has joined #ruby
akem has quit [Read error: Connection reset by peer]
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
fantazo has joined #ruby
mucker has quit [Quit: Lost terminal]
axl_ has quit [Quit: axl_]
banisterfiend has quit [Read error: Connection reset by peer]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
ryan0x2_ has joined #ruby
peregrine81 has quit [Quit: Computer sleeping.]
c0rn has joined #ruby
dv310p3r has joined #ruby
nirakara has quit [Ping timeout: 244 seconds]
jrist-afk is now known as jrist
andrewhl has joined #ruby
hynkle has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
seitensei has quit [Ping timeout: 240 seconds]
flype has joined #ruby
c0rn has quit [Ping timeout: 260 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
TheHunter_1039 has joined #ruby
banister_ has joined #ruby
pu22l3r has quit [Remote host closed the connection]
ryan0x2_ has quit [Remote host closed the connection]
dekroning has quit [Quit: leaving]
dekroning has joined #ruby
iamjarvo has quit [Quit: Leaving.]
dv310p3r has quit [Ping timeout: 260 seconds]
sahli has joined #ruby
xanaru has joined #ruby
sahli has quit [Remote host closed the connection]
sahli has joined #ruby
mvangala has joined #ruby
<shevy> why is creating games so hard :(
ajonsson is now known as ajonsson|away
ajonsson|away is now known as ajonsson
tayy has joined #ruby
justsee has quit [Quit: Linkinus - http://linkinus.com]
robert_ has quit [Read error: Connection reset by peer]
jrist is now known as jrist-mtg
ajonsson is now known as ajonsson|away
digitalcakestudi has joined #ruby
chson_ has quit [Remote host closed the connection]
iori has quit [Remote host closed the connection]
ajonsson|away is now known as ajonsson
bbttxu has joined #ruby
lopin has quit [Remote host closed the connection]
lopin has joined #ruby
<relix> hello brothers
<relix> I'm trying to do this: (thread.participants-[message.from])
<shevy> hi sister relix
peregrine81 has joined #ruby
<relix> i.e. subtracting two arrays from eachother
<relix> the contents of the arrays are each time objects of the class User, and I overrid the User#==() method
<shevy> %w( abc def ghi ) - %w( ghi jkl mno ) # => ["abc", "def"]
bwlang has joined #ruby
<shevy> we have to call Hanmac here
<relix> but apparently it's not working - i.e. they aren't seen as equal in the Array#-() method
<relix> is there another method I should be overriding?
<bwlang> what's the ruby idiom to deal with an array or single value passed parameter as an array?
nlc has joined #ruby
digitalcakestudi has quit [Ping timeout: 252 seconds]
rizzylt has quit [Ping timeout: 260 seconds]
mucker has joined #ruby
<relix> never mind, the error must be somewhere else, I tried manually subtracting arrays like that and it works
dphase- is now known as dphase
theRoUS has quit [Ping timeout: 260 seconds]
banister_ has quit [Read error: Connection reset by peer]
rizzylt has joined #ruby
<relix> ha, the comparison method is never even called
burgestrand has quit [Quit: Leaving.]
<relix> I have it forced to return true and it still doesn't remove any items
heeton has joined #ruby
banister_ has joined #ruby
<FND> given n hashes (database records actually) with a common set of keys (attributes), how can I determine which keys' values are nil for all records?
lopin has quit [Ping timeout: 245 seconds]
<FND> e.g. A = { :foo => "lorem", :bar => nil, :baz => "ipsum" }; B = { :foo => nil, :bar => nil, :baz => "..." }; result == [:baz]
<relix> FND: merge them all
abionic has quit [Ping timeout: 245 seconds]
<heeton> Anyone know of an example of before_filter (like rails controllers) being used on a normal ruby object?
<FND> relix: d'oh! that should work
<heeton> (I.e. inserting some code before/after a call to a method)
<FND> thanks
<relix> FND: np
lopin has joined #ruby
<relix> heeton: alias a method and then call the old method from the before/around/after_filter ?
cha1tanya has quit [Ping timeout: 256 seconds]
<heeton> relix: was thinking that, but then I think I'd need the method defined before the filter
<heeton> That might not always be the case
<heeton> Though, I could go that way...
<FND> except, relix, `merge` doesn't skip fields with `nil` values
mohits has quit [Ping timeout: 244 seconds]
<FND> so I have to reject value == nil first?
cha1tanya has joined #ruby
charliesome has quit [Ping timeout: 248 seconds]
sleetdrop has joined #ruby
<tommylommykins> hmm
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
<relix> FND you can use the method #compact to remove nil values I think?
<relix> so merge the compact'ed hashes
<tommylommykins> is it possible to perform deconstruction outside of a set of arguments
<relix> then check the difference between the keys of the final hash, and the keys of one of the original hashes
darthdeus has joined #ruby
<relix> heeton: oh yeah, that's right, it'd get messy fast
dev_ has quit [Ping timeout: 248 seconds]
<afallows> If I only need a single table with a very small number of rows (~100) at any given time, what's the best DB solution that I can get up and running quickly in Ruby?
Guest29062 has quit [Quit: derp herp]
<FND> relix: hashes don't have a `compact` method
jcromartie has joined #ruby
<relix> FND: f*ck
apeiros_ has quit [Remote host closed the connection]
<relix> FND then you'll have to do the reject thingy yes
kenperkins has joined #ruby
<relix> FND sorry, the API sometimes gets messy in my head
<FND> ditto :)
<relix> it's hard to remember some of the subtle details :D
<relix> so, what could be the reason that this: thread.participants-[message.from]
<relix> doesn't call the User#==() method, but this: thread.participants.delete(message.from)
<relix> does
sahli has quit [Remote host closed the connection]
lorandi has joined #ruby
adamramadhan has quit [Ping timeout: 260 seconds]
Vert has quit [Ping timeout: 252 seconds]
<jedmtnman> afallows: single access user?
a_a_g has quit [Quit: Leaving.]
<jedmtnman> afallows: also relational or datastore?
<FND> relix: that's very interesting indeed - I would guess it's some internal optimization
<afallows> jedmtnman: Single access, and I don't have a preference. I am woefully undereducated on databases, I just need to keep a persistent record.
krusty_ar_ has joined #ruby
<jedmtnman> sqlite is pretty simple
bwlang has quit [Ping timeout: 240 seconds]
<jedmtnman> its the default that comes with rails, and its pretty quick, but its limited to one user at a time
<jedmtnman> and it relational
krusty_ar has quit [Ping timeout: 245 seconds]
<jedmtnman> afallows: if the data is not relational, it might be reasonable just to store it in a flat file.
<jedmtnman> as a list of ruby hash objects, maybe.
iamjarvo has joined #ruby
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<afallows> I think the advantage of using sqlite or similar would be that the structure is already implemented. As opposed to devising a flat file format and parsing process myself.
ben_alman has quit [Excess Flood]
erichmenge has joined #ruby
erichmenge has quit [Client Quit]
Guest85767 has quit [Read error: Connection reset by peer]
<jedmtnman> also afallows: this might be a post to read in regards to that: http://cleancoder.posterous.com/no-db
<jedmtnman> afallows: well, you aren't parsing it, you're just reading it.
Guest85767 has joined #ruby
blacktulip has quit [Remote host closed the connection]
xanaru has quit [Remote host closed the connection]
<jedmtnman> flat file has structure [{id:1, post:"foo"},{id:2, post:"bar"}]
<jedmtnman> in code
<jedmtnman> MyPosts = File.read('posts.rb')
<jedmtnman> MyPosts.each {...}
seitensei has joined #ruby
<jedmtnman> (metacode)...
erichmenge has joined #ruby
nanderoo has quit [Read error: Connection reset by peer]
d2s has left #ruby [#ruby]
<afallows> Hm. I'll have to consider that. I'm only expecting to have one table, which sort of defeats the purpose of relational DBs
ryan0x2 has quit [Remote host closed the connection]
<afallows> I think my coworkers/supervisors might just be DB-happy, they recommended that I use a DB
<jedmtnman> yah, not to exactly promote all the ideas in the linked post, but one interesting one is to not worry so much about the persistence layer up front, just use something that works
bwlang has joined #ruby
<jedmtnman> DB's are required when you need to have atomic reads and writes. A flat file, however can be versioned and is plain text readable, which may also be useful
<jedmtnman> shoot, you can just use rubys csv lib if you want
kenperkins has quit [Quit: Computer has gone to sleep.]
ben_alman has joined #ruby
iamjarvo has quit [Ping timeout: 244 seconds]
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
<afallows> I almost want to. The only thing I might get out of a (R)DB is that entries need unique IDs and I can just tell the DB "Do that" and it will do it.
Guest85767 has quit [Ping timeout: 252 seconds]
sonicpond has joined #ruby
<jedmtnman> afallows: well, if you keep your entries in a list, the vector index is a unique id.
iamjarvo has joined #ruby
eurek has joined #ruby
<afallows> True enough
<jedmtnman> also you can generate an id, based on something random:
<jedmtnman> Digest::SHA1.hexdigest ("{serialize(data)}")
tomb__ has quit [Quit: Computer has gone to sleep.]
uris has joined #ruby
bwlang_ has joined #ruby
ryan0x2 has joined #ruby
Guest85767 has joined #ruby
<jedmtnman> the other major advantage to a 'real' DB is that it can run as a process and its easy to access it, even from another machine. so if many people are using it (and esp if you want to enforce rights and privileges) then even if it is a small db, its worth doing something like running a mysql server
Helius has quit [Remote host closed the connection]
arturaz has quit [Ping timeout: 260 seconds]
<jedmtnman> and any of those dbs mentioned have very good ruby drivers and finally afallows, you may consider just writing a little rails app so you have a gui to maintain the data.
bwlang has quit [Ping timeout: 245 seconds]
bwlang_ is now known as bwlang
<jedmtnman> you can probably write the rails app faster than you can figure out how to communicate with a db through plain ruby if you are new.
theRoUS has joined #ruby
<jedmtnman> for a small db, its just a few generator commands away from doing basic db actions and if you don't care about privacy, host on heroku for free.
<jedmtnman> if you do care about privacy, hooking up authentication and authorization is a bit more difficult
<jedmtnman> but then you could still host it for free
ryan0x2 has quit [Remote host closed the connection]
rizzylt has quit [Remote host closed the connection]
PaciFisT has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
fearoffish has joined #ruby
jprovazn has quit [Quit: Leaving]
<afallows> Thanks for all your advice, jedmtnman - for the record, this DB is for a Sinatra app. I don't know if that colors the choices at all.
eurek has quit [Quit: Computer has gone to sleep.]
<jedmtnman> no, we use sinatra all the time. if your that comfortable with ruby, I'd just do a mysql db and if possible host it on a sep server from your app.
banisterfiend has joined #ruby
eurek has joined #ruby
lolmaus has quit []
<jedmtnman> afallows: google for the mysql gem and you can pick from any number of orms like ActiveRecord if you want abstraction
<afallows> For this particular implementation, I expect it to be on the same server as the app - The app is small, simple, and on a VPN.
<afallows> It's also on an AWS instance.
jprovazn has joined #ruby
<afallows> No need to run two instances for one small app.
chson has joined #ruby
xaq has joined #ruby
<jedmtnman> still i'd probably use mysql for any prod work over sqlite and run it on the same instance if you are serving a web app.
<jedmtnman> i mean that if… to be a prefixed statement :)
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
Morkel has joined #ruby
<hoelzro> mysql == frown town
carlyle has joined #ruby
seitensei has quit [Ping timeout: 252 seconds]
<jedmtnman> hoelzro: its simple and standard and easy to support.
siksia has quit [Ping timeout: 252 seconds]
bwlang_ has joined #ruby
Guedes_out is now known as Guedes
<jedmtnman> I'm not a huge fan, but its fine for what he's doing it sounds like
mucker has quit [Quit: leaving]
<hoelzro> it's popular, and a lot of devs know it
<jedmtnman> even a lot of non-devs know it
<hoelzro> that's about all I'll give it =)
<jedmtnman> (at least the syntax)
<hoelzro> however, the same could be said of PHP =P
<jedmtnman> no. no one knows php, just cmd-c, cmd-p
<afallows> I think it will be. I won't run afoul of any of the major flaws of MySQL with such a small project.
apeiros_ has joined #ruby
<afallows> PHP makes my heart hurt.
zz_chrismcg is now known as chrismcg
<jedmtnman> afallows: no. mysql hosts data for some pretty important projects.
<hoelzro> my favorite feature of MySQL is how you can insert data that doesn't fit and it'll just keep chugging along.
<jedmtnman> hoelzro: postgresql fan?
<apeiros_> "feature"
<hoelzro> jedmtnman: I like PostgreSQL, but I haven't used it much. I just hate MySQL.
darthdeus has joined #ruby
seitensei has joined #ruby
<hoelzro> granted, it pays the bills, but I still hate it =)
<apeiros_> hoelzro: you haven't had a chance to use oracle yet, yes? :)
<afallows> I hate things that pay the bills. :|
siksia has joined #ruby
<hoelzro> apeiros_: nope
bwlang has quit [Ping timeout: 265 seconds]
bwlang_ is now known as bwlang
<apeiros_> hoelzro: you'd hate it even more, trust me.
<jedmtnman> afallows: I just finished "7 databases in seven weeks" its worth a read, regardless of your db experience.
<afallows> Hooray! \o/ 'gem install mysql' failed to build native extensions.
<jedmtnman> we use mysql, couchdb, and neo4j in house.
dv310p3r has joined #ruby
<afallows> jedmtnman: That's definitely a book I'd like to pick up, but haven't, and it would be pretty far down my current reading list.
<hoelzro> jedmtnman: which DBs are covered?
<afallows> My team actually uses MongoDB in-house, but I wasn't planning to use that here - not sure it's worth the overhead.
mickn has joined #ruby
<jedmtnman> hoelzro: off the top of my head: postgresql, couchdb, redis ...
<jedmtnman> neo4j
<jedmtnman> pretty good survey
<hoelzro> sounds neat
<afallows> Redis, Neo4J, CouchDB, MongoDB, HBase, Riak, and Postgres
<jedmtnman> afallows: well for what you're saying if you already have a mongo instance running…. maybe use that.
<afallows> jedmtnman: There isn't already a MongoDB install running on this particular instance for this app.
<jedmtnman> its a good follow up to their 7 languages in 7 weeks book
<afallows> It's just the DB of choice for the other projects in the team.
internet_user has joined #ruby
<afallows> SLSW is an excellent book. I really, really liked Io.
<jedmtnman> well, but you can communicate with the instance from anywhere afallows
<jedmtnman> afallows: just sayin, i know you know that
<afallows> Yeah.
DefV has quit [Read error: Connection reset by peer]
linusoleander has quit [Quit: linusoleander]
<jedmtnman> afallows: I really enjoyed the prolog chapter and while I probably would choose a diff jvm targeted lang for me, the scala chapter was refreshing.
<Hanmac> banisterfiend: "Sollbruchstelle"
<afallows> Databases are very new to me, though, and I'm not perfectly clear on the existing usage of MongoDB on the team. Full disclosure, I'm an intern working on a support project to help the full-timers improve their workflow.
djdb has quit [Remote host closed the connection]
<jedmtnman> afallows: its a pretty simple interface if you know javascript and json
peregrine81 has quit [Quit: Computer sleeping.]
heftig has quit [Quit: leaving]
<jedmtnman> you can store more than one db on a prod server, so if they already have that infrastructure, you might be able to take advantage of it and the mindshare.
seitensei has quit [Read error: Operation timed out]
seitensei has joined #ruby
akem has joined #ruby
pu22l3r has joined #ruby
<afallows> I might, but it's also possible I couldn't. We're developing apps in a very modular structure, where each functional piece is its own (collection of) AWS instance(s), and each piece kind of manages its data its own way. I think the design-consistent implementaiton would be to use my own small DB for this new piece.
ph^ has quit [Remote host closed the connection]
Ripp___ has joined #ruby
Ripp__ has quit [Ping timeout: 244 seconds]
MissionCritical has quit [Ping timeout: 244 seconds]
awarner has joined #ruby
ryan0x2 has joined #ruby
mensvaga has joined #ruby
nilg` has quit [Read error: Connection reset by peer]
lopin has quit [Ping timeout: 244 seconds]
g0bl1n has joined #ruby
dekroning has quit [Ping timeout: 260 seconds]
devdazed has quit [Quit: Bye]
lopin has joined #ruby
sspiff has quit [Remote host closed the connection]
jrist-mtg is now known as jrist
peregrine81 has joined #ruby
devdazed has joined #ruby
TrahDivad has joined #ruby
nebiros has joined #ruby
xclite has joined #ruby
<TrahDivad> Hi people. I remember seeing somewhere that you could call all the methods in a block on an object so you didn't have to prefix fix on every line. Did I dream this?
<nebiros> hi, there's a way to send a password when I execute "git pull" command using PTY module?
mdhopkins has joined #ruby
billiamii has joined #ruby
<hoelzro> nebiros: why not use an SSH key instead?
kenperkins has joined #ruby
<apeiros_> TrahDivad: instance_eval?
<nebiros> hoelzro: yeah, I think is better :\
siksia has quit [Ping timeout: 260 seconds]
Konboi has joined #ruby
Jan_ has joined #ruby
franksort has quit [Quit:]
kenperkins has quit [Ping timeout: 252 seconds]
<TrahDivad> apeiros_: I'll check it out
axl_ has joined #ruby
statix is now known as stat1x
siksia has joined #ruby
chico_chicote has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
stat1x is now known as statix
jrallison has joined #ruby
mohits has quit [Read error: Operation timed out]
pygospa has quit [Ping timeout: 244 seconds]
mickn has quit [Quit: Leaving]
Sheehan has joined #ruby
pl_ab has quit [Quit: pl_ab]
CheeToS has joined #ruby
jcromartie has quit [Quit: jcromartie]
pygospa has joined #ruby
bbttxu has quit [Quit: bbttxu]
heeton has quit [Ping timeout: 260 seconds]
heeton has joined #ruby
kevinbond has joined #ruby
tk___ has joined #ruby
keanehsiao has joined #ruby
andrewhl has quit [Remote host closed the connection]
afallows has quit [Quit: Lost terminal]
freeayu has joined #ruby
afallows has joined #ruby
jcromartie has joined #ruby
jcromartie has quit [Client Quit]
ajonsson is now known as ajonsson|away
nascro has quit [Quit: Programming is hard.]
bbttxu has joined #ruby
<makkura> TrahDivad: http://pastie.org/4038299 Found a discussion for the same thing. instance_eval is the way to go, it seems
rippa has joined #ruby
<TrahDivad> makkura: Thanks! That's exactly what I was looking for
rmascarenhas has joined #ruby
indian has quit [Ping timeout: 248 seconds]
becom33 has quit [Ping timeout: 252 seconds]
MissionCritical has joined #ruby
becom33 has joined #ruby
deryl has joined #ruby
binaryplease has joined #ruby
<makkura> TrahDivad: :)
deryl is now known as Guest83718
Guest83718 has quit [Client Quit]
gilead has quit [Ping timeout: 260 seconds]
qwerxy has quit [Quit: offski]
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Vert has joined #ruby
qwerxy has joined #ruby
AxonetBE has quit [Quit: Leaving.]
tomask has quit [Quit: Quit]
phantasm66 has joined #ruby
dekroning has joined #ruby
deryl_ has joined #ruby
deryl_ is now known as deryl
deryl has quit [Client Quit]
deryl has joined #ruby
ken_barber has joined #ruby
a_a_g has joined #ruby
jprovazn has quit [Quit: Leaving]
jrist is now known as jrist-mtg
khakimov has joined #ruby
heeton1 has joined #ruby
jprovazn has joined #ruby
heeton has quit [Ping timeout: 256 seconds]
jprovazn is now known as jprovazn_away
enroxorz has joined #ruby
bitsar2 has joined #ruby
xjiujiu_ has quit [Ping timeout: 252 seconds]
qwerxy has quit [Ping timeout: 244 seconds]
bitsar has quit [Ping timeout: 260 seconds]
qwerxy has joined #ruby
axl__ has joined #ruby
axl__ has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
tk___ has quit [Quit: ばいばい]
axl_ has quit [Ping timeout: 245 seconds]
axl__ has joined #ruby
lopin has quit [Ping timeout: 244 seconds]
lopin has joined #ruby
kenperkins has joined #ruby
alexim has quit [Quit: sleep]
axl_ has joined #ruby
ckrailo has joined #ruby
xargoon has joined #ruby
sparrovv has quit [Ping timeout: 245 seconds]
dekroning has quit [Ping timeout: 250 seconds]
axl__ has quit [Ping timeout: 256 seconds]
tvw has quit [Remote host closed the connection]
looopy has joined #ruby
abionic has joined #ruby
eurek has quit [Quit: Computer has gone to sleep.]
eurek has joined #ruby
ajonsson|away is now known as ajonsson
abionic has quit [Read error: Connection reset by peer]
abionic has joined #ruby
cbuxton has joined #ruby
MasterIdler has quit [Quit: MasterIdler]
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
phantasm66 has quit [Quit: *poof*]
abionic has quit [Read error: Connection reset by peer]
bwlang_ has joined #ruby
abionic has joined #ruby
abionic has quit [Read error: Connection reset by peer]
abionic has joined #ruby
mdw has quit [Remote host closed the connection]
abionic has quit [Read error: Connection reset by peer]
abionic has joined #ruby
abionic has quit [Read error: Connection reset by peer]
Aaton_off is now known as Aaton
abionic has joined #ruby
bwlang has quit [Ping timeout: 250 seconds]
bwlang_ is now known as bwlang
freeayu has quit [Quit: 离开]
zomgbie has joined #ruby
tatsuya__ has quit [Remote host closed the connection]
yannis has quit [Quit: yannis]
abionic has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby
burgestrand has joined #ruby
abionic has joined #ruby
berserkr has quit [Quit: Leaving.]
mdw has joined #ruby
Criztian has quit [Remote host closed the connection]
maesbn has quit [Remote host closed the connection]
abionic has quit [Read error: Connection reset by peer]
oooPaul has joined #ruby
emmanuelux has joined #ruby
blacktulip has joined #ruby
Y0Gi has left #ruby [#ruby]
abionic has joined #ruby
otters has quit [Ping timeout: 245 seconds]
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
blischalk has joined #ruby
a_a_g has quit [Ping timeout: 256 seconds]
abionic has quit [Read error: Connection reset by peer]
abionic has joined #ruby
abionic has quit [Read error: Connection reset by peer]
baroquebobcat has joined #ruby
test34 has quit [Ping timeout: 252 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
lkba has joined #ruby
tatsuya_o has joined #ruby
axl__ has joined #ruby
gmvsea has joined #ruby
axl_ has quit [Ping timeout: 244 seconds]
axl__ is now known as axl_
rmascarenhas has quit [Quit: leaving]
hoelzro is now known as hoelzro|away
mayankkohaley has joined #ruby
becom33 has quit [Read error: Connection reset by peer]
bwlang_ has joined #ruby
flype has joined #ruby
GreaterCore has joined #ruby
looopy has quit [Remote host closed the connection]
siksia has quit [Ping timeout: 248 seconds]
<GreaterCore> hello, i have some issues with Ruby Mail and hoping somebody could enlighten me
wvms has quit [Quit: wvms]
looopy has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
cj3kim has joined #ruby
dentarg has joined #ruby
<apeiros_> GreaterCore: just ask your question. if somebody in the know sees it, he/she'll certainly help.
<GreaterCore> have anyone experience not being able to extract the body from an email sent from a mobile client (blackberry or iphone)?
Advocation has joined #ruby
<dentarg> ftp.ruby-lang.org seems down
<dentarg> :(
bwlang has quit [Ping timeout: 256 seconds]
bwlang_ is now known as bwlang
<GreaterCore> i am using Net::POP3 to connect to gmail and download new mails, but incoming mobile emails does not seem to have a body
jcromartie has joined #ruby
zomgbie has quit [Read error: Connection reset by peer]
<GreaterCore> it appears to be there when i look directly at the mail (string), but running mail.html_part or mail.text_part returns false (which imho implies that it could not extract the body)
<GreaterCore> i did google for it, and it might be due to the possibility of the email not being in multipart
poga has joined #ruby
<GreaterCore> if so, how would i be able to extract the body from the email?
kenperkins has quit [Read error: Connection reset by peer]
indian has joined #ruby
g0bl1n has quit [Quit: Ex-Chat]
<GreaterCore> i am this close to writing my own parser when Net::POP3 Mail object trips over such emails
siksia has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
schovi has quit [Remote host closed the connection]
<dentarg> so, is there a mirror of ftp.ruby-lang.org?
bbttxu has quit [Quit: bbttxu]
cha1tanya has quit [Quit: Leaving]
fmcgeough has quit [Read error: Connection reset by peer]
lopin has quit [Ping timeout: 252 seconds]
Eldariof-ru has quit [Read error: Operation timed out]
axl__ has joined #ruby
fmcgeough has joined #ruby
rushed has joined #ruby
GreaterCore_ has joined #ruby
alfism has joined #ruby
GreaterCore_ has quit [Client Quit]
axl_ has quit [Ping timeout: 252 seconds]
axl__ is now known as axl_
GreaterCore has quit [Ping timeout: 260 seconds]
zomgbie has joined #ruby
thecreators has joined #ruby
thone_ has joined #ruby
bluenemo has quit [Remote host closed the connection]
n1x has joined #ruby
kenperkins has joined #ruby
thone has quit [Ping timeout: 252 seconds]
senny has quit [Remote host closed the connection]
jcromartie has quit [Quit: jcromartie]
cj3kim has quit [Quit: This computer has gone to sleep]
Sheehan has quit [Quit: Sheehan]
lkba has quit [Quit: Bye]
lkba has joined #ruby
uris has quit [Quit: leaving]
zomgbie has quit [Read error: Connection reset by peer]
eywu has joined #ruby
ipoval has joined #ruby
Solnse has joined #ruby
blischalk has quit [Quit: blischalk]
Morkel has quit [Quit: Morkel]
Sheehan has joined #ruby
ekaleido has quit [Remote host closed the connection]
d3c has quit [Quit: Sleep]
ajonsson is now known as ajonsson|away
<dentarg> no one cares about ruby-lang.org?
MasterIdler has joined #ruby
tomb__ has joined #ruby
robotmay_ has quit [Remote host closed the connection]
uris has joined #ruby
Jackneill has quit [Remote host closed the connection]
jrist-mtg is now known as jrist
ipoval has quit [Client Quit]
bier has quit [Ping timeout: 244 seconds]
enroxorz has quit [Read error: Connection reset by peer]
Paul-Atreides has joined #ruby
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
<heeton1> Are there any gems or snippets available that provide before_filter like functionality to normal ruby objects?
Limb_ is now known as Limb
Araxia_ has joined #ruby
looopy has quit [Remote host closed the connection]
jrist is now known as jrist-afk
Kartagis has quit [Ping timeout: 246 seconds]
maletor has joined #ruby
<makkura> heeton1: Off hand, none that I see. Though I see a SO suggesting to simply use ActiveModel callbacks (exactly as rails does). The AR:CallBacks section actually has some details on doing that
looopy has joined #ruby
<geekbri> looks like ruby-lang.org might be having some issues today huh
kenichi has joined #ruby
mucker has joined #ruby
SegFaultAX|work2 has quit [Quit: Lost terminal]
ajonsson|away is now known as ajonsson
eywu has quit [Read error: No route to host]
eywu has joined #ruby
Aaton is now known as Aaton_off
Karmaon has joined #ruby
kevinbond has quit [Quit: kevinbond]
Kartagis has joined #ruby
Bela-Lugosi has joined #ruby
Paul-Atreides has quit [Read error: Connection reset by peer]
Bela-Lugosi has joined #ruby
zomgbie has joined #ruby
bier has joined #ruby
<dentarg> geekbri: YES finally, I'm not alone in acknowledge that
ajonsson has quit [Ping timeout: 245 seconds]
<geekbri> good times :)
<dentarg> it sucks
<heeton1> makkura: thanks
<dentarg> there's mirros, so know I have 1.9.3-p194 installed
<dentarg> but gem linecache19 fails, it wants to download http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
<geekbri> Yeah, im just going to mirror that tarballls myself
<dentarg> fails to install for me
<makkura> heeton1: :)
<dentarg> maybe I have to do the old hosts file trick
okc_frienemy has joined #ruby
zomgbie has quit [Read error: Connection reset by peer]
fantazo has quit [Remote host closed the connection]
davidw has quit [Ping timeout: 244 seconds]
Croms has quit [Read error: Connection reset by peer]
Croms has joined #ruby
adeponte has joined #ruby
ptka has joined #ruby
ptka has left #ruby [#ruby]
flype has quit [Quit: Computer has gone to sleep.]
BiHi has quit [Quit: Computer has gone to sleep]
Paul-Atreides has joined #ruby
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
Bela-Lugosi has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
minijupe has joined #ruby
<minijupe> is there a more graceful way to get double quotes inside double quotes than this: "Remove \"#{product.name}\" "
milestone has quit [Ping timeout: 252 seconds]
<dcope> Anyone using VIM in here? I'm trying to use the ruby complete bundle but VIM fails to start every time.
flype has joined #ruby
<dcope> States (eval):475: [BUG] terminated node (0x102584690)
<heeton1> minijupe: you can use %{} instead of the out double quotes
<heeton1> %{Remove "#{product.name}"}
cj3kim has joined #ruby
<minijupe> heeton1: i knew I'd seen s/t like that before. tnx
CheeToS has quit [Ping timeout: 256 seconds]
etehtsea has quit []
<minijupe> heeton1: does that thing have a name?
mdw has quit [Remote host closed the connection]
<minijupe> dcope: I use vim, but I'm sure I can't help you :|
cj3kim has quit [Client Quit]
lxsameer has quit [Ping timeout: 256 seconds]
<dcope> minijupe: you don't use the rubycomplete.vim plugin?
<minijupe> dcope: nope, but maybe I should?
<minijupe> dcope: I have the vim rails plugin installed and use it occasionally.
n1x has quit [Ping timeout: 244 seconds]
wangr has quit [Remote host closed the connection]
araujo has quit [Read error: Connection reset by peer]
wangr has joined #ruby
savage- has joined #ruby
Paul-Atreides has quit [Read error: Connection reset by peer]
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
Paul-Atreides has joined #ruby
bwlang has quit [Ping timeout: 240 seconds]
flagg0204 has quit [Quit: leaving]
brianpWins has joined #ruby
<heeton1> minijupe: sorry, slipped my mind, if you find out let me know
luxurymode has joined #ruby
eddie_ has quit [Quit: Ex-Chat]
williamcotton has joined #ruby
maesbn has joined #ruby
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
bwlang has joined #ruby
ephemerian has quit [Quit: Leaving.]
Aaton_off is now known as Aaton
Criztian has joined #ruby
hoelzro|away is now known as hoelzro
hoelzro is now known as hoelzro|away
siksia has quit [Ping timeout: 240 seconds]
mneorr has quit [Remote host closed the connection]
siksia has joined #ruby
a_a_g has joined #ruby
timonv has quit [Ping timeout: 260 seconds]
maesbn has quit [Remote host closed the connection]
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
gmvsea has left #ruby [#ruby]
parzo has quit [Quit: Leaving.]
tayy has quit [Remote host closed the connection]
bwlang_ has joined #ruby
Emmanuel_Chanel has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
eywu1 has joined #ruby
eywu has quit [Read error: Connection reset by peer]
bwlang has quit [Read error: Operation timed out]
bwlang_ is now known as bwlang
flagg0204 has joined #ruby
araujo has joined #ruby
bricker88 has quit [Quit: Leaving.]
sparrovv has joined #ruby
zommi has quit [Remote host closed the connection]
daniel_hinojosa has joined #ruby
otters has joined #ruby
banisterfiend has quit [Ping timeout: 265 seconds]
jcromartie has joined #ruby
leequarella has joined #ruby
<leequarella> are the rvm servers down? I am unable to fetch any rubies
banisterfiend has joined #ruby
mneorr has joined #ruby
mrsolo has joined #ruby
Paul-Atreides has quit [Read error: Connection reset by peer]
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
Paul-Atreides has joined #ruby
bigoldrock has joined #ruby
n1x has joined #ruby
eywu1 has quit [Read error: No route to host]
rmascarenhas has joined #ruby
peregrine81 has quit [Quit: Computer sleeping.]
<dominikh> leequarella: the rubies aren't hosted on rvm servers, they're hosted by ruby. and yes, those seem to be down, judging by ruby-lang.org
Araxia_ is now known as Araxia
maesbn has joined #ruby
mdhopkins has quit [Quit: mdhopkins]
n1x has quit [Max SendQ exceeded]
carloslopes has joined #ruby
ringotwo has joined #ruby
mneorr has quit [Remote host closed the connection]
n1x has joined #ruby
gmci has joined #ruby
mneorr has joined #ruby
looopy has quit [Remote host closed the connection]
wangr has quit [Remote host closed the connection]
eywu has joined #ruby
werdnativ has joined #ruby
wangr has joined #ruby
hynkle has quit [Quit: hynkle]
hynkle has joined #ruby
sparrovv has quit [Ping timeout: 250 seconds]
sleetdrop has quit [Remote host closed the connection]
alfism has quit [Quit: alfism]
sleetdrop has joined #ruby
chrismcg is now known as zz_chrismcg
adamkittelson has joined #ruby
Advocation has quit [Quit: Advocation]
bwlang has quit [Ping timeout: 244 seconds]
sleetdrop has quit [Remote host closed the connection]
yosinof has joined #ruby
araujo has quit [Quit: Leaving]
jrist-afk is now known as jrist
digitalcakestudi has joined #ruby
mohits has quit [Ping timeout: 245 seconds]
sbanwart has quit [Ping timeout: 240 seconds]
flak has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
baroquebobcat has quit [Ping timeout: 245 seconds]
flak is now known as Guest3082
barefoot has joined #ruby
Morkel has joined #ruby
Morkel has quit [Client Quit]
puff has quit [Remote host closed the connection]
Morkel has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
rippa has quit [Ping timeout: 244 seconds]
bwlang has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
jenrzzz-mac has joined #ruby
FND has quit [Quit: leaving]
<shevy> long live ruby!
<GeekOnCoffee> +1
bwlang_ has joined #ruby
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
Guest3082 has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
nfluxx has joined #ruby
rippa has joined #ruby
nfluxx has quit [Remote host closed the connection]
khakimov has joined #ruby
nfluxx has joined #ruby
bwlang has quit [Ping timeout: 252 seconds]
bwlang_ is now known as bwlang
araujo has quit [Client Quit]
Emmanuel_Chanel has quit [Quit: Leaving]
stepnem has quit [Ping timeout: 250 seconds]
robert_ has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
pawdro has joined #ruby
gilead has joined #ruby
Emmanuel_Chanel has joined #ruby
zomb1e has joined #ruby
Guest85767 has quit [Read error: Connection reset by peer]
<shevy> long live perl!!!
Guest85767 has joined #ruby
gilead has quit [Client Quit]
ken_barber has joined #ruby
mneorr has quit [Remote host closed the connection]
thecreators has quit [Remote host closed the connection]
alexim has joined #ruby
thecreators has joined #ruby
artOfWar has joined #ruby
leequarella has quit [Quit: Leaving]
cha1tanya has quit [Quit: Leaving]
imami|afk is now known as banseljaj
<mensvaga> Is there a good full document on how to compile ruby on solaris 10?
araujo has joined #ruby
araujo has joined #ruby
Amnesia has joined #ruby
<Amnesia> does by any chance anyone know a function to see what the seconds since epoch is at a specific time?
<dominikh> Time#to_i
<shevy> mensvaga no idea. but try to compile it from source and paste here what error you have
robert_ has quit [Ping timeout: 244 seconds]
timonv has joined #ruby
<Amnesia> dominikh: ?
timonv has quit [Remote host closed the connection]
<dominikh> Amnesia: !
<Amnesia> ruby 1.9 only by any chance?
ajonsson has joined #ruby
<shevy> there is Time.at too
strnx has quit [Excess Flood]
<dominikh> doubt it
friskd_ has joined #ruby
<shevy> Time.at(0) # => Wed Dec 31 19:00:00 -0500 1969
Eldariof-ru has joined #ruby
<yxhuvud> shevy: that is the direction he didn't ask for
ekaleido has joined #ruby
robert_ has joined #ruby
<Amnesia> shevy: I need the unix timestamp:)
tatsuya_o has quit [Remote host closed the connection]
<dominikh> even 1.8.6 had Time#to_i ...
<Sigma00> Integer(Time.now) works...
IrishGringo has joined #ruby
<Sigma00> not entirely sure what it's returning though
<Sigma00> I'd hope that's epoch
<Sigma00> er, time since epoch
Vert has quit [Read error: Connection reset by peer]
friskd has quit [Ping timeout: 244 seconds]
friskd_ is now known as friskd
Emmanuel_Chanel has quit [Quit: Leaving]
<Amnesia> I neet the opposite of Time.at:)
bbttxu has joined #ruby
strnx has joined #ruby
<mensvaga> shevy: OK. I'm trying to get back to a good "clean" broken run :)
baroquebobcat has joined #ruby
digitalcakestudi has quit [Read error: Operation timed out]
b3gott3n has quit [Quit: Lost terminal]
<dominikh> Amnesia: and why exactly is Time#to_i not working?
ph^ has joined #ruby
<Amnesia> well it returns a Time object which I cant use
abstrusenick has joined #ruby
<dominikh> eh? to_i implies _a lot_ that it returns an integer
mikepack has joined #ruby
<Amnesia> puts Time#to_i.class
<Amnesia> Time
<dominikh> ... are you kidding me?
<bnagy> Time.now.class?
<dominikh> Time#to_i refers to the instance method to_i on Time
<dominikh> you#re not supposed to type "Time#to_i" in your code...
<Amnesia> ah lol
<dominikh> Time.now.to_i => 1339004527
<Amnesia> Time.utc(2012,"jun",6,17,50,0).strftime('%s') <- that did the job:)
<bnagy> sry meant time now to_i class obviously
robert_ has quit [Ping timeout: 260 seconds]
jgrevich has joined #ruby
<dominikh> Time.utc(2012,"jun",6,17,50,0).to_i ...
<dominikh> yours returns a string…
apok has joined #ruby
tayy has joined #ruby
<apeiros_> note that to_f does the same, but provides sub-second precision
<apeiros_> (and works with .at too)
stepnem has joined #ruby
apok has left #ruby [#ruby]
Ripp___ has quit [Read error: Operation timed out]
<apeiros_> (re Time#to_i)
<Amnesia> dominikh: hm good one
<Amnesia> sorry for the stupidness
<Amnesia> and thanks:)
Guest85767 has quit [Ping timeout: 252 seconds]
Guest85767 has joined #ruby
<mensvaga> WEll, I'm a dork. When I got back to an environment where I would have a good example of failing to compile
<mensvaga> it's further than it got before.
Karmaon has quit [Ping timeout: 276 seconds]
<mensvaga> I set up certain commands to be explicit instead of relying on $PATH, and it's working.
<mensvaga> err, it's progressing.
ringotwo has quit [Remote host closed the connection]
Ripp__ has joined #ruby
bricker88 has joined #ruby
kenperkins has joined #ruby
indian has quit [Ping timeout: 265 seconds]
DuoSRX has quit [Remote host closed the connection]
mrdtt has quit [Remote host closed the connection]
DuoSRX has joined #ruby
keanehsiao has quit [Quit: keanehsiao]
kenperkins has quit [Read error: Connection reset by peer]
kenperkins has joined #ruby
<shevy> we are crossing thumbs hopefully mensvaga
<shevy> be prepared to punch your computer down in case of errors though
<mensvaga> It's still building.
<mensvaga> ha! will do.
<shevy> k hold your fist...
<shevy> hold it ...
<shevy> hold it ...
<shevy> ...
<shevy> ...
<shevy> .
<shevy> .
<shevy> PUNCH NOW JUST IN CASE!
<mensvaga> "Generating RI format into..."
<mensvaga> that's where it is now.
abstrusenick_ has joined #ruby
<mensvaga> and then I need to do it once more, because I left off --prefix...
<mensvaga> !paste
<mensvaga> .paste
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<shevy> that is usually a good sign
mohits has joined #ruby
<shevy> because the RI format comes late in the compile stage. I think in 1.8.7 it's even the last step actually
seoaqua has quit [Quit: Leaving]
<mensvaga> yeah, I'm doing the latest 1.9.3 stable
<mensvaga> It finished without errors.
<bricker88> Here is my question: I am attempting to extend a class with a module, but it doesn't seem to be working… the Module is loaded (verified in the console) but this class method isn't being recognized for some raosn. https://gist.github.com/2883551
<bricker88> reason*
<mensvaga> I need to get the full list of compilation stuff somebody wants me to use now.
williamcotton_ has joined #ruby
williamcotton has quit [Ping timeout: 252 seconds]
williamcotton_ is now known as williamcotton
Guest85767 has quit [Ping timeout: 265 seconds]
<shevy> bricker88 I dont think that works
<shevy> I've never seen include used inside a method
jdripper has quit [Quit: Leaving.]
qwerxy has quit [Ping timeout: 240 seconds]
mrdtt has joined #ruby
polysics has joined #ruby
<bricker88> shevy: I was following this example: http://yehudakatz.com/2009/11/12/better-ruby-idioms/
mrdtt has quit [Client Quit]
abstrusenick has quit [Ping timeout: 248 seconds]
abstrusenick_ is now known as abstrusenick
<apeiros_> bricker88: must be something else that doesn't work. the pasted code certainly works
mrdtt has joined #ruby
<shevy> k but in that example even he uses different code
<shevy> send :include, InstanceMethods
<apeiros_> bricker88: I made your example reproducable: http://pastie.org/4039330
<apeiros_> send :include is stupid
<banisterfiend> shevy: he doesnt need send
<shevy> why does he do it then
<bricker88> apeiros_: Thanks!
zomb1e has quit [Remote host closed the connection]
<apeiros_> shevy: yehuda shows examples that are bad
stepnem has quit [Ping timeout: 260 seconds]
<shevy> yeah
zomb1e has joined #ruby
<apeiros_> and he goes on to show how to do it better
<shevy> I see
Solnse has quit []
<shevy> well actually
<shevy> apeiros_ showed how to do it better now
<shevy> :)
Karmaon has joined #ruby
maesbn has quit [Remote host closed the connection]
binaryplease has quit [Quit: WeeChat 0.3.7]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
ken_barber has quit [Remote host closed the connection]
<apeiros_> shevy: hm? I only stated that his pasted code was correct…
<bricker88> I guess this is something to do with the Rails stack then
yosinof has quit [Quit: Leaving]
fermion has quit [Quit: P]
<apeiros_> bricker88: I doubt it
affix has quit [Excess Flood]
<apeiros_> I've done a couple of acts_as_* that way and I haven't encountered a NameError
<bricker88> apeiros_: hm
<apeiros_> bricker88: do you use something like pry or irb_drop? if so, drop in right before your acts_as call
stepnem has joined #ruby
pawdro has quit [Quit: Konversation terminated!]
<apeiros_> then check .methods and ActsAsStandalone.instance_methods
<apeiros_> what could be a problem is rails' autoloading and auto-vivification of modules
affix has joined #ruby
bwlang_ has joined #ruby
<apeiros_> i.e., that your ActsAsStandalone seems loaded because the module is there, but actually it's only an empty shell, which rails auto-vivified
hukl has joined #ruby
pawdro has joined #ruby
chienpo has joined #ruby
<bricker88> apeiros_: Good idea, I will play around with it
peregrine81 has joined #ruby
a_a_g has quit [Ping timeout: 245 seconds]
a_a_g1 has joined #ruby
looopy has joined #ruby
weasels has joined #ruby
otters has quit [Quit: Page closed]
tayy has quit [Remote host closed the connection]
weasels has quit [Remote host closed the connection]
bwlang has quit [Ping timeout: 250 seconds]
bwlang_ is now known as bwlang
otters has joined #ruby
albemuth has joined #ruby
havenn has joined #ruby
fserb has joined #ruby
<bricker88> apeiros_: Just a quick check on it and it doesn't seem like the acts_as_standalone method is part of that module. Once I required the file, it was included as an instance method. So is it possible that Rails just isn't properly requiring the file?
<bricker88> (by "Rails" I mean "me")
dekroning has joined #ruby
<bricker88> hm, I have it autoloading a directory in /lib but I wonder if it loads files recursively…. let's find out, shall we
limed has quit [Ping timeout: 240 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<apeiros_> bricker88: possible.
<apeiros_> you can check $LOADED_FEATURES to check whether your file has been loaded at all
<apeiros_> do you have `module ActsAsStandalone` somewhere else in your code?
<apeiros_> if so, that'll stop rails from even loading your file
<apeiros_> (because the constant is defined at that point…)
akem has quit [Read error: Connection reset by peer]
user__ has joined #ruby
<bricker88> apeiros_: No, I don't have it anywhere. Using your suggestion, it appears as if the file isn't being loaded at all.
<bricker88> anywhere else*
jedmtnman1 has joined #ruby
<apeiros_> sadly, there's no const_added :(
<apeiros_> ah
<apeiros_> you could do: ActsAsStandalone = "Foo"
<apeiros_> now module ActsAsStandalone will cause a warning, telling you where it gets defined…
<apeiros_> actually even an exception :D
<bricker88> Good idea
bluenemo has quit [Remote host closed the connection]
null- has joined #ruby
jedmtnman has quit [Ping timeout: 252 seconds]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
Bosma has joined #ruby
<apeiros_> just do it early enough ;-) (e.g. on the top in config/application.rb)
n1x has quit [Quit: "off to reading/learning SICP"]
aruntomar has joined #ruby
bwlang_ has joined #ruby
<bricker88> No warning, I just think the file isn't getting loaded at all
ringotwo has joined #ruby
<aruntomar> i tried installing ruby on 4 different machines and still getting this error. git://gist.github.com/2883705.git
krusty_ar_ has quit [Read error: Connection reset by peer]
ryan0x2 has quit [Remote host closed the connection]
krusty_ar has joined #ruby
paul__ has joined #ruby
<aruntomar> i should have sent this link: https://gist.github.com/2883705 . by the way, i'm trying it with rvm and i've previous install ruby on many of my machines.
<bricker88> apeiros_: I think I just need to require the file in an initializer
bwlang has quit [Ping timeout: 248 seconds]
bwlang_ is now known as bwlang
<GeekOnCoffee> aruntomar: the website is down
pdtpatrick has joined #ruby
MrGando has joined #ruby
<aruntomar> GeekOnCoffee, oh..., ok.
<GeekOnCoffee> unfortunately I don't have a solution for you
one8zero has joined #ruby
<bricker88> apeiros_: yeah, I just added `require "acts_as_standalone"` to the top of the base controller class and it works fine now - Thanks for your help!
one8zero has quit [Remote host closed the connection]
one8zero has joined #ruby
<apeiros_> bricker88: yw, wonder where/why the module got created, though
tscolari has quit [Quit: Linkinus - http://linkinus.com]
milestone has joined #ruby
milestone has quit [Client Quit]
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
limed has joined #ruby
tscolari has joined #ruby
bbttxu has quit [Quit: bbttxu]
roolo has quit [Quit: Linkinus - http://linkinus.com]
williamcotton has quit [Quit: williamcotton]
limed has quit [Changing host]
limed has joined #ruby
williamcotton has joined #ruby
pawdro has quit [Ping timeout: 248 seconds]
abstrusenick has quit [Quit: abstrusenick]
waazzuup has joined #ruby
rosepichu has joined #ruby
Michagogo has joined #ruby
heeton1 has left #ruby [#ruby]
flagg0204 has quit [Quit: leaving]
rosepichu has left #ruby [#ruby]
peregrine81 has quit [Quit: Computer sleeping.]
tds has joined #ruby
hasrb has joined #ruby
Michagogo has left #ruby [#ruby]
mrdtt has quit [Quit: Leaving]
aquaranto has joined #ruby
Squarepy has joined #ruby
sbanwart has joined #ruby
whitequark has joined #ruby
josefig has joined #ruby
flagg0204 has joined #ruby
Konboi_ has joined #ruby
<josefig> Hello, I'm having problems to install ree with rvm on mac os x lion 10.7.2 http://pastebin.com/ta9gxwYC I tried to install the https://github.com/kennethreitz/osx-gcc-installer but it fails when tries to build and play
apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste >3 lines of text on gist.github.com || Rails is in #rubyonrails || Log: http://irclog.whitequark.org/ruby
d3c has joined #ruby
pu22l3r has quit [Remote host closed the connection]
Konboi has quit [Ping timeout: 244 seconds]
MrGando has quit [Quit: Computer has gone to sleep.]
null- has left #ruby [#ruby]
geekbri has quit [Remote host closed the connection]
jenrzzz-mac has joined #ruby
ajonsson has quit [Quit: ajonsson]
jrist is now known as jrist-gym
mucker has quit [Read error: Connection reset by peer]
Targen has joined #ruby
bosphorus_ has quit [Remote host closed the connection]
williamcotton_ has joined #ruby
williamcotton has quit [Ping timeout: 256 seconds]
williamcotton_ is now known as williamcotton
berserkr has joined #ruby
mucker has joined #ruby
hynkle has quit [Ping timeout: 244 seconds]
jrist-gym is now known as jrist
bbttxu has joined #ruby
fflush has joined #ruby
rushed has quit [Quit: rushed]
jenrzzz-mac has quit [Read error: Connection reset by peer]
whitequark has left #ruby [#ruby]
yaymukund has joined #ruby
Nahra has joined #ruby
yaymukund has left #ruby [#ruby]
<fbernier> Hi, is there an easy way to merge two elements of a class which includes "enumerable" ?
trend has joined #ruby
psycho_one has joined #ruby
<shevy> depends on the classes
<apeiros_> fbernier: depends on what class and what you understand under 'merge'
<apeiros_> fbernier: with arrays e.g. you probably want + or | or &
<apeiros_> with hashes, you probably want merge or merge!
<apeiros_> with ranges, I wouldn't know what you want…
jimeh has quit [Ping timeout: 244 seconds]
<shevy> fbernier, if you have two arrays, you can use + %w( abc def ) + %w( ghi jkl ) # => ["abc", "def", "ghi", "jkl"]
hynkle has joined #ruby
<fbernier> I'd like to merge two csv rows
<fbernier> together
<fbernier> without replacing existing keys
jenrzzz-mac has joined #ruby
<apeiros_> that's still open to interpretation
workmad3 has joined #ruby
DrShoggoth has joined #ruby
<apeiros_> there isn't a generic solution. I'd say from the API that you'd want to use each and []=
<fbernier> Maybe if I to_hash the two rows together and then merge! it'll do it
stephenjudkins has joined #ruby
codezombie has joined #ruby
<apeiros_> or convert both to hash, use merge, then convert to a csv row again
* apeiros_ too slow
mucker has quit [Quit: leaving]
eywu has quit [Quit: Leaving.]
minijupe has quit [Quit: minijupe]
Emmanuel_Chanel has joined #ruby
<fbernier> since i'll need to do that about 3 times in the whole csv, I think the second solution would do it.
<apeiros_> you can always write a method for it
Paul-Atreides has quit [Write error: Connection reset by peer]
Paul-Atreides has joined #ruby
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
jrist is now known as jrist-gymk
jrist-gymk is now known as jrist-gym
classix has quit [Ping timeout: 248 seconds]
Squarepy_ has joined #ruby
fflush has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
classix has joined #ruby
sparrovv has joined #ruby
<apeiros_> you could even add a method to CSV::Row
<fbernier> indeed
peregrine81 has joined #ruby
jcromartie has quit [Quit: jcromartie]
SegFaultAX|work2 has joined #ruby
Squarepy has quit [Ping timeout: 269 seconds]
theRoUS has quit [Ping timeout: 260 seconds]
fflush has joined #ruby
<fbernier> thanks apeiros_
<apeiros_> fbernier: seems you didn't really need the help after all ;-) but you're welcome
demian`_ has joined #ruby
nilg` has joined #ruby
Squarepy__ has joined #ruby
Bela-Lugosi has joined #ruby
Paul-Atreides has quit [Read error: Connection reset by peer]
Bela-Lugosi has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
Tricks has quit [Read error: Connection reset by peer]
jrajav has joined #ruby
Squarepy_ has quit [Ping timeout: 260 seconds]
maccosmo has joined #ruby
a_a_g1 has quit [Quit: Leaving.]
zomb1e_ has joined #ruby
Tricks has joined #ruby
siksia has quit [Ping timeout: 256 seconds]
<fbernier> works great :)
alexparker has joined #ruby
<alexparker> hello rubyists
shadoi has joined #ruby
mayankkohaley has quit [Ping timeout: 245 seconds]
ajonsson has joined #ruby
ajonsson has quit [Client Quit]
darthdeus has quit [Read error: Connection reset by peer]
<alexparker> so Ruby does not support overloading correct?
darthdeus has joined #ruby
milestone has joined #ruby
Jeff23 has joined #ruby
zomb1e has quit [Ping timeout: 260 seconds]
zomb1e_ is now known as zomb1e
Bela-Lugosi has quit [Read error: Connection reset by peer]
azm has quit [Read error: Connection reset by peer]
<apeiros_> alexparker: depends on your definition.
Bela-Lugosi has joined #ruby
Bela-Lugosi has joined #ruby
Bela-Lugosi has quit [Changing host]
Squarepy_ has joined #ruby
<fbernier> alexparker: correct but you can still define a method with a variable number of arguments
<Sou|cutter> ruby loads just the right amount
<apeiros_> but the proper definition of overloading is not supported in ruby. can't be supported.
<apeiros_> simply because it's not strictly typed
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
axl__ has joined #ruby
<apeiros_> also, due to the way ruby works, it's not really needed either.
axl__ has quit [Read error: Connection reset by peer]
one8zero_ has joined #ruby
fflush has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
siksia has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
<tds> is there a way to see if a method is defined in an object's class, but not the object's ancestors?
piotr_ has joined #ruby
<banisterfiend> tds: obj.method(name).owner
axl__ has joined #ruby
<tds> thanks banisterfiend
jenrzzz-mac has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
Jeff23 is now known as Jeffery
Jeffery is now known as Jeff23
Squarepy__ has quit [Ping timeout: 260 seconds]
waazzuup has quit [Quit: waazzuup]
theRoUS has joined #ruby
axl_ has quit [Ping timeout: 260 seconds]
axl__ is now known as axl_
Y_Ichiro has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
one8zero has quit [Ping timeout: 265 seconds]
one8zero_ is now known as one8zero
stephenjudkins has quit [Quit: stephenjudkins]
cdempsey has quit [Quit: Quitting!]
d34th4ck3r has joined #ruby
Jeff23 is now known as Cider
jenrzzz-mac has quit [Ping timeout: 248 seconds]
jimeh has joined #ruby
Emmanuel_Chanel has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
Bela-Lugosi has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
Squarepy__ has joined #ruby
Bela-Lugosi has joined #ruby
Bela-Lugosi has quit [Changing host]
Bela-Lugosi has joined #ruby
bwlang_ has joined #ruby
ktilcu has joined #ruby
fserb has quit [Quit: ttyl]
TheFuzzball is now known as Guest12323523423
locriani has joined #ruby
kenneth has joined #ruby
Guest12323523423 is now known as TheFuzzball
Squarepy_ has quit [Ping timeout: 260 seconds]
sako has joined #ruby
bwlang has quit [Ping timeout: 265 seconds]
bwlang_ is now known as bwlang
<sako> hey guys, where would an error in unicorn.rb after_fork hook be logged to?
<sako> /tmp/unicorn.stderr.log?
TheFuzzball is now known as luyang123
luckyruby has joined #ruby
heeton1 has joined #ruby
<heeton1> How do you check if a method is public or private?
<kenneth> heeton1: pry can tell you i believe
<heeton1> In the code I mean
eph3meral has joined #ruby
<kenneth> heeton1: if it's after a private statement it's private
luyang123 is now known as TheFuzzball
<heeton1> Yes.. but is there a way to programmatically check that?
<kenneth> or do you mean at runtime (retrospection)
<banisterfiend> heeton1: not easily
<banisterfiend> heeton1: you have to check private_methods, public_methods, protected_methods
<banisterfiend> and see to which one it belongs
<banisterfiend> that's what pry does, too
Vainoharhainen has quit [Read error: Connection reset by peer]
<shevy> heeton1 perhaps if you use .send
Vainoharhainen has joined #ruby
Squarepy_ has joined #ruby
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
Paul-Atreides has joined #ruby
Bela-Lugosi has quit [Read error: Connection reset by peer]
kpshek has joined #ruby
<heeton1> Cheers everyone
<heeton1> I'm doing this within method_added
one8zero has quit [Quit: one8zero]
<heeton1> and it seems it isn't actually in the lists of public/private methods yet at that point
<banisterfiend> heeton1: you could write a private? public? protected? class extension for Method/UnboundMethod
<banisterfiend> to make life easier
<heeton1> *it's an instance method
waazzuup has joined #ruby
nilg`` has joined #ruby
<heeton1> banisterfiend: not sure what you mean
one8zero has joined #ruby
nilg` has quit [Read error: Connection reset by peer]
<banisterfiend> heeton1: nevermind :)
chico_chicote has quit [Ping timeout: 245 seconds]
ringotwo has quit [Read error: Connection reset by peer]
ringotwo_ has joined #ruby
<Khyron320> Hey guys, i just need a bit of direction on how to parse data that looks like this:
<kenneth> hey all, so i've got a rack app which also launches an event machine as part of the config.ru (works fine). i'd like to use web sockets in the event machine and i'm having trouble figuring out how this should be done
Squarepy__ has quit [Ping timeout: 260 seconds]
<Khyron320> ((13333333333, 13339999999, 60), [1380000.0, None])
<Khyron320> im not sure where to start
<Khyron320> or what to google to find a good guide
marten has quit [Remote host closed the connection]
kirun has joined #ruby
BrianE has quit [Remote host closed the connection]
amar_key has quit [Remote host closed the connection]
relix has quit [Remote host closed the connection]
ziyadb has quit [Remote host closed the connection]
Spaceghostc2c has quit [Remote host closed the connection]
denysonique has quit [Remote host closed the connection]
notbrent has quit [Read error: Connection reset by peer]
DavidTiger has quit [Read error: Connection reset by peer]
cesario has quit [Read error: Connection reset by peer]
moeSeth has quit [Read error: Connection reset by peer]
srid has quit [Read error: Connection reset by peer]
randym has quit [Remote host closed the connection]
pkondzior has quit [Remote host closed the connection]
jrgifford has quit [Remote host closed the connection]
Dr4g has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
jhowarth has quit [Read error: Connection reset by peer]
kapowaz has quit [Read error: Connection reset by peer]
MoMo has quit [Read error: Connection reset by peer]
SeanTAllen has quit [Read error: Connection reset by peer]
aquaranto has quit [Remote host closed the connection]
<Khyron320> the value i would care about is 138000.0
patricksroberts has quit [Read error: Connection reset by peer]
blooberr has quit [Remote host closed the connection]
ctevie has quit [Remote host closed the connection]
dekz has quit [Remote host closed the connection]
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
MetaCosm has quit [Remote host closed the connection]
svnlto has quit [Remote host closed the connection]
si14 has quit [Remote host closed the connection]
Squarepy_ is now known as Squarepy
_marvin has quit [Remote host closed the connection]
amar_key has joined #ruby
NimeshNeema has quit [Remote host closed the connection]
dkannan has quit [Remote host closed the connection]
relix has joined #ruby
<kenneth> what i've got so far is this: fork. child launches event-machine on a random available port in a port range. parents waits for child to report port id thru a pipe, stuffs it into a global variable and launches the rack web app
lectrick has quit [Remote host closed the connection]
NotreDev has quit [Quit: NotreDev]
mayankkohaley has joined #ruby
NimeshNeema has joined #ruby
tvw has joined #ruby
<heeton1> banisterfiend: haha, we're crossing over on twitter too ;)
<kenneth> the web app process can respond to the html client with the port id of its sibling web socket process, which can then be connected to directly
<kenneth> does that make sense, or is it just plain insane?
dekz has joined #ruby
Resure has joined #ruby
jrgifford has joined #ruby
Dreamer3 has joined #ruby
jenrzzz-mac has joined #ruby
beneggett has joined #ruby
<dentarg> yay ruby-lang.org is alive again
ziyadb has joined #ruby
nilg``` has joined #ruby
digitalcakestudi has joined #ruby
nilg`` has quit [Ping timeout: 240 seconds]
moeSeth has joined #ruby
_marvin has joined #ruby
dekroning has quit [Ping timeout: 252 seconds]
kapowaz has joined #ruby
<fbernier> let's say ive got those 2 arrays:
<fbernier> [1, nil, 2, 3, nil] and [nil, nil, 2, nil, nil]
<fbernier> how could I merge the two to give this as a result:
mdw has joined #ruby
gregorg_taf has joined #ruby
werdnativ_ has joined #ruby
<fbernier> my bad let me start over
mayankkohaley_ has joined #ruby
<fbernier> [1, nil, 2, 3, nil] and [nil, 4, 2, nil, nil]
mneorr has joined #ruby
si14 has joined #ruby
<fbernier> and the result: [1, 4, 2, 3, nil]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
jimeh2 has joined #ruby
werdnativ has quit [Read error: Connection reset by peer]
werdnativ_ is now known as werdnativ
x0F_ is now known as x0F
gregorg has quit [Read error: Connection reset by peer]
mayankkohaley has quit [Ping timeout: 245 seconds]
icyfenix has quit [Ping timeout: 245 seconds]
mayankkohaley_ is now known as mayankkohaley
mneorr_ has joined #ruby
darthdeus has quit [Quit: Leaving...]
aruntomar has quit [Quit: Leaving]
Tricks has quit [Read error: Connection reset by peer]
<rakm> fbernier you want to push one array into the other and then use .uniq method
mneorr_ has quit [Remote host closed the connection]
jimeh has quit [Ping timeout: 245 seconds]
icyfenix has joined #ruby
nilg``` has quit [Ping timeout: 260 seconds]
BrianE has joined #ruby
fserb has joined #ruby
timonv has joined #ruby
aquaranto has joined #ruby
jhowarth has joined #ruby
SeanTAllen has joined #ruby
<carloslopes> rakm: hmm but i think that if he do this way, it will not return in the desired order
<carloslopes> d/do/does
iamjarvo has quit [Quit: Leaving.]
<yxhuvud> fbernier: what do you want to happen if the entries are different at a spot?
kaneda has joined #ruby
demian`_ has quit [Quit: demian`_]
<fbernier> yxhuvud: it will never happen
<banisterfiend> heeton1: oh that was you, hehe, cool.
kaneda is now known as Guest40233
<yxhuvud> a.zip(b) {|el_a, el_b| el_a || el_b}
jrajav has quit [Quit: burgermouth]
<carloslopes> fbernier: result = array1 + array2; result.sort
<carloslopes> fbernier: this works
linduxed has quit [Ping timeout: 252 seconds]
user__ has quit [Read error: Connection reset by peer]
<rakm> carloslopes ahh, it looks like he's using boolean logic to get the truthy value if there is one and nil if there is one. fbernier is that right?
linduxed has joined #ruby
<rakm> in that case, don't use .uniq
<rakm> or .sort
<carloslopes> fbernier: ops... result = array1 + array2; result.uniq!.sort!
<carloslopes> fbernier: this is correct :)
yoklov has joined #ruby
albemuth has quit [Ping timeout: 248 seconds]
ctevie has joined #ruby
ctevie has quit [Changing host]
ctevie has joined #ruby
ronniy has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Tricks has joined #ruby
allsystemsarego has joined #ruby
Eldariof-ru has quit []
<fbernier> carloslopes: id does not because it does not keep my nil elements
jrajav has joined #ruby
AxonetBE has joined #ruby
<carloslopes> fbernier: hmm yeah.. this is true :/
albemuth has joined #ruby
lectrick has joined #ruby
bosphorus has joined #ruby
cesario has joined #ruby
pkondzior has joined #ruby
<yxhuvud> oops. my solution should have been a.zip(b).map {|el_a, el_b| el_a || el_b}
tatsuya_o has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
Resure has quit [Remote host closed the connection]
bradhe has joined #ruby
indian has joined #ruby
banisterfiend has quit [Ping timeout: 252 seconds]
allsystemsarego has quit [Client Quit]
<bradhe> I keep seeing at '->' a la CoffeeScript. I've been writing Ruby for about a year and a half full time, is there a lexeme I'm unfamiliar with??
banisterfiend has joined #ruby
<eph3meral> bradhe, pastie.org ?
<eph3meral> bradhe, -> is not anything ruby related that I know of
bwlang has quit [Ping timeout: 265 seconds]
<lectrick> ok i think so much more could be done with the lowly 'require' call.
heeton1 has left #ruby [#ruby]
<shevy> lectrick like what... require cookies
<bradhe> eph3meral: this is from the Mongoid documentation: https://gist.github.com/da31dde8d26a5879614a
<eph3meral> oh yeah actually
weasels has joined #ruby
<eph3meral> i believe that's similar to a lambda
<eph3meral> or is a lambda/block type of some kind
fbernier has quit [Ping timeout: 260 seconds]
<eph3meral> anonymous proc maybe? i'm not positive
<lectrick> shevy: as much as I love cookies, are you talking about a real thing? lol
<eph3meral> I do think I've seen that before
otters has quit [Quit: Leaving]
<yxhuvud> eph3meral: it IS a lambda. using new syntax from 1.9.
hemanth has quit [Read error: Connection reset by peer]
<eph3meral> yxhuvud, ahh, ok cool
<shevy> lectrick well the require call, not sure what you mean with it :D
weasels has quit [Client Quit]
<eph3meral> yeah, nice, didn't know there was a shorthand for lambda :)
<eph3meral> knew about the new hash shorthand syntax
otters has joined #ruby
hemanth has joined #ruby
pawdro has joined #ruby
fbernier has joined #ruby
<lectrick> ->(lambdavars){ some code }
Spaceghostc2c has joined #ruby
<carloslopes> lectrick: ugly :(
Nahra has quit [Quit: leaving]
<lectrick> i'm ok with it
one8zero has quit [Quit: one8zero]
Axsuul has joined #ruby
iamjarvo has quit [Quit: Leaving.]
<carloslopes> lectrick: imho :)
<lectrick> anyway shevy, we have an issue in production where the same code is getting loaded twice. While this shouldn't cause problems normally (even if it's not supposed to happen due to how "require" works), it does in this case, sigh.
AxonetBE has quit [Quit: Leaving.]
MetaCosm has joined #ruby
Dr4g has joined #ruby
bglusman has quit [Remote host closed the connection]
<bradhe> I tink it looks nice
banisterfiend has quit [Read error: Connection reset by peer]
<lectrick> basically, the following code will be successful the first time you run it, but fail the second time: module Hashie; class Hash < Hash; end; end
bglusman has joined #ruby
<bradhe> moving the vars out of the block is kinda wonky though
<lectrick> The fix is to do module Hashie; class Hash < ::Hash; end; end but the problem is that something is loading the module def twice
MoMo has joined #ruby
sparrovv has quit [Ping timeout: 248 seconds]
<carloslopes> bradhe: maybe i need to familiarize with it :/
Criztian has quit [Read error: Operation timed out]
Cider has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
kirun has quit [Ping timeout: 260 seconds]
roadze has joined #ruby
banisterfiend has joined #ruby
Criztian has joined #ruby
<banisterfiend> lectrick: maybe u can replace your require with require File.expand_path(that_file)
kirun has joined #ruby
<banisterfiend> lectrick: it could be because the same file is being referred to in different ways, which causes rquire to think it's a different file
<banisterfiend> i.e require ".././hello" vs require "../hello"
<lectrick> Anyone ever try "ap $:" and see the ivar peculiarity there? (assuming you have awesome_print gem)
<lectrick> banisterfiend: since "require" only stores absolute paths, that should no longer matter, although it may have in prior Rubies
jrist-gym is now known as jrist
<lectrick> at least in 1.9.2, $" only contains absolute paths of files loaded so "require"s with different file paths should still resolve to the same thing
<banisterfiend> Yeah i've seen it/heard of it being an issue before
Yarou_ has quit [Quit: Leaving]
<banisterfiend> lectrick: yes it should, but i wouldn't put it passed require being buggy
<fbernier> Anyone know how I could turn [1, nil, 2, 3, nil] and [nil, 4, 2, nil, nil] into [1, 4, 2, 3, nil] ? Arrays will aleays be the same length and if both values exist they'll always be the same.
friskd has quit [Quit: friskd]
sepp2k has quit [Ping timeout: 252 seconds]
<banisterfiend> lectrick: and unfortunately we have to work around ruby bugs, my libraries are full of workarounds for ruby bugs
havenn has quit [Remote host closed the connection]
bglusman has quit [Ping timeout: 246 seconds]
sepp2k has joined #ruby
Ecco_ has joined #ruby
<Ecco_> Hi everyone
<Ecco_> I'm writing a test where I need to define a class
<banisterfiend> Ecco_: Class.new
friskd has joined #ruby
<Ecco_> how can I destroy the class afterward ?
davidw has joined #ruby
mensvaga has quit [Quit: Leaving.]
<banisterfiend> Ecco_: just assign the class to a local,and it'll die when it goes out of scope
<Ecco_> sweet
<Ecco_> so a = Class.new do
<Ecco_> end
<Ecco_> ?
davidw is now known as Guest72442
<lectrick> banisterfiend/shevy : a simple require enhancement: make it check a Hash, where the key is the hash of the absolute path to the file and the value is an array of the last modified time and any modules or classes defined in it
<banisterfiend> Ecco_: Yeah
<Ecco_> cool
<jrajav> fbernier: ([1, nil, 2, 3, nil] + [nil, 4, 2, nil, nil]).uniq
<banisterfiend> lectrick: require has been enhanced in the funnyfalcon patches
<jrajav> fbernier: => [1, nil, 2, 3, 4]
<banisterfiend> i'm not sure what approach he used
<yxhuvud> fbernier: I have already answered you.
<fbernier> jrajav: I'd like to keep the nil in place
<lectrick> and only do the require if the path hash doesn't exist, or if it exists but the file has been modified since it was recorded.
Paul-Atreides is now known as enroxorz
<jrajav> Yeah what didn't work about yxhuvud's method
NotreDev has joined #ruby
<lectrick> banisterfiend: i could look up what he did
<Ecco_> banisterfiend: Excellent, it worked
<Ecco_> thanks a lot :-)
<yxhuvud> (the second one. the first had a bug)
<banisterfiend> Ecco_: np
mdhopkins has joined #ruby
<Ecco_> I can't believe how fast you answered :-)
<fbernier> yxhuvud: I think I pinged time out and didn't see your second method
<Ecco_> I've been googling this for like 30 minutes before asking
<Ecco_> :-)
<yxhuvud> [22:10] <yxhuvud> oops. my solution should have been a.zip(b).map {|el_a, el_b| el_a || el_b}
<lectrick> Oh my other idea was to maintain a separate global hash of namespaced class/module names pointing to an array of all the files that opened that class or module, in the order they were loaded (although you could construct this info using the idea I already mentioned)
<banisterfiend> Ecco_: unfortunately google is not a very good natural langauge parser yet
psycho_one has quit [Ping timeout: 245 seconds]
<fbernier> yxhuvud: Cool I really didnt see this pass. Thank you I'll try this out
randym has joined #ruby
<Ecco_> indeed :-)
Konboi_ has quit [Remote host closed the connection]
minijupe has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
xaxisx has left #ruby [#ruby]
minijupe has left #ruby [#ruby]
<jrajav> Google needs to buy Wolfram Alpha :(
enroxorz is now known as enroxorz[soon-to
enroxorz[soon-to is now known as enroxorz[zzz]
xaxisx has joined #ruby
<fbernier> yxhuvud: Does exactly what it should. Thanks again.
nisstyre has joined #ruby
looopy has quit [Remote host closed the connection]
G has quit [Remote host closed the connection]
G has joined #ruby
rippa has quit [Ping timeout: 244 seconds]
enroxorz[zzz] is now known as enroxorz[0]
banisterfiend has quit [Read error: Connection reset by peer]
<lectrick> wait, modules can't inherit from other modules? how did I not know this till now?
enroxorz[0] has left #ruby ["Leaving"]
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
<shevy> lectrick modules are like crippled classes
<lectrick> indeed
d34th4ck3r has quit [Remote host closed the connection]
<shevy> I used to think modules are mostly used because you group things into the same namespace
banister_ has joined #ruby
<shevy> module Foo; class Bar
<shevy> then I saw that apeiros_ did class Foo; class Bar
fbernier has quit [Ping timeout: 246 seconds]
<shevy> when I asked him, he said the latter gave him more options
<shevy> so now, I still wonder why we even have modules at all in ruby ... :(
demian`_ has joined #ruby
anildigital_work has joined #ruby
<apeiros_> shevy: because classes can't be included
<banister_> shevy: mixins
<apeiros_> I prefer including over inheritance in most situations
<TTilus> my rule of thumb is to use include and composition
Amnesia has left #ruby [#ruby]
Bosma has quit [Ping timeout: 244 seconds]
<TTilus> deep inheritance hierarchies make things prittle
<TTilus> thats my experience
davidpk has joined #ruby
rmascarenhas has quit [Quit: leaving]
<apeiros_> inheritance also has many pitfalls
<apeiros_> does a Square inherit from a Rectangle or the Rectangle from the Square?
<jrajav> They both inherit from Shape, duh
mnaser has joined #ruby
AlbireoX`Laptop has joined #ruby
azm has quit [Ping timeout: 248 seconds]
robdodson has joined #ruby
zeromodulus has joined #ruby
kylemcgill has joined #ruby
<TTilus> but where doe dot inherit from?
<jrajav> That classic OO "debunking" example assumes that you have a reason to establish a hierarchy between Square and Rectangle (or the more standarad Circle and Ellipse) in the first place. It only shows that some people have trouble applying OO, or overapply it, not that OO is somehow fundamentally flawed
<apeiros_> from Apeiron, of course
<apeiros_> since everything derives from it
<TTilus> or is it jus zero-radius jrajav?
carloslopes has quit [Quit: Leaving]
<apeiros_> jrajav: agreed.
<jrajav> TTilus: Why have you assumed that the Shape generic needs more than one vertex, or any volume? ;)
robbyoconnor has joined #ruby
<TTilus> jrajav: good point
<TTilus> (pun intended)
<jrajav> Har har
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
tommyvyo_ is now known as tommyvyo
<TTilus> jrajav: oo is more than inheritance, actually its mostly other things than inheritance :)
<jrajav> I know. And OO isn't everything, either
<TTilus> and inheritance has good amount of legit uses
<jrajav> Inheritance tends to get the most attention since it's one of the main "business reasons" to use a language that implements OOP
awarner has quit [Remote host closed the connection]
notbrent has joined #ruby
<TTilus> from my experience i have noticed i (it might be just me) do more robust designs when doing less inheritance and more modules and composition
<jrajav> Yup yup
<jrajav> Lots of developers get too caught up in inheritance frenzy and forget about good decoupling
<jrajav> Kind of ironic
<TTilus> "business reason" is a smell in itself =D
sepp2k has quit [Remote host closed the connection]
<jrajav> "Code reuse" and such
stephenjudkins has joined #ruby
<kirun> Requirements change enough inside a project, never mind reusing any of it.
<TTilus> component based silver bulletization
<jrajav> That's the best buzzword I've heard all week
fserb has quit [Quit: ttyl]
<TTilus> thats so ninetees u know, last season
jrallison has quit [Ping timeout: 252 seconds]
ktilcu has quit [Quit: ktilcu]
hukl has quit [Ping timeout: 245 seconds]
<TTilus> now its silver cloud bullet paas html5zy nodeization
<bricker88> Sorry to crosspost but I didn't get any response in #ror… just having a strange issue with cucumber/controller inheritance that I'm hoping someone can shed some light on. https://gist.github.com/2884660 Maybe it's a question for the cucumber devs but I thought I'd ask anyways
jrallison has joined #ruby
<TTilus> bricker88: tried #cucumber already?
<bricker88> No, I will hop over there and ask as well
AlbireoX`Laptop has quit [Remote host closed the connection]
secondplanet has joined #ruby
<TTilus> bricker88: in case david or aslak is online
<jrajav> TTilus: I'm a scaling prototype-based mobile cloud silver bullet developer myself
rdesfo has joined #ruby
yxhuvud has quit [Ping timeout: 248 seconds]
<TTilus> jrajav: u forgot event-based nonblockingness
<Sigma00> and nosql
<TTilus> omg we forgot nosql!
<jrajav> no.sql
<jrajav> node.sql?
<jrajav> sql.io
<TTilus> norwegian sql?
<jrajav> Hey sql.io isn't registered :3
bfig has quit [Ping timeout: 245 seconds]
<TTilus> wtflol?!
one8zero has joined #ruby
<TTilus> that real?
<jrajav> It doesn't load at least. I have no idea how to check .io names
<jrajav> Godaddy doesn't have em :(
Gavilan has joined #ruby
sparrovv has joined #ruby
one8zero has quit [Client Quit]
mohits has quit [Read error: Connection reset by peer]
d3c has quit [Quit: Quit]
friskd has quit [Quit: friskd]
cbuxton has quit [Quit: Leaving.]
cbuxton has joined #ruby
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Guedes0 has joined #ruby
dmerrick_ has joined #ruby
jgrevich has quit [Read error: Connection reset by peer]
pawdro has quit [Ping timeout: 252 seconds]
jgrevich has joined #ruby
<robacarp> or, http://www.nic.io/
dotnull has joined #ruby
xaxisx has quit [Quit: xaxisx]
bglusman has joined #ruby
dmerrick has quit [Ping timeout: 245 seconds]
hynkle has quit [Quit: hynkle]
banseljaj is now known as imami|afk
dmerrick_ has quit [Ping timeout: 246 seconds]
<Khyron320> is there a way to just dump any output to a string?
<Khyron320> .to_s does not work for me and i am not sure why
<lectrick> .inspect on it, or .to_s on it?
<robacarp> Khyron320: you can try .inspect
<lectrick> puts object.inspect
<lectrick> or p object
<lectrick> or if you have the awesome_print gem, "ap object" is pretty nice
<Khyron320> Sweet
<Khyron320> that did it
dcolebatch has joined #ruby
<Khyron320> i was getting pretty frustraighted i was about to do some really shady stuff dumping it to standard out then reading it back intoa string
fserb has joined #ruby
one8zero has joined #ruby
dotnull has quit [Remote host closed the connection]
swistak35 has joined #ruby
jcromartie has joined #ruby
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
jedmtnman has joined #ruby
fserb has quit [Client Quit]
thecreators has quit [Quit: thecreators]
thecreators has joined #ruby
jedmtnman1 has quit [Ping timeout: 244 seconds]
ph^ has quit [Remote host closed the connection]
internet_user has quit [Remote host closed the connection]
dkannan has joined #ruby
srid has joined #ruby
wereHamster has quit [Ping timeout: 260 seconds]
Squarepy has quit [Quit: Leaving]
libertyprime has quit [Quit: Lost terminal]
fearoffish has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Guest40233 has quit [Read error: Connection reset by peer]
lorandi has quit [Quit: Leaving]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
libertyprime has joined #ruby
libertyprime has quit [Client Quit]
Guest40233 has joined #ruby
Guest72442 has quit [Ping timeout: 260 seconds]
Tricks has quit [Read error: Connection reset by peer]
libertyprime has joined #ruby
berserkr has quit [Quit: Leaving.]
mdw__ has joined #ruby
mdw has quit [Read error: Connection reset by peer]
fserb has joined #ruby
hakunin has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
axl__ has joined #ruby
vlad_starkov has joined #ruby
Morkel has quit [Quit: Morkel]
stephenjudkins has quit [Quit: stephenjudkins]
tscolari has quit [Quit: Linkinus - http://linkinus.com]
PaciFisT has quit [Quit: Leaving.]
iamjarvo has joined #ruby
Tricks has joined #ruby
axl_ has quit [Ping timeout: 265 seconds]
axl__ is now known as axl_
alexparker has left #ruby [#ruby]
vlad_starkov has quit [Read error: Connection reset by peer]
mneorr has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
<lectrick> Is the "caller" array the same as the "backtrace" array available in a rescue?
fserb has quit [Quit: ttyl]
<apeiros_> I think so, yes
<apeiros_> you can try it
timonv has quit [Remote host closed the connection]
deryl has quit [Quit: Time To Go, So Sad!]
<apeiros_> begin; p *caller; raise; rescue; p *$!.backtrace; end
Bosma has joined #ruby
ZachBeta has joined #ruby
xaxisx has joined #ruby
xaxisx has left #ruby [#ruby]
jenrzzz-mac has joined #ruby
philips has quit [Read error: Operation timed out]
sam113101 has quit [Ping timeout: 245 seconds]
sparrovv has quit [Ping timeout: 245 seconds]
deryl has joined #ruby
addi is now known as Pele_Parted
philips has joined #ruby
robdodson has quit [Quit: robdodson]
stephenjudkins has joined #ruby
dv_ has quit [Read error: Connection reset by peer]
Pele_Parted is now known as addi
looopy has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
Sgeo has joined #ruby
workmad3 has joined #ruby
jedmtnman1 has joined #ruby
wangr has quit [Ping timeout: 244 seconds]
Foxandxss has joined #ruby
dfr|work has joined #ruby
dv_ has joined #ruby
kirun_ has joined #ruby
jedmtnman has quit [Ping timeout: 245 seconds]
luxurymode has quit [Quit: Computer has gone to sleep.]
banister_ has joined #ruby
kirun has quit [Ping timeout: 272 seconds]
Karmaon has quit [Quit: WeeChat 0.3.8-rc2]
chimkan_ has joined #ruby
Karmaon has joined #ruby
wvms has joined #ruby
linusoleander has joined #ruby
chimkan___ has joined #ruby
chimkan_ has quit [Ping timeout: 260 seconds]
bbttxu has quit [Quit: bbttxu]
chimkan___ has quit [Client Quit]
sam113101 has joined #ruby
berserkr has joined #ruby
one8zero has quit [Quit: one8zero]
cobragoat has joined #ruby
<cobragoat> is there an irc channel for godrb?
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
nricciar has joined #ruby
NotreDev has quit [Quit: NotreDev]
brasten has quit [Quit: brasten]
brasten has joined #ruby
jenrzzz-mac has quit [Ping timeout: 244 seconds]
joshman_ has joined #ruby
tectonic has joined #ruby
bradhe has quit [Remote host closed the connection]
fserb has joined #ruby
gmci has quit [Read error: No route to host]
Boohbah has joined #ruby
apok_ has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
Boohbah_ has joined #ruby
jenrzzz-mac has joined #ruby
jrajav has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Boohbah_ has quit [Remote host closed the connection]
gmci has joined #ruby
jrajav has joined #ruby
dv310p3r has quit [Ping timeout: 244 seconds]
moshee has quit [Ping timeout: 244 seconds]
Emmanuel_Chanel has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
billiamii has quit []
balki_ has joined #ruby
alanp has quit [Read error: Connection reset by peer]
balki has quit [Read error: Connection reset by peer]
noganex has quit [Ping timeout: 252 seconds]
fayimora has joined #ruby
siksia has quit [Ping timeout: 256 seconds]
noganex has joined #ruby
mnaser has quit [Ping timeout: 244 seconds]
okc_frienemy has quit [Ping timeout: 256 seconds]
zomb1e has quit [Ping timeout: 260 seconds]
Guedes has quit [Disconnected by services]
Guedes0 is now known as Guedes
Guedes has quit [Changing host]
Guedes has joined #ruby
zomb1e has joined #ruby
siksia has joined #ruby
Tomasso has quit [Ping timeout: 248 seconds]
bigoldrock has quit [Quit: Leaving.]
mrsolo has quit [Quit: This computer has gone to sleep]
olrrai has joined #ruby
<olrrai> hi!
bigoldrock has joined #ruby
libertyprime has quit [Quit: Lost terminal]
peregrine81 has quit [Quit: Computer sleeping.]
MasterIdler has quit [Read error: Operation timed out]
dentarg has left #ruby [#ruby]
libertyprime has joined #ruby
winfreak has joined #ruby
carlyle has quit [Remote host closed the connection]
<lectrick> apeiros_: How do I find out the class name of the class instance that called out to my method in my class?
<winfreak> hello!
libertyprime has quit [Client Quit]
mrsolo has joined #ruby
mdw__ has quit [Remote host closed the connection]
bluenemo has quit [Ping timeout: 260 seconds]
trend has quit [Read error: Connection reset by peer]
trend has joined #ruby
KL-7 has joined #ruby
winfreak has left #ruby [#ruby]
drizz has quit [Ping timeout: 245 seconds]
tommyblue has quit [Ping timeout: 250 seconds]
telling has quit [Remote host closed the connection]
<Hanmac> lectrick show me a pastie what you want
libertyprime has joined #ruby
rdesfo has left #ruby [#ruby]
heftig has joined #ruby
sonkei has quit [Quit: WeeChat 0.3.7]
telling has joined #ruby
[Neurotic] has joined #ruby
tommyblue has joined #ruby
<lectrick> Hanmac: Someclass#dosomething calls Otherclass#detectcaller. I want detect to return 'Someclass'
<lectrick> ah I mean I want detectcaller to return 'Someclass'
fantazo has joined #ruby
<lectrick> fairly straightforward in theory
brasten has quit [Quit: brasten]
dax has left #ruby [#ruby]
chson has quit [Remote host closed the connection]
telling has quit [Remote host closed the connection]
zomgbie has joined #ruby
hadees has joined #ruby
sonkei has joined #ruby
telling has joined #ruby
wvms has left #ruby [#ruby]
<banister_> lectrick: it should be i caller()
<banister_> in*
<banister_> lectrick: failing that, try: https://github.com/banister/binding_of_caller
tommyblue has quit [Ping timeout: 260 seconds]
tayy has joined #ruby
Defusal_ has joined #ruby
Defusal_ has joined #ruby
bluenemo has joined #ruby
brasten has joined #ruby
Defusal has quit [Ping timeout: 252 seconds]
telling has quit [Ping timeout: 265 seconds]
libertyprime has quit [Quit: Lost terminal]
td123 has quit [Quit: WeeChat 0.3.8]
telling has joined #ruby
thecreators has quit [Quit: thecreators]
libertyprime has joined #ruby
bglusman has quit [Remote host closed the connection]
<lectrick> banister_: caller just returns an array equivalent to a stack trace
bglusman has joined #ruby
<lectrick> banister_: that binding_of_caller looks very nice, almost like it should be stock ruby, although you don't recommend it for production apps :O
nlc has quit [Remote host closed the connection]
tewecske has quit [Quit: Leaving.]
<banister_> lectrick: https://gist.github.com/2885303
tommyblue has joined #ruby
libertyprime has quit [Client Quit]
libertyprime has joined #ruby
<banister_> lectrick: it should not be part of stock ruby :)
<banister_> lectrick: it makes code extremely hard to refactor, when you have a method that relies on its caller being just so
telling has quit [Ping timeout: 252 seconds]
<banister_> what if u want to refactor the call chain? it can break that method. I've had this problem myself when using it, it makes life hard :)
Chryson has joined #ruby
kirun_ has quit [Quit: Client exiting]
<lectrick> banister_: So basically it adds too much coupling potential? :)
<banister_> lectrick: pry-stack_explorer had to be designed very carefully to avoid that problem
okc_frienemy has joined #ruby
<banister_> lectrick: Yeah
<lectrick> banister_: interesting re: pry
bglusman has quit [Ping timeout: 245 seconds]
polysics has quit [Remote host closed the connection]
<banister_> lectrick: binding_of_caller is what drives this: https://github.com/pry/pry-stack_explorer
<banister_> so it's very useful for debugging
waazzuup has quit [Quit: waazzuup]
<banister_> but i probably wouldnt use it in real code outside of debugging
Guedes has quit [Quit: Saindo]
telling has joined #ruby
tommyblue has quit [Quit: Coyote finally caught me]
okc_frie` has joined #ruby
blacktulip has quit [Remote host closed the connection]
zomgbie has quit [Ping timeout: 244 seconds]
cousine has joined #ruby
libertyprime has quit [Client Quit]
libertyprime has joined #ruby
cousine has quit [Remote host closed the connection]
okc_frienemy has quit [Ping timeout: 240 seconds]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
iocor has quit [Quit: Computer has gone to sleep.]
telling has quit [Ping timeout: 245 seconds]
CannedCorn has joined #ruby
shadoi has quit [Remote host closed the connection]
vandemar has quit [Ping timeout: 260 seconds]
shadoi has joined #ruby
sridatta has joined #ruby
TrahDivad has quit [Quit: TrahDivad]
tommyvyo has joined #ruby
<sridatta> hey all, i'm using EventMachine's `start_tls` to initiate an SSL client handshake but my server outputs this error: "SSL23_GET_CLIENT_HELLO:unknown protocol". Other language clients work. any clues?
Yarou has joined #ruby
Yarou has joined #ruby
Yarou has quit [Changing host]
codezombie has quit [Quit: Linkinus - http://linkinus.com]
wvms has joined #ruby
CannedCorn has quit [Client Quit]
telling has joined #ruby
telling has quit [Changing host]
telling has joined #ruby
waazzuup has joined #ruby
DavidTiger has joined #ruby
flagg0204 has quit [Quit: leaving]
peregrine81 has joined #ruby
adeponte has quit [Remote host closed the connection]
jenrzzz-mac has joined #ruby
chico_chicote has joined #ruby
flagg0204 has joined #ruby
mvangala_mac has joined #ruby
flagg0204 has quit [Client Quit]
fserb has quit [Quit: ttyl]
bluenemo has quit [Remote host closed the connection]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
demet8 has joined #ruby
Yarou has quit [Quit: Leaving]
bluenemo has quit [Client Quit]
Yarou has joined #ruby
Yarou has quit [Changing host]
Yarou has joined #ruby
joaoqalves has joined #ruby
zomb1e has quit [Quit: I'm tired. Real tired.]
uris has quit [Quit: leaving]
siksia has quit [Ping timeout: 256 seconds]
chienpo has quit [Quit: Leaving.]
flagg0204 has joined #ruby
trend has quit [Read error: Connection reset by peer]
trend has joined #ruby
ank has quit [Ping timeout: 260 seconds]
milestone has quit [Quit: milestone]
test34 has joined #ruby
kpshek has quit []
lkba has quit [Ping timeout: 245 seconds]
tatsuya_o has quit [Remote host closed the connection]
aantix has joined #ruby
siksia has joined #ruby
josefig has quit [Quit: Textual app]
test34- has quit [Ping timeout: 245 seconds]
theRoUS_ has quit [Ping timeout: 245 seconds]
IrishGringo has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725]]
aantix has quit [Read error: Connection reset by peer]
oooPaul has quit [Quit: Ciao for now!]
sabooky has joined #ruby
ank has joined #ruby
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
ank has quit [Remote host closed the connection]
<sabooky> If I have an erb template say... template = ERB.new "The value of x is: <%= x %> and y is: <%= y %>" how can I list the variables defined in that template? ex ["x", "y"]
<sabooky> If ERB doesn't support this, do you guys know of a good templating language that does?
aantix has joined #ruby
IrishGringo has joined #ruby
<sabooky> Writing a command line tool that allows the user to pass in values and to create files based on the templates.. want to error out to the user when he doesn't provide values.. and want to also be able to lookup the required values for a template and show that back to the user.
mikepack has quit [Remote host closed the connection]
khakimov has joined #ruby
minijupe has joined #ruby
kenneth has quit [Ping timeout: 250 seconds]
<heftig> execute the template with a Binding where self is a Blank Slate that has method_missing
brianpWins has quit [Quit: brianpWins]
minijupe has quit [Client Quit]
<heftig> have method_missing record which calls it sees
davidpk has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<sabooky> not sure how to use binding
<heftig> or instance_exec or whatever
<heftig> point is that "x" will call self#x when x is not a defined local variable
fivetwentysix has joined #ruby
tvw has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
xaq has quit [Remote host closed the connection]
<sabooky> trying to do it.. quickly reading through the documentation (never used erb before)
nari has joined #ruby
<sabooky> heftig: I think I got it..
<sabooky> I created a small class with 2 methods, get_binding which returns binding
<sabooky> And a method missing which puts the method that was called
<sabooky> just for testing atm..
<sabooky> is that what you meant?
vandemar has joined #ruby
kenneth has joined #ruby
billiamii has joined #ruby
<heftig> probably. i never really delved into ERB myself
zenom has joined #ruby
<sabooky> heftig: seems to work pretty good
<heftig> nice.
<sabooky> Not 100% sure how to do it with instance_exec
<sabooky> could you give me a quick example of using that
<heftig> foo.instance_exec { ... } runs the block with self set to foo
<sabooky> oh, so I have to add method_missing to the template object
<heftig> not sure what you mean
<zenom> I have a file that has columns, but also has spaces, no quotes or commas. https://gist.github.com/c132bfa393bf57599f3b what is the best way to split that? Only way I could think of (which is a little more painful) is look for rows that start with letters and join them, then leave the number /date columns alone.
geekfactor has quit [Remote host closed the connection]
jrallison has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<zenom> There is no fixed width on the columns either.
fayimora has quit [Read error: Connection reset by peer]
fayimora has joined #ruby
kevinbond has joined #ruby
<heftig> zenom: always Text Date Date Text Number Number?
thecreators has joined #ruby
<zenom> heftig: yes
mnaser has quit [Quit: Computer has gone to sleep.]
<heftig> zenom: %r{(.+?)\s+(\d?\d/\d?\d/\d{4})\s+(\d?\d/\d?\d/\d{4})\s+(.+?)\s+(\d+)\s+(\d+)}
<heftig> something like this, maybe
ryanf has joined #ruby
<sabooky> heftig: ok, one last check.. I think I understand both now.. could you review if this makes sense: template = ERB.new "The value of x is: <%= x %> and z is: <%= z %>"; def template.method_missing(x) puts x end; template.instance_exec(template) {|t| t.run(binding)}
fbernier has joined #ruby
<sabooky> although.. hmm I probably don't want to override method_missing on the template object.. since that might be destructive
Sheehan has quit [Quit: Sheehan]
<zenom> heftig: would I use match with that?
nlc has joined #ruby
<sabooky> heftig: hmm.. I actually need to head out of the office.. thanks for you help
<heftig> zenom: yes.
<heftig> sabooky: use another object with method_missing on it
libertyprime has quit [Quit: Lost terminal]
<heftig> not the template object itself
<zenom> heftig: I think that will work, thanks a ton.
<sabooky> heftig: gotcha, thanks!
<zenom> Haven't had to do much stuff with things like that
nat2610 has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
<heftig> sabooky: class CallPrinter < BasicObject; def method_missing(meth, *args, &blk); puts meth; end; end
libertyprime has joined #ruby
ringotwo_ has quit [Ping timeout: 252 seconds]
<heftig> ah whoops
<heftig> that won't work
<heftig> needs to be ::Kernel.puts meth
Liothen_ has quit [Remote host closed the connection]
<bricker88> There has to be a better way to do this, right? ["ModuleName", attrib.to_s.singularize.camelize].join("::").constantize
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
xaxisx has joined #ruby
theRoUS has joined #ruby
peregrine81 has quit [Quit: Goodbye.]
<heftig> sabooky: class CallPrinter < BasicObject; def method_missing(meth, *args, &blk); ::Kernel.puts meth; end; def __binding; ::Kernel.binding; end; end
<heftig> sabooky: template.run(CallPrinter.new.__binding)
sako has quit [Ping timeout: 250 seconds]
chson has joined #ruby
<heftig> bricker88: try #ror
zomgbie has joined #ruby
piotr_ has quit [Ping timeout: 260 seconds]
maccosmo_ has joined #ruby
<heftig> bricker88: what does attrib look like?
KL-7 has quit [Quit: Leaving]
maccosmo has quit [Ping timeout: 240 seconds]
maccosmo_ is now known as maccosmo