Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
whatasunnyday [whatasunnyday!~v4t3c1d3@108-65-191-116.lightspeed.irvnca.sbcglobal.net] has joined #ruby-lang
gasbakid [gasbakid!~gasbakid@41.96.108.121] has joined #ruby-lang
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
tla [tla!~tla@toelboell-lund.dk] has joined #ruby-lang
andrewhl [andrewhl!~andrewhl@out-pq-136.wireless.telus.com] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
gasbakid__ [gasbakid__!~gasbakid@41.96.84.75] has joined #ruby-lang
andrewhl [andrewhl!~andrewhl@out-pq-136.wireless.telus.com] has joined #ruby-lang
gasbakid__ [gasbakid__!~gasbakid@41.96.61.85] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.42] has joined #ruby-lang
gasbakid__ [gasbakid__!~gasbakid@41.96.31.58] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.38] has joined #ruby-lang
Indian_ [Indian_!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B31094F.dip0.t-ipconnect.de] has joined #ruby-lang
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
gasbakid [gasbakid!~gasbakid@41.96.60.182] has joined #ruby-lang
savage-_ [savage-_!~savage-@209.118.197.220] has joined #ruby-lang
andrewhl [andrewhl!~andrewhl@out-pq-136.wireless.telus.com] has joined #ruby-lang
perryh [perryh!~perryh@unaffiliated/perry753] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.36] has joined #ruby-lang
ltd [ltd!~z@zx.io] has joined #ruby-lang
gasbakid [gasbakid!~gasbakid@41.96.12.154] has joined #ruby-lang
nazty [nazty!~n@70.44.2.190.res-cmts.bus.ptd.net] has joined #ruby-lang
beiter_ [beiter_!~beiter@manz-5f74a471.pool.mediaWays.net] has joined #ruby-lang
iande [iande!~ieccles@dynamic-acs-24-144-204-51.zoominternet.net] has joined #ruby-lang
davpoind_ [davpoind_!~davpoind@c-24-7-244-19.hsd1.in.comcast.net] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
vpamulap [vpamulap!~textual@97-91-100-189.dhcp.roch.mn.charter.com] has joined #ruby-lang
<jalljo> 
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.40] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0E202.dip0.t-ipconnect.de] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.43] has joined #ruby-lang
savage- [savage-!~savage-@209.118.197.220] has joined #ruby-lang
ryanf [ryanf!~ryanf@100.sub-174-253-237.myvzw.com] has joined #ruby-lang
Zyclops1 [Zyclops1!~Adium@ec2-176-34-56-205.ap-northeast-1.compute.amazonaws.com] has joined #ruby-lang
<Zyclops1> got anyone here who's played much with nodejs?
<samuelkadolph> There is an IRC channel on freenode for that
<Zyclops1> yeah i know.. want rubiests perspectives on it
<yfeldblum> Zyclops1, why?
<Zyclops1> ah we're about to build a large system which we really want to scale up to 100,000s of users involving data transferring, push messaging using web sockets etc. The entire client side is written in javascript (which we've almost finished) with local storage. Now we're approaching the need to start building the server which will manage all the syncing etc between devices
<Zyclops1> my team knows both ruby and javascript extremly well
<samuelkadolph> I would stick with js then
<samuelkadolph> Especially with websockets
<Zyclops1> but we're not sure whether to build it in ruby or weather to build it in node
<shevy> javascript is killing ruby :(
<Zyclops1> samuelkadolph: just because of the websockets?
<samuelkadolph> No but it would be a significant reason
<Zyclops1> one advantage of having it in js.. is that if i hire more developers they only know one language
<Zyclops1> but the problem is we have got a huge amount of experience in developing client side js apps, little server side experience
<Zyclops1> all our server side stuff has been in ruby so far
<Zyclops1> although i doubt it's a huge step
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
<yfeldblum> shevy, what makes you think js is killing ruby?
neoesque [neoesque!~neoesque@210.59.147.226] has joined #ruby-lang
<shevy> yfeldblum Zyclops1 does now. he is going to use js rather than ruby :(
<shevy> also TIOBE is ... http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html js is before ruby now :(
<Zyclops1> well.. i dont' actually care what langague we use
<shevy> https://github.com/languages <-- also js before ruby
<Zyclops1> just want to use best tool for the job
<shevy> but ruby is better than js!
<shevy> hmm
<shevy> perhaps it is more difficult
<yfeldblum> js is also the universal language in the browser
<Zyclops1> yeah. but the thing is .. we know js extremly well
<Zyclops1> like we know 0.2 * 0.2 is 0.40000000000000001
<Zyclops1> haha
<yfeldblum> not sure TIOBE is a great indicator for whether js is killing ruby on the server
<shevy> I'll watch the overall trend :D
<burgestrand> Zyclops1: that’s a limitation of floating point numbers, not only js
<burgestrand> Zyclops1: try it in IRB :)
<Zyclops1> lol really ok
<Zyclops1> ah the other issue
<Zyclops1> node.js guys just told me
<shevy> lies!
<Zyclops1> there is still memory leaks
<Zyclops1> and they say if you want to build a company on it
<shevy> irb says 0.2 * 0.2 # => 0.04 !
<Zyclops1> they wouldn't recommend it yet
<Zyclops1> yeah.. see ruby not stupid
<burgestrand> [1] pry(main)> 0.2 * 0.2 # => 0.04000000000000001
<shevy> hmm I just realized, I didn't read that you wrote 0.4 :P
<shevy> I almost thought js was correct save for the last 1 ... but you were off a lot with it Zyclops1
<Zyclops1> haha yeah
<shevy> pfft memory leaks
<shevy> what is the adage
<shevy> fail early fail often
<shevy> or something
<shevy> or was that the route to those who disappeared?
<burgestrand> Just reboot often ;)
<burgestrand> … the application, not necessarily the box itself
<burgestrand> *cough*
<shevy> oh
<shevy> I want software that fixes its own bugs itself... evolutionary
<erikh> actually GC has improved significantly in the 1.9 series
t-mart [t-mart!~t-mart@c-174-49-68-22.hsd1.ga.comcast.net] has joined #ruby-lang
methods1 [methods1!~Adium@c-69-136-250-114.hsd1.nj.comcast.net] has joined #ruby-lang
spuk [spuk!~spuk@186.222.1.205] has joined #ruby-lang
ryanf [ryanf!~revfitz@adsl-71-141-89-169.dsl.snfc21.sbcglobal.net] has joined #ruby-lang
<burgestrand> If a #to_str call can fail, should I return nil, an empty string or raise an error? Any thoughts?
<burgestrand> Seems odd to return nil, but I have no meaningful result in that case so an empty string could be misleading.
<heftig> burgestrand: don't you mean to_s?
<burgestrand> heftig: no, #to_str, the object is essentially a string, and is just as meaningful as one
<heftig> then why would it fail?
methods1 [methods1!~Adium@c-69-136-250-114.hsd1.nj.comcast.net] has quit [#ruby-lang]
<burgestrand> it’s a remote resource, and unless the resource is fully loaded it can (in some cases) lead to a temporary failure (that can be resolved by waiting until it’s been loaded fully)
<burgestrand> heftig: ^
<heftig> return nil, i guess
<heftig> not exceptional enough for an Exception (it's not a programming error, either)
<burgestrand> heftig: thanks for your input :)
<erikh> if someone automatically coerces to string it'll be empty if it's nil
<erikh> e.g., your_call.to_s
<burgestrand> ah, cool, didn’t know that
<erikh> yeah, nil.to_s in irb
mndoci [mndoci!~mndoci@216.9.28.154] has joined #ruby-lang
<erikh> see also #{your_call}, which calls to_s behind the scenes
<erikh> might just be best to raise; if it's an exceptional case, make it one
<burgestrand> to_str, not to_s
<heftig> that said, i don't think anyone expects to_str to fail randomly, certainly not the core classes
<heftig> so i wouldn't implement it at all
<burgestrand> hm, that’s true, a failure in to_str could be more severe than it looks because of the expectations
<heftig> rather, provide a method that fetches the resource explicitly
<burgestrand> I’ll see if I can move things around a bit and make it #to_s instead, thanks
<heftig> if you use exceptions you're going to end up with things like begin; a = res.to_str; ...; rescue; ...; end anyway
* burgestrand nods
<heftig> which just get harder to understand if to_str gets called implicitly somewhere
Zyclops1 [Zyclops1!~Adium@ec2-176-34-56-205.ap-northeast-1.compute.amazonaws.com] has quit [#ruby-lang]
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-71-224-112-231.hsd1.pa.comcast.net] has joined #ruby-lang
x0F_ [x0F_!~x0F@unaffiliated/x0f] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
rippa [rippa!~splitta@85.158.54.234] has joined #ruby-lang
wimplash [wimplash!~Adium@wireless.sit-co.net] has joined #ruby-lang
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby-lang
wimplash [wimplash!~Adium@wireless.sit-co.net] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@bl5-203-93.dsl.telepac.pt] has quit [#ruby-lang]
setmeaway [setmeaway!~setmeaway@119.201.52.190] has joined #ruby-lang
JosephRuby [JosephRuby!~joseph@46.33.34.35] has joined #ruby-lang
toretore [toretore!~toretore@ti0006a380-0261.bb.online.no] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.91.153] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
<erikh> haha
<erikh> ruby exploited by a 10 year old bug fixed and corrected in perl when most of you were in junior high school
<erikh> I am crying I'm laughing so hard
bglusman [bglusman!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
<petercooper> an old version of Ruby, no less
<erikh> make all the excuses you want, heh
<petercooper> Windows 3.1 also has some nasty vulnerabilities I hear
<erikh> the exploit was discovered in ... 2002? 2003?
<erikh> c'mon now
<erikh> there's a huge document in the perl source tree about it.
<petercooper> But the beautiful thing about this is how Ruby has done better than Perl, Python and Java :-)
<petercooper> All of which are affected in current production versions
<erikh> yes, and it fails to capitalize on all the lessons learned from every other popular system
<erikh> and perl wasn't affected
<erikh> :)
<petercooper> The 3 people using Perl are ecstatic
<erikh> yes, ad hominem in the face of facts.
<erikh> way to be a ruby rockstar.
<petercooper> A similar level of maturity to that shown 5 minutes ago on your entrance, sir.
<erikh> it's hilarious
<erikh> you guys spend so much time talking about how superior ruby is to perl
<erikh> and it gets busted
<erikh> by shit that's well known and documented
<erikh> it's *hilarious*
<petercooper> Not quite at Louis CK levels but it has its charm, I guess.
<petercooper> I guess you again missed that it hasn't affected a production release of Ruby.
<petercooper> At least, at time of reporting.
<Manhose> petercooper, how long have you had an Internet connection for?
<petercooper> s/Ruby/MRI .. let's not forget about JRuby ;-)
<erikh> you... might want to upgrade rack if you really believe that.
gokulnath [gokulnath!~gokulnath@115.111.177.122] has joined #ruby-lang
srbaker_ [srbaker_!~srbaker@184.66.82.213] has joined #ruby-lang
<rue> Should the MRI developers also be versed in the Python and Java source trees, or just Perl?
<erikh> all the things
<savage-> petercooper: still loving sublime text 2? :)
<petercooper> It's... "OK" :-)
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<savage-> i'm loving it :)
<savage-> i'm using the latest dev build though.
<savage-> i'm really liking the ruby snippets, etc.
<erikh> rue: in all seriousness, shouldn't language implementors be held to higher standards?
<dominikh> call me stupid, but why is Rack on the list at http://www.ocert.org/advisories/ocert-2011-003.html ? Wouldn't Rack's vunlerability depend directly on Ruby, or does Rack use its own hashing algorithms?
<erikh> if rack manipulates post content it could be more vulnerable depending on how it does it. I'd have to consult the doc again but the population in a specific order is the crux of the exploit
<erikh> it attacks rebucketing algorithms
<dominikh> fwiw, in university nobody told us about that when they taught us hashing algorithms – can't hold universities to higher standards, either, it seems
setmeaway [setmeaway!setmeaway3@119.201.52.190] has joined #ruby-lang
ankurgel [ankurgel!~prog@59.178.141.156] has joined #ruby-lang
setmeaway [setmeaway!stemearay@119.201.52.190] has joined #ruby-lang
QoQOoO [QoQOoO!dc82981e@gateway/web/freenode/ip.220.130.152.30] has joined #ruby-lang
queeway [queeway!~queequeg@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
queequeg1 [queequeg1!~queequeg@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-17-181.a149.priv.bahnhof.se] has joined #ruby-lang
davpoind [davpoind!~davpoind@c-24-7-244-19.hsd1.in.comcast.net] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@200-55-73-237.dsl.prima.net.ar] has joined #ruby-lang
benholley [benholley!~ben@71.45.99.160] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.90] has joined #ruby-lang
jxie [jxie!~jxie@115.197.90.102] has joined #ruby-lang
wimplash [wimplash!~Adium@wireless.sit-co.net] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@FLA1Aaa311.hrs.mesh.ad.jp] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@host208-21-dynamic.24-79-r.retail.telecomitalia.it] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
ankurgel [ankurgel!~prog@59.178.153.210] has joined #ruby-lang
IoGA [IoGA!~ioga@91.191.181.77] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@200-55-79-28.dsl.prima.net.ar] has joined #ruby-lang
solars [solars!~solars@mk089144206038.a1.net] has joined #ruby-lang
gasbakid [gasbakid!~gasbakid@41.96.35.127] has joined #ruby-lang
thone [thone!~thone@g226049035.adsl.alicedsl.de] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
gianlucadv [gianlucadv!~gianlucad@host171-14-dynamic.10-188-r.retail.telecomitalia.it] has joined #ruby-lang
QaDeS [QaDeS!~mklaus@frbg-5d84f0c9.pool.mediaWays.net] has joined #ruby-lang
baniseer`sleep [baniseer`sleep!~baniseter@115.189.221.141] has joined #ruby-lang
gasbakid [gasbakid!~gasbakid@41.96.45.52] has joined #ruby-lang
shevy [shevy!~shevy@178-191-252-75.adsl.highway.telekom.at] has joined #ruby-lang
phaedrix [phaedrix!~phaedrix@c-24-22-86-235.hsd1.or.comcast.net] has joined #ruby-lang
bobobobobo [bobobobobo!~down@ppp118-208-15-156.lns20.bne1.internode.on.net] has joined #ruby-lang
bobobobobo [bobobobobo!~down@ppp118-208-15-156.lns20.bne1.internode.on.net] has quit [#ruby-lang]
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
<yorickpeterse> Morning gents
davpoind_ [davpoind_!~davpoind@c-24-7-244-19.hsd1.in.comcast.net] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
The_prospector [The_prospector!MILLYBAYS@unaffiliated/cornman] has joined #ruby-lang
dbussink [dbussink!dirkjan@elle.fallingsnow.net] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@host154.190-227-60.telecom.net.ar] has joined #ruby-lang
tarcieri [tarcieri!~bascule@cryptosphere.org] has joined #ruby-lang
<tarcieri> uhhhh
<tarcieri> anyone know a moderator for the ruby-talk ML?
<tarcieri> it's getting bombarded with garbage
<petercooper> isn't that normal?
<petercooper> I joke ;-) The Luca Pagano stuff?
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
pet_r [pet_r!~petr@85.132.143.21] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@host154.190-227-60.telecom.net.ar] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
arthurlockhart [arthurlockhart!~cinch@60-242-128-8.static.tpgi.com.au] has joined #ruby-lang
Ttech [Ttech!ttech@botters/staff/ttech] has joined #ruby-lang
duckinator [duckinator!nick@botters/staff/duckinator] has joined #ruby-lang
jalljo [jalljo!jalljo@im.a.noo-b.com] has joined #ruby-lang
flori [flori!flori@irc.ping.de] has joined #ruby-lang
conceal_rs [conceal_rs!~conceal_r@www9237u.sakura.ne.jp] has joined #ruby-lang
mqt [mqt!m@pheasant.nirv.net] has joined #ruby-lang
joast [joast!~rick@76.178.187.164] has joined #ruby-lang
eban [eban!~eban@www2371u.sakura.ne.jp] has joined #ruby-lang
DefV [DefV!~Jan@2a02:d08:1002:100:881:5124:6028:4] has joined #ruby-lang
mitchty [mitchty!~mitchty@ec2-50-19-41-37.compute-1.amazonaws.com] has joined #ruby-lang
<josh9> according to it's readme, capybara comes with a built-in DSL. does it mean i can run it without rspec? if that's the case, how do i run my tests?
empity [empity!~user@net-93-70-0-178.cust.dsl.vodafone.it] has joined #ruby-lang
<dreinull> josh9: rstatus uses capybara extensively. check their code.
<josh9> dreinull: will do. thanks
<josh9> dreinull: i am still sad that they switched from sinatra to ror
<dreinull> josh9: if you go back to August or so when everything was still ...
<dreinull> josh9: you name it :)
<josh9> (:
<dreinull> josh9: the old code base is a nice reference for all kinds of things related to sinatra
<josh9> dreinull: i'll clone it and try to go back in time
<dreinull> use github for that.
<josh9> we need some good examples for bigger sinatra websites
<dreinull> josh9: exactly. Especially when it comes to authentication without all these bloated gems
<josh9> dreinull: agree. i try to minimize the usage of crazy big gems.
<josh9> i also start with Plain old ruby objects, and only if i need orm, i'll add it
<josh9> or odm
<dreinull> josh9: I'm always trying to go without activeXXX and then I see my beloved mongomapper does use just that :)
<josh9> i used mongoid before. didn't try mongomapper
<dreinull> its very nice
<dreinull> used datamapper before
<josh9> dreinull: btw, have u heard about avdi grimm's new book?
<dreinull> so much more flexible
<dreinull> no, r do you mean the exceptional ruby one?
<josh9> no
<josh9> give me a sic
<dreinull> then no
<josh9> sec
<dreinull> are you in Australia? You're still online...
<josh9> topics:
<josh9> no. CA
<josh9> it's 1 am here
<dreinull> ok, doing the same crazy stuff I do
<josh9> Starting with business models, adding persistence later.
gokulnath [gokulnath!~gokulnath@115.111.177.122] has joined #ruby-lang
<josh9> Blazing-fast isolated tests using minitest without Rails loaded.
<josh9> Using the language of the domain, not the language of the framework.
<josh9> and more...
<dreinull> sounds good.
<dreinull> have you tried renee?
<josh9> dreinull: no. but loooked at their readme
<dreinull> seems like a nice solution if you have many routes. I'm a bit pissed because I can't dry my routes in sinatra
<josh9> what's your github, i feel like i can learn from you about sinatra
<dreinull> I haven't yet published all my apps because most of the time they are unfinished
<josh9> (: sounds familiar
<ruskie> heh
<dreinull> too embarrassing.
<josh9> you forked sinatra-book
<dreinull> I sometimes put stuff into gists to at least release something.
<josh9> and ruby itself...
<josh9> i also noticed sequel. i like it better than AR
<dreinull> haven't used it for a year but it's quite nice.
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-107-198.dsl.scarlet.be] has joined #ruby-lang
<yorickpeterse> Sequel <3
<josh9> i try to use mongo for every project...
<josh9> i was sad to hear Sarah Mei in rubyconf talking about the change from mongo to mysql (diaspora)
<josh9> but her arguments were valid - social network is not a good fit for document based db.
<yorickpeterse> NoSQL/document stores aren't the answer to everything
<yorickpeterse> They have valid use cases but you shouldn't use them as a replacement for a DBMS
bms [bms!~brandon@S0106001e583dc542.mh.shawcable.net] has joined #ruby-lang
<josh9> the documentaion for rstat.us is still about sinatra. yaa!
davpoind [davpoind!~davpoind@c-24-7-244-19.hsd1.in.comcast.net] has joined #ruby-lang
<josh9> dreinull: yeah. i like their testing stack - minitest and capybara
<josh9> i don't see cuc or rspec
<dreinull> josh9: no, its just that.
<josh9> dreinull: the question is how to run capybara? i tried with ruby <file name> but it didn't do anything. i didn't get any output.
<dreinull> don't know. haven't used it in my own projects only wrote some tests for rstatus back then.
<josh9> i'll clone their project and try running the tsets
<manveru> wtf is going on on ruby-talk?
<rue> Spam?
<rue> dreinull: Let me Duck Duck Go that for you :P
<rue> Er, josh9 :/
<josh9> rue: google what?
<rue> "Running capybara", par example
<josh9> rue: i am on the readme page, can't find it....
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
<josh9> it's running if i have rspec installed. i user rspec <filename>
<josh9> but i don't need rspec
sandelius [sandelius!~textual@90-231-202-62-no214.tbcn.telia.com] has joined #ruby-lang
<rue> You're not testing anything? Do you maybe want Mechanize instead?
<josh9> i want to use method like visit
<josh9> feature, scenario, page.should have_content
<josh9> i believe they are all part of capybara
<rue> Do you need to do that include Capybara::DSL thing?
<rue> …For that
<josh9> rue: are u saying i need to include Capybara::DSL somewhere?
pet_r [pet_r!~petr@85.132.143.21] has joined #ruby-lang
<rue> Maybe?
ioga_wrk [ioga_wrk!~ioga@92.255.125.251] has joined #ruby-lang
<josh9> rue: i tried opening my app - class MyApp; include Capybara::DSL; end
<josh9> but got the same error: undefined method `feature'
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
Pip [Pip!~Pip@host-193-146-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
ioga_wrk [ioga_wrk!~ioga@92.255.125.251] has joined #ruby-lang
<rue> So this is when you're not using RSpec?
<josh9> rue: correct.
<josh9> i try to run it with the ruby executable
<josh9> with rspec it's ok.
<josh9> but i don't think i should install rspec at all.
<rue> Why? That's the part that does the actual testing
<rue> And provides the underlying facilities
<josh9> what's going on when i do: require 'capybara/rspec'
<josh9> is it looking for a file called rspec.rb?
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
<josh9> rue: also, rstat.us are using capybara without rspec - https://github.com/hotsh/rstat.us/blob/master/test/acceptance/acceptance_helper.rb
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
path[l] [path[l]!~path@115.114.59.182] has joined #ruby-lang
fatnic388 [fatnic388!~dave@027c5fd6.bb.sky.com] has joined #ruby-lang
<dreinull> josh9: you oren?
<josh9> dreinull: yeah
<dreinull> josh9: still looking for a simple file upload solution?
<josh9> was i looking for simple file upload solution?
<dreinull> josh9: this padrina repo of yours
<josh9> dreinull: oh...
<dreinull> padrino
<josh9> dreinull: if u have anything intereting, why not
<dreinull> josh9: this here is great: https://github.com/lchanmann/file_uploader
<dreinull> works with sinatra and is just basic
<josh9> nice!
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
ioga_wrk [ioga_wrk!~ioga@92.255.125.251] has joined #ruby-lang
<josh9> i see require 'rspec/core' in https://github.com/jnicklas/capybara/blob/master/lib/capybara/rspec.rb and this is the line that crashes. does it mean that it's looking for the rspec gem?
<rue> It's looking for that file, yes
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby-lang
<josh9> rue: so now i am looking at rspec repo. i want to see what's in core.rb
<josh9> but i can't find this file
<josh9> unless it means rspec/core.rb in the capybara repo? which i also can't find this file.
davpoind_ [davpoind_!~davpoind@c-24-7-244-19.hsd1.in.comcast.net] has joined #ruby-lang
<josh9> and i believe that i have to require 'capybara/rspec' since this one have require 'capybara/rspec/features' that I need for the 'feature' method.
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-81-161.ssp.dialog.net.pl] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@FLA1Aao143.hrs.mesh.ad.jp] has joined #ruby-lang
xjonc [xjonc!~xjonc@bgm72.neoplus.adsl.tpnet.pl] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@FLA1Aao143.hrs.mesh.ad.jp] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B3109C7.dip0.t-ipconnect.de] has joined #ruby-lang
takaokou_ [takaokou_!~takaokouj@FLA1Aao143.hrs.mesh.ad.jp] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
hzlocky [hzlocky!~me@dynamic-vpdn-46-53-167-34.telecom.by] has joined #ruby-lang
Mchl [Mchl!~Mchl@h1881165560.rev.rootvps.pl] has joined #ruby-lang
dr_bob [dr_bob!~dr_bob@p5DC4FAAB.dip.t-dialin.net] has joined #ruby-lang
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby-lang
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
jensn [jensn!~Jens@90-229-211-15-no150.tbcn.telia.com] has joined #ruby-lang
<rue> It's a morass
davpoind [davpoind!~davpoind@c-24-7-244-19.hsd1.in.comcast.net] has joined #ruby-lang
jbsan [jbsan!~jbsan@m80-170-33-81.cust.tele2.se] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.90] has joined #ruby-lang
tcurdt [tcurdt!~tcurdt@p5B03A322.dip.t-dialin.net] has joined #ruby-lang
thebastl [thebastl!bastl@vserve.bastl.org] has joined #ruby-lang
Jake232 [Jake232!~textual@5e02784b.bb.sky.com] has joined #ruby-lang
rolfb [rolfb!~rolfb@ti0168a340-0442.bb.online.no] has joined #ruby-lang
diegoviola [diegoviola!~viola@host-1-211.b15.cvc.com.py] has joined #ruby-lang
jjp [jjp!~jjp@info-1.adm.espci.fr] has joined #ruby-lang
tavon [tavon!~tavon@adsl-76-249-24-181.dsl.klmzmi.sbcglobal.net] has joined #ruby-lang
dr_bob1 [dr_bob1!~dr_bob@p5DC4FAAB.dip.t-dialin.net] has joined #ruby-lang
retro|cz [retro|cz!~retro@137.174.broadband15.iol.cz] has joined #ruby-lang
dr_bob1 [dr_bob1!~dr_bob@p5DC4FAAB.dip.t-dialin.net] has joined #ruby-lang
urbanmonk [urbanmonk!~rom@bas1-toronto08-1279299012.dsl.bell.ca] has joined #ruby-lang
kain [kain!~kain@151.64.211.61] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
beiter [beiter!~beiter@manz-5f74a471.pool.mediaWays.net] has joined #ruby-lang
Manhose [Manhose!~Manhose@bl17-45-13.dsl.telepac.pt] has joined #ruby-lang
jensn [jensn!~Jens@host-95-199-154-67.mobileonline.telia.com] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
jensn [jensn!~Jens@host-95-199-155-238.mobileonline.telia.com] has joined #ruby-lang
singpolyma [singpolyma!~singpolym@69.171.154.34] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
jensn [jensn!~Jens@host-95-204-129-4.mobileonline.telia.com] has joined #ruby-lang
dFire [dFire!~coolfire@145.116.233.201] has joined #ruby-lang
<dFire> Hello
<dFire> I have another question, perhaps someone knows.
<dFire> I have a program that parses input from a socket
<dFire> And for each line of input, it spawns a thread with the parser subroutine
<dFire> And this works swimmingly in Ruby 1.8
<dFire> But in 1.9.1 it starts parsing the same line several times, skipping other lines all together
<yorickpeterse> Don't use 1.9.1
<dFire> When the input speed gets higher
<yorickpeterse> Use 1.9.2 or newer instead
<rue> ^
<rue> Then, details
fra000 [fra000!~franc@net-93-144-221-159.cust.dsl.teletu.it] has joined #ruby-lang
<rue> How/when you're spawning, how you're feeding input &c.
<yorickpeterse> 1.9.1 is known for being buggy and I don't think it is even developed anymore
<yorickpeterse> (though I could be wrong with the latter)
<rue> It's not supported
<yorickpeterse> Ah
<shevy> I want ruby 1.9.4
<lianj> socket.puts "A\n"*100_000 # happy threading
<dFire> Hrm, that's a bit of a pickle, since I don't really have control over the Ruby platform where it's being deployed
<shevy> but you can test on your home machine at least?
<yorickpeterse> If they don't know about all the problems with 1.9.1 the least you can do is inform them about it
rippa [rippa!~rippa@109-161-123-10.pppoe.yaroslavl.ru] has joined #ruby-lang
<rue> shevy: rvm install ruby-head
<rue> O, wait, it's actually 2.0
<shevy> oh
enebo [enebo!~enebo@75-168-44-241.mpls.qwest.net] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
sodani [sodani!~cmiso@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
* dFire shakes fist at apt
<dFire> Not providing 1.9.2 are we!
<dFire> Is there any reason to expect problems when installing multiple versions from source?
<lianj> depends on where you install them
<dFire> I was planing on where ever "make install" decided
<manveru> use rvm :)
jbsan [jbsan!~jbsan@m80-170-33-81.cust.tele2.se] has joined #ruby-lang
<yorickpeterse> ^^
<yorickpeterse> RVM/rbenv, whatever floats your boat
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
<sodani> does anyone know of a library for deobfuscating javascript?
<hzlocky> deobfuscating?
<hzlocky> what does it means? just insert in obfuscated js somewhere line breaks?
<rue> sodani: Maybe ##javascript does?
<sodani> i'm new to obfuscated javascript, but google does it a lot
<rue> Do you mean minified or whatever nonsense it's called?
<rue> Well there you go, then
<sodani> i'm looking for a ruby way of doing it
sora_h [sora_h!~sora_h@mayfield.privs.net] has joined #ruby-lang
leopard_me [leopard_me!~Le0pard@213.160.145.74] has joined #ruby-lang
<rue> See anything on rubygems or ruby-toolbox?
dejongge [dejongge!~jonke@pD9E0E202.dip0.t-ipconnect.de] has joined #ruby-lang
elux [elux!~peter@96.45.198.150] has joined #ruby-lang
<dFire> Is syntax for require 'somefile.rb' different since 1.9.2?
empity [empity!~user@net-93-70-0-178.cust.dsl.vodafone.it] has joined #ruby-lang
<yorickpeterse> No, but it doesn't use . anymore
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby-lang
<yorickpeterse> so you have to explicitly do require './somefile.rb'
<yorickpeterse> or something like require File.expand_path('../somefile', __FILE__)
<dFire> ok
jensn [jensn!~Jens@host-95-200-58-51.mobileonline.telia.com] has joined #ruby-lang
* rue troutslaps yorickpeterse
<rue> require_relative
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<elux> hey gents
<elux> rue: btw check this out ..
<elux> rue: this is an example i put together using goliath -- https://github.com/pkieltyka/web-proxy-service
<elux> spin it up .. and open, http://localhost:9000/webp?url=http://anysite.com/blah/etc
<elux> uses goliath+em-http-request .. its cool
<rue> Frosty
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
dave_miles [dave_miles!~davemiles@gatek.mh.bbc.co.uk] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
jensn [jensn!~Jens@host-95-198-135-80.mobileonline.telia.com] has joined #ruby-lang
solars [solars!~solars@mk089144206038.a1.net] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
jensn [jensn!~Jens@host-95-198-135-80.mobileonline.telia.com] has joined #ruby-lang
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
beiter [beiter!~beiter@manz-5f74a471.pool.mediaWays.net] has joined #ruby-lang
path[l] [path[l]!~path@115.114.59.182] has joined #ruby-lang
<shevy> hmm. how to conditionally require something best? right now I tend to do ... begin; require 'some_library_which_perhaps_was_not_installed_yet';rescue ... is there a way to do require 'foo' if defined?(:foo) or something?
<erikh> the idiomatic pattern is to require and rescue LoadError
<shevy> okies thanks
<rue> Or just fail if you can't proceed without.
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
empity [empity!~user@net-93-70-0-178.cust.dsl.vodafone.it] has joined #ruby-lang
scampbell [scampbell!~scampbell@c-98-224-240-62.hsd1.mi.comcast.net] has joined #ruby-lang
ankurgel [ankurgel!~Ankur@59.178.139.65] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0E202.dip0.t-ipconnect.de] has joined #ruby-lang
Jake232 [Jake232!~textual@5e02784b.bb.sky.com] has joined #ruby-lang
<shevy> hmm ... wondering about at_exit
<shevy> cgi_exception has a code part like this here: http://pastie.org/3091172
<shevy> however, when requiring that into other non-cgi scripts, it seems to be invoked every time an exit event happens
<shevy> that code part more or less just returns an error message for .cgi scripts
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
<shevy> hmm hmm hmm ... for now I shall decide to dislike at_exit ...
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
<manveru> how about disliking cgi?
<yorickpeterse> ha, good ol' CGI
<shevy> nah, it's simple, the rest forces you to go big
<shevy> I think a fix would be to change that code to "only perform at_exit in .cgi files" ... or something like that
SuperTaz_work [SuperTaz_work!~supertaz_@38.99.52.59] has joined #ruby-lang
<shevy> but I can't think clearly :(
<yorickpeterse> if File.extname(__FILE__) == '.cgi'; at_exit { ... }; end :)
<shevy> hmm
<shevy> let's see!
Mozillion [Mozillion!~paul@2001:610:1118:0:202:a5ff:fef0:ce4f] has quit ["Sorry! Leaving..."]
<shevy> <pre style="color:#CC0000"><b>shell/exit.rb:12:in `exit': exit (SystemExit)</b>
<shevy> somehow it still gets pulled in
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
<shevy> oh well, I'll disable cgi_exception again
jrwesolo [jrwesolo!~jrwesolo@82.100.0.156] has joined #ruby-lang
<shevy> I need to stop requiring things I don't need too
<yorickpeterse> Why are you running Ruby via CGI anyway?
<shevy> because it's very easy
<yorickpeterse> So is running it with Thin :)
<bougyman> doesn't smell easy.
<yorickpeterse> ^
<shevy> don't even know what is Thin
<yorickpeterse> what
<bougyman> i can fully support using just Rack.
<bougyman> but using just CGI is too much ABW.
<shevy> Mongrel, EventMachine, Rack, Rails ... doesn't sound very easy
<bougyman> shevy: thin has nothing to do with rails.
<bougyman> it can run any rack app.
<bougyman> that's neither here nor there, though.
<shevy> but it advertizes for rails right on that page :(
<shevy> "Go to your Rails app directory and run:"
<bougyman> if you make your app rack-friendly, you don't have to worry about webserver integration.
<shevy> I don't feel like the target audience
<yorickpeterse> gem install thin; cd path/to/project/with/config.ru/in/it; thin start
<bougyman> because it can run as cgi, fastcgi, proxy, other modes.
<shevy> yeah, rack may be an option eventually
<yorickpeterse> Using Ruby via the web without Rack is a bit, well, silly
<yorickpeterse> You'd be re-inventing all sorts of wheels
<shevy> no worries, I am ok with rack eventually
savage- [savage-!~savage-@209.118.197.220] has joined #ruby-lang
<yfeldblum> Thin is a Rack-compatible HTTP server (talks HTTP at one end and Rack at the other); Rack is an explicit documented interface plus a few helper classes so that any Ruby application can talk to any Rack-compatible HTTP server
<yfeldblum> so you write a class that has a method #call which takes a single Hash argument and returns an array of size 3 with members: status code, headers (Hash), and body (must respond to #each and yield String objects)
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
RickHull [RickHull!~rhull@209.119.14.25] has joined #ruby-lang
<yfeldblum> you write a single extra file (config.ru) which simply requires your class and uses one method from the Rack API to make your application Rack-compatible
<shevy> config.russia!
<shevy> well, one method #call sounds easy enough
<dFire> For those who don't remember: I have a program that parses input from a socket, and for each line of input, it spawns a thread with the parser subroutine.
<yfeldblum> and now any Rack-compatible HTTP server such as Thin can load your application because your application has the required Rack config file which calls the one Rack API passing in your one class that exposes the one method
<dFire> And this works swimmingly in Ruby 1.8. But in 1.9.1 it starts parsing the same line several times, skipping other lines all together
<dFire> This also happens in 1.9.2 and 1.9.3
RickHull [RickHull!~rhull@pdpc/supporter/active/rickhull] has joined #ruby-lang
<yorickpeterse> dFire: pastie it
<rippa> one method to rule them all!
<yorickpeterse> or whatever parts of it are allowed to be pastied
<shevy> yeah
<erikh> one method to binding them
<shevy> one thing to rule them all is usually good
<dFire> It's rather much code
<yorickpeterse> one language to unite them
<shevy> one currency to pay all bills
<yxhuvud> makes me remember that Base.class that someone used to import *everything* into
<shevy> hehe
<yorickpeterse> Hm, I recall seeing that as well somewhere
<shevy> the fattest object in the universe
<yorickpeterse> INCLUDE ALL THE THINGS
<erikh> ActiveRecord::Base
<shevy> SOLVES ALL YOUR PROBLEMS SOMEWHERE IN ITS CODE
<yorickpeterse> haha
<dFire> http://pastie.org/3091275 <- the crux of it
<dFire> https://guest:guest@www.insomnia247.nl/websvn/listing.php?repname=nanobot <- all of the code, if needed
<yorickpeterse> Side question: why are you using numbers and not booleans for the @status.threads thing?
<yxhuvud> erikh: the one I'm referring to went through the stdlib, and all installed gems and just put everything into Base.
<erikh> oh, pretty.
<dFire> Too lazy to do it properly, but that's something I will change at some point
<erikh> I have a small bit of code that walks objectspace and installs exec calls in place of every method in the interpreter (except for exec)
<yxhuvud> yorickpeterse: yes, that one.
<shevy> hehehe
<shevy> "But why stop there? Why not have even more methods? In fact, let's put every method on one Base class!"
<RickHull> all your base are belong to gary?
<yxhuvud> the most brilliant part is when he chooses a random method implementation to call
<shevy> "It's so badass that it takes five seconds just to answer that question! " HAHAHA
<erikh> heh
<rue> dFire: Is #parser thread-safe?
<dFire> I would have to guess not, from the results I'm getting
t-mart [t-mart!~t-mart@c-174-49-68-22.hsd1.ga.comcast.net] has joined #ruby-lang
<rue> Also, theoretically the line can change before the block runs… I think
<dFire> But it works as expected in 1.8.7, so there would have to be some fundamental change in how threads are handled since 1.9.x
<erikh> parser() is more or less a shim for socket
<erikh> so on 1.8.7 it's going to hit rb_thread_select() isn't it?
<dFire> I hope you're not asking me, because I haven't a clue
<erikh> no, rue
<dFire> Oh good :p
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
<erikh> it's a little slow but it loads
<dFire> Is it?
<dFire> I'll have to go punch my server
<erikh> for me at least, but I'm on the west coast of the states
<erikh> anyhow; you need to toss around a little more Mutex I think.
<erikh> (should come with require 'thread')
<rue> dFire: You'd want to use a case for #parse
<dFire> There's a lot of things that need to be better, but it's nowhere near release
<rue> #parser. But it seems to be using instance state, which is a problem
<rue> The method's not reentrant
<dFire> I have no idea what that means.
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
retro2 [retro2!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
<rue> In short, you need to remove state from the parser, or initialize a new one for each command
<rue> And to be safe, I think you'd need to also force the line to be copied so it doesn't get overwritten
<dFire> I was rather hoping starting it in a new thread would do that
<erikh> or he could synchronize each change
<rue> Illustrating the problem: a = 1; Thread.new { sleep 1; p a }; a = 2
<rue> But, considering it, shouldn't the stuff be processed sequentially anyway?
<dFire> so the problem is that each thread doesn't get it's own local copy, but rather that they're shared variables?
<dFire> Some stuff, but not all
<dFire> especially calls to external stuff that takes long
<rue> The line inside your thread block is just the variable, yes. It can point to a different object depending on how the thread scheduler runs
foca [foca!~foca@li25-211.members.linode.com] has joined #ruby-lang
<rue> But, in addition to that, so far as I can tell, you're using instance variables in a shared IRCParser
<rue> …instance.
<rue> But I didn't look close to see if there was anything conflicting there
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
<dFire> I was under the impression that starting a new thread would give each thread it's own variables to work with
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
<dFire> But that turns out to not be true (at least, not anymore since 1.9)
<rue> I think the difference is more likely in the thread scheduler
<dFire> Fair enough
<rue> Closures are the same either way
<dFire> But speaking in terms of solutions; If I would give that parser it's own class, and create a new parser object for each line, would that not solve the problem?
<rue> It'd solve the second problem
<dFire> Wait, I have two problems?
<RickHull> i know, use a regex
<rue> dFire: To solve the problem with the line, you'd need to either wait on the thread to ensure it's running (dicey), or you could force separating the object by, for example, calling a method which starts the thread
<rue> With the line as the argument
<rue> Or use mutexes
<dFire> but using a mutex would kill parallel processing
<lianj> whaaa
takaokouji [takaokouji!~takaokouj@FLA1Aam052.hrs.mesh.ad.jp] has joined #ruby-lang
<Tasser> how would you use existing python code? popen3?
<rue> Was there a bridge?
<rue> But, sure, pipes work
takaokouji [takaokouji!~takaokouj@FLA1Aam052.hrs.mesh.ad.jp] has joined #ruby-lang
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby-lang
Jake232 [Jake232!~textual@5e02784b.bb.sky.com] has joined #ruby-lang
Guest2061 [Guest2061!~nfxgosu@c-24-6-170-1.hsd1.ca.comcast.net] has joined #ruby-lang
<Guest2061> bang = "!"
<Guest2061> "hello world#{bang}" # => "hello world!"
<Guest2061> :"hello world#{bang}" # => :"hello world!"
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
<Guest2061> why does this guy bang = "!"
<lianj> as an example?
<rue> Why does that guy bang?
<erikh> she bangs
<Guest2061> but is it necessary to bang like that
<hagabaka> ...?
<Guest2061> can't he he just bang! like this!
<rippa> you don't make sense
<rue> :D
<Guest2061> "hello world!"
<lianj> as an example!
<rippa> of interpolation!
tris [tris!tristan@2001:1868:a00a::4] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
Manhose_ [Manhose_!~Manhose@bl17-45-13.dsl.telepac.pt] has joined #ruby-lang
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-107-198.dsl.scarlet.be] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-132-26.aei.ca] has joined #ruby-lang
rawkz [rawkz!~jesse@adsl-98-71-140-252.gsp.bellsouth.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
tommyvyo_ [tommyvyo_!~tommyvyo@38.123.129.115] has joined #ruby-lang
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
Steppenwolf [Steppenwolf!~maus@83-70-33-197-dynamic.b-ras1.wtd.waterford.eircom.net] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
<shevy> is there an easy way to alias a class method? http://pastie.org/3091668
<RickHull> inside class << self
<lianj> instance_eval{ alias test_again test }
<shevy> cool, works, thanks
enebo [enebo!~enebo@75-168-44-241.mpls.qwest.net] has joined #ruby-lang
<rippa> a = p !!!!! p
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby-lang
jarrod__ [jarrod__!~jarrod@rrcs-24-153-217-133.sw.biz.rr.com] has joined #ruby-lang
<RickHull> P = NP
jbsan [jbsan!~jbsan@m80-170-33-81.cust.tele2.se] has joined #ruby-lang
<heftig> probably not
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
<RickHull> dang, i guess i'll have to redo my thesis then
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
_guns_ [_guns_!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
<rue> heftig: P = NP == NP
burgestrand [burgestrand!~burgestra@81-229-85-235-no66.tbcn.telia.com] has joined #ruby-lang
tla [tla!~tla@toelboell-lund.dk] has joined #ruby-lang
<heftig> rue: so P is true?
<rue> Exactly
<Harzilein> hmm
<Harzilein> is there something similar to apt-rdepends -r for gems?
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<Harzilein> so, say i want to look for nice wrappers around the pivotal-tracker gem
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
<Harzilein> i'd run gem-rdepends -r and would get a recursive list of gems that depend on pivotal-tracker
<Harzilein> oops, plus the gem name of course
<Harzilein> hmm
<rue> drbrain had some kind of a reverse list, at least… I don't recall if it works directly though
<Harzilein> $ gem dependency -R pivotal-tracker
<Harzilein> No gems found matching pivotal-tracker (>= 0)
<rue> Try -r also
<rue> For remote
<Harzilein> ERROR: Only reverse dependencies for local gems are supported.
<Harzilein> ah
<rue> Heh
felipe [felipe!~felipe@unaffiliated/felipe] has joined #ruby-lang
<Harzilein> oh
<Harzilein> hmm
<Harzilein> wait...
<Harzilein> the error message might be misleading
DMKE [DMKE!~DMKE@f050187165.adsl.alicedsl.de] has joined #ruby-lang
DMKE [DMKE!~DMKE@pdpc/supporter/student/dmke] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<rue> Nah
<dFire> I can't get this mutex thing to work the way I want
<dFire> :(
<dFire> But it makes perfect sense, so there's no question.
<rue> You see the race now?
_guns_ [_guns_!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
<shevy> rat race
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
<rue> Sorta, but it's ugly
<rue> The crux is still that you need to get the ref before the variable's reassigned
<rue> A simple #spawn_parser would be a simpler way
<dFire> please explain?
<rue> def spawn_parser(line); Thread.new { parse line }; end
<dFire> It seems to work, but I don't understand why
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
_guns_ [_guns_!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
<rue> It works, because when you call the method, its local variable line will refer to the *object* you want it to. Then outside the method the old variable can change to refer to something else without affecting your thread
<rue> Make sense?
<dFire> In a way, but it smells an aweful lot like you're moving the problem
<rue> In a way ;)
sodani [sodani!~cmiso@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
<rue> The problem is just variables vs. objects
__guns__ [__guns__!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
Jake232 [Jake232!~textual@5e02784b.bb.sky.com] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
andrewhl [andrewhl!~andrew@CPE687f7402a2d8-CM00195ed25a2a.cpe.net.cable.rogers.com] has joined #ruby-lang
<shevy> moving the problem is often easier than solving it
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby-lang
<Harzilein> how would you write an error handler that augments the information in the stack trace and then continues?
<Harzilein> (i.e. prints some of the arguments of the current method or something)
tavon [tavon!~tavon@69.51.137.210] has joined #ruby-lang
<Harzilein> s/continues/& with the regular error handling/
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
gearaholic [gearaholic!~gearaholi@c-71-238-98-243.hsd1.mi.comcast.net] has joined #ruby-lang
* muzone is now playing: http://www.rainymood.com
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
<dFire> <shevy> moving the problem is often easier than solving it <= true, but the problem is that you've not solved the problem XD
<dFire> Moving it makes it entirely likely it'll come back to bite you again
<chris2> who the fuck is that luca on ruby-talk?
<dominikh> why does everybody care? you all lack proper killfiles? :P
<dominikh> i spent about 1 minute dealing with him, and that includes reading the messages of people who complained
<chris2> my rss generator doesnt
<dominikh> :D
<shevy> I never even heard of him but from the name he sounds italian
<shevy> perhaps he knows how to cook spaghetti
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-209-87.ssp.dialog.net.pl] has joined #ruby-lang
uniqanomaly_ [uniqanomaly_!~ua@dynamic-78-8-214-159.ssp.dialog.net.pl] has joined #ruby-lang
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
ryanf [ryanf!~revfitz@50.0.160.40] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@host226.190-31-167.telecom.net.ar] has joined #ruby-lang
diegoviola [diegoviola!~viola@host-1-211.b15.cvc.com.py] has joined #ruby-lang
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
theconartist [theconartist!~tca@thewired.me] has joined #ruby-lang
cored [cored!~homer@201.229.129.150] has joined #ruby-lang
cored [cored!~homer@unaffiliated/cored] has joined #ruby-lang
<cored> is there a project that lets me run a single project in different vm's ?
<cored> without switching something that I specified the installed vm's
<cored> and it just run everything in it
<cored> ?
scampbell [scampbell!~scampbell@c-98-224-240-62.hsd1.mi.comcast.net] has joined #ruby-lang
yakkof [yakkof!~yakkof@ip68-6-125-21.sb.sd.cox.net] has joined #ruby-lang
<yakkof> hi... how can I overwrite the last n bytes of a file?
path[l] [path[l]!~path@120.138.102.50] has joined #ruby-lang
<ryanf> only with write instead of read
<ryanf> ah, yeah
<ryanf> if you open the file in r+ mode
<ryanf> you can do f.seek(-100, IO::SEEK_END) and then f.write("stufF") to overwrite the end of the file
<lianj> echo AAA > foo.txt; ruby -e 'File.open("foo.txt","r+b"){|f| f.seek(f.size-2); f.print "B" }'; cat foo.txt
<ryanf> oh yeah I guess you could use f.size instead of a negative value for seek
<yakkof> lianj: what's the b for (r+b)?
<ryanf> binary mode
<ryanf> IIRC that doesn't make a difference except in windows?
<ryanf> I might be misremembering
<lianj> yakkof: also, make f.size-1 to really overwrite the last byte
<erikh> IO::SEEK_END is faster, I think.
<yakkof> I was trying lianj's method first... but get a NoMethodError for size... (File:teset (closed)>
<erikh> he probably mean f.stat.size
<ryanf> f.size works for me in 1.9.3
<ryanf> ah
<ryanf> not in 1.8.7
<yakkof> ok. I'm still on 1.8.7
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
<shevy> my brother! yakkof!
<shevy> hmm is it possible to have rubygems list rdoc documentation of a gem?
<ryanf> shevy: try "gem server"
<ryanf> doesn't do much for me though since I keep doc generation disabled
<ryanf> you can also go rubydoc.info to get yard docs for pretty much any gem
jbsan_ [jbsan_!~jbsan@m83-188-244-236.cust.tele2.se] has joined #ruby-lang
<shevy> hmm
<shevy> are these docs automatically generated?
<shevy> when you push a gem for instance
<ryanf> yeah
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
<ryanf> I think they are actually generated on demand
dustin__ [dustin__!~ddeyoung@99-7-24-156.lightspeed.iplsin.sbcglobal.net] has joined #ruby-lang
<shevy> ah cool
<shevy> indeed
<shevy> thanks ryanf :)
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
Foxmaster [Foxmaster!~root@c-83-219-199-232.cust.bredband2.com] has joined #ruby-lang
shevy [shevy!~shevy@178-191-252-75.adsl.highway.telekom.at] has joined #ruby-lang
perryh [perryh!~perryh@unaffiliated/perry753] has joined #ruby-lang
Manhose__ [Manhose__!~Manhose@bl17-45-13.dsl.telepac.pt] has joined #ruby-lang
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby-lang
dustin__ [dustin__!~ddeyoung@99-7-24-156.lightspeed.iplsin.sbcglobal.net] has quit [#ruby-lang]
jbardin [jbardin!~jbardin@173-11-110-83-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
<jbardin> heya guys, is there any discussion surrounding the recent issue of hash-table-collision DDOS attacks?
<ryanf> only a bit, and it was fairly trolly :)
<ryanf> the most up-to-date versions of 1.8 and 1.9 aren't vulnerable
<ryanf> so there's not that much to talk about
<jbardin> most recent as in > ruby 1.8.7 (2009-12-24 patchlevel 248) ?
<ryanf> yeah I think it's like patch three hundred something
<ryanf> oh I guess jruby and rubinius are still vulnerable, so that's something
<ryanf> the original disclosure page says, anyway
<ryanf> yeah it's 1.8.7-p357 plus every version of 1.9
<jbardin> thanks
zvrba [zvrba!96456@diamant.ifi.uio.no] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
<jbardin> arg, looks like REE is lagging a couple patch levels as well
<petercooper> and a whole major version, hehe
<jbardin> thanks for you time guys, catchya on the flip side
<shevy> proudly on ruby 1.8.7 (2011-12-28 patchlevel 357) [i686-linux]!
<lianj> m(
<shevy> lisp is cool
<shevy> )
<shevy> hmm
<shevy> So I have a directory in bash, that is reported to have ... a size of 2.3K
<shevy> my ruby script ... somehow rounds up to 3 KB
<shevy> I am confused
t-mart [t-mart!~t-mart@c-174-49-68-22.hsd1.ga.comcast.net] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0E202.dip0.t-ipconnect.de] has joined #ruby-lang
Codif [Codif!~codif@84.120.204.160.dyn.user.ono.com] has joined #ruby-lang
RickHull [RickHull!~rhull@pdpc/supporter/active/rickhull] has quit [#ruby-lang]
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
sora_h [sora_h!~sora_h@mayfield.privs.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
jbwiv_ [jbwiv_!~jb@cpe-098-026-172-101.triad.res.rr.com] has joined #ruby-lang
tavon [tavon!~tavon@c-98-209-27-241.hsd1.mi.comcast.net] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0C147.dip0.t-ipconnect.de] has joined #ruby-lang
Ki4n [Ki4n!~Ki4n@91-115-236-252.adsl.highway.telekom.at] has joined #ruby-lang
<andrewvos> shevy: Maybe it's "size on disk"
arthurlockhart [arthurlockhart!~cinch@60-242-128-8.static.tpgi.com.au] has joined #ruby-lang
<shevy> yeah, no idea yet ... the faulty code part seems to be in http://pastie.org/3092983 now I actually need to first understand it, there is surely a bug in it
SuperTaz_work [SuperTaz_work!~supertaz_@vpn.lax.truecarcorp.com] has joined #ruby-lang
<andrewvos> shevy: I wish your code had a to_human_readable method on it :)
<shevy> yeah ... it is supposed to toggle display between long version for bytes like 1758979 or 1758 into something that is more readable on first sight
<shevy> and
<shevy> it is buggy
<shevy> :(
<andrewvos> :(
<shevy> know what
<shevy> I simply discard it and start from 0
<dreinull> super productive. I hunted down one bug by reverting to old code while keeping the feature.
<shevy> haha dreinull know that feeling :(
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
<shevy> I tried to update my ancient IRC code in ruby
<dreinull> it's been like that for the last days now.
<shevy> I made some changes, then it suddenly no longer worked ... but I didn't revert... after a while I abandoned it entirely and now I don't find the motivation to even touch it anymore
<shevy> (my IRC bot)
<ryanf> that whole middle part of the method could probably be like one line
<ryanf> crazy conversions going on
<shevy> yeah it can be shortened
<dreinull> new web app idea: method shortener
<ryanf> aren't you just trying to round up to the nearest integer?
<shevy> ryanf hmm ... I am not sure... what I want to try is to copy what bash does when listing files
<shevy> ls -Flh -p
<shevy> but I can see that I make some rounding errors hmm
<shevy> 3.4K becomes 4K
<shevy> 2.3K becomes 3K
<shevy> and 150 becomes 15 B (!)
<shevy> die, code, DIE!
lake [lake!lake@bbis.us] has joined #ruby-lang