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
<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
<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
<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...
<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.
<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>
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
<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
<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
<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)
<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
<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)
<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
<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
<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.
<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.
<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
<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
<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
<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
<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
<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.