Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<zenspider> injekt: define "not work" ?
<zenspider> if a test task isn't set up... but that's obvious so...
<injekt> zenspider: using the --seed option doesn't use that seed
niklasb [niklasb!~codeslay0@p5B3109E4.dip0.t-ipconnect.de] has joined #ruby-lang
<injekt> so I assume the options arent being read
<zenspider> how'd you hook up the test?
<zenspider> (to rake)
<injekt> zenspider: minitest/autorun and manual requires
<zenspider> minitest doesn't know anything about rake, so TESTOPTS prolly isn't being used
<zenspider> (minitest doesn't know TESTOPTS either)
<zzak> drbrain: '@agent.agent.http.reuse_ssl_sessions = false' did it, thanks!
<injekt> oh.. must be a rake thing
<zenspider> try `ruby -Ilib test/test_blah.rb --seed 42` first
<zzak> drbrain: will you ping #13 when youve resolved the issue?
<injekt> zenspider: yup that works fine, must be a rake issue. Thanks
<zenspider> I haven't looked at rake's test task in a really long time
<injekt> zenspider: I read that rake steals TESTOPTS and throws it at minitest, that was all
<drbrain> zzak: I'll push a commit with the issue number, but I don't know if that causes a notification
<zenspider> sure looks like it: ruby "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}"
<zenspider> option_list => ENV["TESTOPTS"] ...
<injekt> zenspider: odd
<zzak> drbrain: thanks
<injekt> zenspider: yup, doesn't work here, strange
<zenspider> injekt: is it doing -e requires or -Ilib + rake_loader ?
<zenspider> try setting loader to :direct if it isn't -e requires
<injekt> zenspider: -I lib and manual requires, Dir['test/*_test.rb'] and require
<zenspider> well shit
<injekt> ahh
<injekt> well duh
* injekt slaps himself
<zenspider> ?
<injekt> that code you have is for the rake test task?
<zenspider> I'm looking at testtask.rb yeah
<injekt> which I dont use, I assume rake doesn't even look at TESTOPTS with the method I'm using
<injekt> yeah
<injekt> my fault
mkovacs [mkovacs!~mkovacs@216.38.150.34] has joined #ruby-lang
<zenspider> hee
<zenspider> so if you rolled your own, just throw in ENV['TESTOPTS'] into your sh string
<injekt> word
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
havenn [havenn!~skipper@rrcs-76-79-113-21.west.biz.rr.com] has joined #ruby-lang
<Guest42318> i'm trying to write text for a text file format converter ... i could just test the input file vs. a expected output file, correct?
mksm [mksm!~ramorim@pdpc/supporter/professional/mksm] has joined #ruby-lang
<mksm> *write tests
<drbrain> mksm: yup
<zenspider> abstract out the conversion from the file writing and test the conversion directly
<mksm> drbrain: a colleague says I should test the method that converts each line, not just input/output. I feel like testing every detail of the internal code is turning a small simples project into something way larger
<drbrain> mksm: if it's a complex format, line by line is better
<mksm> it seems that i need both then ... test the conversion and the other methods for header/footer and then the input vs. output file.
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
<drbrain> most likely
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
<mksm> testing is too much work <.<
<injekt> rarely
<drbrain> mksm: testing has saved me uncountable hours of time
<injekt> time you dont appreciate unless you forgot to test something
<injekt> but.. it's there
<drbrain> it's best when you add some new feature and you find out that it broke something that you never would have remembered
<zenspider> mksm: I'm working on something very similar right now... and testing saves my ass EVERY. Single. Day.
<injekt> regression testing <3
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
<zenspider> I was just able to isolate a bug, corner it into a test, and then work out the solution. boom done.
<mksm> tests are essential but they are a lot of work
<mksm> or i'm not doing it right
<shevy> yeah you need discipline
<shevy> hippie coders don't test
<zenspider> they're not much more work than you're already doing, and they permanently prevent regressions... so they make up for the time spent
<zenspider> shevy: haha
<zenspider> I like that term
<mksm> shevy: duuuuude, make code not test
<mksm> but yeah, they save our asses/weekends
<injekt> hippie coders
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
<mksm> what's that thing that shows test coverage?
<drbrain> simplecov
takaokouji [takaokouji!~takaokouj@2001:268:306:1:225:bcff:fedc:e1fe] has joined #ruby-lang
<mksm> thanks
wyhaines [wyhaines!~wyhaines@64.134.162.13] has joined #ruby-lang
<zzak> drbrain: nvm that didn't fix it, still getting 'certificate verify failed'
<zzak> Net::HTTP::Persistent::Error: too many connection resets (due to SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed - OpenSSL::SSL::SSLError) after 0 requests on 23186980, last used 1327019940.1339812 seconds ago
<drbrain> zzak: hrm
<zzak> could it be the server i'm requesting?
<drbrain> it could be
<zzak> i have no idea what their using
<drbrain> without vcr, can you connect?
<drbrain> maybe you don't have the right certificate?
lightcap [lightcap!~lightcap@97-115-90-91.ptld.qwest.net] has joined #ruby-lang
<zzak> same issue
<zzak> even without vcr
<zzak> i've installed ca-certificates for ubuntu
<wwalker> zzak: i hate to be ovious, but your earlier gist had http not https....
<zzak> right, this _is_ http
<wwalker> oh, quite strange that
<zzak> hm so it appears to be an issue on the server i'm requesting
<zzak> i'm getting a 302 to an https login page now
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<zzak> son of a..
<zenspider> abe?
<erikh> abe froman, the sausage king of chicago
_inc [_inc!~inc@unaffiliated/-inc/x-0498339] has joined #ruby-lang
<zzak> two things i hate in life: encodings and crypto
<zzak> oh, and regex
<zzak> three things
<drbrain> and counting?
<zzak> four things
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby-lang
<zenspider> five anybody? do I hear five?
<zzak> and spiders
replore [replore!~replore@203.152.213.161.static.zoot.jp] has joined #ruby-lang
<andrewvos> YES spiders
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby-lang
<cconstantine> I have a class instance, and the name of a method as a string/symbol. How would I wrap calls to methods of that name on instances of the class?
<cconstantine> class.alias_method and class.define_mathod ?
oddmunds [oddmunds!~oddmunds@s21-04214.dsl.no.powertech.net] has joined #ruby-lang
<injekt> cconstantine: 'wrap calls to methods of that name on instances of that class' confuses the hell out of me
RomyRomy_ [RomyRomy_!~stickycak@cpe-74-64-122-182.nyc.res.rr.com] has joined #ruby-lang
drdr [drdr!d059b08f@gateway/web/freenode/ip.208.89.176.143] has joined #ruby-lang
<injekt> you want to execute existing methods with this name, or build new ones?
<cconstantine> I want to replace an instance method on the class with another method that can call the old version
<injekt> oh, yeah define_method and alias_method
<zenspider> yes, alias it to the side and replace the method with a new one
<injekt> ^
<zenspider> I wonder if muff daddy is still around... did I gem that?
<injekt> muff..daddy..?
<zenspider> the ultimate wrapper!
jaisoares [jaisoares!~jsoares@bl13-197-21.dsl.telepac.pt] has quit [#ruby-lang]
<injekt> cconstantine: probably something like https://gist.github.com/ebc00248f7c5b998b3bf
<injekt> zenspider: what about mc muff daddy, the ultimate rapper?
<injekt> oh i missed it
<injekt> wow it's that late here
<injekt> zenspider: i like it
<injekt> eek
<zenspider> blame eric idle for the name
* injekt stares at drbrain
<injekt> eval all the things
<injekt> lol __rap_object
<drbrain> injekt: what, you wanted me to give you the video? http://www.thedailyshow.com/watch/mon-march-3-2003/eric-idle
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
<cconstantine> injekt: I don't want to have to call foo.class.send… for every new object
<injekt> cconstantine: then build a helper method, you're calling private methods on a class
<injekt> drbrain: oh snap
mantono [mantono!~mantono@c83-251-126-234.bredband.comhem.se] has joined #ruby-lang
<cconstantine> injekt: it'll be provided by a extend class
<injekt> then what's the problem?
<cconstantine> it's not working
<injekt> cconstantine: you might want to show some code then
<cconstantine> it's for protecting methods, so I want to be able to say "permission :method name, :some_permission" in a class
<cconstantine> and before :method is called on an instance some code verifies that you have :some_permission
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
<injekt> ahhhh
<injekt> you know you could use a delegator and permissions hash of some sort
<cconstantine> so it looks like, because I'm defining the permission at the top of the class no other methods are defined so the alias_method is failing
<injekt> not sure I'd redefine a new method for every single method just to test that
<savage-> here's an example of redefining methods to do an ActiveRecord before_filter type thingy: https://gist.github.com/1283413
<injekt> right
<savage-> right
<injekt> tehe method_added
<savage-> I agree, redefining all the methods might be a little overkill.
<savage-> ignore method_added though
<injekt> not often you see that
<savage-> that's being too clever
<cconstantine> sure
<savage-> but the basic idea of redefining methods is shown there.
<drbrain> injekt: oh, I guess this is not the right video
<injekt> drbrain: I wasn't allowed to watch it anyway
<injekt> plus I'm on a dial up connection right now
<drbrain> heh
<cconstantine> python and stewart… might be wrong but it's still right
<cconstantine> ew
<cconstantine> savage-: that's almost exactly what I wanted. thanks :)
<savage-> cconstantine: np
<injekt> :)
<injekt> savage-: how's the job/
<injekt> ?*
<savage-> injekt: love it!! :)
<savage-> injekt: let me know if you want to move to SF :)
<injekt> sweet :)
<savage-> injekt: we are hiring :)
<injekt> nice
<zenspider> savage-: where are you working?
<savage-> zenspider: http://www.spreecast.com
<injekt> I have some stuff on the table right now, but depending on how that goes, I may be eventually looking. Already have my eye on a couple of SF based companies
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
<savage-> injekt: cool!
<savage-> let me know if you'd like to chat, we're doing some really stuff here with ruby/rails/eventmachine/async-sinatra/etc.
<savage-> ^cool stuff
<injekt> well, new product is going out in 3 weeks, so I'll know within a few more how successful things are looking :)
<zenspider> heh
<savage-> cool !
<savage-> we are having a tough time finding qualified people.
<injekt> 'qualified' what does that mean? ;P
<savage-> almost everyone that I've interviewed iterates in ruby with: for x in y
<savage-> :-(
<injekt> hah
<injekt> I almost joined an SF company just before christmas but changed my mind at the last minute, heh. Still thinking about it, though
<injekt> I kinda liked van, though
<savage-> well, the weather is a lot better over here than in Canada :)
codewrangler [codewrangler!~codewrang@pool-108-28-240-83.washdc.fios.verizon.net] has joined #ruby-lang
<injekt> yeah, even better than the uk (where I am now)
queequeg1 [queequeg1!~chatzilla@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
<savage-> injekt: I thought you were in Canada?
<injekt> savage-: I came back early dec for xmas
<injekt> (I like here)
<injekt> live*
<savage-> ohhh
<savage-> I thought you were living in Canada permanently.
<injekt> I just went to canada for 4 months
<savage-> oh I see, gotcha.
<injekt> supposed to be heading back soon
<injekt> once visa stuff is sorted
<savage-> ah I see.
<injekt> so perhaps not so soon
<injekt> and on that note, sleep time. g'night!
<savage-> cya!
SuperTa__ [SuperTa__!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<cconstantine> savage-: did you write the code in that gist just for me?
<savage-> cconstantine: no I wrote it on an airplane back to Boston.
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<savage-> a while back
<cconstantine> haha, ok good :)
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
ricardovaleriano [ricardovaleriano!~ricardova@186.220.217.229] has joined #ruby-lang
<cconstantine> so, if I wanted to add a single method to every instance that does an 'include' of this permission class, how would I do that?
<cconstantine> would I just put it in add_hooks_to and just make sure I don't do it more than once per class?
<cconstantine> define_method(…) unless responds_to? method_name
jaisoares [jaisoares!~jsoares@bl13-197-21.dsl.telepac.pt] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<pablo_> cconstantine, khase?
<cconstantine> hu?
<pablo_> are u @khase?
<cconstantine> no
<pablo_> ok
<cconstantine> is that a good thing?
<pablo_> not beein him? :D
<cconstantine> yeah
<pablo_> may be :)
<pablo_> is a rubinius commiter
<cconstantine> ah
<cconstantine> any idea about my problem?
<pablo_> cconstantine, can u simplify it?
<cconstantine> defining an instance method on a class from an include(ed) module
<pablo_> ahhh ok
<pablo_> easy
<cconstantine> it always is :)
<cconstantine> or it always is when you know it
<pablo_> klass.singleton_class.define_method(:foo) { puts "this is the foo method" }
<pablo_> (put that inside the 'included' hook)
<cconstantine> what is klass?
<pablo_> the parameter
<pablo_> form the hook method
<pablo_> from*
<pablo_> the 1st and only parameter it takes
jredville [jredville!~james.dev@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
pabloh [pabloh!~pablo@186.22.82.39] has joined #ruby-lang
<cconstantine> I stated it wrong
<cconstantine> it's an extend relationship
<cconstantine> so in self.extended in the module I can't call define_method off klass
<pabloh> the module is "included" inisde the class like this: extend MyModule ?
<cconstantine> yes
<cconstantine> I mispoke earlier
<cconstantine> got it!
<cconstantine> make a submodule and in self.extended do: klass.send(:include, SubModule) and put the instance methods in SubModule
yakko [yakko!~quassel@200.175.171.251] has joined #ruby-lang
<cconstantine> thank you :)
ivanoats [ivanoats!~ivanoats@pdpc/supporter/active/ivanoats] has joined #ruby-lang
<pabloh> cconstantine: ok, u could also do: def extended klass; klass.send(:define_method, :foo) { puts "inside foo method" }
<pabloh> end
<cconstantine> oh, I suppose
Clordio [Clordio!~textual@c-174-52-72-79.hsd1.ut.comcast.net] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby-lang
jredvill_ [jredvill_!~james.dev@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
robglees_ [robglees_!~rob@87-198-38-217.ptr.magnet.ie] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
bludimnd [bludimnd!~amichai@178-83-34-252.dynamic.hispeed.ch] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
<bludimnd> I'm following the 20 min tutorial and I'm trying to understand what the following does:
<bludimnd> if __FILE__ == $0
<bludimnd> mg = Megagreeter.new
<bludimnd> mg.say_hi
<bludimnd> mg.say_bye
<bludimnd> any ideas?
<lianj> mg… is only run is this file is run directly
<bludimnd> i get that, I don't understand if __FILE__ == $0, what does that do?
<lianj> __FILE__ is the filename the code is in. and $0 the filename your process got started with
<bludimnd> ah ok, thanks ;)
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
<lianj> bludimnd: echo 'p [__FILE__, $0]; require "b"' > a.rb; echo 'p [__FILE__, $0]' > b.rb; ruby -I. a.rb
bludimnd [bludimnd!~amichai@178-83-34-252.dynamic.hispeed.ch] has quit [#ruby-lang]
bludimnd [bludimnd!~amichai@178-83-34-252.dynamic.hispeed.ch] has joined #ruby-lang
ricardovaleriano [ricardovaleriano!~ricardova@186.220.217.229] has joined #ruby-lang
nofxx [nofxx!~nofxx@187.23.26.139] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
Gekz [Gekz!~gekz@unaffiliated/gekz] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby-lang
crudson [crudson!~doug@static-96-227-79-15.phlapa.fios.verizon.net] has quit [#ruby-lang]
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
<theconartist> what is up with irb -r test
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
jredvill_ [jredvill_!~james.dev@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
ivanoats [ivanoats!~ivanoats@pdpc/supporter/active/ivanoats] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
rippa [rippa!~splitta@85.158.54.234] has joined #ruby-lang
imperator [imperator!~Daniel@184-96-109-96.hlrn.qwest.net] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
jredvill_ [jredvill_!~james.dev@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
gianlucadv [gianlucadv!~user@host32-80-dynamic.44-79-r.retail.telecomitalia.it] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531121.dsl.bell.ca] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-113-31.dclient.hispeed.ch] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.247.109] has joined #ruby-lang
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
perryh [perryh!~perryh@far3677.urh.uiuc.edu] has joined #ruby-lang
perryh [perryh!~perryh@unaffiliated/perry753] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
jalljo_ [jalljo_!jalljo@im.a.noo-b.com] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<lianj> a,b=:a,:b is so nice, but so slow compared to normal assignment :.(
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
<erikh> performance is important when stroking the rubby
<lianj> hehe true, but sometimes it matters when nicer syntax takes twice the time
thegeekinside [thegeekinside!~thegeekin@189.135.220.214] has joined #ruby-lang
<erikh> are you running 4,000 of them in a tight loop or something?
<lianj> somewhat, yes
takaokouji [takaokouji!~takaokouj@2001:268:306:3:226:8ff:fedd:31a3] has joined #ruby-lang
<erikh> does the loop start with Benchmark.bm ?
<erikh> I guess I'm not 100% certain how that's such a performance problem that it actually needs to be cared about
<lianj> its not a bottleneck in the app right now, but im so used to parallel assignment syntax
<lianj> true
<shevy> hmm
<shevy> a,b = :a, :b
<shevy> is slower than two lines with a = :a and b = :b ?
<lianj> erikh: its a gl render loop
<erikh> ok, you win :P
<lianj> shevy: yes. not noticeable in a normal app though.
<erikh> although, there's probably a "why are you using ruby in the first place" argument here too, though
<drbrain> erikh: because ruby is way easier than C
<drbrain> (I know, because I'm rehabilitating ruby-opengl)
<erikh> cool
<erikh> isn't there gosu as well?
<erikh> banisterfiend's thing
<lianj> haha yea. but i haven't touched a bottleneck yet with my gl stuff, cpu still stays cool :) just wanted to prepare if it gets more complex
<lianj> drbrain: hehe, shaders stay c-like though :P
<erikh> I need to go to a convention or something
<drbrain> lianj: are you working with ruby-opengl or the FFI wrapper I keep hearing about?
<drbrain> or something else?
<lianj> a ffi wrapper
<drbrain> ah
<lianj> if you drop the deprecated api (its in there though) the ffi binding for opengl is done in about 200 lines ^^
<robgleeson> shevy: you're optimizing wrong if you think that assignment is a bottle neck :p
<lianj> robgleeson: i was just curious if its syntax, and does the same thing, why its not same bytecode
<robgleeson> lianj: not sure to be honest
<robgleeson> I would like to know =)
<drbrain> a, b = 1, 2 creates an Array [1, 2] then takes it back apart
<drbrain> a = 1; b = 2 does not
<lianj> yep, the bytecode said that too :)
<lianj> is there a benefit to it, or was it just not easily implemented in another way?
<lianj> i'm not so good at ruby internal, sorry
<lianj> *s
<lianj> its that big of a topic here anyway. was just curious for a minute
<drbrain> you could optimize it if the RHS was literals, but I don't think anybody has bothered
<lianj> thanks
<savage-> just filed this, in case you guys are interested: https://bugs.ruby-lang.org/issues/5912
<drbrain> savage-: that's awesome
<savage-> #rubinius claims it works there though.
<drbrain> savage-: works on trunk
<savage-> mri trunk?
<drbrain> yeah
<savage-> i just tested that it works in rbx 2.0.0, but rails in mri 1.9.2p290 and 1.9.3.
<savage-> s/rails/fails
<drbrain> works on 1.9.2-p290 and 1.9.3-p0 as well for me
<savage-> what!
<lianj> drbrain: ack
<savage-> drbrain: type this:
<savage-> def foo; binding; end; b = foo { puts 'hi!' }; b.eval('Proc.new').call
<savage-> then type:
<savage-> b.eval('Proc.new').call
<savage-> that blows up for me.
<drbrain> twice?
<savage-> yes
<savage-> it's a super weird bug.
<drbrain> still passes
<savage-> well definitely fails on: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.1]
<robgleeson> crashes here
<theconartist> blew up for me
<savage-> and crashes on: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
<robgleeson> 3-p0
<theconartist> ^
<Okasu> works for me too
<drbrain> passes on ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
<drbrain> built with clang
<Okasu> ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
<lianj> 1.9.3_p0-2 - works here
<drbrain> and ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
<lianj> ruby -e "def foo; binding; end; b = foo { puts 'hi' }; b.eval('Proc.new').call; b.eval('Proc.new').call"
<drbrain> ruby -ve 'def foo() binding end; b = foo { puts "hi" }; b.eval("Proc.new").call; b.eval("Proc.new").call'
<erikh> working here, rvm gcc-4.2 build of 1.9.2-p290
<erikh> xcode 4.1 if that helps any
<erikh> built it earlier today
<deryl> yeah 4.1 works fine. its 4.2 thats flakey
<savage-> interesting
<savage-> well at least it crashes for some other folks.
<erikh> blame the compiler
<drbrain> llvm-gcc is flaky
<deryl> the osx-gcc-installer works too, but if you are going to need Node.js then you need the regular full xcode due to the headers.
<robgleeson> i didnt build with llvm-gcc
<deryl> forget if its Carbon or Cocoa headers that are needed
<erikh> X11 headers.
<erikh> probably carbon
<savage-> how do I find out which version of xcode I have?
<robgleeson> just run 'xcode'
<savage-> I'm running version 4.1 build 4B110
yxhuvud [yxhuvud!mongo@h-85-82.a212.priv.bahnhof.se] has joined #ruby-lang
<erikh> how'd you build ruby?
<savage-> just grabbed it using rvm.
<erikh> before or after late december?
<deryl> yeah we include the URL for the 4.1 dmg in the requirements
<erikh> because.. I had this exact argument with mr. papis, who argued back, until phusion said something about it.
<deryl> hrmm well we did
<erikh> about gcc-4.2
<deryl> i see michal changed hat out
<deryl> s/hat/that/
<savage-> erikh: definitely before december.
<erikh> :)
<erikh> totally have nothing else to add right now
* erikh does a dance
<deryl> erikh: if you had 4.1 already installed and upgraded to 4.2 it works fine because rvm checks for gcc-4.2 binary. 4.2 leaves it in place on an upgrade, but an initial install of 4.2 will not put it in place
<erikh> no, that is not what was happening
<erikh> it's why REE was failing to build, period
<deryl> something different then?
<erikh> he was using /usr/bin/gcc
<deryl> ahhh
<erikh> which is not gcc on anything xcode 4.x
<muzone> lol
<deryl> yeah thats the llvm version
<muzone> nice dance erikh
<theconartist> it runs fine for me in a script, not in irb
<deryl> erikh: actually it is.
<deryl> i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
<deryl> the version string for gcc-4.2 is i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
<drbrain> clang: Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
<erikh> /usr/bin/gcc is llvm-gcc
<deryl> yes
<erikh> anyhow
<muzone> erikh: i can see you bought http://www.youtube.com/watch?v=2HiuCaaQhxg haha
<deryl> i just said that i thought
<erikh> I'm already a white guy, I don't need an instruction manual
<muzone> :P
<deryl> the point was that gcc-4.2 binary is what is being looked for with rvm, and if thats not found then iirc, michal has it defaulting to --with-gcc=clang iirc
<deryl> been awhile
<deryl> hahah
<deryl> erikh: i thought that was just you playing with the bleach ;)
<erikh> ok!
<erikh> I am going to ... go stack b.b.'s underwater or something
<erikh> bbl
<deryl> time for me to hit the rack. 0136
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@host250-13-dynamic.54-79-r.retail.telecomitalia.it] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
fullsailor [fullsailor!~fullsailo@ip24-250-174-76.ga.at.cox.net] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
<heftig> lianj: parallel assignment seems to be fast on rbx
<heftig> it seems to skip the array creation
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
<lianj> heftig: oh, nice!
<heftig> just experimenting, rbx compile -Be 'c, d = :c, :d'
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
Locke23rus [Locke23rus!~quassel@188.162.162.191] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
thone [thone!~thone@g226033030.adsl.alicedsl.de] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.79] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby-lang
fritzek [fritzek!~fritzek@p5DDB5AF5.dip.t-dialin.net] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@2001:268:306:1:225:bcff:fedc:e1fe] has joined #ruby-lang
fritzek [fritzek!~fritzek@p5DDB5AF5.dip.t-dialin.net] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
<havenn> join #pry
<havenn> sry
jredville [jredville!~james.dev@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@2001:268:306:3:226:8ff:fedd:31a3] has joined #ruby-lang
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-10-236.dyn.iinet.net.au] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby-lang
cyri_ [cyri_!~cyri_@149.93.119.80.rev.sfr.net] has joined #ruby-lang
gaveen_ [gaveen_!~gaveen@unaffiliated/gaveen] has joined #ruby-lang
cyri_ [cyri_!~cyri_@149.93.119.80.rev.sfr.net] has joined #ruby-lang
tokumine [tokumine!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-10-236.dyn.iinet.net.au] has joined #ruby-lang
<tjgillies> how i can get foo to equal 4 in this example? http://cl.ly/281M2B3q2Q2o1f45141h
<tobiasvl> tjgillies: foo = 4
<tobiasvl> ?
<tobiasvl> :-/
<tjgillies> can you use a "pointer" for Fixnums?
<tjgillies> like bar = &foo
m1d4s [m1d4s!~m1d4s@178-37-171-87.adsl.inetia.pl] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.224.153] has joined #ruby-lang
<fullsailor> Integers in Ruby are stored as immediates
<fullsailor> There is no pointer
<fullsailor> Fixnums*
<fullsailor> So you would simply foo = 4 or foo = bar
<fullsailor> And they're immutable so they share a copy of the Integer
<rob___> hi
<tjgillies> fullsailor: thnx
<fullsailor> tjgillies: You're most welcome.
<fullsailor> Howdy rob__
<rob___> im using this: https://github.com/sosedoff/rackspace-clouddns/blob/master/lib/clouddns/configuration.rb and if i create an instance of CloudDns::Client.new, how do i go about setting CoudDns::Configuration.log_requests == true to enable logging?
shevy [shevy!~shevy@178-190-74-219.adsl.highway.telekom.at] has joined #ruby-lang
<fullsailor> Seems like you could just call CloudDns::Configuration.log_requests = true
<fullsailor> I'm not familiar with the API
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
<rob___> fullsailor: that's what i thought but dont i have to call it on my instance of CloudDns::Client.new ?
<fullsailor> No, its a global configuration
<rob___> ah ok, thanks! :)
<fullsailor> You're welcome
<tjgillies> fullsailor: how would i make a pointer to a string in this example? http://cl.ly/3c0g3w2t1w2v3M1j0k2Z
<tjgillies> str is "", i would expect it to be "hello"
<rob___> unfortunately: NoMethodError - undefined method `log_requests=' for CloudDns::Configuration:Module:
<fullsailor> rob__: Make sure you're using the version that belongs to that source.
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
<rob___> fullsailor: sorry, how do you mean? the gem version?
<rob___> fullsailor: i checked it out from that git repo
<fullsailor> Okay
<fullsailor> oh
<fullsailor> It's being used by the root namespace
<fullsailor> CloudDns.log_requests = true
robotmay [robotmay!~robotmay@94.30.13.228] has joined #ruby-lang
<fullsailor> tjgillies: We don't use pointers in Ruby
<rob___> fullsailor: ahh! perfect thank you..
<tjgillies> then whats the point of Object#dup?
<fullsailor> To get a second copy of the object
<tjgillies> why not var2 = var1
<tjgillies> wouldn't that make a second copy?
<fullsailor> They are *pointers* but that's an implementation detail of the runtime, not really Ruby
<fullsailor> It won't
<fullsailor> They'll share a copy
<tjgillies> so if they are actually pointers underneath, why does str == "hello" in my example?
<tjgillies> doesn't
<rippa> because "hello" is new instance
<fullsailor> Yeah you replaced the value
<rippa> man.replace "hello" would work
<fullsailor> You didn't mutate the instance
<tjgillies> is it like man = String.new "hello"
<rippa> yes
<tjgillies> ah
<tjgillies> so man.gsub! /.*/, "hello" would get me what i want probably
<fullsailor> That's what String#replace does
<tjgillies> ahhh
<tjgillies> fullsailor: thanks
workmad3 [workmad3!~workmad3@vpn148.its.manchester.ac.uk] has joined #ruby-lang
zmack [zmack!~zmack@78.97.143.6] has joined #ruby-lang
t0h [t0h!thelineva@nikita.tnnet.fi] has joined #ruby-lang
TTilus [TTilus!terotil@idan.ihme.org] has joined #ruby-lang
<whitequark> is there any gem with an implementation of lazy array?
<whitequark> namely, I want to do array.map { |elem| expensive_computation(elem) } and have the computation only be performed when necessary
<whitequark> that's not a drop-in replacement for Array
<rippa> it's not
antinitro_ [antinitro_!~adam@93-97-23-188.zone5.bethere.co.uk] has joined #ruby-lang
peppe__ [peppe__!4f0f14a7@gateway/web/freenode/ip.79.15.20.167] has joined #ruby-lang
<peppe__> hi all, in extconf.rb, how do I check if I'm on 32 vs 64 bits platform?
bludimnd [bludimnd!~amichai@178-83-34-252.dynamic.hispeed.ch] has joined #ruby-lang
tokumine [tokumine!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
bludimnd [bludimnd!~amichai@178-83-34-252.dynamic.hispeed.ch] has quit [#ruby-lang]
<peppe__> got it
<peppe__> `uname -a`
srbartlett [srbartlett!~srbartlet@124-170-10-236.dyn.iinet.net.au] has joined #ruby-lang
<darix> peppe__: why do you need to know it?
dave_miles [dave_miles!~davemiles@gatej.thls.bbc.co.uk] has joined #ruby-lang
<peppe__> different library to include
<darix> huh?
<peppe__> I have two version of a library: 32 and 64 bits
<peppe__> I need to tell the linker which one to use
<darix> why is the library different for the 2 architectures
<darix> just curious
<peppe__> because the vendor has two different version
<darix> aha
<darix> smells like commercial binary only stuff
<peppe__> trying to build a ruby extension for the Faircom DB
<darix> ic
<darix> good luck. you will probably need it
<peppe__> ty
<darix> peppe__: you could also check RbConfig::CONFIG['arch']
<darix> peppe__: RbConfig::CONFIG['target_cpu']
<peppe__> let me try
<peppe__> yup, work fine
<peppe__> I was trying something like /x86_64/ =~ `uname -a`
<peppe__> I'll go with your official ruby version
<peppe__> ty, darix
<darix> welcome
tokumine_ [tokumine_!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
nofxx [nofxx!~nofxx@187.23.26.139] has joined #ruby-lang
ovnimancer [ovnimancer!~anton@212.59.96.38] has joined #ruby-lang
tekin [tekin!~tekin@host-78-151-28-217.as13285.net] has joined #ruby-lang
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
toretore [toretore!~toretore@crr06-3-82-231-12-81.fbx.proxad.net] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
x0F [x0F!~x0F@unaffiliated/x0f] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@31.203.200.89] has joined #ruby-lang
robotmay_ [robotmay_!~robotmay@94.30.13.228] has joined #ruby-lang
judofyr [judofyr!~judofyr@195.159.219.65] has joined #ruby-lang
<judofyr> HEY MY HOES
_inc [_inc!~inc@unaffiliated/-inc/x-0498339] has joined #ruby-lang
gix [gix!~gix@e180003251.adsl.alicedsl.de] has joined #ruby-lang
<andrewvos> hello
m1d4s_ [m1d4s_!~m1d4s@77-253-135-242.adsl.inetia.pl] has joined #ruby-lang
QaDeS [QaDeS!~mklaus@frbg-5d84f20b.pool.mediaWays.net] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
ahf [ahf!ahf@irssi.org] has joined #ruby-lang
ahf [ahf!ahf@irssi/staff/ahf] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
nofxx [nofxx!~nofxx@187.23.26.139] has joined #ruby-lang
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
<rob___> hi can someone tell me why this fails: module Foo; def test; puts "hello!"; end;end; Foo.test
<andrewvos> rob___: Because the test method is not a class method.
<andrewvos> Try Foo.new.test
<lianj> andrewvos: its a module, but yea
<rob___> but i'm creating a module!
<rob___> is what im trying to do fundamentally wrong?
<andrewvos> lianj: Oh didn't see that :)
<rob___> i want to seperate my method definitions into different namespaces but access them directly
<lianj> no, if what you want is a class method
dr0id [dr0id!~andy@115.187.37.63] has joined #ruby-lang
<lianj> def self.test;...
<rob___> basically im using sinatra and dont want to keep all my methods in the 'helper' block
<lianj> or module Foo; module_fuction;...
<rob___> i dont want a class method though do i?
<rob___> i dont really understand what you're saying
<lianj> if you want to do Foo.test, yes
<lianj> module Foo; def self.test; puts "hello!"; end;end; Foo.test
<lianj> or
<lianj> module Foo; module_function; def test; puts "hello!"; end;end; Foo.test
<lianj> or
<lianj> module Foo; def test; puts "hello!"; end; extend self; end; Foo.test
<rob___> so by extending itself it adds it's own methods to the module object?
setmeaway2 [setmeaway2!~setmeaway@118.45.149.247] has joined #ruby-lang
<lianj> it adds his instance methods to its class obj
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
dave_miles_cf [dave_miles_cf!~davemiles@gatej.mh.bbc.co.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby-lang
dave_miles_cf [dave_miles_cf!~davemiles@gatej.mh.bbc.co.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<rue> rob___: If you want to call a method like Foo.test, it's the same as anyobject.test. The object, in this case Foo, must respond to the method
<rue> Any of the above ways work
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
publicvoid_ [publicvoid_!~publicvoi@p5DC15226.dip.t-dialin.net] has joined #ruby-lang
soze [soze!29df91eb@gateway/web/freenode/ip.41.223.145.235] has joined #ruby-lang
<soze> hi
<soze> pls i need some help with Ruby.. a newbie here
<tobiasvl> soze: ok?
<tobiasvl> just ask your questiom
<tobiasvl> n
<tobiasvl> i'm sure someone can help :)
niklasb [niklasb!~codeslay0@p5B31098C.dip0.t-ipconnect.de] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-78-144-139-130.as13285.net] has joined #ruby-lang
ricardovaleriano [ricardovaleriano!~ricardova@186.220.217.229] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@194.209.75.58] has joined #ruby-lang
<soze> thank you @tobiasvl
<soze> ActiveRecord::JDBCError: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.: SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [tbl_traces].trace_id) AS _row_num, [tbl_traces].* FROM [tbl_traces] WHERE [tbl_traces].[] = N'22') AS t WHERE t._row_num BE
<soze> I have that error when I try to run this
<soze> @tbl_trace = TblTrace.find(params[:id])
<soze> notice the ......... WHERE [tbl_traces].[] = N'22')
<soze> no column was supplied in d query
empity [empity!~user@149.255.121.162] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
mark_locklear [mark_locklear!~jlocklear@ab-tech-lan-to-ab-tech-gw.ncren.net] has joined #ruby-lang
<judofyr> soze: that's very weird
<judofyr> what is params[:id] ?
<judofyr> (what value does it has)
<apeiros_> icanhazvalue!
malev [malev!~malev@190.210.138.237] has joined #ruby-lang
* apeiros_ feel elpful
<judofyr> apieros: always
<soze> my primary key is tracer_id not id
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<kke> how come String#concat isn't concat!
<soze> @judofyr
<soze> my primary key is tracer_id and not id
<tobiasvl> kke: it's not?
<soze> I tried to change that to tracer_id but it says "Couldn't find TblTrace without an ID"
<judofyr> kke: <<
<judofyr> kke: and what do you mean "it isn't" ?
<kke> judofyr: s="foo"; s.concat("poo"); s.inspect => "foopoo"
<judofyr> kke: yes?
<kke> i would think it would be s.concat!("poo") if it overwrites
<apeiros_> judofry, who's it going?
<tobiasvl> kke: isn't that concatenation?
<judofyr> ah, but ! doesn't mean "overwrite"
<judofyr> ! means "more dangerous than without !"
<apeiros_> actually it just means "dangerous"
<kke> just like str.upcase! modifies the original and str.upcase returns the modified version
<judofyr> I disagree
<apeiros_> kke: there ain't push & push!, unshift & unshift! etc. either
<judofyr> you pretty much never see a bang-method without a equivalent non-bang-method
<kke> correct
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-ffhmlzduwxqdftog] has joined #ruby-lang
<Spooner> I'd expect: s="foo"; s.concat!("poo"); s => "foopoo"; s.concat("poo") => "foopoopoo"; s => "foopoo"
<Spooner> But since we have + and += anyway, seems moot.
<soze> judofyr: pls help
<apeiros_> judofyr: while that's true, we have what matz said, and afair that was simply and only "dangerous", not "more dangerous than"
<soze> is there something I need to do to tell ruby that my primary key is tracer_id and not id?
<rue> soze: Drop and roll!
<soze> sry, I dont understand what that means (newbie)
<rue> soze: In AR, you can .set_primary_key or somesuch
<kke> soze: that's something you should ask in #rubyonrails
soze_ [soze_!29df91eb@gateway/web/freenode/ip.41.223.145.235] has joined #ruby-lang
<kke> but if you google "rails legacy database", you'll find how it's done
<soze_> sry I lost conection
<soze_> I didnt see ur previous posts
<kke> soze: that's something you should ask in #rubyonrails, but if you google "rails legacy database", you'll find how it's done (set_primary_key :poop maybe)
<tobiasvl> *snicker*
<kke> snickerpoop
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
<soze_> kke: thanks
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
ricardovaleriano [ricardovaleriano!~ricardova@186.220.217.229] has joined #ruby-lang
<andrewvos> I want to run a bit of code for 30 mins, then another bit of code for 4 hours. Any thoughts how I can make this happen in a stable manner
<andrewvos> ?
<andrewvos> Same script though
joast [joast!~rick@76.178.187.164] has joined #ruby-lang
rippa [rippa!~rippa@87-253-30-9.pppoe.yaroslavl.ru] has joined #ruby-lang
<rue> Depends largely on the characteristics of the code
<andrewvos> rue: Which characteristics?
<rue> You can time it out in many ways
<rue> Primarily whether the code has a natural run-pause rhythm. If it's a busy loop, then you'll need to just kill it off
<andrewvos> rue: I want it to run for ten hours in total. For the first thirty minutes it will request and record the response from a set of urls. Then I fake a downed API. Then I run it for a few hours again and record all responses. (This is to tested caching obviously)
<andrewvos> s/tested/test
<rue> At its simplest, you could use Timeout
<andrewvos> rue: the method?
<rue> Is it the same code and you're just changing what happens when it runs?
<andrewvos> Oh ok I see
<andrewvos> Yeah
<andrewvos> So timeout would work in this situation
tekin [tekin!~tekin@88-96-65-166.dsl.zen.co.uk] has joined #ruby-lang
<judofyr> THIS FRIDAY IS SPONSORED BY: http://www.youtube.com/watch?v=1GaKaGwch0U
soze_ [soze_!29df91eb@gateway/web/freenode/ip.41.223.145.235] has joined #ruby-lang
jjmgbt [jjmgbt!~chatzilla@c-71-61-59-172.hsd1.pa.comcast.net] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@216.199.155.226.nw.nuvox.net] has joined #ruby-lang
<rue> Platinum sponsor
knicholl [knicholl!~knicholl@CPE0023bee423c3-CM0023bee423c0.cpe.net.cable.rogers.com] has joined #ruby-lang
<jjmgbt> Help me, ruby-masters! http://pastie.org/3219108
mztriz [mztriz!~mztriz@nkugateway.nku.edu] has joined #ruby-lang
<mztriz> Is there a directory listing script for a website in Ruby...similar to this? http://greg-j.com/phpdl/
jkprg [jkprg!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
<Tasser> mztriz, you should have one in 10 minutes ;-)
<Tasser> mztriz, cross-posting is evil btw
<mztriz> Tasser, lol sorry
Defusal [Defusal!~DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
outoftime [outoftime!~mat@ool-ad03cbeb.dyn.optonline.net] has joined #ruby-lang
indstry [indstry!~apple@c-71-238-98-243.hsd1.mi.comcast.net] has joined #ruby-lang
Defusal [Defusal!DeFi@dsl-240-243-100.telkomadsl.co.za] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-145.washdc.btas.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
<rob___> hi, if i create an include like this: http://pastie.org/3219193 for sinatra and then try and run Rob::SubRob.test i get 'NameError: uninitialized constant Rob', can anyone tell me what I'm doing wrong?
<rob___> or if i've made some fundamental error
Asher [Asher!~asher@c-24-126-149-16.hsd1.ga.comcast.net] has joined #ruby-lang
<judofyr> rob___: Rob isn't in the global namespace
<judofyr> Sinatra::Rob::SubRob should work
<rob___> im trying to call it from a route
<rob___> reading from here: http://www.sinatrarb.com/extensions.html
<rob___> the first example doesn't do Sinatra.h, it just does 'h'
<judofyr> method lookup behaves differently from constant lookup
<rob___> or rather, it doesn't do Sinatra::HTMLEscapeHelper.h
<judofyr> rob___: that's because `h "foo"` isn't the same as `Sinatra::HTMLEscapeHelper.h "foo"`
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
<rob___> judofyr: i think i'm missing something..
<judofyr> rob___: do you know how modules work?
<judofyr> (or, how it works when you include/extend them)
<rob___> judofyr: im trying to learn
<judofyr> rob___: "helpers Rob" is the same as "class Sinatra::Request; include Rob; end"
<rob___> what also confuses me is why in my methods in my module i cant access Sinatra::Base.halt
<judofyr> rob___: just call "halt"
<rob___> once i've done 'helpers Rob'
<rob___> yeah, i get 'undefined method'
<judofyr> rob___: could you paste your example?
<rob___> could you give me 5 minutes to write a test-case?
<judofyr> sure
<rob___> thanks brb
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby-lang
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
<rob___> hi again!
<rob___> this is where my confusion lies
<rob___> judofyr: is it because i'm using two layers of modules?
<judofyr> rob___: yes
<judofyr> and because Sinatra::HTMLEscapeHelper.h and h are two completely different things
<rob___> still confused :)
<judofyr> rob___: the important thing you must know: self
<judofyr> self decides what methods and instance variables you can access
<judofyr> someobject.somemethod runs the `somemethod` with someobject as self
<judofyr> so `Sinatra::HTMLEscapeHelper.h` means that the h-method is called with Sinatra::HTMLEscapeHelper as self
<judofyr> same with Sinatra::Rob::SubRob.test
<judofyr> so that means that inside the test-method, it doesn't know that it has been called from a Sinatra request
<judofyr> because self == Sinatra::Rob::SubRob
<rob___> ah i see
<judofyr> running "halt" inside there will lookup halt within Sinatra::Rob::SubRob
<judofyr> and there is no Sinatra::Rob::SubRob.halt
<judofyr> also note that `halt` is the same as `self.halt`
<rob___> and this is because using 'helpers Rob' to register my module doesn't understand sub modules?
<judofyr> if you had this: module Sinatra::Rob; def test; … end; end
<judofyr> then you could call `test` from within your app
<rob___> the reason i wanted that extra layer of modules is because if i load two of my modules then the method names will clash..
<rob___> i want to be able to seperate the namespaces
<judofyr> rob___: why do you want them as helpers?
<rob___> so i can use them from my routes
<judofyr> helpers are there explicitly for creating methods you can use directly in your routes
<judofyr> isn't it really needed?
<rob___> maybe my application design is wrong then
<judofyr> if so: rename the helpers do they don't clash
<rob___> ok, is that the solution? i thought having submodules and accessing them through their sub-module names would be neater..
<judofyr> first of all: it's not equivalent
<rob___> because of self?
<judofyr> doing "Mod.meth" is completely different from "meth"
<judofyr> yes
<rob___> ok, then i suppose i dont really understand modules properly
<rob___> this is the first time i've tried to use them
<judofyr> the only reason you can actually call "Mod.meth" is because you used the "extend self" trick
<apeiros_> extend self--
<apeiros_> use module_function
<apeiros_> (which is what things like the Math module use too, just as an example)
<rob___> oh
uniqanomaly [uniqanomaly!~ua@dynamic-87-105-215-27.ssp.dialog.net.pl] has joined #ruby-lang
<rob___> i'll look up method_function
<rob___> but is what i'm trying to do fundamentally A Bad Thing?
<judofyr> rob___: your app shouldn't have helpers which clashes
tekin [tekin!~tekin@88-96-65-166.dsl.zen.co.uk] has joined #ruby-lang
<apeiros_> rob___: module_function, not method_function
<judofyr> rob___: if you want to use other classes/modules in your routes, you don't need to register them as helpers
<judofyr> just use them
<rob___> even if they include 'halt'?
<judofyr> nope. you can only use halt in a helper or your routes
<rob___> ok so that's why i was trying to make an extension
<judofyr> just try to write classes which don't need halt inside them :)
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
elux [elux!~peter@96.45.198.150] has joined #ruby-lang
<rob___> judofyr: :)
<judofyr> rob___: it's kinda hard to know without seeing the real code, but it seems to me that you're making the helpers do too much
<rob___> judofyr: im not sure where else to put my code?
<rob___> i thought the helpers where simply where you defined all your methods to do all the work
Sailias [Sailias!~jonathan@206-248-172-164.dsl.teksavvy.com] has joined #ruby-lang
<judofyr> no, no, no. helpers are there for simple stuff that's used in several routes
<judofyr> so you don't need to copy-paste code around
<judofyr> rob___: to give an example: when you click the "Follow" button on Twitter, they don't have a follow_user_helper. instead they have a User class (representing a user) that has a follow-method
<judofyr> rob___: so their route look something like: current_user.follow(User.find(params))
<judofyr> sorry
<rob___> i didnt see any point in putting these methods in a class since they have no state
<judofyr> current_user.follow(User.find(params[:id]))
<judofyr> well, they must be working on *something*. what do they take as argument?
<rob___> basically this app is an interface between an api on another web server and a php page
ap3mantus [ap3mantus!~ap3mantus@c-98-217-179-108.hsd1.ma.comcast.net] has joined #ruby-lang
<judofyr> so, what kind of helpers do you have?
<judofyr> e.g. what do they do; what's the name; what are the parameters?
<rob___> so an example:
ricardovaleriano [ricardovaleriano!~ricardova@201-27-125-84.dsl.telesp.net.br] has joined #ruby-lang
<rob___> one helper takes in params['name'], adds something to it and then calls this other webserver with the new parameter
zmack_ [zmack_!~zmack@78.97.143.6] has joined #ruby-lang
MistyM [MistyM!~mistym@50.museumforhumanrights.com] has joined #ruby-lang
<judofyr> I would have a class called WebService (or, the name of the web-service/server). with something like this: def initialize(options = {}) @url = options[:url] end
<judofyr> and then maybe a low-level: def call(url) end
jxie [jxie!~jxie@115.197.87.147] has joined #ruby-lang
<rob___> what's the point in creating a class for it when it has no state?
<judofyr> and one for your specific example: def do_something(name) call(name + "foobar") end
<judofyr> rob___: what's the other solution?
<rob___> because it is better to keep code in classes than modules or helpers?
<judofyr> this class can be used outside of Sinatra too
<rob___> i dont know :)
<judofyr> the other solution is usually to do things like this: class WebService; def self.do_something() … end end
<judofyr> so you do WebService.do_something instead of creating a new WebService and calling methods on that object
<judofyr> brb
<rob___> ah yes
<rob___> that is sort of what im looking for
<rob___> but then why not just do module WebController; module_function; def do_something; "blah"; end; end ?
<rob___> i can't get over this idea that modules should be used if your group of methods are related but have no state
<judofyr> rob___: well, this is less flexible. because now you can only have one web service.
<judofyr> what if you want to use the same code across several sites?
<rob___> hmm, ok
<rob___> ok, thanks for explaining this to me
<rob___> in my app i'd set API_KEY as a global constant
<rob___> if i change my module to a class then i can store that key when i initialize it
ricardovaleriano [ricardovaleriano!~ricardova@201-27-125-84.dsl.telesp.net.br] has joined #ruby-lang
<judofyr> it's called a "singleton" when you can only use a single object
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
<rob___> then i can get over this OCD DONT USE A CLASS IF IT HAS NO STATE problem that for some reason i'm having :)
<judofyr> rob___: it does have state in some sense; just not changing state
<rob___> aye
<judofyr> rob___: you can also do: class WebService; end; WS = WebService.new("api_key")
<judofyr> and then you get the same functionality as if you've used a singleton
<judofyr> it's harder to do it the other way
<judofyr> rob___: ever played with ActiveRecord? (or heard of it)?
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
<rob___> heard of it but not used it
<rob___> doesnt rails use it?
<judofyr> yeah
<rob___> i've never used rails
<judofyr> there you do: ActiveRecord::Base.establish_connection(…)
<judofyr> to connect to a DB
Markuss [Markuss!Markuss@79.115.148.217] has joined #ruby-lang
<judofyr> and then magically everything uses that connection
Markuss [Markuss!Markuss@79.115.148.217] has quit [#ruby-lang]
<judofyr> which means that if I want to talk to two databases; well, I have no idea how to do that reliable without looking up the docs.
<rob___> ok
<rob___> hmm
<judofyr> what I'm trying to say: singletons may look simpler, but when you first use them, you're kinda stuck
<rob___> i should look up self/singletons and how calling module methods and things work
<rob___> tell you what though, it's hard finding places where this sort of stuff is explained and makes sense
<rob___> so thanks for your help :)
<judofyr> rob___: try to think that "one class should solve one problem"
<judofyr> e.g. one class to talk to a web service
<judofyr> one class to represent a user
<rob___> hey brb 1 sec
bludimnd [bludimnd!~amichai@178-83-34-252.dynamic.hispeed.ch] has joined #ruby-lang
<judofyr> rob___: e.g. it explains it very briefly
<judofyr> rob___: that just explains objects though
<judofyr> rob___: I've got to go now
<judofyr> catch me later (or mail me at judofyr@gmail.com)
<judofyr> if the tutorial makes sense, I might finish it; if it's not for you, well, we'll figure something out
jMCg [jMCg!~hiro@apache/committer/igalic] has joined #ruby-lang
jkprg [jkprg!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
imperator [imperator!~djberg96@184-96-109-96.hlrn.qwest.net] has joined #ruby-lang
<imperator> good morning
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
ap3mantus [ap3mantus!~ap3mantus@c-98-217-187-172.hsd1.ma.comcast.net] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
Austin__ [Austin__!~austin@96.45.197.22] has joined #ruby-lang
micha-- [micha--!~mbelow@i59F6D44D.versanet.de] has joined #ruby-lang
<rob___> what a spiffing chap
dustin_ [dustin_!~ddeyoung@99-7-24-156.lightspeed.iplsin.sbcglobal.net] has joined #ruby-lang
jkprg [jkprg!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
perryh_ [perryh_!~root@unaffiliated/perry753] has joined #ruby-lang
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@bl13-197-21.dsl.telepac.pt] has quit [#ruby-lang]
kleech [kleech!~kleech@cpc18-mapp10-2-0-cust39.12-4.cable.virginmedia.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
n0rest [n0rest!58a62175@gateway/web/freenode/ip.88.166.33.117] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
paul0 [paul0!~user@189.114.198.57.dynamic.adsl.gvt.net.br] has joined #ruby-lang
<rue> MORNNG
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<paul0> moarning
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nofxx [nofxx!~nofxx@187.23.26.139] has joined #ruby-lang
<zzak> moooooo
<n0rest> has anything to do with pastie bot here ?? o.O
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<erikh> HELLO
<rue> n0rest: No, you have to WORK for your paste
<n0rest> no, I mean, on the site, it explain that to get a pastie URL, you have to register to nickserve, then send a msg to "pastie"
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
<n0rest> The pastie bot can be found on freenode in #rubyonrails or #ruby-lang. Obtaining a paste URL is easy. send a public message to pastie (e.g. "pastie: hi!")
<rue> There is no paste spoon
<rue> n0rest: gist >> anyway
<n0rest> thanks for support guys
<n0rest> have a nice day/evening.
mahlon [mahlon!mahlon@martini.nu] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0C406.dip0.t-ipconnect.de] has joined #ruby-lang
darkf_ [darkf_!~darkf_dix@adsl-68-88-97-41.dsl.wacotx.swbell.net] has joined #ruby-lang
darkf_ [darkf_!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
robotmay [robotmay!~robotmay@94.30.13.228] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ricardov_ [ricardov_!~ricardova@177.33.16.222] has joined #ruby-lang
crudson [crudson!~doug@static-72-94-51-106.phlapa.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<rue> Wait, where am I again?
Yu\2 [Yu\2!~Yu@ubi-1-50-54.zif.uni-bielefeld.de] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
perryh_ [perryh_!~root@mobile-111-90.near.uiuc.edu] has joined #ruby-lang
perryh_ [perryh_!~root@unaffiliated/perry753] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
malev [malev!~malev@190.210.138.237] has joined #ruby-lang
simon_weber [simon_weber!u4119@gateway/web/irccloud.com/x-uyufnalikskhqbnm] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-dldajprualtlzisp] has joined #ruby-lang
malev_ [malev_!~malev@190.210.138.237] has joined #ruby-lang
jMCg [jMCg!~hiro@apache/committer/igalic] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-awhbctxesupkxaur] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
mccraig [mccraig!u574@gateway/web/irccloud.com/x-kxnuctjhjftmgkal] has joined #ruby-lang
dkannan [dkannan!u480@gateway/web/irccloud.com/x-ciyhxqwqhnkvlylo] has joined #ruby-lang
<zzak> guatemala
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-qcurwzmcqioyupsj] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
agib [agib!u781@gateway/web/irccloud.com/x-xfqireptxnznumbd] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-zamfmrjebbmcynag] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@46.50.122.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
hzlocky [hzlocky!~me@dynamic-vpdn-93-125-116-216.telecom.by] has joined #ruby-lang
dreinull [dreinull!~dreieins@217.18.70.225] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
dnyy [dnyy!u2106@gateway/web/irccloud.com/x-iparzxantbnkpglz] has joined #ruby-lang
pvh [pvh!u717@gateway/web/irccloud.com/x-gqficydzaajrdlmi] has joined #ruby-lang
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-burjhglsnklxaome] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
simon_weber [simon_weber!u4119@gateway/web/irccloud.com/x-gkkvkcykmfpjlqpc] has joined #ruby-lang
savage- [savage-!~savage-@209.118.197.220] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
m1d4s [m1d4s!~m1d4s@77-255-12-89.adsl.inetia.pl] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-sskjdonfbauccqfe] has joined #ruby-lang
longtheta [longtheta!u4275@gateway/web/irccloud.com/x-qonstcvhocudrnhp] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
principino97 [principino97!~principin@host246-136-dynamic.36-79-r.retail.telecomitalia.it] has joined #ruby-lang
benanne [benanne!~rijdier@137.7-241-81.adsl-dyn.isp.belgacom.be] has joined #ruby-lang
principino97 [principino97!~principin@host246-136-dynamic.36-79-r.retail.telecomitalia.it] has quit [#ruby-lang]
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-faqzlquurydggwhp] has joined #ruby-lang
Sailias [Sailias!~jonathan@206-248-172-164.dsl.teksavvy.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-fngiwjataryiknmv] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
dreinull [dreinull!dreieins@217.18.70.225] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
cldwalker [cldwalker!~cldwalker@64.134.66.135] has joined #ruby-lang
cldwalker_ [cldwalker_!u2984@gateway/web/irccloud.com/x-wyvxduasqcdglwzs] has joined #ruby-lang
taf2 [taf2!~enduser@66.153.72.177] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-145.washdc.btas.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
madona [madona!jkilaa@41.141.182.242] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<MistyM> Loving the ri docs on #instance_variable_set.
<MistyM> "Sets the instance variable names by symbol to object, thereby frustrating the efforts of the class’s author to attempt to provide proper encapsulation."
madona [madona!jkilaa@41.141.182.242] has joined #ruby-lang
dustin_ [dustin_!~ddeyoung@99-7-24-156.lightspeed.iplsin.sbcglobal.net] has joined #ruby-lang
<rue> Heh, I think that's from the last doc drive drbrain was running
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ilyam [ilyam!~ilyam@2620:65:0:281:f5ac:b0f0:39c1:e843] has joined #ruby-lang
InfiniteJest [InfiniteJest!~InfiniteJ@dynamic-adsl-78-12-91-46.clienti.tiscali.it] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
vamshionrails [vamshionrails!~Adium@216.172.20.16] has joined #ruby-lang
<vamshionrails> hi
<vamshionrails> anybody there
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<ged> vamshionrails: Yes.
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<vamshionrails> hi ged
<vamshionrails> nice meeting you
RomyRomy [RomyRomy!~stickycak@cpe-74-64-122-182.nyc.res.rr.com] has joined #ruby-lang
<ged> Likewise.
<rue> You say that to everybody!
<vamshionrails> I have a question are they gonna add sinatra to default framework?
<vamshionrails> for ruby
cconstantine [cconstantine!~cconstant@173.247.200.5] has joined #ruby-lang
pigdude [pigdude!~tallen@li61-243.members.linode.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<pigdude> is there anything like virtualenv's --no-site-packages option for rvm? i don't want my local to use system gems, etc
<rue> vamshionrails: Default how, in the stdlib?
<rue> pigdude: Gemsets?
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-djmbaglayhrphqia] has joined #ruby-lang
<vamshionrails> not as gem
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<vamshionrails> as sinatra is only 1500 lines of code
setmeaway [setmeaway!~setmeaway@118.45.149.247] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
<erikh> unfortunately, rubygems is a lot more than package management
<erikh> you're pretty much stuck using them
<pigdude> rue, not quite
<vamshionrails> sinatra uses most of the ruby code
<vamshionrails> while programming compared to rails
<pigdude> rue, i've been using gemsets ... but it's really weird because after i install rails 2.3.8, i see gem yaml (spec) errors coming out of AR 3.2, etc in the gemset directory
<pigdude> stuff like:
<pigdude> Invalid gemspec in [/Users/tomallen/.rvm/gems/ree-1.8.7-2011.12@gawa3/specifications/actionmailer-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x1033cb280> 3.2.0"]
agib [agib!u781@gateway/web/irccloud.com/x-hrzfdxvcjjqzzwne] has joined #ruby-lang
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-fejkdgmnqdorbbwb] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-yhqmonvmgmopvlfc] has joined #ruby-lang
<rue> vamshionrails: It's unlikely it'll be added, but not impossible. Right now, the idea is more to *reduce* the number of standard libraries
janissary [janissary!~user@adsl-98-85-0-232.mco.bellsouth.net] has joined #ruby-lang
<pigdude> hm, i think i barked up the wrong tree. i'll come back when i have more info. i think something else is going on here, but i should be able to fix it myself
pvh [pvh!u717@gateway/web/irccloud.com/x-ionyblnjzdauofzt] has joined #ruby-lang
<pigdude> thanks for looking rue :^)
<rue> Sure
mccraig [mccraig!u574@gateway/web/irccloud.com/x-edikhhirpocmescw] has joined #ruby-lang
<vamshionrails> rue : thank you
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-163-211.dclient.hispeed.ch] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-znxkptkcccmdnfgy] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-katyuctzbnbibior] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ap3mantus [ap3mantus!~ap3mantus@c-98-217-187-172.hsd1.ma.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
janissary [janissary!~user@adsl-98-85-0-232.mco.bellsouth.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
vamshionrails [vamshionrails!~Adium@216.172.20.16] has quit [#ruby-lang]
imperator2 [imperator2!~djberg96@184-96-109-96.hlrn.qwest.net] has joined #ruby-lang
crudson [crudson!~doug@static-72-94-51-106.phlapa.fios.verizon.net] has quit [#ruby-lang]
crudson [crudson!~doug@static-72-94-51-106.phlapa.fios.verizon.net] has joined #ruby-lang
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby-lang
probst [probst!~probst@global-1-92.nat.csx.cam.ac.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<crankharder> is there a way to simplify this: a ? Foo.new(a) : Foo.new
<crankharder> can't pass nil to new
<fullsailor> Is Foo your class?
<crankharder> yes
<crankharder> er, no
<crankharder> IPAddr
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<fullsailor> Foo.new(a||'::')
<crankharder> yea, could do that, but the default could change behind my back
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
<fullsailor> That's why we write tests! :-P
InfiniteJest [InfiniteJest!~InfiniteJ@dynamic-adsl-78-13-118-218.clienti.tiscali.it] has joined #ruby-lang
<fullsailor> And it wouldn't change without you upgrading Ruby
<crankharder> mostly just thinking academically now
<crankharder> say it's some gem with more churn
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@46.50.40.68] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-rkctocoshijjytuy] has joined #ruby-lang
<fullsailor> I think you're overthinking it.
<fullsailor> The API could change anyways. Maybe it starts requiring that argument.
<fullsailor> So the second part of your ternary would fail.
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@46.50.40.68] has quit [#ruby-lang]
<fullsailor> Or they could remove the arguments from #new and then the first part would fail.
<fullsailor> Thats why your tests are so important
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ambethia [ambethia!~Adium@cpe-24-160-98-85.tampabay.res.rr.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
Locke23rus [Locke23rus!~quassel@128-70-95-104.broadband.corbina.ru] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@92.250.30.106] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
<chris2> i get a series of events, and want to run a function after 200ms of no event. how to do that best?
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
logbot99693 [logbot99693!~cinch@boxand.lnk.telstra.net] has joined #ruby-lang
<rue> Ooh, a twist on the timeout question from earlier
<rue> How about a 200 ms ticker reset by other events?
<chris2> dont really have one
<rue> Might be a little tight on the timing
<chris2> its not that hard
kyrylo [kyrylo!~kyrylo@46.118.237.209] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@subtle/user/kyrylo] has joined #ruby-lang
<chris2> essentially, i get tk window resize events and only want to redraw when the resize is done
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<rue> Hm, is that tight enough to not seem sluggish? I guess
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<workmad3> chris2: hmm... redraws... I'd be tempted personally to add a ticker that limits redraws to every 200ms or something, rather than wait till the end of the resize and then redraw
<workmad3> chris2: that way, your screen content will look like it's resizing with the rest of the window ;)
<rue> That's reasonable
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<chris2> workmad3: know how to do that in tk?
<workmad3> chris2: pass? :)
<chris2> hehe
<rue> Rescheduling a timer callback
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<rue> chris2: after event?
<imperator2> did someone say they're using tk?
<chris2> i am
<rue> Tk.after delay, proc
<chris2> rue: hah!
<chris2> thanks
<shevy> rue is the master of documentation
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<shevy> 20 years of finnish bootcamp really pays off eventually
<rue> If you wanted to get fancy, you could then have the timer invalidated by the resizes
<rue> I didn't see a way to cancel a timer at a glance
<livinded> people still use tk?
<rue> livinded: Bundled, native
<livinded> yuck
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<imperator2> hm, how do you get the char number again in 1.9? .chr just returns the letter
<chris2> .ord
<imperator2> thanks
cyri_ [cyri_!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby-lang
<chris2> livinded: and freaking fast to develop in
<chris2> i have no idea how to do this stuff in a different toolkit
<chris2> (heavily using TkText)
<livinded> Qt and Cocoa are pretty fast
<shevy> hmmm ruby-qt?
* imperator2 used to do tk a long, long time ago
<chris2> and fuck qt
<chris2> :P
<livinded> shevy: ya, I haven't used it in probably 3-4 years but it was pretty quick and easy
<imperator2> tk was pretty easy, i'll give it that
<shevy> when you were still young and EVIL imperator2 but those days are gone, you weak old man!
<livinded> macruby with cocoa is pretty slick though
<imperator2> but platform specific :)
<shevy> damn mac fanboys!
lightcap [lightcap!~lightcap@bc100132.bendcable.com] has joined #ruby-lang
<shevy> admit it
<wmoxam> fanboys?
<livinded> can't remember the last time I built a cross platform gui app
<shevy> you are just too lazy to hack your own WM
<livinded> I prefer native UIs
<imperator2> i played with fox and wx a bit
<shevy> wmoxam I can't mention the 3% fangirls :>
dfr|mac [dfr|mac!dfr|work@nat/google/x-mbodayngndlfaqvk] has joined #ruby-lang
<chris2> tk is a native ui
<rue> The docs are actually pretty sweet
<shevy> hmm
<shevy> tk silently and sneakily got better
<livinded> chris2: as in looks native
<shevy> when it realized it does no longer have to compete with motif
<rue> But yeah, bundled native is nice.
<livinded> like Java UI is gross
<lianj> livinded: tk has nativeish themes
<shevy> the pink theme where everything is extremely pink
<imperator2> motif, now those were the days
<imperator2> when men were men, memory was precious and a 19" crt was sweet
<chris2> livinded: it looks native too :P
brianpWins [brianpWins!~brianpWin@S01060014bf8930ea.vc.shawcable.net] has joined #ruby-lang
<wmoxam> I loved my 19" CRT
<shevy> I always hated my CRT, they were so heavy...
<shevy> imperator2 and death stars still affordable to build right. in today's economy you could only build mini death stars in pocket size
<imperator2> i still haven't paid off the first one even
<shevy> :(
<shevy> we are living in a world of debts
<shevy> I am going to live in a world where the currency will become (program) code
<imperator2> though i hear i'm worth more than Greece atm
<uniqanomaly> shevy: right, world in you cabinet lol
QaDeS [QaDeS!~mklaus@frbg-5d84f20b.pool.mediaWays.net] has joined #ruby-lang
dialout [dialout!~dialout@94.79.121.157] has joined #ruby-lang
mztriz [mztriz!~mztriz@nkugateway.nku.edu] has joined #ruby-lang
<shevy> uniqanomaly, well ok all kind of code in general perhaps. and robots working rather than people!
<uniqanomaly> shevy: yeah, singularity, I love the idea too
<uniqanomaly> shevy: problem is politicians write bills for people who pay for them a.k.a. lobbyism a.k.a. corruption
<uniqanomaly> examples: SOPA/PIPA/ACTA
ambethia [ambethia!~Adium@cpe-24-160-98-85.tampabay.res.rr.com] has joined #ruby-lang
pxjorge [pxjorge!~pxjorge@a89-152-235-119.cpe.netcabo.pt] has joined #ruby-lang
<uniqanomaly> not really on topic
<uniqanomaly> friday evening in my timezone, so
<uniqanomaly> ;)
<chris2> yay
<uniqanomaly> do code while you drink just make more comments to know wtf you've wrote next day~
<uniqanomaly> !*
<chris2> TkTimer#reset looks good
whatasunnyday [whatasunnyday!~sunny@c-24-130-81-47.hsd1.ca.comcast.net] has joined #ruby-lang
<rue> Ah, there you go
<chris2> bbl
crudson [crudson!~doug@static-72-94-51-106.phlapa.fios.verizon.net] has quit [#ruby-lang]
<uniqanomaly> what do you guys think about reddit-like site visualised like that one
<uniqanomaly> every user gets personalised news stream in similar form
<uniqanomaly> yeah sherlock it's written in neo4j
<uniqanomaly> xD
dejongge1 [dejongge1!~jonke@pD9E0C406.dip0.t-ipconnect.de] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
brmouzone [brmouzone!~brmouzone@108-90-18-133.lightspeed.cicril.sbcglobal.net] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
spanner [spanner!~quassel@128.249.96.10] has joined #ruby-lang
spanner [spanner!~quassel@128.249.96.10] has quit ["You expect me to talk?"]
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
pigdude [pigdude!~tallen@li61-243.members.linode.com] has quit [#ruby-lang]
dejongge2 [dejongge2!~jonke@pD9E0CCAF.dip0.t-ipconnect.de] has joined #ruby-lang
dejongge3 [dejongge3!~jonke@pD9E0CCAF.dip0.t-ipconnect.de] has joined #ruby-lang
ricardovaleriano [ricardovaleriano!~ricardova@177.33.16.222] has joined #ruby-lang
<shevy> uniqanomaly yeah but this system only works as long as people accept it
<uniqanomaly> shevy: supposedly
<shevy> well, without politicans anymore, who could be corrupted :)
senj [senj!~senj@S01060026f323bcdf.ed.shawcable.net] has joined #ruby-lang
mztriz_ [mztriz_!~mztriz@192.122.237.201] has joined #ruby-lang
kain [kain!~kain@151.64.210.200] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
rolfb [rolfb!~rolfb@165.219.202.84.customer.cdi.no] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-113-31.dclient.hispeed.ch] has joined #ruby-lang
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
tenderlo_ [tenderlo_!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
spleeze [spleeze!~Spleeze@173-15-131-114-BusName-Philadelphia.hfc.comcastbusiness.net] has joined #ruby-lang
s0ber_ [s0ber_!~s0ber@114-36-233-132.dynamic.hinet.net] has joined #ruby-lang
y3llow_ [y3llow_!~y3llow@114-36-233-132.dynamic.hinet.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
geo1 [geo1!~Adium@adfb12c6.cst.lightpath.net] has quit [#ruby-lang]
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-233-132.dynamic.hinet.net] has joined #ruby-lang
y3llow [y3llow!~y3llow@114-36-233-132.dynamic.hinet.net] has joined #ruby-lang
mdmdm [mdmdm!~maestro@50-0-12-246.dsl.dynamic.sonic.net] has joined #ruby-lang
ambethia [ambethia!~Adium@cpe-24-160-98-85.tampabay.res.rr.com] has quit [#ruby-lang]
y3llow [y3llow!~y3llow@114-36-233-132.dynamic.hinet.net] has joined #ruby-lang
<rue> Squamous
<chris2> rue: timer=nil; BIND { timer ||= TkTimer.new(200) { ACTION; timer.cancel; timer = nil } }
<chris2> not that nice, but it works well
Xzyx987X [Xzyx987X!~Xzyx987X@c-75-72-121-187.hsd1.mn.comcast.net] has joined #ruby-lang
<rue> Cool. I thought there must be a way to cancel timers, but didn't glance far enough, obviously
<chris2> note that you always need to cancel because they seem to repeat
<shevy> hmm what is BIND {} ?
QaDeS [QaDeS!~mklaus@frbg-5f73156f.pool.mediaWays.net] has joined #ruby-lang
epitron_ [epitron_!~epi@unaffiliated/epitron] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
fritzek [fritzek!~fritzek@tmo-096-104.customers.d1-online.com] has joined #ruby-lang
fritzek [fritzek!~fritzek@tmo-096-104.customers.d1-online.com] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
codewrangler [codewrangler!~codewrang@pool-72-66-12-100.washdc.fios.verizon.net] has joined #ruby-lang
Regenechse [Regenechse!~regechse@h1985974.stratoserver.net] has joined #ruby-lang
cirwin [cirwin!~conrad@wiktionary/ConradIrwin] has joined #ruby-lang
<MistyM> Hm. This feels tricky.
<MistyM> I have a set of plain-English descriptions of filename ranges I'd like to expand into an array of all the files.
<MistyM> Having a little trouble figuring out how, though. Ruby Range is lovely for simple patterns but this is a little beyond it.
<manveru> MistyM: like?
<drbrain> what's an example description?
<MistyM> Few examples: "C0001_d4.mov to C0011_d4.mov"; "C0001.mov to C0085.mov"; "000_0014_01.mov to 000_0035_01.mov"
<MistyM> So, the filename patterns themselves are not consistent from one to the next, and the variable portion of the filename can happen anywhere (numerical) in the name.
Weems [Weems!~the@nat.resnet.mc.edu] has joined #ruby-lang
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
<manveru> ok... that sounds doable
<manveru> you scan for digits, look for ones that are different, calculate the range, create a glob, match the files
<slyphon> drbrain: ping?
<slyphon> drbrain: ever seen this one? https://gist.github.com/35a32cdd9189d8b9c707
<drbrain> damn you gist sidebar
<drbrain> wow
<drbrain> that is amazing
<slyphon> nooooo
<drbrain> can you edit spec_fetcher.rb around line 130 and find out what gem that is?
<drbrain> I don't even...
<slyphon> i don't want amazing, i want "Yeah, stupid, socks *then* shoes"
<slyphon> ok
<drbrain> my guess is someone decided to package their gem with a fistful of clevar
RomyRomy [RomyRomy!~stickycak@dyn-209-2-226-72.dyn.columbia.edu] has joined #ruby-lang
<slyphon> X-/
<MistyM> manveru: Oh yeah, didn't think of actually globbing the files.
<slyphon> diff-lcs-1.1.2.gemspec COME ON DOWN!!!
<slyphon> i don't think it barfs like this w/ jruby 1.6.5
<slyphon> i *think*
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
<headius> that's wacky man
<headius> the elusive double-nil rational
<slyphon> :)
<slyphon> headius: i have the touch
<headius> you certainly do
<slyphon> headius: so, that doesn't look liek "Ohhhh, we fixed that in 1.6.5, you should really upgrade" to you?
<slyphon> that's "bad data"
<headius> I've never seen that in my life
<slyphon> :)
<headius> anything's possible though, 1.6.3 is many hundreds of commits back from 1.6.6 now
* slyphon nods
<drbrain> headius: that's from Rational.allocate
<headius> this is reproducible?
<drbrain> but, there's no Rational in the marshal'd gemspec
<slyphon> so What The Fuck
<headius> drbrain: makes sense
<headius> or at least makes nonsense
<slyphon> ha
<drbrain> and nothing in the spec in the .gem: http://paste.segment7.net/qk.html
<drbrain> … no Rational
<slyphon> wow
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
<drbrain> I think this is on headius ☹
<headius> yay
<headius> how do I reproduce
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
<slyphon> lemme pull up the gemspec files
<slyphon> ffs
<slyphon> oh that's not good
<slyphon> drbrain: gemspecs for the same gem should always be identical, no matter the source, no?
<slyphon> actually
<slyphon> lemme back up
<slyphon> drbrain: how did you get that dump you showed before?
<drbrain> slyphon: yes
<slyphon> drbraye
<slyphon> lksjldfakjdflajksfa
<drbrain> gem unpack --spec diff-lcs-1.1.2.gem
<slyphon> if i have a .gemspec file?
<drbrain> which gives you diff-lcs-1.1.2.gemspec
<slyphon> and then?
<slyphon> gem spec
<slyphon> ?
<drbrain> cat diff-lcs-1.1.2.gemspec
* headius drums his fingers on the desk
<slyphon> headius: sorry
<headius> no problem
<headius> I'm doing other stuff too
<headius> just needling you
<slyphon> :)
<slyphon> drbrain: that looks like garbage to me
<slyphon> i got it out of ais it compressed in some way?
<slyphon> oh
<drbrain> it should be YAML
<slyphon> er
<drbrain> from gem unpack --spec
<slyphon> oh, this is from ~/.gem/
<drbrain> that one is Marshal from your gem server
RomyRomy [RomyRomy!~stickycak@dyn-209-2-226-72.dyn.columbia.edu] has joined #ruby-lang
<drbrain> you can view that with this cheat:
<drbrain> ri --dump /path/to/marshal/file
<drbrain> but it depends on inspect, so it may not be useful
<drbrain> you'll need rdoc 3ish or newer
havenn [havenn!~skipper@pool-108-0-252-201.lsanca.dsl-w.verizon.net] has joined #ruby-lang
<erikh> gem install rdoc -v '>= 3ish'
<slyphon> fuck
<slyphon> fucking meetings
<slyphon> I DON'T WANT TO ESTIMATE THINGS ANYMORE
<slyphon> i've been explaining shit for like 4 straight fucking hours
<zzak> ERROR: While executing gem ... (ArgumentError) Illformed requirement [">= 3ish"]
<yxhuvud> welcome to scrum
<erikh> heh
<erikh> you'd think after 30 years of large scale software development people would learn that estimations are pointless.
<lake> is agile > scrum? is agile worth it?
<slyphon> i used to look at my manager and tell him "I'm going to sit here, and type thing at this keyboard, until it works. When it works, it will work, and I will stop typing things"
<uniqanomaly> guys, relaing to levels of abstraction, what do you thing about treating programming languages as simply syntax + libraries being translated to machine language?
<slyphon> uniqanomaly: WHAT!?
<uniqanomaly> syntax as means of expression more than utilistation of existing ecosystem
<slyphon> it sounds like you need to stop doing bong hits
<uniqanomaly> that would ultimately destroy low lvl languages for most purposes i believe
<lake> LOL
<chris2> the slyphon
<uniqanomaly> 1) divide language syntax from its implementation
<slyphon> chris2 jones!
<drbrain> slyphon: just present this gif: http://i.imgur.com/VhlQK.gif
<chris2> ^^
<slyphon> drbrain: :D
<cirwin> uniqanomaly: it's a good idea
<cirwin> I wrote the beginnings of a programming language using the uglify.js javascript parser
<cirwin> however
<cirwin> if you want your language to feel perfect
<cirwin> you'll want the syntax to encourage sensible operation
<erikh> meh
<erikh> real men use APL
<drbrain> slyphon: if that fails to be properly descriptive, then show http://www.createdbyx.com/image.axd?picture=funnypic250.gif
<slyphon> yeah, then figure out how to do it in fewer characters
<erikh> slyphon: what? that never happens. you always get the simplest solution the first time.
<slyphon> drbrain: epic
<uniqanomaly> cirwin: i also think syntax could be separated from intended use but that's perhaps too far fetched
<slyphon> erikh: hahahha
<uniqanomaly> like DSLs
<erikh> damn skippy languages
<injekt> heh
<erikh> C is a dsl for assembler
<injekt> slyphon: I don't suppose you've checked out v3 branch of slop yet?
<slyphon> oh, no havn't gotten a chance yet
<injekt> np just curious. Gonna push an rc1 soon so would like a few people to check it out
<slyphon> ah
<injekt> erikh: you included if you have a spare 10
<erikh> what would you like me to do?
<erikh> it's 3:30 on a friday
<injekt> erikh: just a quick browse of the code/api would be really helpful
<injekt> not right now, whenever you have time :)
<erikh> sure
<erikh> it's 3:30 on a friday
<erikh> I'll do it now :)
<injekt> xD
<rue> injekt: He's saying he's got all the time in the world!
<injekt> for the interested: https://github.com/injekt/slop/tree/v3
dejongge [dejongge!~jonke@pD9E0CCAF.dip0.t-ipconnect.de] has joined #ruby-lang
Defusal_ [Defusal_!DeFi@dsl-240-222-161.telkomadsl.co.za] has joined #ruby-lang
Defusal_ [Defusal_!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
<uniqanomaly> right, IRC = secondary and tertiary and quaternary etc. responses
<uniqanomaly> I'm just likje omfg
<uniqanomaly> and there's no graph for that
<erikh> sure there it, it's a acyclic directed graph that looks something like this: 8====D
<slyphon> isn't "uniqanomaly" redundant?
<slyphon> erikh: :D
<rue> Hey now, mister
<erikh> injekt: I love your code
<rue> That could be cyclic
<slyphon> rue: ohhhh, is that "go fuck yourself"?
<erikh> haha
<injekt> erikh: why? (thanks)
<erikh> injekt: it's documented, short methods, generally verbose variable names
<erikh> (without_being_a_huge_underscored_monstrosity)
<slyphon> :)
<injekt> hehe, I try
<uniqanomaly> slyphon: you got me, it kind of is
<injekt> yeah v3 has some nice small methods, really happy with that
<erikh> injekt: how are you doing for test coverage? need a platform tested?
savage-_ [savage-_!~savage-@istep.static.monkeybrains.net] has joined #ruby-lang
<injekt> erikh: lots of test coverage, only tested locally on 187/193 though, I really should test on jruby/rbx
<erikh> I guess there isn't much here that could be considered platform dependent
<erikh> oh, I meant OS-wise
<erikh> this is really nice work dude
<injekt> I dont think so, if there is I've gone massively wrong, but yeah I haven't tested on any other OS
<erikh> pat yourself on the back
<injekt> thanks man
savage- [savage-!~savage-@istep.static.monkeybrains.net] has joined #ruby-lang
<headius> yay, option parsing
<slyphon> ooh
<headius> I have like a dozen projects that parse options for shit
<injekt> haha
<injekt> headius: they're all worse than slop.
<injekt> (kidding, but srsly)
<slyphon> do you support DOS31 style /s /w /i /t /c /h /e /s ?
<erikh> I have some tooling I'm working on over the weekend; I'll see if I can use this for it
<injekt> slyphon: gtfo
<erikh> haha
<slyphon> :D
<headius> I had been leaning toward just making everything use thor
<slyphon> injekt: that's "ha ha only serious"
<injekt> slyphon: :D
<slyphon> (your comment about slop, not my silliness)
<erikh> injekt: do you have prerelease gems out there?
<injekt> erikh: not for v3 yet no, I can push one though
<headius> ugh, ruboto still uses 'main'
<injekt> the only thing I really need to do is rewrite some of the readme and add a few more tests for Slop::Commands
<headius> I should rip that out and use slop
<headius> require 'ruboto/util/main_fix'
<headius> awesome
<injekt> :P
<erikh> injekt: yeah, if you push one out there I'll spend some time with it this weekend. tak!
<injekt> erikh: sweet, thanks. I'll push one up now :)
<injekt> erikh: rc1 prerelease is out, please abuse it :)
savage-_ [savage-_!~savage-@istep.static.monkeybrains.net] has joined #ruby-lang
<context> injekt: of what ?
<injekt> context: slop
<context> url?
<context> ahh more option parsing :D
<injekt> quite
<context> looks nice
<context> i like the dsl
<Spooner> Speaking of new projects, people might be interested in https://github.com/Spooner/relapse (used for releasing ruby applications, including reasonable cross-platform support). I'd appreciate any feedback from you fellows (based on reading the readme, that is; it works reasonably well, but needs to be made less crappy :D). Still wondering if I shouldn't use a prettier DSL than to copy the gemspec style.
<drbrain> p.files = `git ls-files`.split("\n").reject {|f| f[0] == '.' } NOOOOOOOOOO
<slyphon> drbrain: whaaaaaaaa...
<context> spooner: id personally make it less "optiony"
<drbrain> slyphon: use a manifest
<Spooner> drbrain: And why not? (Based on the fact that I'm expecting the user to decide what does and doesn't go in there).
<injekt> also, str[0] wont ever be '.' on 1.8.7
<slyphon> drbrain: i use that kind of thing from bundler
<Spooner> context: Less optiony? Don't know what you mean?
<slyphon> yeah
<slyphon> str[0] == ?.
<injekt> str[0, 1] == '.'
<injekt> or that
<context> spooner: output_for :windows assume .exe, output_for :os_x assume .dmg (realize probably cant do that on linux)
<shevy> well str[0,1] would work on both I guess
<injekt> yeah as would ?.
<injekt> or start_with?
<drbrain> slyphon: Spooner: thanks to manifest I've never released a gem that's contained previous versions of my gem
<slyphon> uhh
<drbrain> I'm with injekt on start_with?
<slyphon> drbrain: that happens?
<context> though i guess the archive format is the only really optional thing in there :/
<Spooner> drbrain: I don't understand the issue. Explain?
<drbrain> slyphon: yes
<slyphon> you mean someone doesn't clear .gem out of their wd
<slyphon> ?
<drbrain> slyphon: the manifest ensures you know what you're shipping with your gem
<drbrain> slyphon: jeweler doesn't
<drbrain> and doesn't use a manifest
<slyphon> yeah, but it's a pain in the balls to maintain
<slyphon> i liked my gem-creator
<drbrain> slyphon: nope! `rake check_manifest` then review then `rake check_manifest | patch`
<slyphon> 'mohel'
<slyphon> pfft
<slyphon> i did a clean-room build
<slyphon> based on a tag
<slyphon> checked out the current repository into a temp dir, changed to a tag, created the .gemspec version based on the tag, built the gem, copied it back to the original dir, blew awya the temp one
<slyphon> i think that was pretty ideal (for git)
SuperTa__ [SuperTa__!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang