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>
[A
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>
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?
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)
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>
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
<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
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
<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