Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<RubyPanther> iboB: read again what I said above. You use coerce so that you have something like Foo.new(7)/x which you can then decide is not valid.
pablo_ joined #ruby
<iboB> RubyPanther i don't think i get it, how can this help?
ujihisa joined #ruby
pabloh joined #ruby
<RubyPanther> iboB: Have some faith that it can, and read it a few times
<RubyPanther> def /(scalar); #am I valid? end
<iboB> er... vector/scalar is always valid
Aaaarg joined #ruby
<iboB> whereas scalar/vector is never valid
<iboB> can i determine which was on which side of the operator in coerce?
Asher joined #ruby
<RubyPanther> Are you even sure that / is an appropriate operator?
<iboB> RubyPanther, yes vectors can be divided by scalars
<iboB> it's a valid mathematical notion
<iboB> so / seems quite appropriate
<RubyPanther> I don't think that it is a valid notion that you can / by something where the values are different types of things that can't be converted
wyhaines joined #ruby
<iboB> see
<iboB> the / operator is quite popular with vectors
<iboB> and vector/vector is also ivalid
<RubyPanther> iboB: if you click the "toggle source" there, you can see that it simply checks the type in the / method
Draco_ joined #ruby
<iboB> RubyPanther yes, and throws if the type is a vector :)
<RubyPanther> ...
<iboB> it's an operator that "/ by something where the values are different types of things that can't be converted"
_debo joined #ruby
wyhaines_ joined #ruby
BiHi joined #ruby
<hacim> if File.exists?(dir) tells me if it exists, how do I tell if it doesn't exist?
<hacim> if ! File.exists?(dir) -- ?
<TheMoonMaster> !File.exists?(dir)
stephenjudkins joined #ruby
<hacim> TheMoonMaster: seems like 'if ! File.exists?(dir) works too, why is your way better?
<TheMoonMaster> It's the same thing.
<deryl> its the same thing
<samuelkadolph> unless File.exists?(dir)
<hacim> thanks
Kichael joined #ruby
bwlang joined #ruby
Behi joined #ruby
funktronic_ joined #ruby
jfredett joined #ruby
sebastorama joined #ruby
funktronic_ left #ruby
yekta joined #ruby
albemuth joined #ruby
<cbuxton> has anyone used Ruote?
jfredett joined #ruby
craigglennie_ joined #ruby
jtdowney joined #ruby
craigglennie_ joined #ruby
ilyam joined #ruby
philcrissman joined #ruby
pen_isident joined #ruby
mickn joined #ruby
otakutomo joined #ruby
<thomasfedb> Hey, is it possible to store objects in a way that they can be brought back even if their class is missing?
robotmay joined #ruby
<samuelkadolph> thomasfedb: Yes and no. While you can remove the constant of a class, the class won't be GCed until all instances are gone since they hold references to the class.
Mohan joined #ruby
Mohan joined #ruby
<thomasfedb> samuelkadolph, I was thinking more along the lines of instantiating an object, storing it in a database, and then reviving it in a context that may not have the original class available (or perhaps with a changed version of the class that I don't want it to use).
ksinkar joined #ruby
<samuelkadolph> Not without keeping a reference to the class aroudn
<samuelkadolph> around*
cdepue joined #ruby
<thomasfedb> samuelkadolph, ok.
<thomasfedb> samuelkadolph, is there a way to store classes in, say, redis?
<samuelkadolph> I don't know how well classes can be serialized
<thomasfedb> samuelkadolph, hmmm. I'm beginning to realize that the problem I'm trying to solve is hard.
<thomasfedb> =P
<banister`sleep> thomasfedb: maybe you want to look at maglev
<banister`sleep> they take object persistence seriously iirc
<thomasfedb> banister`sleep, I'll have a look, thanks. Although I'm trying to make this a tool that anybody can use.
<thomasfedb> *looks*
revans joined #ruby
<banister`sleep> thomasfedb: there would be so many edge cases doing what u want, it's not easy. But you can look at something like sourcify
<thomasfedb> banister`sleep, i think perhaps I need to try for a different solution. Thanks for the advice though.
ilyam joined #ruby
<banister`sleep> thomasfedb: if i was to serialize an object the way you're talking about i'd dump the source for the methods and so on
jbhewitt joined #ruby
<banister`sleep> thomasfedb: and ivars that have procs
flock joined #ruby
<flock> hey crew, I've been trying figure out how to count days for a bunch of code I am putting together
<shevy> monday tuesday wednesday
<flock> I have an array of days (just integers), say 60 of them, and I have an array of Times that dont quite account for every past of the 60 days
minijupe joined #ruby
<flock> so I want to increment members in my array of 60 integer days based on whether they exist in my array of Time objects
robyurkowski joined #ruby
<shevy> can you upload code somewhere?
<any-key> days.map { |day| <if date in Times> then day += 1 end }
<any-key> like that?
<flock> so I basically loop through this array of Time, and need to figure out a way to calculate a (rounded) amount of days ago that was for and increment by one
bbttxu joined #ruby
<any-key> you can subtract date objects to get the number of elapsed days
<flock> any-key: thats a step in the right direction, I was hoping to not have to loop through both every time (eg, the algorithm complexity of your solution is N=(days * Times_array))
<flock> any-key: I was thinking using strftime and then to_i, but was wondering if there is a sexier way to do it :)
<any-key> if you're iterating and checking if something exists in an array my way is as good as any
Backsorry joined #ruby
<flock> any-key: only I would like to loop just one of the arrays as the second one is static (the days0
<flock> its for a time series graph
<any-key> what do you mean by static?
<any-key> give me a small example of the second array
<flock> say I want to show two months worth of data aggregated per day, so I have graph_data = Array.new(61,0)
Syzygy_ joined #ruby
<flock> I then grab a bunch of record from the db, and want to use their created_at (its Rails) timestamp to increment the appropriate day in my graph_data array
<flock> eg, graph_data[28]++
<any-key> oh hey
<any-key> funny you should mention this
<flock> the problem is, how do I find out how many days (in numberic) was created_at?
<any-key> I wrote code that does this for generating traffic patterns...
<shevy> what's with the ++
<any-key> lol
<flock> shevy: remainder of the C days :)
<flock> any-key: mind sharing some snippets of code with me? I am wondering for a clearer way to do things
closedbracket joined #ruby
<any-key> flock: my way isn't amazing but lemme see if I can pastebin a section for you...
<flock> sweet!
<flock> thanks
<any-key> it's kind of unrelated but close enough I guess
<any-key> lines 8-10 are *not* clever and I am ashamed of them
<any-key> you end up with an array of hours/weekdays/days with 1 being added to every slot that corresponds to a date from the DB
eignerchris joined #ruby
<shevy> let me look at what you are ashamed of
<any-key> nooooo :(
<shevy> pffft
<shevy> it is readable man
<shevy> change daily = [] to d = []
<shevy> :>
<any-key> I feel like if(foo) then 1 else 0 end is lame
<any-key> surely there's a better way to do that
<shevy> nah
<any-key> flock: does that help at all?
<shevy> it is absolutely readable
<flock> any-key: hacking in inspiration already :P
<any-key> it sounds like you're trying to draw some pretty time graphs like I am :)
<flock> hehe, yeah
<flock> geckoboard ftw
<thomasfedb> banister`sleep, wow. Maglev is really something...
<shevy> what is Maglev
sdavis joined #ruby
<banister`sleep> shevy: lmgtfy
<shevy> why do we need maglev
iamjarvo joined #ruby
<banister`sleep> thomasfedb: it's based on smalltalk and is actually written by the guy who created seaside iirc
dbgster joined #ruby
<banister`sleep> RubyPanther: do u miss #ruby-lang
<RubyPanther> banister`sleep: don't come here to bully people, it is lame and reflects on your character.
<flock> any-key: here's what I got: http://pastebin.com/jKK7wGyM
<banister`sleep> RubyPanther: im not bullying you im asking if u miss #ruby-lang now you've been banned
rook_flood joined #ruby
nari joined #ruby
<thomasfedb> banister`sleep, what is the difference between #ruby and #ruby-lang ?
<RubyPanther> You joined a clique, yay for you.
<banister`sleep> thomasfedb: RubyPanter isn't on #ruby-lang
<banister`sleep> :P
<thomasfedb> eh.
<thomasfedb> sounds dull
<banister`sleep> thomasfedb: but aside from that, the people there are generally smarter and the quality of help is higher
<banister`sleep> thomasfedb: it's also the official ruby channel
sebastor_ joined #ruby
<RubyPanther> This is personal harassment and I formally state that I find it offensive and unbecoming of a professional in a public forum.
sebastor_ joined #ruby
<deryl> who the hell are you? a politician?
<shevy> man don't insult him!
<deryl> i take it you haven't been on IRC long enough to grow a thick skin
<thomasfedb> RubyPanther, I think you'd best just make as little fuss as you can.
<RubyPanther> You don't have to be a politician to see Good and Bad and ask people to be Good.
zenergi joined #ruby
<deryl> yeah well this aint church
<any-key> shit did everyone just pull out their guns?
<thomasfedb> banister`sleep, you're not being particularly polite however.
<shevy> good people are in church?
* any-key fumbles around, can't find his gun :\
<thomasfedb> deryl, what in heck has church got to do with goodness?
<RubyPanther> It isn't church, but why would that mean it is okay to harass, but not to ask somebody not to? How is having an opinion that it is bad somehow worse than the bullying?
<any-key> It wasn't bullying
<any-key> it was just rude
<any-key> but I don't care either way
<RubyPanther> It is a very strange sort of censorship, where you'll allowed to be intentionally offensive but not to complain about it.
<deryl> becaue all you every do is bitch and whine and bring drama. you have about the thinnest skin of anyone I have ever met on IRC or IRL.
<thomasfedb> RubyPanther, just cool it man, you're not doing yourself any service.
<shevy> whoa now comparing IRC to IRL ...
<samuelkadolph> Wait, RubyPanther got banned from #ruby-lang?
<any-key> flock: that looks decent
<shevy> and fowl!
<RubyPanther> thomasfedb: I never claimed it was my intent to do myself some "service" by being submissive when treated poorly. I don't see that as a service.
<banister`sleep> samuelkadolph: fo shizzle, one of the lulziest things i've witnessed in a while. He was accusing zenspider of being a "bully" ---> ban
<shevy> but he is playing skyrim anyway so it doesn't matter... that game should be removed
<samuelkadolph> Hmm
<shevy> hehe
<samuelkadolph> Must check my logs
<samuelkadolph> That sounds hilarious
<RubyPanther> samuelkadolph: Yes, I got banned because zenspider was calling me names, I called him a bully, and he proved it with a ban.
<samuelkadolph> QQ more plz
<flock> any-key: thanks mate, it seems to do the trick too :P
<RubyPanther> and now banister is following me to other channels to bully/harass me about it
wyhaines joined #ruby
<thomasfedb> RubyPanther, I never claimed that you made such claim.
<samuelkadolph> You can't follow people on freenode, everyone has +i
<any-key> flock: no problem! Good timing, that code I gave you was very fresh :P
geekfactor joined #ruby
<RubyPanther> I mean if that is the level of professional discourse in the Ruby, that is pathetic.
<flock> any-key: sweet mate, was just telling someone here how I got inspired :)
<shevy> who
<shevy> your cat?
jrun joined #ruby
<thomasfedb> RubyPanther, well you're free to leave.
<any-key> "ChanServ(ChanServ@services.)- [#ruby-lang] Ruby - The programming language, http://ruby-lang.org | Ruby 1.9.2 is out"
<shevy> thomasfedb and he is free to stay too?
<any-key> hehe
<RubyPanther> thomasfedb: so are they, I don't try to censor people. They can leave if they don't like me, they aren't somehow compelled to exclude people they have a personal dislike for.
<shevy> oh... they are lagging in version ...
<thomasfedb> shevy, yeah, he seems happy here.
<any-key> RubyPanther: just shut the fuck up nobody is censoring you
<shevy> no wait ... the title is Ruby 1.9.3p0
<banister`sleep> RubyPanther: i didnt come here to bully you, just to gloat a bit. and ive finished that now. Now im just here to watch the normal RubyPanther drama and enjoy it. let's hope yu're not banned from #ruby too or we'd lose a decent source of entertainment
<samuelkadolph> Getting banned from an irc channel for being a troll and arse isn't censorship.
<RubyPanther> If somebody is going to take the time to call me names, they should be prepared to take the time to hear me say that namecalling is not acceptable public behavior.
<thomasfedb> RubyPanther, the difference is that they seems happy here, you seem to be unhappy here.
<any-key> RubyPanther: you struck first, banister`sleep made a rude comment but you turned it into a big fucking deal
<any-key> see?
<any-key> now nobody is happy
<shevy> not true
<samuelkadolph> I'm happy
<RubyPanther> I see that is standard bully language.
<shevy> I enjoy this very much!
<samuelkadolph> Another troll banned from #ruby-lang
<deryl> wait a minute, he's screaming sensorship, but he does it to people all the time? holy cow. talk about double standards
<banister`sleep> lol i love all this "bully" stuff
<samuelkadolph> And I got some popcorn for this log from this early morning
<deryl> s/sen/cen/
<banister`sleep> i haven't heard this kind of tlak since i was 13
<RubyPanther> deryl: I have never censored anyone
<banister`sleep> it's cute
* thomasfedb goes to #freenode
<deryl> RubyPanther, bullshit, you pull the censorship crap all the time in #rubyonrails
<deryl> don't even try it
<RubyPanther> deryl: I have never
<any-key> I kind of wish I had a ruby question right now so I could somehow diffuse things
<deryl> i get pissed off at people all the time. even in here. i run my mouth like most other humans, but I don't try to censor what people should or should not say etc
chrstphrhrt joined #ruby
<samuelkadolph> I like that "you're not being bullied. you're self-martyring instead."
<any-key> dingdingding
<shevy> down with censorship!!!
<shevy> occupy #ruby-lang now!
p0y joined #ruby
<robyurkowski> occupy all the things!
chilling joined #ruby
<shevy> not my toilet :(
<deryl> RubyPanther, you. are. a. liar. (if you're truly going with that. Radar kicked you out for several hours because yous tarted a whole shitstorm over some comment someone said in the #rubyonrails channel YOU were the ONLY one not to like)
<chilling> IM A BULLY TOO.
<RubyPanther> Doesn't it make the brain hurt to claim that it is okay to say anything you want even if it is offensive, but then say that the one exception is you can't say that something shouldn't have been said because it was intentionally offensive? How can a complain of offense be more offensive than the offense?
<deryl> so i don't even want to hear it
<chilling> I LIKE BULLYING PEOPLE.
<shevy> yeah chilling! that's the spirit
<chilling> YOU ARE ALL MY SLAVES.
<shevy> look at deryl he wants it chilling!
<chilling> IM PURE BULLY.
<thomasfedb> Shush all you children. Quiet.
<deryl> shevy, mm, chilled wine?\
<tdubellz> chilling: enough
<chilling> oh
<chilling> didnt know you were here :S
<shevy> see? we wake up people
<deryl> heh
Emmanuel_Chanel joined #ruby
Pierogi joined #ruby
<tdubellz> chilling: well now you do right?
<chilling> hmm
<chilling> not sure
BarkingFish joined #ruby
<samuelkadolph> lawl RubyPanther started his banning by not understanding floating point math
<RubyPanther> samuelkadolph: for the record, they were not floats!
<RubyPanther> There was no reason to think they were floats, either.
<any-key> you're a float!
<any-key> sorry...that was over the line :\
Pierogi left #ruby
chilling left #ruby
<shevy> bah that is boring
<samuelkadolph> Then what were they? BigDecimals?
<shevy> fowl's ban was funnier
<RubyPanther> Nor would it matter if they were. Testing floats incorrectly wouldn't have been trolling, or any other thing other than a bug.
dcarper joined #ruby
<any-key> context?
* any-key grabs popcorn
<RubyPanther> They were not BigDecimals
<samuelkadolph> Mystery classes!
Draco_ joined #ruby
<any-key> BigDecimal < Float
<samuelkadolph> No
<any-key> lol
roaminghorse joined #ruby
<RubyPanther> for your entertainment
<any-key> this is way better than working on my lab report
<RubyPanther> Honestly, 99% of the questions I ask in #ruby-lang go unanswered anyways, it is not like I get a lot back for the help I give
<samuelkadolph> You help people? Whoa
<RubyPanther> derp
<shevy> any-key yeah... I have to write an important email ... but this here is more fun than that
<robyurkowski> fffffuuuuuu
<shevy> yeah!
<robyurkowski> vulnerability in rails i18n stuff :(
<shevy> rails sucks!
<any-key> now I'm bored...bored enough to solve amplifier circuits
<RubyPanther> "vulnerability in rails i18n stuff" About 75,400 results (0.16 seconds)
amacgregor joined #ruby
ilyam joined #ruby
<robyurkowski> go read rails-security, rubypanther
<shevy> any-key don't leave me like that :(
<banister`sleep> RubyPanther: was this the precise point where your heart broke: "<RubyPanther> That is a hint you have too much. * #ruby-lang :Cannot send to channel "
<banister`sleep> im trying to pinpoint the nanosecond
<shevy> lol
<any-key> RubyPanther: my analysis: you overreacted to something that could've just been laughed off and they pounced because you started to rebel
<RubyPanther> No that is the point where I said, "lol what an [expletive]"
<any-key> ass?
<shevy> girl
fedalto joined #ruby
<samuelkadolph> You called the entire channel dicks
<RubyPanther> girl doesn't start with a vowel sound, so it couldn't follow an
<RubyPanther> samuelkadolph: No, I did not.
<samuelkadolph> "maybe people who are dicks don't like me" No one liked you in that channel, ergo you called them all dicks
<banister`sleep> haha
<RubyPanther> derrr
<banister`sleep> +1
<RubyPanther> how clever, you could be a comedy writer.
<any-key> he is
<deryl> quit feeding him material to work with and he might be out of a job
<any-key> everyone has a day job
<samuelkadolph> lol
<deryl> wait this is the human race, he'll never be out of material
<RubyPanther> dude, you could get your own weblog with material like that.
<shevy> !!!
<samuelkadolph> What the fuck is a weblog?
<samuelkadolph> Did we hit a time warp and go back to 1999?
<shevy> bring back java applet games!
<any-key> we tweet about such things in this day and age
<RubyPanther> shevy: the most popular free MMORPG in 2011 runs as a Java applet.
<RubyPanther> in 99 everybody was still playing nethack
<shevy> good old 1999 ... where old school browsergames were still fun
luoluoluo joined #ruby
<any-key> I have a friend (21) who plays it obsessively
<shevy> then flash came along, brought great graphics, but killed the real thinking challenge in those games
Manhose_ joined #ruby
<shevy> are there any browsergames written in rails?
<RubyPanther> That was from around 99
chrstphrhrt left #ruby
BarkingFish left #ruby
<RubyPanther> It is actually individually animated flash sprites, not a video
<luoluoluo> hi there. I put a hash called code_words in my wordlist.rb file and require "wordlist" in my do.rb file and try to use code_words in my do.rb. But "undefined local variables " appeared. I googled around but not got the solution. What happened to my code? http://pastebin.com/tBJex196
whitequark joined #ruby
* whitequark has missed all the fun apparently.
<shevy> yeah whitequark
espeed joined #ruby
<RubyPanther> whitequark: it is the internet, fun in asynchronous
<RubyPanther> is
<luoluoluo> RubyPanther: I'll check it out
<whitequark> well I still have logs...
<whitequark> when I'd become sad and grumpy I'll read them again.
<shevy> but logs just show the past man... the present is where the real action lies!
<RubyPanther> debatable
<whitequark> shevy, that does not make them any less entertaining, through
<shevy> I dunno
<shevy> sitting through these things live is a lot more fun to me!
<RubyPanther> The Programmer's Stone people have a theory that we're facing backwards in time, that everything happened already in the future and is now unraveling backwards with the present just showing the point where the weave of the complexity comes apart as entropy unravels the... future.
mxweas_ joined #ruby
zanaga joined #ruby
gnnr joined #ruby
funktronic joined #ruby
sebastorama joined #ruby
funktronic joined #ruby
<any-key> brooooooo that shit's deeeep
<patrick99e99> exit
<whitequark> shevy: you have remind me of a quote. "[near the spring] there once was a stump with obscene words written all over it. It was so nice and comfortable to sit on it, drink some water, read the inscribings... add something maybe. It was stubbed up since that time. I miss it a bit."
bwlang joined #ruby
ontehfritz joined #ruby
<whitequark> It sounds better in Russian, through.
<any-key> one of the few things that do ;)
vitoravelino__ joined #ruby
<whitequark> any-key: I guess it's just because of my poor translating skills.
<shevy> russian is cool
<any-key> whitequark: naah
<any-key> just making a cheap stab at russian for no reason
p0y joined #ruby
<whitequark> well, no offense taken. everyone thinks of russian like that somewhy
<shevy> other than that I don't like the other slavik languages ... Serbo-Croat is quite ugly
<robyurkowski> man, i looove russian
<robyurkowski> it's one of my favourite languages to sing
<any-key> romantic languages are almost polar opposites, we find the slavik languages to be a bit intense ;)
<robyurkowski> beautiful deep vowels
Adman65 joined #ruby
<whitequark> ah, I understand now why two ruby channels exist on freenode.
<mattp_> is there any way to interpolate a hash key/val into a string?
<mattp_> the equiv of "#{foo}"
<mattp_> "#{a[:b]}" nevermind
Draco_ joined #ruby
<whitequark> mattp_: you can use any expression within an interpolation
Phrogz_ joined #ruby
<shevy> hmm 1 / 0
<mattp_> whitequark: word. thanks
<shevy> whitequark sure two channels, this here is kinda a dumpyard ;)
Draco_ joined #ruby
<whitequark> but then I'm curious what these 700+ (500+ now, but that varies) do on this channel
<whitequark> *people
<any-key> I idle but I'm procrastinating so bad tonight that I'm hanging out here and hoping people ask questions that I know the answers to
<shevy> idling
<shevy> I do that since years
<whitequark> shevy: how's that going? I heard it's not so easy to idle well
<robyurkowski> whitequark: I answer questions, generally, but enjoy the occasional OT banter :)
<shevy> whitequark it's like being super relaxed... and not getting stressed about anything ... and then silently falling asleep ...
<whitequark> shevy: I wonder if you've already passed the last stage. That won't prevent you from posting to #ruby, will it?..
DarkFoxDK joined #ruby
* whitequark has a lot to do and it's 6AM. sigh.
sebastorama joined #ruby
Draco__ joined #ruby
albemuth joined #ruby
_debo_ joined #ruby
mxweas_ joined #ruby
mxweas_ joined #ruby
ccchriss joined #ruby
kevinbond joined #ruby
vtr joined #ruby
<shevy> whitequark not yet, though I am slowly getting tired
pencilcheck joined #ruby
pen_ joined #ruby
macabre joined #ruby
mikeycgto joined #ruby
mikeycgto joined #ruby
dv310p3r joined #ruby
n8ji joined #ruby
jay_zawrotny joined #ruby
luckyruby joined #ruby
mxweas joined #ruby
philcrissman joined #ruby
Indian joined #ruby
Bish joined #ruby
drizz joined #ruby
_axx joined #ruby
Muz joined #ruby
jim_ec2 joined #ruby
mc_mac joined #ruby
sbanwart joined #ruby
lobo_d_b joined #ruby
john2x joined #ruby
bigkm joined #ruby
ank joined #ruby
v4n_ joined #ruby
manizzle joined #ruby
milkpost_ joined #ruby
Draco_ joined #ruby
satyavvd joined #ruby
blaenk joined #ruby
dyer joined #ruby
blaenk left #ruby
dhodgkin joined #ruby
v4n_ joined #ruby
ilyam joined #ruby
lobo_d_b joined #ruby
h4mz1d joined #ruby
aef joined #ruby
Draco_ joined #ruby
zodiak joined #ruby
Draco_ joined #ruby
stephenjudkins joined #ruby
banister`sleep joined #ruby
badabim joined #ruby
espeed joined #ruby
phantasm66 joined #ruby
<Syzygy_> shevy, you there?
<shevy> yea Syzygy_
ccchriss left #ruby
<Syzygy_> so i got it working yesterday, but then i changed the order of operation a bit and i broke it again... then i changed it back and it didn't work anymore :/
otakutomo joined #ruby
<shevy> Syzygy_ upload your current code somewhere?
<shevy> pastie.com
<Syzygy_> I did work on the front end tonight, but I think I've got it pretty much finished
friskd joined #ruby
<Syzygy_> we can both edit the code there :>
<shevy> yeah but the syntax highlighting is terrible
<Syzygy_> i agree
<Syzygy_> it's worth noting that there currently seems to be no thread that would produce a hit
jackfu joined #ruby
<shevy> I am not really sure what that code tries to do
<shevy> so you are iterating over http://boards.4chan.org/v/#{n}
x0F__ joined #ruby
<Syzygy_> yeah
<Syzygy_> give me a second
<shevy> you are using so many variables that are not really needed
<shevy> and what is with the next and break
<shevy> you don't need these either
<shevy> you already iterate through all that with .each_line
dnyy joined #ruby
<shevy> if the line does not interest you, just do nothing in the code
<Syzygy_> one second
<shevy> if line.include?("vidyadev") or line.include?("AGDG")
<shevy> # here add your regex
jackfu left #ruby
<Syzygy_> at the beginning hit is false
Adman65 joined #ruby
<shevy> yes and you don't need hit
<Syzygy_> but when it registers a hit, it checks the next line for the regexp
<shevy> you should always try to strive to use as little code as possible
<Syzygy_> why don't I need hit?
<Syzygy_> there are many lines that fullfill the regexp, but I only need those that have hit in them
<shevy> the next line always includes what you desire?
<Syzygy_> yes
<Syzygy_> unless in one very specific case, but I can't think of a way to avoid that unless I do f.lines.to_a.reverse .... I tried that but it broke everything, so right now I'll rather have this slim chance of a false positive.
<Syzygy_> oh, seems like the bot is working again
<Syzygy_> now I somehow need to interface it with crawler.not-a-number.net (I can't run ruby on my host sadly)
pencilcheck joined #ruby
maletor joined #ruby
peterwald joined #ruby
dabaR joined #ruby
<Syzygy_> Thanks for the help shevy
<dabaR> When using thor, how can the invoked task return data to the invoking task?
<dabaR> Other than setting contants
genexp joined #ruby
vtr joined #ruby
bwlang joined #ruby
<Syzygy_> Can I set a Timer on my ruby app that it only does this stuff once per hour or so?
stephenjudkins joined #ruby
radic joined #ruby
<shevy> Syzygy_ probably. You can use thread = Thread.new ... thread.join ... and sleep 36000 or something like that
kurzweil4 joined #ruby
<kurzweil4> Hi, do I need JRuby to be able to install rails?
DarthGandalf joined #ruby
flip_digits joined #ruby
roaminghorse joined #ruby
Draco_ joined #ruby
ujihisa joined #ruby
<shevy> no
pencilcheck joined #ruby
_numbers joined #ruby
<_numbers> my rake task is failing with failed: #<TypeError: can't convert Fixnum into String>
<_numbers> even though i run it with `rake --trace` i cant seem to get a backtrace printing out. i have no idea what line number is causing it
yekta left #ruby
<_numbers> is there a way to debug this? maybe i can use ruby-debug and have it pause on error?
<_numbers> it might be because its failing inside of a resque job
<dabaR> _numbers: how about a line of code that has a plus on it?
GreaseMonkey joined #ruby
GreaseMonkey joined #ruby
<_numbers> well i want to be able to trace my resque jobs
h4mz1d joined #ruby
stephenjudkins joined #ruby
<banisterfiend> _numbers: try ruby-debug's post mortem debugging
<banisterfiend> i think it can freeze on exception and let u see what's up
gnnr joined #ruby
tomzx joined #ruby
Backsorry joined #ruby
skrewler joined #ruby
epochwolf joined #ruby
stephenjudkins joined #ruby
djr_ joined #ruby
aef_ joined #ruby
aef__ joined #ruby
pencilcheck joined #ruby
_numbers left #ruby
pen_ joined #ruby
xpot joined #ruby
stephenjudkins joined #ruby
lobo--d-_-b joined #ruby
lottadot joined #ruby
thecreators joined #ruby
stephenjudkins joined #ruby
Beoran_ joined #ruby
<aces1up> can i use Kernel.const_get on a string with this: Interpreter::Workers keep getting error : wrong constant name
lobo_d_b joined #ruby
Syzygy__ joined #ruby
ExpDate joined #ruby
robbyoconnor joined #ruby
ryanf joined #ruby
davidboy joined #ruby
john2x joined #ruby
dch4pm4n joined #ruby
djr_ joined #ruby
otakutomo joined #ruby
shaatar joined #ruby
dkannan joined #ruby
jwmann joined #ruby
stephenjudkins joined #ruby
p0y joined #ruby
<shevy> aces1up how
<shevy> Foobar = "test"; foobar = Object.const_get "Foobar"; foobar => "test"
bluOxigen joined #ruby
<shevy> aces1up hmm you probably mean, a constant within a module
<shevy> aces1up module Test; TEST1 = "test1"; end; Test.const_get "TEST1" => "test1"
poisonarms joined #ruby
pencilcheck joined #ruby
pen_isident joined #ruby
ryanf joined #ruby
<RubyPanther> I added the Ruby section in Google News and the top article it gave me was about race car driver Rory Bryant who "proves he’s got Ror talent"
p0y joined #ruby
thecreators joined #ruby
akitada joined #ruby
dch4pm4n joined #ruby
n8ji joined #ruby
ujihisa joined #ruby
<RubyPanther> aces1up: you can't do const_get "Foo::Bar" you have to do like Kernel.const_get("Foo").const_get("Bar")
<banisterfiend> RubyPanther: hey there paris
becom33 joined #ruby
eignerchris joined #ruby
<becom33> I just moved into ruby . I dont undertand the whats ruby in rails and whats ruby
pen_ joined #ruby
jbpros joined #ruby
<RubyPanther> aces1up: it is an unpopular technique but you can also do something like "Foo::Bar::Baz".split("::").inject(Kernel){|m,o|m.const_get o}
<akitada> Hi. any recommendations for learning Ruby for non-newbie programmer? I know C, Python, Perl etc and now I want to learn ruby
<RubyPanther> becom33: Ruby is a language, RubyOnRails is a web application framework (eg, a library)
ryanf joined #ruby
pen__ joined #ruby
<any-key> Be sure to listen to the soundtrack at the same time
<RubyPanther> akitada: Generally experienced people should just read the Pickaxe book though
h4mz1d joined #ruby
<any-key> akitada: as with any language, just start reading whatever you can get your hands on...there's no one perfect source for ruby
<RubyPanther> Yeah, the soundtrack is critical... I ride my bike around town singing along, "there are the simple parts of Ruby, yeah yeah yeah."
<RubyPanther> "these"
<any-key> I actually just listened to it...I started reading the poignant guide today for some reason, hadn't known about it two years ago when I was learning ruby
<RubyPanther> You could actually start with ruby.h and learn it via the C api, but I'm not sure what the result would be
<any-key> you would hate it more
<RubyPanther> if you hate C, surely
<any-key> well
<any-key> someone looking to learn ruby is better off cutting their teeth just writing ruby
<any-key> you develop a good sense for it that way
<any-key> but yes, knowing the underlying parts couldn't hurt
<RubyPanther> rb_funcall(rb_mKernel,rb_intern("puts"), 1, rb_str_new2("Hello World"));
<any-key> I think someone looking to learn the language would be better off with irb and a few good books
<RubyPanther> Presumably. It would have to be better than learning with Rails, though.
pencilcheck joined #ruby
MasterIdler joined #ruby
<any-key> learning with rails is a lot of tinkering
seivan joined #ruby
<any-key> to learn rails you literally have to just start fucking around with it, along with the right reading
<becom33> what else ruby has except rails ?
MasterIdler_ joined #ruby
<akitada> RubyPanther: Pickaxe book looks a little bulky but thanks for the suggestion.
<Kiten> list of popular gems(aka libraries/module whatever you wanna call it) by category
Cervajz joined #ruby
<any-key> it's a great language for a ton of things
<RubyPanther> akitada: it includes a reference to the core and stdlib, it is actually only half the size it looks to be.
<RubyPanther> It also briefly covers the C API, etc.
<RubyPanther> It is the standard text, the closest thing to an official book in English. (there is an official book... in Japanese.)
<RubyPanther> Also it is good.
<akitada> RubyPanther: I'll look at that book and yugui's Learning Ruby, which was also suggested by my colleague
<any-key> akitada: read the poignant guide, if anything for a bit of ruby history and fun
<Kiten> why's is pretty cool if you just wanna relax and read
<any-key> it's worth it to just go read about _why if you're bored
* any-key did that yesterday and it was rewarding and whimsicle
<Kiten> yeah its pretty cool way of learning
<Kiten> though coming from C a semantics reference is really all i need ;p
<RubyPanther> If you read Japanese, her book is probably a great choice
p0y_ joined #ruby
ChampS_ joined #ruby
<akitada> RubyPanther: I'm japanese but didn't know there's the official book written in Japanese.
ujihisa joined #ruby
<Kiten> if i'm not mistaken matz made ruby in japan :P
<any-key> yep
<any-key> it's been joked at how until more recent versions it couldn't support actual japanese text in strings though :P
<Kiten> really ?
<Kiten> lol
<any-key> I keep hearing it, too lazy to actually check
<Kiten> would seem kinda weird to not support your native language too
<RubyPanther> akitada: Yeah, Matz has a Japanese book that is considered canonical, there is also an English version now
<RubyPanther> illustrated by _why
<any-key> of course
<RubyPanther> No, it supported Japanese strings, just not Japanese variable names, etc
<Kiten> ahh
<any-key> that's it
<akitada> ok, I'll look at Pickaxe, yugui's and why's and which pick one and start enjoying. thanks guys for suggestoins!
<any-key> the pickaxe book was written by the Wendy's guy too which is pretty awesome
<RubyPanther> Now we have more freedom, like I have a method named π
<Kiten> oh hey akitada try-ruby.org i think its called is pretty good if you wanna get started fast
ksinkar joined #ruby
<Kiten> ahh its tryruby.org not try-ruby.org
philcrissman joined #ruby
ChampS_ joined #ruby
rboyd joined #ruby
ujihisa joined #ruby
yxhuvud joined #ruby
gnnr joined #ruby
brownies joined #ruby
a_a_g joined #ruby
a_a_g1 joined #ruby
vtr joined #ruby
iori joined #ruby
sdavis left #ruby
ujihisa joined #ruby
qiyong joined #ruby
Textmode joined #ruby
<qiyong> from "a.b.c" i want to get "a"
<qiyong> how? a b c can be any word
<Kiten> string = "a.b.c" \n other =~ /a.*/ #unless you want to match only the a in a.b.c
<Kiten> btw \n meant newline
maarten joined #ruby
_whitelogger joined #ruby
Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
rudyl313 joined #ruby
<rudyl313> I saw a line in some ruby code that went: variable_name = $1
<rudyl313> what is $1?
<iboB> rudyl313 the result of a pattern match
<rudyl313> for context it's inside an each block for a hash (so two block params)
<rudyl313> iboB ahhh
<rudyl313> iboB: thanks!
dabaR left #ruby
robotmay joined #ruby
Adman65 joined #ruby
ph^ joined #ruby
pencilcheck joined #ruby
luoluoluo joined #ruby
Mchl joined #ruby
Draco_ joined #ruby
vtr joined #ruby
Morkel joined #ruby
krz joined #ruby
mafolz joined #ruby
pen_ joined #ruby
S1kx joined #ruby
S1kx joined #ruby
mafolz_ joined #ruby
ph^ joined #ruby
sandstrom joined #ruby
sandstrom joined #ruby
mikalv joined #ruby
cyri_ joined #ruby
pi3r joined #ruby
BiHi joined #ruby
mklappstuhl joined #ruby
austinflores joined #ruby
mikepack joined #ruby
ChampS_ joined #ruby
workmad3 joined #ruby
batlock666 joined #ruby
Blackflys joined #ruby
andoku joined #ruby
whitequark joined #ruby
mengu joined #ruby
austinflores joined #ruby
ammar01 joined #ruby
flippingbits joined #ruby
Helius joined #ruby
Seisatsu joined #ruby
austinflores left #ruby
sandelius joined #ruby
jbpros joined #ruby
pencilcheck joined #ruby
pantsman joined #ruby
pantsman joined #ruby
hinogi joined #ruby
hinogi joined #ruby
manizzle joined #ruby
beilabs joined #ruby
danted joined #ruby
gf3 joined #ruby
becom33 joined #ruby
<danted> Is there a quicker way to complete this task? http://pastie.org/2882186
<danted> it takes forever to proccess each number
<danted> i assume i can do something where i can thread multiple ranges through the same loop, but would that be faster overall or would it still just bog everything down?
rtdp joined #ruby
smgt joined #ruby
<danted> anyone?
ph^ joined #ruby
becom33 joined #ruby
<RubyPanther> danted: it is not likely to be less slow.
<RubyPanther> danted: normally that is the sort of thing you would put in a C function
<danted> what do you mean?
<danted> and thanks for replying :)
bastilian joined #ruby
ph^ joined #ruby
<mog-> RubyPanther, yeah rewriting it in a different language would be a quick win. try Java or JavaScript, or C
<RubyPanther> danted: well to start with, that is probably the slowest way imaginable to calculate it. 1*n is already painful without even getting into the regex
jbpros joined #ruby
<mog-> calculating fibonacci using the same algorithm in javascript and ruby takes 3.942s vs 49.223s source: http://joshuakehn.com/2011/10/3/Diagnosis-No-Cancer.html
<danted> so kicking that algorithm out should help?
<RubyPanther> yes, definitely
ephemerian joined #ruby
<danted> wow, insanely fast in comparison
becom33 joined #ruby
<iboB> can I rescope a class? say: module MyModule; do something with Integer here, so that MyModule::Integer is absolutely the same as Integer but is a different class
abstrusenick joined #ruby
pen joined #ruby
gregorg_taf joined #ruby
hurikhan|Work joined #ruby
<banisterfiend> iboB: dont quite know what u mean
<iboB> in my particular case I want to define a special object, that is almost entirely similar to Integer
<iboB> i want to add it to a module MyModule::Integer
<iboB> and modify it, keeping the actual Integer intact
<banisterfiend> iboB: class MyModule::Integer < ::Integer
<RubyPanther> iboB: module Foo; Integer = ::Integer.dup end
<iboB> ah RubyPanther, thanks
<RubyPanther> iboB: it is more correct to subclass, I was just answering the original question literally :)
timonv joined #ruby
a_a_g joined #ruby
bier joined #ruby
vtr joined #ruby
hemanth joined #ruby
seivan joined #ruby
enikar joined #ruby
fujimura joined #ruby
fujimura left #ruby
RomD joined #ruby
workmad3 joined #ruby
tatsuya_o joined #ruby
perryh joined #ruby
xec joined #ruby
vtr joined #ruby
dhruvasagar joined #ruby
pen_isident joined #ruby
Shrink joined #ruby
DarkFoxDK joined #ruby
ramusara joined #ruby
Mchl joined #ruby
Cervajz joined #ruby
robotmay joined #ruby
josephwilk joined #ruby
Manhose joined #ruby
pen_isident joined #ruby
apeiros_ joined #ruby
closedbracket joined #ruby
Sliker_ joined #ruby
BiHi joined #ruby
ph^_ joined #ruby
bier|tp joined #ruby
<robotmay> Any tips for how to check if a number is cleanly divisible by another number? Need to validate something is a multiple of twelve
Kiten joined #ruby
<apeiros_> modulo
<a_a_g> if(!a%b)
<apeiros_> a_a_g: 0 is true in ruby
<robotmay> apeiros_: Someone mentioned that. I nodded and then swiftly forgot the name :D
<apeiros_> % is an alias for modulo btw.
<robotmay> Ooh, didn't know that
<apeiros_> (on numeric classes, that is)
<a_a_g> sigh if((a%b) != 0)
<Kiten> quick question i've heard Shoe's is the most popular GUI but i've also heard it uses a modified version of ruby?
<robotmay> So if it's cleanly divisible it'll be 0?
<apeiros_> modulo returns the remainder
<robotmay> Oh awesome, I'll go give that a go - thanks chaps
<apeiros_> so yes, of course, if it is cleanly devidable, there's no remainder
ujihisa joined #ruby
<apeiros_> *divisible
<apeiros_> there's also divmod, which returns both, quotient and remainder
<Kiten> i suppose what i'm asking is what does the community as a whole generally use for GUI applications ?
<Tasser> Kiten, rails ^^
<Kiten> rails ?
<Kiten> thought rails was for web dev ?
<Tasser> yeah it is.
<RubyPanther> Kiten: Gtk it popular for large apps
<Kiten> good documentation ?
<RubyPanther> Shoes is probably more fun than Tk for small apps, but there are a zillion Tk prototypes out there as it is in stdlib
<RubyPanther> Kiten: extensive documentation in general, though you may have to translate from docs in other languages at times... not a problem IMO as it is consistent
<Kiten> mostly i'm just looking for one with good documentation i was looking at wxruby but couldn't access the site
<RubyPanther> Most of it is documented for Ruby
<Kiten> well i use Gtk with C/C++ just didn't know there was a ruby binding
<RubyPanther> wxWindows was a nice try, but it fell on it's face a decade ago
<Tasser> I had some fun with ffi-tk, but I haven't actually tried anything else
<RubyPanther> Yeah if you're used to Gtk in C it will be the same in Ruby
<Kiten> oh thats great :P thanks
<Tasser> Kiten, tk doesn't really care about signals n stuff, you can just pass blocks
<nicksmith> could always try QtRuby as well
<Kiten> thanks for these great suggestions :P
<nicksmith> or if you're on OS X MacRuby
jds joined #ruby
<Kiten> nicksmith: nah i'm on linux ;p
<Tasser> Kiten, ah wait, it does kinda. It's just called 'bind' on an event. Would be strange otherwise.
<Kiten> RubyPanther: hey its not in gems ?
<Tasser> Kiten, which one?
<Kiten> Gtk
<Tasser> I get a bunch of hits on gtk
Manhose_ joined #ruby
<Kiten> bigdecimal (1.1.0)
<Kiten> english (0.6.3)
<Kiten> language (0.6.0)
<Kiten> polyglot (0.3.3)
<Kiten> thats all i get
<Tasser> gem search -r gtk ?
<Kiten> ..........
<Kiten> oooh
<Kiten> hehe
<Tasser> ^^
tvw joined #ruby
bier joined #ruby
<Kiten> yeah i forgot that gem searches locally unless used with -r
<Kiten> XD
<RubyPanther> Kiten: Sorry, no it is not... you have to install the ruby-gnome2 package http://sourceforge.net/projects/ruby-gnome2/files/
<Kiten> RubyPanther: gem install gtk2 ?
<RubyPanther> Kiten: on windows, do that for sure :)
<RubyPanther> maybe it is current now, I know a few months ago I had to install from the source to get current Ruby working
<Kiten> wait so on windows use gem/ on nix use sourceforge ?
trivol joined #ruby
<RubyPanther> It is the only negative thing I have to say about it, sometimes releases are slow
<Kiten> well if its stable and mostly bug free i don't mind
<RubyPanther> Kiten: yeah, or at least, on *nix use sourceforge unless the gem already works for you ;)
<Kiten> i'll try the gem first, last time i built from source it took 2 days
<Kiten> err
<RubyPanther> I never found any bugs other than the "breaks on brand new Ruby version" variety
<Kiten> last time i built something from source
<Kiten> RubyPanther: i'm using the svn version
<RubyPanther> on *nix it will build the source either way, presumably
<Kiten> yeah it
<Kiten> err
<Kiten> yeah it'll but it will take 2 days depending on how big it is
<Kiten> computers from 1999
<Kiten> slow as all get out
<RubyPanther> it is only the bindings that get compiled, it should be just some glue
<RubyPanther> probably most of the time gets spent running configure :)
<Kiten> should be good then
<Kiten> unless they used the ever popular BSD checklist
iocor joined #ruby
<Kiten> on my machine takes 5 - 10 minutes depending on how much they added
<Kiten> really do you need to check for mmx support on a package that doesn't even implement optimization for mmx
<Kiten> or a host of other stuff
<Kiten> or extremely old headers that aren't part of the stl anymore
<nicksmith> Kiten: 2 days to build?
Spockz joined #ruby
<Kiten> yeah took me 2 days to build inspircd
szallol joined #ruby
<Kiten> should just used pacman instead of yaourt but stupid me decided to use yaourt and happened to choose the AUR version which must be compiled
ChampS_ joined #ruby
demian`_ joined #ruby
Telling joined #ruby
adambeynon joined #ruby
gnnr joined #ruby
grekko joined #ruby
incluye joined #ruby
dlitvak joined #ruby
tvw joined #ruby
Manhose joined #ruby
pwned joined #ruby
adambeynon joined #ruby
raincole joined #ruby
davidrinnan_ joined #ruby
whitequark joined #ruby
johan_ joined #ruby
Johnnus_ joined #ruby
davidrinnan joined #ruby
ksinkar joined #ruby
rsampaio joined #ruby
John_P joined #ruby
LockeVendetta joined #ruby
Paladin joined #ruby
<LockeVendetta> hi, does anuone knows how can i simulate the following in ruby (1.8.6): ps aux | grep httpd ?
soulnafein joined #ruby
tomzx joined #ruby
soulnafein left #ruby
Spockz joined #ruby
tk_ joined #ruby
bwlang joined #ruby
negative joined #ruby
Morkel joined #ruby
_whitelogger joined #ruby
Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
_whitelogger joined #ruby
Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
zastaph joined #ruby
smgt joined #ruby
fermion joined #ruby
JohnBat26 joined #ruby
fermion joined #ruby
bier joined #ruby
elliot98 joined #ruby
Paladin joined #ruby
elliot98 joined #ruby
stenno joined #ruby
andoku joined #ruby
Johnnus__ joined #ruby
jtrudeau joined #ruby
BiHi joined #ruby
norex joined #ruby
rsampaio joined #ruby
Paladin joined #ruby
rsampaio joined #ruby
sikor_sxe joined #ruby
apeiros_ joined #ruby
eregon joined #ruby
rsampaio joined #ruby
raluxgaza joined #ruby
shevy joined #ruby
rsampaio joined #ruby
Syzygy__ joined #ruby
jds joined #ruby
pen_isident joined #ruby
<sikor_sxe> hello, i have weird issues with my ruby http code. i try to read a piece of xml over http and ruby somehow stumbles over a missing http header (`read_status_line': wrong status line: "<?xml version=\"1.0\"...). However when i use curl to perform the same request, the header seems to be there. What could be wrong? My http code is here: http://pastebin.com/GwHNbtXi
tatsuya_o joined #ruby
jbpros joined #ruby
cdepue joined #ruby
tatsuya__ joined #ruby
Cervajz_ joined #ruby
ecolitan joined #ruby
tommyvyo_ joined #ruby
nanderoo joined #ruby
danielpunt joined #ruby
Helius joined #ruby
bwlang joined #ruby
andrewl joined #ruby
andrewl left #ruby
jrist joined #ruby
Paladin joined #ruby
Telling joined #ruby
Pip joined #ruby
rook_flood joined #ruby
ontehfritz joined #ruby
jbpros joined #ruby
poisonarms joined #ruby
macabre joined #ruby
troll__ joined #ruby
<troll__> o, a bully.
<troll__> im a bully.
advorak joined #ruby
jbpros joined #ruby
enikar joined #ruby
<troll__> im a bully.
kedare joined #ruby
was kicked by apeiros_: you're a goner
troll__ joined #ruby
<troll__> im a bully.
jbpros joined #ruby
KL-7 joined #ruby
<raluxgaza> troll__: aright we get it
was kicked by apeiros_: the kick was a warning, you're banned now
seivan joined #ruby
Adman65 joined #ruby
albemuth joined #ruby
cjs226 joined #ruby
Shrink joined #ruby
jesteracer joined #ruby
dyer joined #ruby
psino joined #ruby
yfeldblum joined #ruby
Johnnus_ joined #ruby
linoj joined #ruby
advorak joined #ruby
ph^ joined #ruby
sbanwart joined #ruby
Paladin joined #ruby
jimgg joined #ruby
rippa joined #ruby
iamjarvo joined #ruby
dv310p3r joined #ruby
beakerman joined #ruby
jimgg left #ruby
jay_zawrotny joined #ruby
iocor joined #ruby
docwhat joined #ruby
enroxorz joined #ruby
enroxorz joined #ruby
DarkFoxDK joined #ruby
Jackneill joined #ruby
LBRapid joined #ruby
andoku_ joined #ruby
Draco_ joined #ruby
devdazed joined #ruby
jwill joined #ruby
wyhaines joined #ruby
flip_digits joined #ruby
stoffus joined #ruby
g0bl1n joined #ruby
g0bl1n joined #ruby
linoj_ joined #ruby
glacius joined #ruby
linoj_ joined #ruby
bluOxigen joined #ruby
moshee joined #ruby
moshee joined #ruby
<sikor_sxe> hello, i have weird issues with my ruby http code. i try to read a piece of xml over http and ruby somehow stumbles over a missing http header (`read_status_line': wrong status line: "<?xml version=\"1.0\"...). However when i use curl to perform the same request, the header seems to be there. What could be wrong? My http code is here: http://pastebin.com/GwHNbtXi
[ln]distax joined #ruby
RomD` joined #ruby
vtr joined #ruby
evantravers joined #ruby
steph021 joined #ruby
steph021 joined #ruby
Pip joined #ruby
<apeiros_> sikor_sxe: try to inspect the stream with something like tcpflow or tcpdump
<apeiros_> I've seen servers actually return invalid http
<apeiros_> (IIS, I'm looking at you)
<apeiros_> if that's indeed the case, your options are very limited. you can e.g. use a raw TCPSocket
travisjeffery joined #ruby
savage- joined #ruby
adamjleonard joined #ruby
marcin_m joined #ruby
devdazed left #ruby
bbttxu joined #ruby
jfredett joined #ruby
bbttxu joined #ruby
blischalk joined #ruby
fatguylaughing joined #ruby
jensn joined #ruby
axl_ joined #ruby
fermion joined #ruby
<sikor_sxe> apeiros: it's apache and the header in curl looks alright
theRoUS joined #ruby
berkes joined #ruby
fermion joined #ruby
savage- joined #ruby
Draco_ joined #ruby
kedare joined #ruby
albemuth joined #ruby
pen joined #ruby
apok joined #ruby
ampex joined #ruby
apok left #ruby
emptyflask joined #ruby
grekko joined #ruby
gonglexin joined #ruby
yekta joined #ruby
pootpoot joined #ruby
<blischalk> If I have a variable containing a string like var = "ingredient". How can I use that to dynamically create an object of that name? ex. var.new ?
<Tasser> blischalk, you want a lookup string => class?
<blischalk> So basically I need to get Ingredient.new out of var = "ingredient"
<banisterfiend> blischalk: use a hash
<banisterfiend> ah
<blischalk> I want to dynamically create an object of whatever the string has as the objects name.
<rippa> sounds kinda like bad design
<banisterfiend> blischalk: Object.const_get(var.capitalize).new
<blischalk> banisterfiend: thanks. will try
<Tasser> rippa, rails uses it all the time ;-)
<rippa> exactly my point
<rippa> jk
<yfeldblum> this is ruby, the language of magic and metaprogramming
<ampex> so is there somewhere I can actually discuss ruby vs python without being considered a troll?
redgetan joined #ruby
<banisterfiend> ampex: you can discuss it here so long as you're not actually a troll :P
<Tasser> ampex, #troll
<ampex> hah
<yfeldblum> ampex: i don't mind if people debate the merits of various tools
lkba joined #ruby
<Afal> so saying something like "ruby is the anime version of python" is unacceptable?
ben_alman joined #ruby
Indian joined #ruby
phantasm66 joined #ruby
<yfeldblum> Afal: that's about as useful as saying "ruby is as dumb as a rock; python is as slick as a snake" (not useful), but my version is more witty
<blischalk> Is it possible to have a dynamic method? By this I mean how could I acheive something similar to new_object.byDynamicSetter = The dynamic object I just created
<yfeldblum> blischalk: any object can respond to any message; just `def method_missing(name, *args, &block)` on your class
<rippa> but snake is not sli~ oh I see
<Tasser> blischalk, either method_missing / respond_to? or define_method
<banisterfiend> blischalk: OpenStruct does that
<blischalk> The model that defines the object already has the methods defined.
<blischalk> That isn't the issue.
<blischalk> I need the method to actually be a variable
Draco_ joined #ruby
<yfeldblum> blischalk: i don't really understand your question now ... can you explain again?
<banisterfiend> "i need the method to actually be a variable" is pretty hard to make sense of IMO
<blischalk> like myobject.("this is a string that can change ")
<blischalk> let me illustrate
<blischalk> This works: new_object.ingredient = Ingredient.new
<blischalk> but it only works for ingredients
<banisterfiend> blischalk: use a motherf*cking OpenStruct
<blischalk> I need to be able to do something like: new_object.(setter that matches object on other side) = DynamiclyNamedObject.new
<blischalk> banisterfiend: Will look into OpenStruct
ckrailo joined #ruby
dv_ joined #ruby
crankycoder joined #ruby
<blischalk> banisterfiend: I think just .call("whateverMyMethodIs") would work no?
<banisterfiend> blischalk: tbh i dont actually know what you're trying to do and so i cant atttest to it actually making any sense
TomJ joined #ruby
<banisterfiend> but based on what you were saying up there abou t'setter matches object on other side' i have a feeling it doesnt even make sense
<banisterfiend> :P
<banisterfiend> anyway time to sleep
dv_ joined #ruby
Morkel joined #ruby
<yfeldblum> `name = "cat" ; new_object.send("#{name}=", name.capitalize.constantize.new)`
<yfeldblum> ampex: where's the ruby-vs-python i was promised?
jbpros joined #ruby
advorak joined #ruby
wyhaines joined #ruby
wyhaines joined #ruby
devdazed joined #ruby
ksinkar joined #ruby
steph021 joined #ruby
youdonotexist joined #ruby
enikar joined #ruby
mikepack joined #ruby
advorak joined #ruby
not-gaypiel left #ruby
p0y joined #ruby
rushed joined #ruby
vtr joined #ruby
Morkel joined #ruby
theRoUS joined #ruby
perturbedpanda joined #ruby
MasterIdler joined #ruby
zbrown joined #ruby
S2kx joined #ruby
LiquidInsect joined #ruby
kenichi joined #ruby
releod joined #ruby
vtr joined #ruby
vtr joined #ruby
minijupe joined #ruby
mengu joined #ruby
pen_isident joined #ruby
hubble joined #ruby
<hubble> May I ask for guidance on dealing with files and directories?
<hubble> Reading the Ruby api docs isn't helping me get to where I want to go
jergason joined #ruby
Spockz joined #ruby
closedbracket joined #ruby
<hubble> I'm modifying this set of rake tasks for a Rails 3.0.x app, and basically at line 22 I need to have it create any subdirectories first then upload the files in their respective directories
Spockz joined #ruby
<hubble> i'm not using assets:precompile, I'm actually just grabbing my public/images dir and trying to upload it *as-is* to s3
<hubble> and I'm not sure how to modify it to do files & directories
<hubble> I guess I can google more, though
bastilian joined #ruby
<thomasfedb> hubble, wrong channel. You need #rubyonrails
<hubble> well...
p0y joined #ruby
<hubble> it's just ruby, though
<samuelkadolph> What does rake have to do with rails?
<hubble> using the Dir and File classes
<thomasfedb> samuelkadolph, he's hacking on rails rake tasks. though it would be more relevant in the rails chan
<samuelkadolph> No he's not
<samuelkadolph> Perhaps you should read his gist before making assumptions
p0y_ joined #ruby
Targen joined #ruby
apeiros_ joined #ruby
<hubble> My problem is at line 22 in https://gist.github.com/1121506 -- Because I'm not using assets:precompile, I need it to deal with subfolders and files, and just reading Ruby API docs didn't get me very far. I need some guidance on what to do to handle my subdirectories
<thomasfedb> oh, my error. I rescind.
ksinkar joined #ruby
<thomasfedb> sorry, carry on.
Jake232 joined #ruby
vitoravelino__ joined #ruby
<hubble> File.basename() will clearly not work on directories so I just need guidance on how to modify this thing for subdirectories
<samuelkadolph> hubble: Dir.glob uses ** to recursively search directories
<hubble> Yea, I found that
<samuelkadolph> So I would probably do Dir.chdir("public/assets") { Dir.glob("**/*") {} }
<samuelkadolph> So you don't need to use basename
<hubble> hmmm
<hubble> okay let me poke around a bit more
philcrissman joined #ruby
<apeiros_> samuelkadolph: heh, the chdir is a nice one. I only started to do that recently too, can't tell how many years I used slicing…
<samuelkadolph> Otherwise just strip public/assets off the string from glob
philcrissman joined #ruby
thecreators joined #ruby
Cervajz joined #ruby
<thomasfedb> samuelkadolph, sounds like SOAP.
<apeiros_> samuelkadolph: woah, bad
<thomasfedb> samuelkadolph, oh, that act. Yes that's a bit controversial.
<samuelkadolph> A bit?
grekko joined #ruby
* apeiros_ happy he lives in a direct democracy. and a true one.
andoku joined #ruby
<thomasfedb> samuelkadolph, lucking I'm and Australian.
<thomasfedb> *luckily
<samuelkadolph> I don't think the US could do more to kill their economy at a time like this.
<apeiros_> dunno, but the last few years I got the impression, that US citicens get fucked over over and over again…
rsampaio joined #ruby
<samuelkadolph> This bill will destroy the internet for the US
<samuelkadolph> It would be the end of Google, YouTube, Tumblr, etc
<thomasfedb> samuelkadolph, how exactly?
nimbius left #ruby
<iamjarvo> i am trying to require a file in irb and its failing
<samuelkadolph> Uploaders can now face 5 years in jail for posting or using any copyright stuff. Even singing a song
badabim joined #ruby
<iamjarvo> i have run into this problem before and i am drawing a blank. its telling me no such file is there
<samuelkadolph> And the hosters are now forced to take down anything without due process or any evidence at all by anyone
<samuelkadolph> And if they don't they are liable
cbuxton joined #ruby
<thomasfedb> samuelkadolph, bloody hell. Goodbye youtube.
<apeiros_> samuelkadolph: are you a US citicen?
<samuelkadolph> Thankfully no
<samuelkadolph> But we get quite a bit of leakage across the border
andoku joined #ruby
redgetan joined #ruby
<samuelkadolph> So YouTube is dead completely and Google would die slowly as they run around purging their search results of pretty much anything
<thomasfedb> samuelkadolph, the precedent would be bad for everybody.
<apeiros_> samuelkadolph: huge companies like google will simply change their location.
<apeiros_> nothing forces them to stay in the US
<apeiros_> of course, "simply" is quite an understatement
<samuelkadolph> They could still function in the US but they couldn't have any US customers
<samuelkadolph> Since if you are not in the US, they would just force the ISPs to hijack your domain name
<apeiros_> I think the S in US stands for Syriah, no?
<hubble> samuelkadolph: got a source on the 5 years in jail thing? I want to bitch about it with a link to back me up ; )
<mitchty> god, its not going to pass, subcommitees are where bills go to die
<samuelkadolph> Not sure where they sourced it from
Pip joined #ruby
Pip joined #ruby
<hubble> Our government has a long history of creating legislation around topics they clearly don't understand and it leads to more and more nonviolent people in prisons
bbttxu joined #ruby
<thomasfedb> hubble, well the man who was head of the committee that tried to run the internet didn't understand the internet. I can't say I'm any more shocked.
<rippa> >internet
<rippa> >shocked
jf317820_ joined #ruby
<jf317820_> hi, relative ruby n00b here with a couple of questions about packaging my application
maggie_n joined #ruby
Draco_ joined #ruby
paraglade left #ruby
dbgster joined #ruby
Clooth joined #ruby
maletor joined #ruby
Paladin joined #ruby
Morkel joined #ruby
SegFaultAX|work joined #ruby
josh_ joined #ruby
paraglade joined #ruby
eywu joined #ruby
Pip joined #ruby
alfism joined #ruby
p0y joined #ruby
havenn joined #ruby
stkowski joined #ruby
__Genji_Richmond joined #ruby
eignerchris joined #ruby
gearaholic joined #ruby
negative joined #ruby
Araxia_ joined #ruby
segways joined #ruby
paraglade left #ruby
paraglade joined #ruby
<jds> Is it only possible to use 1.9's block literals in assignments, or can you pass them directly to methods?
<jds> I can't seem to get the syntax right for the latter
eywu left #ruby
jbpros joined #ruby
<rippa> block literals?
<rippa> in assignments?
<jds> ->{ 42 }
<rippa> that's lambda
<jds> ok, lambda literals
<jds> For example, rspec has a 'let' method that takes 1 regular argument and 1 block - let(:foo) {bar}
<jds> I was hoping to be able to express that as let :foo -> {bar}
<jds> just for syntactic reasons
nerded joined #ruby
adamkittelson joined #ruby
axl_ joined #ruby
robyurkowski joined #ruby
<rippa> you kinda can
<rippa> try that
<rippa> let :foo &-> {bar}
<jds> oh, of course. Hmm, squiggly. I guess I prefer the first one :/
<rippa> gnarly
rsampaio joined #ruby
h4mz1d joined #ruby
voodoofish430 joined #ruby
codespectator joined #ruby
<Mon_Ouie> How about let foo: -> {bar} ?
Targen joined #ruby
<Mon_Ouie> Oh, didn't see it was for an existing method
albemuth joined #ruby
ianbrandt joined #ruby
radic joined #ruby
<jds> Mon_Ouie: hm, that's not bad. I might submit a patch, see if I can persuade them it's a good idea.
travisjeffery joined #ruby
<Mon_Ouie> I'd say persuading them something is a good idea isn't hard… :p
visof joined #ruby
visof joined #ruby
Paladin joined #ruby
<visof> join #ror
Russell^^ joined #ruby
gattuso joined #ruby
gattuso left #ruby
bier|tp joined #ruby
bier joined #ruby
gattuso joined #ruby
jensn joined #ruby
rhinux joined #ruby
ryanf joined #ruby
lord1234 joined #ruby
lord12 joined #ruby
<lord1234> hi I am trying to install ruby-debug-ide on Ubuntu 10.04 and get the following errors: htt://pastie.org/2884545
<lord1234> can anyone provide advice?
bbttxu left #ruby
jcromartie joined #ruby
pestouille joined #ruby
<Mon_Ouie> Results logged to /var/lib/gems/1.9.1/gems/ruby-debug-ide-0.4.16/ext/gem_make.out
<Mon_Ouie> Reading that log is likely to be helpful
badabim joined #ruby
<bwlang> i have simple ruby program that i need to distribute to some machines... do i really need to go all whole hog on this and add bundler to deal with dependencies. is there some nice way to just package up all the deps ?
<samuelkadolph> Package it into a gem
mrsolo joined #ruby
<lord1234> Mon_Ouie: the ocntents of the gem_make.out is "usr/bin/ruby1.9.1 mkrf_conf.rb"
<lord1234> so its not very helpful:)
shadoi joined #ruby
jcromartie left #ruby
Fire-Wolf joined #ruby
releod joined #ruby
rudyl313 joined #ruby
jergason joined #ruby
Fire-Wolf left #ruby
<bwlang> samuelkadoph: hmm - maybe. any thoughts about crate? then i could just drop this into nfs and have it run
<rudyl313> whats the best way to deal with dependency gem version mismatches when using bundler? (i.e. one gem wants a specific version of one gem, the other gem wants another version of that gem)
awesomenickname joined #ruby
<awesomenickname> I must say one thing
releod joined #ruby
<awesomenickname> who the hell wrote that parse function for yaml if it breaks on every colon in a string?
<awesomenickname> go to new line, check for space indent, use string before first colon as field name, use the rest of the string as data
<awesomenickname> why do you check for other colons in a string? god knows.
<awesomenickname> I should go and write alternative parser, but I am too lazy
<awesomenickname> and therefore retarded
fra000 joined #ruby
sandstrom joined #ruby
sandstrom joined #ruby
<ccooke> awesomenickname: possibly to support terse (ie: Json) mode?
sepp2k joined #ruby
conor_ireland joined #ruby
macmartine joined #ruby
<awesomenickname> maybe, bu anyway, do not ever use yml as a dump for your sql database, guys.
<ccooke> for which reason? I can see several reasons why it would be a bad thing...
tightwork joined #ruby
Jake232 joined #ruby
kirun joined #ruby
<tightwork> Hi
jensn joined #ruby
maletor joined #ruby
enroxorz2 joined #ruby
<awesomenickname> for reasons it would be damn hard to parse afterwards
btanaka joined #ruby
Clooth joined #ruby
[lm]distax joined #ruby
zodiak joined #ruby
tommyvyo_ joined #ruby
tommyvyo_ joined #ruby
xpot-mobile joined #ruby
travisjeffery joined #ruby
ank joined #ruby
Morkel joined #ruby
wyhaines joined #ruby
enroxorz joined #ruby
enroxorz joined #ruby
jbw joined #ruby
dfamorato joined #ruby
_debo joined #ruby
Vendethiel joined #ruby
rboyd joined #ruby
Adept` joined #ruby
workmad3 joined #ruby
gr_ joined #ruby
Pip joined #ruby
Pip joined #ruby
yekta joined #ruby
dfamorato_ joined #ruby
yekta_ joined #ruby
pestouille joined #ruby
lobo_d_b joined #ruby
lobo_d_b joined #ruby
yekta_ joined #ruby
alindeman joined #ruby
mcowan joined #ruby
travisjeffery joined #ruby
strife25 joined #ruby
redgetan joined #ruby
yekta joined #ruby
workmad3 joined #ruby
havenn joined #ruby
GR__ joined #ruby
Draco_ joined #ruby
theRoUS joined #ruby
EddieBluh joined #ruby
wyhaines joined #ruby
thecreators joined #ruby
yekta joined #ruby
dbgster joined #ruby
Pip joined #ruby
Pip joined #ruby
Spockz joined #ruby
theRoUS joined #ruby
theRoUS joined #ruby
crankycoder joined #ruby
<jim_ec2> conditions = conditions." and ".cancelled
theRoUS joined #ruby
theRoUS joined #ruby
<jim_ec2> is this the correct way to append?
<samuelkadolph> jim_ec2: No. There are lots of ways of doing it but the simplest and fastest is conditions << " and " << cancelled
<samuelkadolph> But it mutates the original string which you might not want but that doesn't seem likely in this case
yekta joined #ruby
<jim_ec2> hmm ok, no change :\
<jim_ec2> paginate :parties, :per_page => 50, :conditions => conditions, :order => 'last_name ASC, first_name ASC'
jcromartie joined #ruby
<jcromartie> is there a good way to split an array into n-or-less-sized chunks?
<jim_ec2> this is a rails 1.x app, how can i append a crazy where condition
<jcromartie> like, turn [1, 2, 3, 4, 5] into [[1, 2], [3, 4], [5]]
<samuelkadolph> jcromartie: each_slice
yekta_ joined #ruby
<jim_ec2> no like the query ar builds I need to pop onto the where this: canceled = "party_id not exists (select debt_party.id from debt inner join debt_party on debt.id=debt_party.debt_id where placed_on = '10/26/2011' and debt_status_id=8)"
<jcromartie> each_slice, thanks
<jim_ec2> having to exclude results based on a subquery, so no variables need to in the sql
<jcromartie> samuelkadolph: absolutely perfect :)
jergason joined #ruby
<jim_ec2> I could pastebin if more context is needed
yekta joined #ruby
stunna joined #ruby
<jim_ec2> line 97 is where I'm trying to just tack on the last condition
yekta_ joined #ruby
nbertram joined #ruby
lord1234 left #ruby
j3r0m3 joined #ruby
ChampS_ joined #ruby
workmad3 joined #ruby
tvw joined #ruby
talumees joined #ruby
tommyfun joined #ruby
skrewler joined #ruby
cyri_ joined #ruby
artOfWar joined #ruby
manizzle joined #ruby
KostaS joined #ruby
ghanima joined #ruby
Mch1 joined #ruby
djr_ joined #ruby
dnyy joined #ruby
Clooth joined #ruby
thone joined #ruby
zunpre joined #ruby
<jcromartie> poor man's UUID: rand(0xffffffff).to_s(16)
<Mon_Ouie> SecureRandom.uuid
<Mon_Ouie> (and that's in stdlib)
nbertram left #ruby
wyhaines joined #ruby
wyhaines joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
flip_digits joined #ruby
cdepue joined #ruby
chiel joined #ruby
<chiel> Hey all, any pow users here?
maarten joined #ruby
djMax joined #ruby
<djMax> Ruby (RoR) 1.92p290 on windows 2008 64 bit. Crashing when trying to serve a page before even getting to my handler. How to debug?
<djMax> crashing like Windows crashing, not my app or anything
trivol joined #ruby
rickmast joined #ruby
_debo joined #ruby
Pip joined #ruby
_debo_ joined #ruby
<jcromartie> does Ruby's Dir.chdir work in some weird way, or what?
<jcromartie> when I say Dir.chdir, and then Dir["./*"] I get the contents of the directory BEFORE I chdir
<jcromartie> hm
GreaseMonkey joined #ruby
GreaseMonkey joined #ruby
luckyruby joined #ruby
<jcromartie> never mind
gayasentinel joined #ruby
powwow joined #ruby
<powwow> Hi, it seems that when I run "bundle exec ruby -rfoo bar.rb", ruby require's foo.rb before bundle exec changing $:. This makes my project blow up, because foo.rb requires a file that's not in the load path yet. Is there any way to change the requirement ordering? (Other than adding require 'foo' inside bar.rb)
skrewler joined #ruby
skrewler_ joined #ruby
cdepue_ joined #ruby
skrewler joined #ruby
cdepue joined #ruby
skrewler joined #ruby
<zastaph> how come i can't convert a Fixnum to_i ?
Indian joined #ruby
skrewler joined #ruby
<zastaph> seems parameters to initialize are all Fixnum
havenn joined #ruby
rickmasta joined #ruby
jergason joined #ruby
poggleworth joined #ruby
yekta_ joined #ruby
onetonturd joined #ruby
onetonturd left #ruby
jmontross joined #ruby
s0ber_ joined #ruby
workmad3 joined #ruby
maletor joined #ruby
rickmasta joined #ruby
headius joined #ruby
minijupe joined #ruby
yekta_ joined #ruby
skrewler_ joined #ruby
philcrissman joined #ruby
hobodave joined #ruby
rickmast joined #ruby
iocor joined #ruby
<v0n> hi all
Johannes` left #ruby
<v0n> RFC: is there something simpler to do this: http://fpaste.org/ThXv/ ?
BitPuffin joined #ruby
iocor joined #ruby
apeiros_ joined #ruby
BitPuffin joined #ruby
pantsman joined #ruby
pantsman joined #ruby
Evixion joined #ruby
phrewww joined #ruby
phrewww left #ruby
rsampaio joined #ruby
alanp_ joined #ruby
<djMax> libxml on windows is failing to install. ideas?
rushed joined #ruby
pestouille left #ruby
lprelle joined #ruby
<djMax> is there a non-native libxml for ruby?
Adman65 joined #ruby
<Afal> nokogiri?
<lprelle> little question, how can I run a .rb file?
<lprelle> just ruby foo.rb ?
<jmontross> ruby file.rb
<jmontross> ruby -e 'puts stuff'
<jmontross> stuff is not defined!
<lprelle> I was not sure, but it worked
<lprelle> thanks
<djMax> what a clusterfu** ruby on windows is. Yeesh.
<havenn> lprelle: or puts "#!/usr/bin/env ruby" on the first line of the file, and execute like: ./file.rb
<havenn> put**
<lprelle> havenn: pretty good, thanks
<jmontross> what a cluster… x on windows
<djMax> is there an alternative to libxml-ruby that supports the same interface?
MissionCritical joined #ruby
<yfeldblum> libxml has got nothing to do with windows ...
<djMax> oh yes it does
<djMax> It uses native shit. And that native shit does not work in 64 bit windows
<djMax> at least not what gem installs.
djr_ joined #ruby
<yfeldblum> libxml is here: http://xmlsoft.org/
lprelle left #ruby
incluye joined #ruby
<yfeldblum> "The libxml gem provides Ruby language bindings for GNOME�s Libxml2 XML toolkit."
incluye joined #ruby
<havenn> yfeldblum: Wrong libxml: http://libxml.rubyforge.org/rdoc/
incluye joined #ruby
<tightwork> djMax: Oh I thought it was just me. I'm ruby newb but thought to try aptana for easy button... WTH?
<yfeldblum> havenn: that's the libxml gem, which "provides Ruby language bindings for GNOME�s Libxml2 XML toolkit."
<havenn> yfeldblum: Roger that, confused me for a sec. >.>
<yfeldblum> GNOME libxml2 is here: http://xmlsoft.org/
Targen joined #ruby
wyhaines joined #ruby
AzizLight joined #ruby
<AzizLight> Hi everybody
<shevy> djMax windows is quite annoying but ruby works on windows
<AzizLight> Can someone tell me why my YAML is not being parsed by Psych please? http://pastie.org/2885624 I am getting a Psych::SyntaxError
wyhaines joined #ruby
<shadoi> AzizLight: !!! is invalid
crankycoder joined #ruby
Pip joined #ruby
Pip joined #ruby
rsampaio joined #ruby
<AzizLight> shadoi: I am getting an error at line 1 column 15 which is the first opening square bracket..why is that not valid, it's in a string
der| joined #ruby
<shadoi> try single quotes? it's interpolating things
<shadoi> probably
skrewler_ joined #ruby
<AzizLight> shadoi: yup that fixed it, but it doesn't make sense, why is it interpolating?
<shadoi> backslashes
<shadoi> escape characters basically
rbanffy joined #ruby
<AzizLight> oh yeah, obviously :S
<AzizLight> shadoi: anyway thanks a lot
<shadoi> it's easy to tell in pastie because of the syntax highlighting
Pip joined #ruby
mindCrime_ joined #ruby
<zastaph> been looking for a code sample for sqlite3.trace function at http://sqlite-ruby.rubyforge.org/sqlite3/classes/SQLite3/Database.html#M000100 without any luck .. do I just call db.trace(nil, myblock) ? where def myblock p "test" end
<zastaph> i want to print out all sql calls
Indian joined #ruby
Guedes joined #ruby
Guedes joined #ruby
Draco_ joined #ruby
simensen joined #ruby
<simensen> I have a Rakefile that imports another .rake, is there a way to do the import such that the imported .rake gets the environment/variables that were setup in the Rakefile? If not, what is the best way to do something like what I'm doing so that the imported .rake files can have some sort of context passed to them?
lusory joined #ruby
kenichi joined #ruby
chiel left #ruby
<zastaph> figured it out
Cervajz joined #ruby
Cervajz joined #ruby
cdepue joined #ruby
sythe joined #ruby
<simensen> I'm not sure I'm even asking the question correctly.
<jmontross> ENV['variable']
<simensen> And I'm guessing it isn't allowed exactly like I'd like to do it anyway. Which is fine. But there must be a common way to handle this problem.
<jmontross> or write some yaml file and read it out
<simensen> so in each .rake i'd just re-read the yaml?
<jmontross> i've never done what you are describing with multiple rakes calling eachother… i usually just do one rake file
<jmontross> you might be able to do instance eval or something and pass in variables as you call the other rake file… i
strife25 joined #ruby
sythe_ joined #ruby
Guedes joined #ruby
n8ji joined #ruby
kirun joined #ruby
<friskd> how to i include/create an instance of a class dynamically?
<jmontross> example?
<jmontross> if statements are good.
<jmontross> if some_condition then YourClass.new end
<jmontross> if String then String.new end
<friskd> ex: my script loads i have 15 separate scripts. AAgent, BAgent, CAgent etc. When my my script loads, I get an Agent id. so if its agent id =1 then i want to be able to do require "#{Rails.root}/vendor/agent/1"
<jmontross> that runs and creates a class dynamically.
<friskd> then Agent = Agent1.new('local')
<friskd> the dynamic part being the "1"
<jmontross> if String then require 'CSV' end
<jmontross> require "#{Rails.root}/vendor/agent/1#{agent_id}"
visof joined #ruby
<jmontross> require "#{Rails.root}/vendor/agent/#{agent_id}"
<friskd> so could it be like agent = new Agent#{agent_id}
<jmontross> use irb
<jmontross> type irb
<jmontross> on console
<jmontross> and then test your assumptions
<jmontross> err - in a unixy terminal.
<friskd> ok. Just learning this ish. Thanks. Ill give that a shot.
<friskd> <-- osx
artOfWar joined #ruby
<friskd> terminal
<jmontross> irb is really useful. yeah - osx you'll be fine
dhodgkin joined #ruby
QaDeS joined #ruby
MasterIdler_ joined #ruby
n8ji joined #ruby
kf8a joined #ruby
gener1c joined #ruby
gener1c joined #ruby
<gener1c> well
GR joined #ruby
aef joined #ruby
<gener1c> i made a class that have 2 options for its single initiation parameter
<gener1c> how would you recommend making those options more visible to the user?
<gener1c> i used constants with meaningful names
<gener1c> is there a better way?
<shevy> gener1c often that is a good choice
<shevy> IRB for example uses that too:
<shevy> IRB.conf[:VERBOSE] = true
<gener1c> where can i see its code?
<shevy> for IRB? better don't ... but you can find it somewhere in the SITE_DIR of ruby
<gener1c> it looks more like an accessor
CannedCorn joined #ruby
<shevy> gener1c you can look at /usr/lib/ruby/1.8/irb/init.rb
<shevy> I think IRB may be a module
<gener1c> i used obj = Class.new(CONST)
<shevy> module IRB; IRB.setup(ap_path)
<gener1c> but the const if loaded with the class file
<gener1c> its outside the scope of the class in that file
justinmcp joined #ruby
<gener1c> i dont have that file
<gener1c> i do have it lol
skillachie joined #ruby
pootpoot left #ruby
bbttxu joined #ruby
<gener1c> i didnt get to modules yet
cooper joined #ruby
<gener1c> so you say @CONF is not a class variable since its in a module
<shevy> hmm
<shevy> why did I give IRB as example :(
Newbs joined #ruby
<shevy> gener1c, I think the .conf method just accesses a hash internally
eignerchris_ joined #ruby
mensch joined #ruby
CapsuleNZ joined #ruby
<CapsuleNZ> Hey guys, Is someone free for a quick chat about a bug I'm getting. I'll be happy to pay.
Seisatsu joined #ruby
axl_ joined #ruby
axl_ left #ruby
craigglennie_ joined #ruby
craigglennie__ joined #ruby
_numbers joined #ruby
<_numbers> so when resque launches a job it does it as some kind of fork
<_numbers> if an error occurs before the fork is created, a trace will appear when it crashes
<_numbers> but inside the job, resque only emits the error without a trace and restarts the job
<_numbers> i wonder how i can get a trace when an error occurs at the job level
eywu joined #ruby
eignerchris joined #ruby
[1]maarten joined #ruby
hyperboreean joined #ruby
j3r0m3 joined #ruby
<_numbers> when an exception is caught, how can i print the backtrace from inside the rescue block
thecreators joined #ruby
<_numbers> e.backtrace.join(" ")
skrewler joined #ruby