Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
awesome_ [awesome_!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
awesome__ [awesome__!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
Draco_ [Draco_!~draco@dsl-69-171-130-117.acanac.net] has joined #ruby
zodiak [zodiak!~stef@cpe-75-84-218-68.socal.res.rr.com] has joined #ruby
_whitelogger [_whitelogger!~whitelogg@2a00:ab00:1::4464:5550] has joined #ruby
apok_ [apok_!~apok@96.24.67.22] has joined #ruby
ixti [ixti!~ixti@251.Red-88-25-53.staticIP.rima-tde.net] has joined #ruby
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
moondiamond [moondiamond!~moondiamo@123.208.245.45] has joined #ruby
looopy [looopy!~looopy@pool-141-156-48-7.washdc.btas.verizon.net] has joined #ruby
<loocorez> mztriz: Your indentation...
<mztriz> loocorez, Oh wow I didn't even think about that. I'll take a look at it again. Thanks
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
<loocorez> It just makes it hard to read, and ruby's throwing warnings when I run it for me...
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
yfeldblum [yfeldblum!~Jay@c-71-206-30-119.hsd1.md.comcast.net] has joined #ruby
robyurkowski [robyurkowski!~Rob@bas2-longueuil15-3096771256.dsl.bell.ca] has joined #ruby
mksm_ [mksm_!~mksm@201.20.236.65.user.ajato.com.br] has joined #ruby
sebicas [sebicas!~sebicas@190.194.8.26] has joined #ruby
d2dchat [d2dchat!~d2dchat@173-167-20-129-michigan.hfc.comcastbusiness.net] has joined #ruby
sebicas [sebicas!~sebicas@190.194.8.26] has quit [#ruby]
vyrus001 [vyrus001!~Vyrus001@209.159.137.115] has joined #ruby
<vyrus001> yo, what's the fastest way to turn a bunch of '/n's in a string to actuall newline chars in ruby?
mickn [mickn!~mickn@unaffiliated/mickn] has joined #ruby
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<rramsden> vyrus001: "/n".sub("/n", "\n")
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
<rramsden> vyrus001, opps you want gsub for global replace gsub("/n", "\n")
wedgeV_ [wedgeV_!~wedge@cpe-68-173-18-241.nyc.res.rr.com] has joined #ruby
rickmasta [rickmasta!~rickmasta@ool-ad029554.dyn.optonline.net] has joined #ruby
countskm [countskm!~countskm@pool-108-9-189-75.tampfl.fios.verizon.net] has joined #ruby
<loocorez> rramsden: Those are actual newlines, not just a backslash and an n?
wedgeV__ [wedgeV__!~wedge@cpe-68-173-18-241.nyc.res.rr.com] has joined #ruby
<loocorez> Nevermind, you're right! I was doing something wrong somewhere theer.
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
<rramsden> you might of been using single quotes, in that case \n is not escaped
frogstarr78 [frogstarr78!~frogstarr@lan.viviotech.net] has joined #ruby
mengu__ [mengu__!~mengu@78.184.201.123] has joined #ruby
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
<vyrus001> rramsden: thnx, didnt know if there was a faser way to do it othe than sub
dbgster [dbgster!~dbgster@CPE0013f7b7170c-CM0013f7b71708.cpe.net.cable.rogers.com] has joined #ruby
adeponte [adeponte!~adeponte@pool-173-51-131-236.lsanca.fios.verizon.net] has joined #ruby
norex [norex!~quassel@41-135-90-128.dsl.mweb.co.za] has joined #ruby
raythecat [raythecat!~raythecat@cpe-66-27-147-33.socal.res.rr.com] has joined #ruby
ggtoo [ggtoo!~ggtoo@122.178.1.156] has joined #ruby
jamnew [jamnew!~jamnew@eth12849.sa.adsl.internode.on.net] has joined #ruby
swarles [swarles!~swarley@ip72-218-14-80.hr.hr.cox.net] has joined #ruby
<swarles> is there a way to do something like pointers in C++ or references in perl?
nari [nari!~nari@2001:268:306:1:f2de:f1ff:fe55:2de0] has joined #ruby
caveat- [caveat-!hoax@gateway/shell/bshellz.net/x-ommsxqyglrqnexwm] has joined #ruby
sythe [sythe!~quassel@facade/leader] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
looopy [looopy!~looopy@pool-141-156-48-7.washdc.btas.verizon.net] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
luminare [luminare!~kaneda@5adb21b6.bb.sky.com] has joined #ruby
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
baroquebobcat [baroquebobcat!~nick@c-67-176-80-121.hsd1.co.comcast.net] has joined #ruby
ryanf [ryanf!~revfitz@adsl-67-117-145-134.dsl.snfc21.pacbell.net] has joined #ruby
Harzilein [Harzilein!~harzi@harzilein.eu.org] has joined #ruby
<Harzilein> hi
MrCheetoDust [MrCheetoDust!~farhankha@cpe-76-94-123-32.socal.res.rr.com] has joined #ruby
<Harzilein> is there some way, maybe using a block/proc where in a long chain of calls i can return nil or the earlier object's [] method with an argument?
<Harzilein> like with a nokogiri search:
<Harzilein> Addressable::URI.parse(result.css("a:contains('Next')").first["href"]) here it would help if the last [] would only get used if i actually get a node
<ryanf> rails has a .try() method that I think does what you want
<ryanf> if I understand you correctly
<ryanf> the implementation is simple
<ryanf> so here it would be result.css("a:contains('Next')").first.try(:[], "href")
<ryanf> and that would return nil if first is nil, or else call the method on it
<Harzilein> yeah, nice
<ryanf> uh I guess they patch an alternate implementation onto NilClass, now that I think about it
<ryanf> otherwise it wouldn't make any sense
<Harzilein> hmm
<Harzilein> well, on object, no?
<ryanf> on object it is the same as send, and on nil it returns nil
<Harzilein> of course it'd be nice if it would only affect the current statement
<ryanf> yeah
scx [scx!~Administr@abuk212.neoplus.adsl.tpnet.pl] has joined #ruby
<scx> hrllo
<scx> hello*
<scx> how to change multiple \n to single \n by gsub?
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<dagnachewa> hi all
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
<ryanf> scx: gsub(/\n+/, "\n")
CannedCorn [CannedCorn!~CannedCor@cpe-66-65-102-78.nyc.res.rr.com] has joined #ruby
looopy [looopy!~looopy@pool-141-156-48-7.washdc.btas.verizon.net] has joined #ruby
<scx> ryanf: i tried but not works for me
<scx> i tried also: text = text.gsub(/\n\n+/, "\n")
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<deryldoucette> works here
kuzushi [kuzushi!~kuzushi@ip98-165-117-197.ph.ph.cox.net] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
Liothen [Liothen!~liothen@24-119-65-28.cpe.cableone.net] has joined #ruby
Draco_ [Draco_!~draco@dsl-69-171-130-117.acanac.net] has joined #ruby
JakeyChan [JakeyChan!~JakeyChan@116.226.95.154] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<Harzilein> heh, i found this after searching for mentions of Object#try
<swarles> is there a way to do something like pointers in C++ or references in perl?
<nlew> scx: text.squeeze("\n")
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
<scx> nlew: thx
nerdy_ [nerdy_!~textual@66-44-118-195.c3-0.grg-ubr1.lnh-grg.md.cable.rcn.com] has joined #ruby
<nlew> swarles: Ruby is all references. What do you mean?
spridel [spridel!~spridel@unaffiliated/spridel] has joined #ruby
<banisterfiend> swarles: Yeah, kind of, using object_id and ObjectSpace._id2ref
<swarles> nlew, reference the object to avoid necessarily creating two objects that hold the same value
<ryanf> swarles: you know arguments are passed by reference right?
<banisterfiend> swarles: ruby does that anyway, if you want a copy then you have to explictly call #dup
<ryanf> well, by value where the value is a reference
<nlew> swarles: Assignment creates a reference, not a copy. So what you want is the natural behavior unless you have a particular use case where that's not true.
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
<nlew> Without duping, the only way you're likely to get a copy is by using += (or its ilk)
<ryanf> banisterfiend: what would be a use case for _id2ref? having trouble thinking of an example that can't be done just as easily with normal references
<ryanf> I guess you could use it for a soft reference
<ryanf> that's kind of cool
<ryanf> anything else?
<ryanf> by soft I mean weak
<nlew> It looks like that's exactly how WeakRef is implemented, indeed.
<ryanf> oh, I didn't know weakref existed.
JakeyChan [JakeyChan!~JakeyChan@116.226.95.154] has joined #ruby
<nlew> I didn't either until I just grepped for id2ref in the source heh
<nlew> Looks like it's also used for drb, which is the other thing I was thinking of
<banisterfiend> is github down for anyone else?
<ryanf> looks like it's just a proxy that doesn't inhibit GC?
<ryanf> ahh, interesting
<ryanf> yep
<nlew> where you want to do some sort of strange in-memory "serialization"
ggtoo [ggtoo!~ggtoo@122.178.1.156] has joined #ruby
<ryanf> banisterfiend: scheduled maintenance
<banisterfiend> ryanf: i used it for hacks a while ago, i dont remember the use cases anymore sorry
<nlew> Other than that, it looks largely unused in the source
<nlew> it reminds me of this thread, "Why does Ruby have callcc?" http://bit.ly/vr4AOq
<TheMoonMaster> Github down. :P
<nlew> "The official answer is "why not". I provide the features, you use them. matz."
<banisterfiend> ryanf: https://gist.github.com/1464410
<banisterfiend> oh
<banisterfiend> fucking github
<banisterfiend> ah gists still work
<banisterfiend> nlew: callcc is pretty cool
<banisterfiend> im using it in a project anyway :))
<nlew> I put a continuation in an exception and raised that
<banisterfiend> nlew: Exception#continue ?
<nlew> Oh neat
<banisterfiend> i'm using a slightly modified version of that
<nlew> oh monkey-patching raise, that is glorious
baroquebobcat [baroquebobcat!~nick@c-67-176-80-121.hsd1.co.comcast.net] has joined #ruby
stephenjudkins [stephenjudkins!~stephen@c-76-115-1-70.hsd1.or.comcast.net] has joined #ruby
blaenk [blaenk!~blaenk@unaffiliated/blaenkdenum] has joined #ruby
GreaseMonkey [GreaseMonkey!~gm@unaffiliated/greasemonkey] has joined #ruby
sbanwart__ [sbanwart__!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
<mksm_> rmagick's last commit was ~6 months ago. And its from the previous maintainers ... I wonder if pull requests will ever get merged
mksm [mksm!~mksm@pdpc/supporter/professional/mksm] has joined #ruby
Cyrus_ [Cyrus_!~Cyrus@cpe-173-173-106-235.satx.res.rr.com] has joined #ruby
Cyrus [Cyrus!~Cyrus@unaffiliated/cyrus] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
<banisterfiend> mksm: fork + release :)
raythecat [raythecat!~raythecat@cpe-66-27-147-33.socal.res.rr.com] has joined #ruby
<mksm> banisterfiend, but then i'll have to clone my fork to install the gem
<mksm> or add it to the private repo
<mksm> ~_~
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
baroquebobcat [baroquebobcat!~nick@c-67-176-80-121.hsd1.co.comcast.net] has joined #ruby
replore_ [replore_!~replore@203.152.213.161.static.zoot.jp] has joined #ruby
JakeyChan [JakeyChan!~JakeyChan@ec2-175-41-238-53.ap-northeast-1.compute.amazonaws.com] has joined #ruby
jergason [jergason!~jergason@c-67-161-248-217.hsd1.ut.comcast.net] has joined #ruby
<S1kx> https://github.com/codahale/bcrypt-ruby/blob/master/lib/bcrypt.rb#L173 isnt this vulnerable to timing attacks?
p0y [p0y!~p0y@122.52.126.66] has joined #ruby
ghosTM55 [ghosTM55!~user@li279-245.members.linode.com] has joined #ruby
Bonkers [Bonkers!~matt@pool-108-27-21-239.nycmny.fios.verizon.net] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
radic_ [radic_!~radic@dslb-094-216-228-155.pools.arcor-ip.net] has joined #ruby
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby
kylemcgill [kylemcgill!~kylemcgil@static-ip-202-90-56-14.watchdog.net.nz] has joined #ruby
wiwillia [wiwillia!60fd069b@gateway/web/freenode/ip.96.253.6.155] has joined #ruby
wiwillia [wiwillia!60fd069b@gateway/web/freenode/ip.96.253.6.155] has quit [#ruby]
<samuelkadolph> No
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby
baroquebobcat [baroquebobcat!~nick@c-67-176-80-121.hsd1.co.comcast.net] has joined #ruby
scx_ [scx_!~Administr@eok157.neoplus.adsl.tpnet.pl] has joined #ruby
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby
rickmasta [rickmasta!~rickmasta@pool-108-21-213-102.nycmny.fios.verizon.net] has joined #ruby
pencilcheck [pencilcheck!~pen@dhcp1.csie.ntu.edu.tw] has joined #ruby
baroquebobcat [baroquebobcat!~nick@c-67-176-80-121.hsd1.co.comcast.net] has joined #ruby
stephans [stephans!~stephans@76-217-209-24.lightspeed.sntcca.sbcglobal.net] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
guest42 [guest42!natsel@72.20.53.166] has joined #ruby
crankycoder [crankycoder!~crankycod@24-246-44-226.cable.teksavvy.com] has joined #ruby
skillachie [skillachie!~skillachi@ool-457de73d.dyn.optonline.net] has joined #ruby
rippa [rippa!~splitta@85.158.54.234] has joined #ruby
p1d [p1d!~p1d@dslb-088-065-171-220.pools.arcor-ip.net] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@187.64.90.129] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@unaffiliated/vtr] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.3.83] has joined #ruby
Lord-Harlot [Lord-Harlot!Serenity@adsl-77-86-52-54.karoo.KCOM.COM] has joined #ruby
nanoyak [nanoyak!~nanoyak@173-228-119-246.dsl.dynamic.sonic.net] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
frewsxcv_ [frewsxcv_!~coreyf@unaffiliated/frewsxcv] has joined #ruby
lonny [lonny!~lonny@122.177.189.130] has joined #ruby
<frewsxcv_> anyone here have code completion working in vim?
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
<danheberden> frewsxcv_ ya - i updated janus and doing things like [1,2].ea[tab] fills in the braces and puts the cursur at the arguments
<danheberden> not sure if you use that, but you can see what they use: https://github.com/carlhuda/janus
<frewsxcv_> danheberden: that works for me, but if i do "hello".[tab] it doesn't complete correctl
<danheberden> yeah, without any leading help i just get whatever words i've used already in the file
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<danheberden> :/
<frewsxcv_> it basically lists every method, not necessarily the ones limited to strings.
<frewsxcv_> danheberden: then you're not using omnicomplete
<frewsxcv_> ctrl-x ctrl-o is omni
<scx_> i want to <script> tags from html
<scx_> i tried:
<scx_> text.gsub(/<script[^>]*>.*?<\/script>/, '')
<scx_> but doesnt work for me
<danheberden> want to *get script tags?
<ryanf> *remove
<frewsxcv_> ctrl-x ctrl-p is previous search
<scx_> remove*
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<scx_> danheberden: i want to remove everything from <script to /script>
<scx_> for example from: <script bla>bla blah<div></div></script>I want this<script bla>bla blah<div></div>
<scx_> i want: "I want this"
<mksm> scx_, nokogiri?
<davidcelis> ^
<mksm> paper is the biggest threat to a desk's usable space
<mksm> written papers are the worst
rramsden [rramsden!~rramsden@out-bc-147.wireless.telus.com] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
wedgeV [wedgeV!~wedge@cpe-24-193-124-224.nyc.res.rr.com] has joined #ruby
pencilcheck [pencilcheck!~pen@dhcp1.csie.ntu.edu.tw] has joined #ruby
nari [nari!~nari@2001:268:306:1:f2de:f1ff:fe55:2de0] has joined #ruby
adeponte [adeponte!~adeponte@pool-173-51-131-236.lsanca.fios.verizon.net] has joined #ruby
wmoxam [wmoxam!~wmoxam@76-10-165-34.dsl.teksavvy.com] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
saschaheylik [saschaheylik!~sascha@80-121-56-255.adsl.highway.telekom.at] has joined #ruby
Beoran_ [Beoran_!~beoran@ip-81-11-179-216.dsl.scarlet.be] has joined #ruby
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
frewsxcv_ [frewsxcv_!~coreyf@unaffiliated/frewsxcv] has quit ["WeeChat 0.3.5"]
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
bigkm [bigkm!~bigkm@203-206-185-71.perm.iinet.net.au] has joined #ruby
Draco_ [Draco_!~draco@dsl-69-171-130-117.acanac.net] has joined #ruby
minijupe [minijupe!~benlieb@adsl-98-94-144-217.ard.bellsouth.net] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
kermit`` [kermit``!kermit@c-be44e255.311-23-64736c10.cust.bredbandsbolaget.se] has quit [#ruby]
cdepue [cdepue!~cdepue@200.117.90.63] has joined #ruby
tonini [tonini!~zastav@edge.garaio.com] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
frewsxcv_ [frewsxcv_!~coreyf@unaffiliated/frewsxcv] has joined #ruby
<frewsxcv_> i'm learning rails right now. when i do 'rails server' it thinks i want to create an application called server
keithpitt [keithpitt!~keithpitt@eth2071.vic.adsl.internode.on.net] has joined #ruby
bwright [bwright!~bwright@c122-106-254-100.belrs3.nsw.optusnet.com.au] has joined #ruby
symb0l [symb0l!~symb0l@c-50-131-187-183.hsd1.ca.comcast.net] has joined #ruby
<ryanf> frewsxcv_: you're using rails 2, 'rails server' is part of rails 3, use 'script/server', ask ror questions in #ror
<ryanf> I had to include that last bit or someone might yell at me :)
<frewsxcv_> oh, that explains why #rails is dead
JohnBat26 [JohnBat26!~Eugene@89.175.77.90] has joined #ruby
rramsden [rramsden!~rramsden@207.216.52.184] has joined #ruby
LittleBill902_ [LittleBill902_!smith@c-71-197-103-184.hsd1.ca.comcast.net] has joined #ruby
h4mz1d [h4mz1d!~hamfz@c-69-244-5-169.hsd1.al.comcast.net] has joined #ruby
<davidcelis> lol
acts_as_david [acts_as_david!~acts_as_d@c-71-202-155-161.hsd1.ca.comcast.net] has joined #ruby
tcurdt [tcurdt!~tcurdt@dslb-188-107-221-112.pools.arcor-ip.net] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
yxhuvud [yxhuvud!mongo@h-17-224.a149.priv.bahnhof.se] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
yfeldblum [yfeldblum!~Jay@c-68-34-107-252.hsd1.md.comcast.net] has joined #ruby
sawu [sawu!~textual@pool-71-170-159-147.dllstx.fios.verizon.net] has joined #ruby
stephenjudkins [stephenjudkins!~stephen@c-76-115-1-70.hsd1.or.comcast.net] has joined #ruby
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby
raythecat [raythecat!~raythecat@cpe-76-88-24-94.san.res.rr.com] has joined #ruby
pkondzior [pkondzior!u768@gateway/web/irccloud.com/x-jgiqkmaufkbpfcue] has joined #ruby
<pkondzior> Hello, how to mock/stub Process::Status in ruby ?
nanoyak [nanoyak!~nanoyak@173-228-119-246.dsl.dynamic.sonic.net] has joined #ruby
<pkondzior> specially to test handling nil exit status
Null0 [Null0!nvoid@79.133.201.85] has joined #ruby
wookiehangover [wookiehangover!~wookiehan@c-67-161-138-118.hsd1.co.comcast.net] has joined #ruby
<pkondzior> rubyspec is using Process.fork { Process.exit!(status_code) }
<pkondzior> but how to do this for nil value ?
<pkondzior> like application is quiting without exit code
<pkondzior> because of segmetation fault ie
senny [senny!~senny@edge.garaio.com] has joined #ruby
stephenjudkins [stephenjudkins!~stephen@c-76-115-1-70.hsd1.or.comcast.net] has joined #ruby
ggtoo [ggtoo!~ggtoo@122.178.1.156] has joined #ruby
<matled> pkondzior: there is no such thing as "no exit code". if you want to simulate a segmentation fault you could either set the exit code manually or kill a process with "SEGV"
<pkondzior> matled: there is
pen [pen!~pen@dhcp1.csie.ntu.edu.tw] has joined #ruby
<pkondzior> matled: if your process is going to segfault, you will have exitcode nil
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
<pkondzior> matled: or memory allocation problems, or whatever system related
<pkondzior> matled: but we can argue here is it improtnat from ruby level to handle this or is it not
<pkondzior> my question is, how to stub Process::Status
<pkondzior> in tests
<pkondzior> specially nil :)
<matled> pkondzior: mh, I see. at least in my shell it has an exit code of 139. I'm not too sure how it looks at the system call level.
<pkondzior> matled: well i'm using fork + exec
<matled> but to mimic the way rubyspec does it you could do fork { exec "sleep 60" }; sleep 0.5; Process.kill("SEGV", pid)
<pkondzior> and flex application isnide
<pkondzior> and when application is segfaulting or doing some bad stuff
<pkondzior> it's returning Process::Status with pid but without exitstatus
<pkondzior> i mean, exitstatus = nil in this case
<pkondzior> to mimic all exitcodes using standard api i can just do fork { exit!(status_code); exit_status = Process.waitpid2
<pkondzior> but exit!() accepts only 0-255 :)
<burgestrand> Stub it out
<pkondzior> burgestrand: I'm doing this right now but it's a bit awkward, do you have any suggestions ?
<pkondzior> how to do this _well_ ?
<burgestrand> pkondzior: I’ve never heard of anything not having an exit status; even if things segfault or run out of memory things tend to have an exit status for me
<burgestrand> pkondzior: so, I have no idea
<burgestrand> pkondzior: I would stub it out
<pkondzior> burgestrand: well i can show you exitstatus.inspect :P
<burgestrand> pkondzior: have your process #exited?
<pkondzior> burgestrand: it's just crappy Adobe Air application
<pkondzior> burgestrand: it's probably the reason, but i cannot fix this on that level
<burgestrand> pkondzior: sorry, I must go in like… 1 minute :)
<burgestrand> pkondzior: but yeah, I would stub it out, or actually make the child segfault
<burgestrand> For the latter case you could create a C extension that tries to read something from a null pointer, and BAM
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
<burgestrand> And call that method in your test :)
<pkondzior> burgestrand: yeah, but this is like bazooka :D
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
<pkondzior> burgestrand: for simple thing, anyway if my child is going to exit with SEGV :) it will return exitcode obviously becuase ruby is doing this correclty
<pkondzior> i just have very nasty scenerio Ruby -> Fork -> Flex Application
<burgestrand> Yeah, well stub or fake, it’s the only two viable options I see ^^
<burgestrand> stub or bazooka ;)
<burgestrand> Got to go now, have fun!
michael_mbp [michael_mbp!~Marin@112.134.203.126] has joined #ruby
__main__ [__main__!~main@adsl-99-173-15-158.dsl.pltn13.sbcglobal.net] has joined #ruby
marc-sci` [marc-sci`!~user@c-67-189-92-18.hsd1.or.comcast.net] has joined #ruby
negaduck [negaduck!~negaduck@91.206.116.254] has joined #ruby
Quadlex [Quadlex!~quadlex@li23-6.members.linode.com] has joined #ruby
mafolz [mafolz!~mafolz@dhcp50-207.start.uni-saarland.de] has joined #ruby
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
roaminghorse [roaminghorse!~roamingho@124.74.129.194] has joined #ruby
blaenk [blaenk!~blaenk@unaffiliated/blaenkdenum] has joined #ruby
nanoyak [nanoyak!~nanoyak@173-228-119-246.dsl.dynamic.sonic.net] has joined #ruby
michael_mbp [michael_mbp!~Marin@112.134.196.132] has joined #ruby
burgestrand [burgestrand!~burgestra@62.65.124.23] has joined #ruby
zommi [zommi!quassel@nat/ibm/x-ugiznpcjetfkjwqe] has joined #ruby
gregorg_taf [gregorg_taf!~Greg@78.155.152.6] has joined #ruby
negaduck [negaduck!~negaduck@91.206.116.254] has joined #ruby
sawu [sawu!~textual@pool-71-170-159-147.dllstx.fios.verizon.net] has joined #ruby
roaminghorse [roaminghorse!~roamingho@ec2-50-16-85-142.compute-1.amazonaws.com] has joined #ruby
scx [scx!~Administr@eol62.neoplus.adsl.tpnet.pl] has joined #ruby
moted [moted!~ryan@c-98-246-106-150.hsd1.or.comcast.net] has joined #ruby
ChampS_ [ChampS_!~ChampS@wlan1-60.zw.fh-zwickau.de] has joined #ruby
ph^ [ph^!~ph^@79.135.7.171] has joined #ruby
negaduck_ [negaduck_!~negaduck@91.206.116.254] has joined #ruby
alup [alup!~alup@193.92.123.5] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
EddieS [EddieS!~ed@212.59.167.161] has joined #ruby
pen [pen!~pen@dhcp1.csie.ntu.edu.tw] has joined #ruby
negaduck [negaduck!~negaduck@91.206.116.254] has joined #ruby
RomD [RomD!~Roman@nrbg-d93233a7.pool.mediaWays.net] has joined #ruby
batlock666 [batlock666!~quassel@bvderbau.ugent.be] has joined #ruby
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
dekroning [dekroning!~dekroning@541B931D.cm-5-4c.dynamic.ziggo.nl] has joined #ruby
dekroning [dekroning!~dekroning@541B931D.cm-5-4c.dynamic.ziggo.nl] has joined #ruby
Zsadan [Zsadan!~Zsadan@dhcp30.tropos.de] has joined #ruby
`gregorg` [`gregorg`!~Greg@78.155.152.6] has joined #ruby
Zsadan [Zsadan!~Zsadan@dhcp30.tropos.de] has joined #ruby
pi3r [pi3r!~pi3r@LSt-Amand-152-32-39-189.w80-11.abo.wanadoo.fr] has joined #ruby
michael_mbp [michael_mbp!~Marin@112.134.198.124] has joined #ruby
ikaros [ikaros!~ikaros@dslb-084-059-073-057.pools.arcor-ip.net] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
JohnBat26 [JohnBat26!~Eugene@89.175.77.90] has joined #ruby
Amirh [Amirh!~amir@2.181.19.151] has joined #ruby
bosphorus [bosphorus!~bosphorus@81.214.127.71] has joined #ruby
heliar [heliar!~wally@195.117.37.107] has joined #ruby
araujo [araujo!~araujo@190.73.44.29] has joined #ruby
araujo [araujo!~araujo@gentoo/developer/araujo] has joined #ruby
Helius [Helius!~Adium@212.31.227.18] has joined #ruby
frewsxcv_ [frewsxcv_!~coreyf@unaffiliated/frewsxcv] has quit ["WeeChat 0.3.5"]
grekko [grekko!~grekko@HFUVPN190.HFU-VPN.FU.HS-Furtwangen.DE] has joined #ruby
jonathan___ [jonathan___!~jonathan@119.131.192.45] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
roaminghorse [roaminghorse!~roamingho@ec2-50-16-85-142.compute-1.amazonaws.com] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
<jonathan___> Hello all, I'm new in Ruby and I would like to know what is the standard folders hierarchy used for the Ruby project ?
<jonathan___> I come from Java and I was used to have Maven
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
RubyPanther [RubyPanther!~paris@c-24-22-48-80.hsd1.or.comcast.net] has joined #ruby
xec [xec!~xec@2a00:10b0:1:1002:5ab0:35ff:fef8:6a01] has joined #ruby
nicoulaj [nicoulaj!~nicoulaj@V10K2.bull.fr] has joined #ruby
roaminghorse [roaminghorse!~roamingho@124.74.129.194] has joined #ruby
negaduck [negaduck!~negaduck@91.206.116.254] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
ognevsky [ognevsky!~ognevsky@27-214-94-178.pool.ukrtel.net] has joined #ruby
manizzle_ [manizzle_!~manizzle@adsl-99-102-133-31.dsl.pltn13.sbcglobal.net] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
ognevsky_ [ognevsky_!~ognevsky@27-214-94-178.pool.ukrtel.net] has joined #ruby
BiHi [BiHi!~bihi@did75-17-88-165-129-29.fbx.proxad.net] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
flippingbits [flippingbits!~anonymous@p54A5E8C0.dip.t-dialin.net] has joined #ruby
potatopanic [potatopanic!~king@108-215-232-154.lightspeed.hstntx.sbcglobal.net] has joined #ruby
canton10 [canton10!~canton7@152.78.95.108] has joined #ruby
nari [nari!~nari@2001:268:306:3:6680:99ff:fe23:576c] has joined #ruby
<kke> no standard
<kke> frameworks like rails have their "standards"
<jonathan___> kke, ok I have seen Mr. Bones, and I've just started with it
ognevsky [ognevsky!~ognevsky@27-214-94-178.pool.ukrtel.net] has joined #ruby
<jonathan___> but how to write my code inside is still unclear
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
<jonathan___> I guess Bones is build by using Bones, I'll read the source code and find the answer I guess
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
timonv [timonv!~timonv@140pc227.sshunet.nl] has joined #ruby
vladyn [vladyn!~vlado@214-125.thezone.bg] has joined #ruby
Ammar01 [Ammar01!~hassaa10@gatek.thls.bbc.co.uk] has joined #ruby
negaduck [negaduck!~negaduck@91.206.116.254] has joined #ruby
rippa [rippa!~splitta@85.158.54.234] has joined #ruby
solars [solars!~solars@mk089144206167.a1.net] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
ephemerian [ephemerian!~ian@82-69-1-248.dsl.in-addr.zen.co.uk] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
Manhose [Manhose!~Manhose@2001:690:2200:9a77:e50c:4924:7e:dd66] has joined #ruby
senny [senny!~senny@edge.garaio.com] has joined #ruby
hurikhan|Work [hurikhan|Work!~kakra@82-198-195-142.briteline.de] has joined #ruby
senny [senny!~senny@edge.garaio.com] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
james_cotterill [james_cotterill!~james_cot@89.238.149.34] has joined #ruby
igravity [igravity!~Yasky@41-184-75-149.rv.ipnxtelecoms.com] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
bratsche [bratsche!~bratsche@cpe-76-187-9-64.tx.res.rr.com] has joined #ruby
negaduck [negaduck!~negaduck@91.206.116.254] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
heeton [heeton!~alexheato@mail.bournston.co.uk] has joined #ruby
senny [senny!~senny@edge.garaio.com] has joined #ruby
pen [pen!~pen@dhcp1.csie.ntu.edu.tw] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
workmad3 [workmad3!~workmad3@vpn187.its.manchester.ac.uk] has joined #ruby
heftig [heftig!~Jan@archlinux/developer/heftig] has joined #ruby
<scx> i want to get links from html a hrefs
<scx> i tried:
<scx> text2.gsub(/<a[\t \n]*href[\t \n]*=[\t \n]*("(([^"]*?))[^\\]""|"")[^>]*>/) {|s| puts s}
<scx> but doesnt work for me
<scx> any idea?
remink [remink!~remink@unaffiliated/remink] has joined #ruby
<remink> he guys
<remink> I've a strange problem width the include? method : http://pastie.org/3004370
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
randym [randym!~randym@EM114-48-185-87.pool.e-mobile.ne.jp] has joined #ruby
rpowell [rpowell!~rpowell@CPE-121-217-11-112.lnse1.cht.bigpond.net.au] has joined #ruby
ggtoo [ggtoo!~ggtoo@122.178.1.156] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-193-222.hsd1.mi.comcast.net] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
<scx> remink: both return true for me
<remink> scx: was my mistake
negaduck_ [negaduck_!~negaduck@91.206.116.254] has joined #ruby
nari [nari!~nari@raichu.3in.ne.jp] has joined #ruby
Manhose_ [Manhose_!~Manhose@2001:690:2200:9a77:e50c:4924:7e:dd66] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
cdepue [cdepue!~cdepue@200.117.90.63] has joined #ruby
kalusn [kalusn!~claus@2.111.18.26] has joined #ruby
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
jimmy1980 [jimmy1980!~jimmy@112.224.2.44] has joined #ruby
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
ChampS_ [ChampS_!~ChampS@wlan1-60.zw.fh-zwickau.de] has joined #ruby
bloopletech [bloopletech!~blooplete@101.169.198.232] has joined #ruby
negaduck_ [negaduck_!~negaduck@91.206.116.254] has joined #ruby
bastilian [bastilian!~bastilian@chello213047077012.23.11.vie.surfer.at] has joined #ruby
kaneda_ [kaneda_!~kaneda@5adb21b6.bb.sky.com] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
LowKey [LowKey!~rhel@unaffiliated/lowkey] has joined #ruby
Manhose_ [Manhose_!~Manhose@193.136.33.133] has joined #ruby
dohzya [dohzya!~dohzya@sd-20906.dedibox.fr] has quit [#ruby]
peterwald [peterwald!~peterwald@99-4-181-140.lightspeed.gnvlsc.sbcglobal.net] has joined #ruby
Hellojer_ [Hellojer_!~Hellojere@89.7.90.160] has joined #ruby
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
tvw [tvw!~tv@e176000173.adsl.alicedsl.de] has joined #ruby
berkes [berkes!~ber@188.205.1.214] has joined #ruby
hinogi [hinogi!~Stefan@facade/contributor/hinogi] has joined #ruby
jensn [jensn!~Jens@206-244-96-87.cust.blixtvik.se] has joined #ruby
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
solars [solars!~solars@mk089144206081.a1.net] has joined #ruby
ramusara [ramusara!~ramusara@220.156.210.236.user.e-catv.ne.jp] has joined #ruby
dhruvasagar [dhruvasagar!~dhruvasag@65.98.79.137] has joined #ruby
LowKey [LowKey!~rhel@unaffiliated/lowkey] has joined #ruby
pusewicz_ [pusewicz_!u2036@gateway/web/irccloud.com/x-vojcpaszyaclgzlp] has joined #ruby
ikaros [ikaros!~ikaros@studpool-wlan-74-86.fs.fbi.h-da.de] has joined #ruby
ChampS_ [ChampS_!~ChampS@wlan1-60.zw.fh-zwickau.de] has joined #ruby
quest88 [quest88!~quest88@c-98-207-205-137.hsd1.ca.comcast.net] has joined #ruby
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
kirun_ [kirun_!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
peterwald [peterwald!~peterwald@174.46.144.3] has joined #ruby
fermo [fermo!~fermo@ppp-94-29.26-151.libero.it] has joined #ruby
pen [pen!~pen@2001:288:1001:28:8839:e976:7fb1:f8fc] has joined #ruby
`gregorg` [`gregorg`!~Greg@unaffiliated/gregorg] has joined #ruby
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
timonv [timonv!~timonv@140pc227.sshunet.nl] has joined #ruby
ctp [ctp!~ctp@port-87-234-198-134.static.qsc.de] has joined #ruby
<tightwork> How do I setup gems to work as non root user?
pen [pen!~pen@140.112.30.140] has joined #ruby
Paladin [Paladin!~paladin@p3m/member/Paladin] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
sppadic [sppadic!~sppadic@193.130.68.17] has joined #ruby
<sppadic> hello all
ognevsky_ [ognevsky_!~ognevsky@37-165-94-178.pool.ukrtel.net] has joined #ruby
luis [luis!~luis@nhop.r42.eu] has quit ["ERC Version 5.3 (IRC client for Emacs)"]
<sppadic> was wondering if anyone else has had issues with gem install passenger on RHEL 6 - keep getting errors about missing ruby.h
pencilcheck [pencilcheck!~pen@140.112.30.140] has joined #ruby
Tuxist [Tuxist!~quassel@dyndsl-031-150-005-034.ewe-ip-backbone.de] has joined #ruby
sppadic [sppadic!~sppadic@193.130.68.17] has quit ["Leaving"]
Paladin [Paladin!~paladin@p3m/member/Paladin] has joined #ruby
pen [pen!~pen@140.112.30.140] has joined #ruby
pen_ [pen_!~pen@140.112.30.140] has joined #ruby
xissburg [xissburg!~xissburg@189.102.48.152] has joined #ruby
JakeyChan [JakeyChan!~JakeyChan@ec2-175-41-238-53.ap-northeast-1.compute.amazonaws.com] has joined #ruby
elliot98 [elliot98!~elliot@77.125.7.231] has joined #ruby
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby
JakeyChan_ [JakeyChan_!~JakeyChan@180.172.203.109] has joined #ruby
<tightwork> Internets
elliot98 [elliot98!~elliot@unaffiliated/elliot98] has joined #ruby
<elliot98> what is a rubygem for parsing mboxes?
ecolitan [ecolitan!~ecolitan@aaron.glamus.de] has joined #ruby
nari [nari!~nari@p62e324.totrnt01.ap.so-net.ne.jp] has joined #ruby
rushed [rushed!~rushed@cpe-70-116-11-35.austin.res.rr.com] has quit [#ruby]
sejo [sejo!~SeJo@exherbo/developer/sejo] has joined #ruby
traph [traph!~traph@95-42-78-184.btc-net.bg] has joined #ruby
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
tomzx [tomzx!~tomzx@dsl-59-207.aei.ca] has joined #ruby
zommi_ [zommi_!quassel@nat/ibm/x-ktypezmlmqqsrrum] has joined #ruby
Pip [Pip!~Pip@host-192-146-66-217.spbmts.ru] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
remink [remink!~remink@unaffiliated/remink] has quit [#ruby]
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby
ixti [ixti!~ixti@251.Red-88-25-53.staticIP.rima-tde.net] has joined #ruby
<pen_> hey
<pen_> is there a way to turn an array like ["a", "b", "c"] into [1 => "a", 2 => "b", 3 => "c"]??
Manhose [Manhose!~Manhose@2001:690:2200:9a77:8cc2:e7bd:174:a491] has joined #ruby
<pen_> oops
<pen_> {}
<pen_> for the hash
<pen_> and it should start with 0 not 1
<pen_> sorry
jensn [jensn!~Jens@ip175-143.wireless.lu.se] has joined #ruby
<VortexRikers> Hash[array.each_with_index.map {|i, j| [j+1, i]}]
<pen_> ahh, I see
<pen_> thanks
mengu [mengu!~mengu@95.70.194.61] has joined #ruby
<apeiros_> or Hash[(1..ary.length).zip(ary)]
<pen_> apeiros_: oh that should work too, thanks
mengu_ [mengu_!~mengu@78.188.203.234] has joined #ruby
psino [psino!~psino@unaffiliated/psino] has joined #ruby
p0y [p0y!~p0y@112.198.213.157] has joined #ruby
replore_ [replore_!~replore@ntkngw268248.kngw.nt.ftth.ppp.infoweb.ne.jp] has joined #ruby
<elliot98> um...is there a rubygem or library that can parse mbox email files?
<apeiros_> unaware of, but since mbox is - afaik - mostly the mail as it was received + delimitation, I'd use the mail gem to parse individual emails and handle the delimitation myself
<apeiros_> @ elliot98
senny [senny!~senny@115-75.2-85.cust.bluewin.ch] has joined #ruby
vagabond007 [vagabond007!~vbond007@unaffiliated/vagabond007] has joined #ruby
<vagabond007> sup
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
Manhose [Manhose!~Manhose@2001:690:2200:9a77:4cf8:5a87:f977:d20a] has joined #ruby
<vagabond007> omg
<vagabond007> WTF
<apeiros_> vagabond007: it's good that you're interested in politics, but this is #ruby, not #politics.
_whitelogger [_whitelogger!~whitelogg@2a00:ab00:1::4464:5550] has joined #ruby
r0bby_ [r0bby_!~wakawaka@guifications/user/r0bby] has joined #ruby
Draco_ [Draco_!~draco@dsl-69-171-130-117.acanac.net] has joined #ruby
timonv [timonv!~timonv@140pc227.sshunet.nl] has joined #ruby
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has quit ["Leaving"]
eQuiNoX__ [eQuiNoX__!~eQuiNoX__@115.242.137.179] has joined #ruby
bier [bier!~bier@p54A5B0FC.dip.t-dialin.net] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
<eQuiNoX__> hey guys, im new to ruby and im having to review some code real quick - hope someone can help me. I have instance declared as a cipher object(openssl, aes)
<eQuiNoX__> and the code im doing does something like "cipher << l" where l is a line of input
<eQuiNoX__> all the examples on the internet use something like "cipher.update(input)" and thats understandable
<eQuiNoX__> i guess thats the right way to do it too
Rayk [Rayk!~Rayk@pD9F78D37.dip.t-dialin.net] has joined #ruby
<eQuiNoX__> what exactly does the "cipher << l"(assuming l's a string) do?
<apeiros_> eQuiNoX__: << is a method
<apeiros_> what a method does depends on the receiver, not its arguments
<apeiros_> so here it'd depend on what cipher is
r0bby_ [r0bby_!~wakawaka@guifications/user/r0bby] has joined #ruby
<eQuiNoX__> "cipher = OpenSSL::Cipher::Cipher.new('aes-256-ecb') "
craigglennie [craigglennie!~craigglen@173-167-99-61-sfba.hfc.comcastbusiness.net] has joined #ruby
yekta [yekta!~yekta@nat-165-91-15-157.tamulink.tamu.edu] has joined #ruby
<apeiros_> hm, openssl docs have been lacking in the past… let me see…
ascarter [ascarter!~ascarter@64.122.126.156] has joined #ruby
<eQuiNoX__> apeiros_: i did have a look around; its just that the "cipher.update" methods used usually to encrypt/decrypt from what i see
<eQuiNoX__> apeiros_: thanks
<apeiros_> hm, on ruby 1.9.3, there's no << method on cipher
kenperkins [kenperkins!~textual@174-24-164-49.tukw.qwest.net] has joined #ruby
<tightwork> Hello, How would one individual install Ruby Gems as a NON-root user? please and thank you in advanced.
<eQuiNoX__> apeiros_ does it raise some kind of an exception if theres no method usually?
<apeiros_> eQuiNoX__: yes
<apeiros_> a NoMethodError
<eQuiNoX__> hmm
<apeiros_> but ruby allows you to add methods to existing classes & objects
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby
<apeiros_> tightwork: that's the default if you installed ruby with rvm…
<eQuiNoX__> apeiros_: hmm i just tried cipher << "test" on my irb and it shows me an empty string
Na_Klar [Na_Klar!~chatzilla@p4FFA044A.dip.t-dialin.net] has joined #ruby
<apeiros_> eQuiNoX__: do: cipher.method(:<<)
<apeiros_> and paste the return value/output
<eQuiNoX__> apeiros_: #<Method: String#<<>
<apeiros_> cipher is *not* an OpenSSL::Cipher::Cipher then
<apeiros_> it's a string
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
<Na_Klar> I heard TK was the "standard window toolkit" for ruby. Since TK is not really present anymore, is there now something you may call "standard" for ruby? Besides GTK or QT wxWidgets and so on of course ..
<deryldoucette> FXRuby probably
<eQuiNoX__> apeiros_: oh my bad, i had done cipher << "test" just before it
<shevy> I think FXRuby is dead
<shevy> and TK is ugly
<shevy> I had hopes for wxwidgets but they seem to have slowed down
<shevy> Na_Klar I <3 your nick
<eQuiNoX__> apeiros_: #<Method: OpenSSL::Cipher::Cipher(OpenSSL::Cipher)#<<>
<shevy> I'd go with gtk. or Qt. ruby-gtk because the wiki is nice
<shevy> ruby-qt4 looks better IMHO though
<apeiros_> eQuiNoX__: ok, now cipher.method(:<<).source_location
<Na_Klar> So gtk seems to be it.
<Na_Klar> QT has some bad license issues imho
<eQuiNoX__> apeiros_: aah now i get the no method error
<shevy> no idea. aren't they GPL?
<Na_Klar> they are dual licensed for commercial purposes
<shevy> I think they had a license change some years ago
<apeiros_> eQuiNoX__: oh, what ruby version are you using?
<Na_Klar> shevy, they changed to LGPL and a commercial one
crescendo [crescendo!~eric@unaffiliated/crescendo] has joined #ruby
thone_ [thone_!~thone@g225085078.adsl.alicedsl.de] has joined #ruby
<eQuiNoX__> apeiros_: 0.9.5; came with the machine, pretty old i guess?
Skaag [Skaag!~skaag@81.26.147.34] has joined #ruby
bbttxu [bbttxu!~adam@pool-71-96-208-205.dfw.dsl-w.verizon.net] has joined #ruby
<apeiros_> eQuiNoX__: um, 0.9.5 is pretty unlikely
<apeiros_> that'd be like 15 years old or something…
Skaag_ [Skaag_!~skaag@107.55.153.181] has joined #ruby
<apeiros_> eQuiNoX__: ruby -v
<eQuiNoX__> apeiros_: yyup
<eQuiNoX__> apeiros_: thats what i did
<eQuiNoX__> apeiros_: irb 0.9.5(05/04/13)
<apeiros_> that's irb, not ruby
<shevy> hehe
<eQuiNoX__> ooh my bad
<apeiros_> irb != ruby
<eQuiNoX__> :D
<shevy> yeah
<eQuiNoX__> 1.8.7
<eQuiNoX__> apeiros_: ^
<shevy> my brother!
<apeiros_> ah, hm, ok, 1.8.7 didn't have source_location :(
<shevy> ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux]
<shevy> oh yes, source_location is great
<shevy> though... didn't banisterfiend hack something for pry similar to that?
<shevy> or some workaround, I forgot
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby
<apeiros_> shevy: not sure how well pry works with 1.8
<apeiros_> eQuiNoX__: well, you can try provoking an exception in the method to get its backtrace
<apeiros_> e.g. by doing: cipher << Object.new
<shevy> apeiros_ pretty well!
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
nicoulaj [nicoulaj!~nicoulaj@pas38-5-82-244-59-208.fbx.proxad.net] has joined #ruby
p0y [p0y!~p0y@121.97.59.227] has joined #ruby
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
<eQuiNoX__> apeiros_: hmm gets me a typeerror; ok so let me just clarify something. based on the type of the receiver, the action differs. so basically "<<" does different things for different actions of receivers. um am i right?
Helius [Helius!~Adium@217.200.200.237] has joined #ruby
<apeiros_> eQuiNoX__: that was the point of it
<apeiros_> that you get an error
<apeiros_> along with the error, you get a backtrace
<apeiros_> and in that backtrace, you can see where << is defined
maletor [maletor!~maletor@74.115.25.139] has joined #ruby
<eQuiNoX__> apeiros_: outside irb?
<apeiros_> eQuiNoX__: just paste the full exception you get on pastie.org
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
Helius [Helius!~Adium@217.200.200.237] has joined #ruby
nicoulaj [nicoulaj!~nicoulaj@pas38-5-82-244-59-208.fbx.proxad.net] has joined #ruby
<eQuiNoX__> apeiros_: http://pastie.org/3006141
<apeiros_> odd backtrace
<apeiros_> seems to me like << just calls update
<eQuiNoX__> apeiros_: hmm, i see
<eQuiNoX__> apeiros_: ok, thanks for your time :)
dasfugufish [dasfugufish!~Adium@71-213-26-228.slkc.qwest.net] has joined #ruby
<apeiros_> ah, << was in 1.8.7
<apeiros_> but it was deprecated then already
<apeiros_> eQuiNoX__: http://rubydoc.info/stdlib/openssl/1.8.7/OpenSSL/Cipher#%3C%3C-instance_method
<apeiros_> and yes, it indeed just calls update
<eQuiNoX__> apeiros_: aah ok cool thanks again
Rayk [Rayk!~Rayk@pD9F78D37.dip.t-dialin.net] has quit [#ruby]
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
luxurymode [luxurymode!~luxurymod@rrcs-184-75-21-18.nyc.biz.rr.com] has joined #ruby
Araxia_ [Araxia_!~Araxia@173-164-68-213-Oregon.hfc.comcastbusiness.net] has joined #ruby
ghanima [ghanima!~ghanima@alexander.nat.trb.com] has joined #ruby
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
Amirh [Amirh!~amir@2.181.19.151] has joined #ruby
btanaka [btanaka!~textual@173-228-34-51.dsl.dynamic.sonic.net] has joined #ruby
malkomalko [malkomalko!~malkomalk@adfb4f22.cst.lightpath.net] has joined #ruby
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby
sepp2k [sepp2k!~sexy@g224101175.adsl.alicedsl.de] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
kenichi [kenichi!~kenichi@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
Avi` [Avi`!~mine@unaffiliated/avi/x-8629955] has joined #ruby
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
__main__ [__main__!~main@adsl-99-173-15-158.dsl.pltn13.sbcglobal.net] has joined #ruby
dondani [dondani!5aa4472d@gateway/web/freenode/ip.90.164.71.45] has joined #ruby
<dondani> how could I implement a lazy 'each' in my class?
<dondani> should it return an Enumerator?
PhilK [PhilK!~PhilK@2001:470:1f05:c99:21f:d0ff:fe84:e3ca] has joined #ruby
<samuelkadolph> dondani: Yes
<samuelkadolph> dondani: If not block is given
<samuelkadolph> no*
<samuelkadolph> And if a block is given, use yield that way all you have to do is return an Enumerator for that same method
<dondani> what should happen if no block is given to 'each'?
<dondani> aha
<dondani> ok
<rippa> return enumerator
<samuelkadolph> return Enumerator.new(self, :each) unless block_given? is the standard pattern
pvh [pvh!u717@gateway/web/irccloud.com/x-sqkmblbcttoawrze] has joined #ruby
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
SegFaultAX|work [SegFaultAX|work!~mkbernard@173.228.45.162] has joined #ruby
bafilius [bafilius!~lee@wsip-174-75-64-190.sb.sd.cox.net] has joined #ruby
<dondani> samuelkadolph: works perfectly, many thanks
adamkittelson [adamkittelson!~adamkitte@50.0.132.2] has joined #ruby
zul_ [zul_!~ciunix@151.65.171.142] has joined #ruby
alfism [alfism!~alfism@2620:149:4:1201:a577:c693:8c22:7c18] has joined #ruby
<apeiros_> samuelkadolph: I thought the standard pattern was: return enum_for(__method__) unless block_given? ?
<samuelkadolph> That works too
spyvrsspy [spyvrsspy!~nonenone@209.145.177.162] has joined #ruby
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
<shevy> let's get naked and party!
<rippa> like here?
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
jonathanrwallace [jonathanrwallace!~jonathanr@adsl-074-246-141-204.sip.asm.bellsouth.net] has joined #ruby
Creeture [Creeture!~ccosbygma@c-24-98-6-24.hsd1.ga.comcast.net] has joined #ruby
stkowski [stkowski!~stkowski@ns25.8x8.com] has joined #ruby
ccallahan [ccallahan!u2448@inportb/ubergeek/ccallahan] has joined #ruby
davidcelis [davidcelis!~david@70-89-180-6-smc-or.hfc.comcastbusiness.net] has joined #ruby
raythecat [raythecat!~raythecat@cpe-76-88-24-94.san.res.rr.com] has joined #ruby
io_syl [io_syl!~io_syl@70-36-146-113.dsl.dynamic.sonic.net] has joined #ruby
io_syl [io_syl!~io_syl@unaffiliated/steph021] has joined #ruby
<Creeture> What's the de facto standard gem of the day?
evilgeenius [evilgeenius!518e782d@gateway/web/freenode/ip.81.142.120.45] has joined #ruby
<Creeture> Good grief. Question fail. The de facto *curl* gem? Most features / fewest bugs.
Draco_ [Draco_!~draco@W160.N181.queensu.ca] has joined #ruby
<evilgeenius> Is there an easy way I can allow the text "Gatwick Airp[ort DPE Servisair" to be used within a regular expression without an exception? This crashe : /Gatwick Airp[ort DPE Servisair/
<evilgeenius> I was hoping i could do %r{Gatwick Airp[ort DPE Servisair} , but that stil causes an exception
craigglennie_ [craigglennie_!~craigglen@173-167-99-61-sfba.hfc.comcastbusiness.net] has joined #ruby
<Creeture> evilgeenius: Should just be able to escape that [ and carry on.
<evilgeenius> Creeture: is there a ruby technique that will do this for me?
<apeiros_> Regexp.escape
<evilgeenius> Creeture: the input text could be anything, not just "Gatwick Airp[ort DPE Servisair", so ideally id want a tec.....
<evilgeenius> k
<Creeture> Regexp.escape
<evilgeenius> Cheers!
<Creeture> apeiros_ is faster than me.
<evilgeenius> we should hail him
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby
daniel_hinojosa [daniel_hinojosa!~danno@c-68-35-182-153.hsd1.nm.comcast.net] has joined #ruby
quest88 [quest88!~quest88@12.181.53.99] has joined #ruby
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby
steph021 [steph021!~steph021@unaffiliated/steph021] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
andreim [andreim!~andreim@unaffiliated/andreim] has joined #ruby
andreim [andreim!~andreim@unaffiliated/andreim] has quit ["Leaving"]
Tuxist64bit [Tuxist64bit!~quassel@host-091-097-104-115.ewe-ip-backbone.de] has joined #ruby
andreim [andreim!~andreim@unaffiliated/andreim] has joined #ruby
<andreim> hey, I can't seem to get string.include? "this" or "that" or "bla" to owork
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
<crankycoder> anybody here using jruby on a daily basis? i've always had problems trying to use ruby-debug in jruby-1.6.4
<crankycoder> the debugger always thinks there is only 1 stack frame
<crankycoder> which is obviously not the case
<apeiros_> andreim: that's not how it works
<andreim> how should I go about doing that?
<apeiros_> string.include? "this" or "that" or "bla" --> string.include?("this") or "that" or "bla"
<apeiros_> that's how ruby understands what you're asking it to do
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
<andreim> oh I see
canton7 [canton7!~canton7@152.78.95.108] has joined #ruby
<andreim> then I shoul ddo string.include? "one" or string.include? "two" etc?
<andreim> it gets repetitive
<andreim> is there a way to test it for each values of an array for example?
<apeiros_> you can also use string =~ /foo|bar|baz/
<andreim> oh
<andreim> indeed
<apeiros_> or ['foo', 'bar', 'baz'].any? { |word| string.include?(word) }
<apeiros_> there's surely a couple of other ways
<andreim> whoa, interesting
<andreim> thank you apeiros_
Marco_ [Marco_!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
Lord-Harlot [Lord-Harlot!Serenity@adsl-77-86-52-54.karoo.KCOM.COM] has joined #ruby
josh__ [josh__!~josh@74-95-43-126-Oregon.hfc.comcastbusiness.net] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
Manhose [Manhose!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby
mc_mac [mc_mac!~chatzilla@wsip-174-79-203-102.ks.ks.cox.net] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
Manhose_ [Manhose_!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby
andreim [andreim!~andreim@unaffiliated/andreim] has quit ["Leaving"]
r0bby [r0bby!~wakawaka@guifications/user/r0bby] has joined #ruby
hobodave [hobodave!~hobodave@pdpc/supporter/professional/hobodave] has joined #ruby
pantsman [pantsman!~pantsman@2.27.110.133] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
r0bby_ [r0bby_!~wakawaka@guifications/user/r0bby] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
jonathanrwallace [jonathanrwallace!~jonathanr@adsl-074-246-141-204.sip.asm.bellsouth.net] has joined #ruby
shaman42 [shaman42!shaman42@kapsi.fi] has joined #ruby
dankest [dankest!~dankest@wsip-184-186-226-131.sb.sd.cox.net] has joined #ruby
mxweas_ [mxweas_!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
kuzushi [kuzushi!~kuzushi@ip98-165-117-197.ph.ph.cox.net] has joined #ruby
stayarrr [stayarrr!~olivererx@dslb-178-009-059-241.pools.arcor-ip.net] has joined #ruby
esparkman [esparkman!~esparkman@unaffiliated/esparkman] has joined #ruby
bosphorus [bosphorus!~bosphorus@85.97.4.130] has joined #ruby
devdazed [devdazed!~russ_nyc@static-96-239-59-191.nycmny.fios.verizon.net] has joined #ruby
devdazed [devdazed!~russ_nyc@static-96-239-59-191.nycmny.fios.verizon.net] has quit [#ruby]
devdazed [devdazed!~russ_nyc@static-96-239-59-191.nycmny.fios.verizon.net] has joined #ruby
<devdazed> hi all, what is this syntax in ruby? ->(foo)
<Mon_Ouie> It's another syntax for lambdas
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
<devdazed> Mon_Ouie: thanks
<Mon_Ouie> -> (foo) { … } is the same as lambda { |foo| … }
<devdazed> awesome, i appreciate it
Draco_ [Draco_!~draco@W160.N181.queensu.ca] has joined #ruby
yekta [yekta!~yekta@r74-192-21-77.bcstcmta01.clsttx.tl.dh.suddenlink.net] has joined #ruby
sepp2k [sepp2k!~sexy@g231125225.adsl.alicedsl.de] has joined #ruby
jonathanrwallace [jonathanrwallace!~jonathanr@adsl-074-246-141-204.sip.asm.bellsouth.net] has joined #ruby
tdubellz_ [tdubellz_!~tdubellz@freenode/staff/tdubellz] has joined #ruby
dekroning [dekroning!~dekroning@541B931D.cm-5-4c.dynamic.ziggo.nl] has joined #ruby
zodiak [zodiak!~stef@pool-108-13-237-159.lsanca.fios.verizon.net] has joined #ruby
bwlang [bwlang!~anonymous@70-91-134-14-ma-ne.hfc.comcastbusiness.net] has joined #ruby
lord1231 [lord1231!~Leo@pool-71-174-239-154.bstnma.fios.verizon.net] has joined #ruby
<lord1231> hi
<lord1231> how can i increment on a hash? for example h={};h["key"] += 5 #h["key"] now should = 5)
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-193-222.hsd1.mi.comcast.net] has joined #ruby
hukl [hukl!~hukl@pdpc/supporter/professional/hukl] has joined #ruby
<rippa> h = Hash.new(0)
bwlang [bwlang!~anonymous@70-91-134-14-ma-ne.hfc.comcastbusiness.net] has joined #ruby
MasterIdler [MasterIdler!~MasterIdl@static-66-225-153-161.ptr.terago.net] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
<Mon_Ouie> The only thing is that h["key"] in your example is nil, not 0
Knodi [Knodi!~Knodi@c-68-43-246-216.hsd1.mi.comcast.net] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
MasterIdler [MasterIdler!~MasterIdl@static-66-225-153-161.ptr.terago.net] has quit [#ruby]
<devdazed> h[key] ||= 0; h[key] += 5
<Mon_Ouie> Setting a default value (as in rippa's example) is cleaner
jonathan_ [jonathan_!~jonathanr@200.sub-174-252-136.myvzw.com] has joined #ruby
<Mon_Ouie> And you won't forget to set the value to 0 if you access it
<lord1231> ok
keyword [keyword!~Adium@190.175.155.178] has joined #ruby
<keyword> hey guy how can I split a big csv file into multiple smallers
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
_debo [_debo!~marco.deb@cpc18-enfi16-2-0-cust743.hari.cable.virginmedia.com] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
<lord1231> keyword read a certain number of lines, into a new file, then increment the file name and such
<lord1231> thats a logic, not a ruby question
Helius [Helius!~Adium@93-35-244-141.ip57.fastwebnet.it] has joined #ruby
tomhsx [tomhsx!~tomhsx@c-76-109-169-195.hsd1.fl.comcast.net] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
nanoyak [nanoyak!~nanoyak@50-0-164-69.dsl.dynamic.sonic.net] has joined #ruby
ccallahan [ccallahan!u2448@inportb/ubergeek/ccallahan] has quit [#ruby]
oponder [oponder!~oponder@145-118-116-102.fttx.bbned.nl] has joined #ruby
Jake232 [Jake232!~textual@5e0ed40d.bb.sky.com] has joined #ruby
p1d [p1d!~p1d@dslb-088-065-171-220.pools.arcor-ip.net] has joined #ruby
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
lord123 [lord123!~Leo@pool-71-174-239-154.bstnma.fios.verizon.net] has joined #ruby
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
keyword [keyword!~Adium@190.175.155.178] has quit [#ruby]
jergason [jergason!~jergason@c-67-161-248-217.hsd1.ut.comcast.net] has joined #ruby
norex [norex!~quassel@41-135-90-128.dsl.mweb.co.za] has joined #ruby
ilyam [ilyam!~ilyam@2620:65:0:281:c62c:3ff:fe3c:ab25] has joined #ruby
alex__c2022 [alex__c2022!~alex@207.239.64.154] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.254] has joined #ruby
Marco [Marco!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby
imsplitbit [imsplitbit!~imsplitbi@64.39.5.119] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
Brozilla [Brozilla!~Brozilla@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
Marco [Marco!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
the_lord [the_lord!~david@190.79.41.153] has joined #ruby
<shevy> yeah rippa EXACTLY!
stkowski_ [stkowski_!~stkowski@ns25.8x8.com] has joined #ruby
stephans [stephans!~stephans@209.66.114.6] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
crankycoder [crankycoder!~crankycod@24-246-44-226.cable.teksavvy.com] has joined #ruby
dankest [dankest!~dankest@wsip-174-75-64-190.sb.sd.cox.net] has joined #ruby
Clooth [Clooth!~Clooth@ZYYYCDLIX.gprs.sl-laajakaista.fi] has joined #ruby
sadmac [sadmac!~sadmac@173.203.106.27] has quit [#ruby]
raythecat [raythecat!~raythecat@cpe-76-88-24-94.san.res.rr.com] has joined #ruby
<chilversc> why would gem uninstall be telling me "ruby-debug-ide" is not installed when it shows up in gem list?
jergason [jergason!~jergason@c-67-161-248-217.hsd1.ut.comcast.net] has joined #ruby
sterlo [sterlo!d8d2c802@gateway/web/freenode/ip.216.210.200.2] has joined #ruby
ikaros [ikaros!~ikaros@dslb-084-059-073-057.pools.arcor-ip.net] has joined #ruby
ilyam_ [ilyam_!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby
perturbedpanda [perturbedpanda!~perturbed@matthewabrown.com] has joined #ruby
crankycoder [crankycoder!~crankycod@24-246-44-226.cable.teksavvy.com] has joined #ruby
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has quit [#ruby]
web0 [web0!~webster@216.243.22.23] has joined #ruby
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby
libertyprime [libertyprime!~libertypr@182.236.125.102] has joined #ruby
PhilK [PhilK!~PhilK@2001:470:1f05:c99:21f:d0ff:fe84:e3ca] has joined #ruby
crankycoder [crankycoder!~crankycod@24-246-44-226.cable.teksavvy.com] has joined #ruby
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
<Tasser> chilversc, buggy? reinstall and see if it happens again
BrianE [BrianE!~brian@46.208.45.23] has joined #ruby
kedare [kedare!~kedare@2a01:e35:2f26:5330:713f:f230:56e0:f2b5] has joined #ruby
jergason [jergason!~jergason@208.97.56.66] has joined #ruby
ilyam [ilyam!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby
wingie [wingie!~johnnyluu@c-5eeaaa34-74736162.cust.telenor.se] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@187.64.90.129] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@unaffiliated/vtr] has joined #ruby
TandemAdam [TandemAdam!~TandemAda@203-114-137-9.wir.sta.inspire.net.nz] has joined #ruby
fcser [fcser!~fcser@173-28-82-238.client.mchsi.com] has joined #ruby
manizzle [manizzle!~manizzle@dsl081-053-082.sfo1.dsl.speakeasy.net] has joined #ruby
<scx> i have 2 arrays
<scx> one is really big
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<scx> how to fast check if (B - A) != B; #A, B - my arrays
skrewler [skrewler!~skrewler@209.213.206.58] has joined #ruby
raythecat [raythecat!~raythecat@adsl-99-34-25-11.dsl.sndg02.sbcglobal.net] has joined #ruby
<shevy> scx what? what does that mean
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
<scx> shevy: i want to check that one or more element in array B is included in array A
<dpritchett> Anyone around with experience hosting multiple sinatra apps via passenger on ubuntu?
<apeiros_> scx, which one is really big?
<dpritchett> I'm trying to get the sub uris ironed out and it's not worked yet
<shevy> scx how abouty array1 & array2
PhilK [PhilK!~PhilK@2001:470:1f05:c99:21f:d0ff:fe84:e3ca] has joined #ruby
<scx> apeiros_: A is really big
wicketn00b [wicketn00b!~root@12.182.105.7] has joined #ruby
<scx> B is small
<apeiros_> scx: now I've got a small problem, you gave two problem descriptions which are - as far as I understand them - different from each other
<apeiros_> so you want true if any element in B is also in A?
<scx> yes
<apeiros_> scx: any reason you have them arrays and not e.g. Sets?
<shevy> ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e", "abc", "cat", "dog", "a", "a", "b", nil, nil] & ["a", "b", "jkdajkl"] # => ["a", "b"]
<apeiros_> anyway, shevy's suggestion seems to be spot on
<apeiros_> (A & B).empty? is true if no element of B is also in A
<wicketn00b> Is there a straightforward way to override the default MissingTranslationData error message in Ruby i18n globally?
<apeiros_> the operation has a complexity of O(n+m), where n & m are the number of elements in A and B.
<scx> ok, i will check it
wilmoore [wilmoore!~wilmoore@70-89-165-49-ISTS-co.hfc.comcastbusiness.net] has joined #ruby
QKO__ [QKO__!~reaVer@banzai.speedxs.nl] has joined #ruby
james_cotterill [james_cotterill!~james_cot@94-192-130-249.zone6.bethere.co.uk] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
BrianE [BrianE!~brian@46.208.45.23] has joined #ruby
zastaph [zastaph!zastaph@unaffiliated/zastaph] has joined #ruby
Ch4rAzZz [Ch4rAzZz!~jiri@HSI-KBW-095-208-008-055.hsi5.kabel-badenwuerttemberg.de] has joined #ruby
<Tasser> if you need it a lot, there a memory-efficient-intersect gem
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
lord1231 [lord1231!~Leo@pool-71-174-239-154.bstnma.fios.verizon.net] has joined #ruby
<scx> apeiros_: ok, it works pretty fast
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
GreaseMonkey [GreaseMonkey!~gm@unaffiliated/greasemonkey] has joined #ruby
srid [srid!u3297@gateway/web/irccloud.com/x-mxsrlrozjzjmnusr] has joined #ruby
<srid> learning ruby (from python background); really surprised by the way names don't resolve to functions in immediately scope. https://gist.github.com/65aaaa0532da0b81e251
<incluye> srid: modules don't work that way
crescendo [crescendo!~eric@unaffiliated/crescendo] has joined #ruby
SegFault1X|work [SegFault1X|work!~mkbernard@173.228.45.162] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@host-208-68-238-122.biznesshosting.net] has joined #ruby
lord1231 [lord1231!~Leo@pool-71-174-239-154.bstnma.fios.verizon.net] has quit [#ruby]
<incluye> srid: compare https://gist.github.com/1469072
<incluye> srid: Also, in your snippet, "ping" is trying to call ping, the class method of Foo, but you defined it as an instance method
<incluye> "def self.ping" instead of "def ping" would define a class method
<srid> heh. interesting. modules are like class, then?
<incluye> modules are like classes, but you can't make instances of them
<incluye> but you can mix them in to classes, and that is what they're mainly for
<incluye> that, and namespacing
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
armdale [armdale!~a@24.52.227.6] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
pangur [pangur!~calum@5aca863f.bb.sky.com] has joined #ruby
<srid> well, essentially i want to group a set of functions (for same functionality) into a single file/module. what is the best way to refer them from other files/modules? "include" and ping() or directly Foo::ping?
<incluye> probably include
<srid> maybe i should just learn ruby properly first
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
<incluye> If it's supposed to be a static method then Foo::ping should be okay
<incluye> but if it's supposed to be an instance method of another class, include Foo
PhilK [PhilK!~PhilK@2001:470:1f05:c99:21f:d0ff:fe84:e3ca] has joined #ruby
Faris [Faris!~Administr@41.140.31.82] has joined #ruby
jbpros [jbpros!~jbpros@138.73-66-87.adsl-dyn.isp.belgacom.be] has joined #ruby
<pangur> In my main <div> of my view, I have <% if person.role == "Whatever" %>. Could I have a link in another div that would provide the various "Whatever"s?
<pangur> In other words, I want people to be able to pick from either a menu the relevant role.
<pangur> So that that the value of the role that they pick is passed to "Whatever"
dr_bob [dr_bob!~dr_bob@p549E71AA.dip.t-dialin.net] has joined #ruby
<pangur> Is that a ruby question or an ajax one or something else?
<incluye> srid: here's a short explanation https://gist.github.com/1469112
<incluye> pangur: probably a rails question
<incluye> #rubyonrails
<pangur> I am using sinatra
<incluye> Oh
<incluye> Huh
<incluye> Try #sinatra then
<incluye> :P
<pangur> lol - ok
<srid> incluye: more clear, thanks. modules seem more like mixins, except they can *also* be used as namespace (using self.bark ... Dog.bark)
<pangur> In the main <div> of my view, I have <% if person.role=="Whatever" %>. Could I have a link in my menu div that would supply Whatever with the missing variable?
<incluye> modules *are* mixins
<srid> for my case above, then, I imagine I should prefix all methods with `self.`
<incluye> if you want to call them that
<pangur> oops, sorry that was for sinatra
<srid> remember, for my case above, all I wanted was to namespace the functions.
<incluye> srid: If you want to make them all static methods, yes
hadees [hadees!~hadees@64.132.24.248] has joined #ruby
<incluye> And you don't want to make a class for it, then sure
<incluye> A better way to do it is thus
<srid> right, no class. just a group of functions.
<incluye> I mean, if you're defining more than one function
<incluye> module Foo; class << self; defs here; end; end
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
rickmasta [rickmasta!~rickmasta@pool-108-21-213-102.nycmny.fios.verizon.net] has joined #ruby
<srid> ok, i think i've seen that trick somewhere. will use it.
<incluye> right
<incluye> I don't know why it works, I should probably figure that out
<shevy> magic
<incluye> oh, wait
<shevy> whenever I notice something that works, where it should not, I attribute this to magic
<incluye> class << foo defines methods for foo
<incluye> that's standard syntax
<incluye> in class context, self refers to the class, which is an instance of Class
<incluye> oh Ruby ._.
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
stkowski_ [stkowski_!~stkowski@ns25.8x8.com] has joined #ruby
libertyprime [libertyprime!~libertypr@182.236.125.102] has joined #ruby
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
<tommylommykins> I am running some code in a thread. It appears that when an exception occurs in that thread, the failure is entirely silent
<tommylommykins> How can I 1) make my whole script die, and 2) make it output the error
<tommylommykins> (1.9.3-p0)
<apeiros_> tommylommykins: Thread.abort_on_exception = true
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
<apeiros_> alternatively: Thread.new do begin …yourcode… rescue => e; somehow_handle(e); end; end
<tommylommykins> is abort_on_Exception global? I jsut stick that at the top of my script? :D
<incluye> yes
<tommylommykins> aha, cheers :)
<apeiros_> IMHO that should be the default :-/
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
<tommylommykins> mmm, any idea what the rationale behind letting threads silently die is?
axl__ [axl__!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
araujo [araujo!~araujo@gentoo/developer/araujo] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
Helius [Helius!~Adium@93-35-244-141.ip57.fastwebnet.it] has joined #ruby
keithpitt [keithpitt!~keithpitt@eth2071.vic.adsl.internode.on.net] has joined #ruby
cyri_ [cyri_!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby
<apeiros_> tommylommykins: no idea, which is why I think aborting on exception should be the default…
s0ber_ [s0ber_!~s0ber@114-36-225-238.dynamic.hinet.net] has joined #ruby
y3llow_ [y3llow_!~y3llow@114-36-225-238.dynamic.hinet.net] has joined #ruby
Manhose [Manhose!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby
ilyam [ilyam!~ilyam@2620:65:0:281:c62c:3ff:fe3c:ab25] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
jbpros_ [jbpros_!~jbpros@87.66.34.207] has joined #ruby
daniel_hinojosa [daniel_hinojosa!~danno@c-68-35-182-153.hsd1.nm.comcast.net] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
pangur [pangur!~calum@5aca863f.bb.sky.com] has quit ["Konversation terminated!"]
bwlang [bwlang!~anonymous@70-91-134-14-ma-ne.hfc.comcastbusiness.net] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
Amirh [Amirh!~amir@2.181.29.98] has joined #ruby
stkowski [stkowski!~stkowski@ns25.8x8.com] has joined #ruby
flippingbits [flippingbits!~anonymous@p54A5E8C0.dip.t-dialin.net] has joined #ruby
Faris [Faris!~Administr@41.140.31.82] has quit [#ruby]
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
p1d [p1d!~p1d@dslb-088-065-171-220.pools.arcor-ip.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
puff [puff!~steven@static-108-32-33-25.pitbpa.fios.verizon.net] has joined #ruby
<puff> How hard would it be to set up something to run arbitary, untrusted ruby scripts in an isolated fashion?
<Creeture> puff: Arbitrarily difficult.
<Creeture> What sort of environment are you talking about? Something to build and test the scripts or just dorking around? Look into Jenkins if you're looking for Continuous Integration type of behavior.
josephwilk [josephwilk!~josephwil@109.231.237.58] has joined #ruby
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
jonathanrwallace [jonathanrwallace!~jonathanr@99-11-165-168.lightspeed.tukrga.sbcglobal.net] has joined #ruby
elliot98 [elliot98!~elliot@77.124.222.168] has joined #ruby
wyhaines [wyhaines!~wyhaines@mo-65-173-76-11.sta.embarqhsd.net] has joined #ruby
quest88_ [quest88_!~quest88@12.181.53.100] has joined #ruby
<puff> Creeture: I'm looking into the idea of creating a site to facilitate collaboration between policy wonks and geeks, allowing the geeks to upload arbitrary ruby scripts that munge data from open data source.
azbarcea [azbarcea!~quassel@79.114.114.251] has joined #ruby
kingfishr_ [kingfishr_!~caleb@204.124.203.201] has joined #ruby
<puff> @rn
skrewler [skrewler!~skrewler@209.213.206.58] has joined #ruby
wonderbreads [wonderbreads!~user@72.11.82.226] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
wmoxam_ [wmoxam_!~wmoxam@76.9.195.38] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
wmoxam_ [wmoxam_!~wmoxam@76-10-165-34.dsl.teksavvy.com] has joined #ruby
<shevy> when I have a library called ...
<shevy> foo ... and in its base dir ... I have lib/foo/ and lib/foo.rb
<shevy> what does foo.rb need to include in order to call the other .rb files?
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
hadees [hadees!~hadees@64.132.24.248] has joined #ruby
<devdazed> shevy: require './lib/foo'
<devdazed> or you can optionally unshift the lib directory into your include path
explodes [explodes!~explodes@173-14-235-9-Utah.hfc.comcastbusiness.net] has joined #ruby
<explodes> I am not a ruby developer. That being said. How do I install ftools?
<explodes> I did "brew install ruby"
<explodes> I have ruby 1.9.3p0
<shevy> hmmm
<Creeture> explodes: gem search -r ftools ; gem install <whatever that returns> maybe? Dunno what ftools is.
<explodes> Its some missing decency when manually installing rake. I guess i can gem install rake and skip this search process
<explodes> Thanks tho!
<explodes> Though **
<Creeture> Oh, it's a rails thing. I don't do rails.
<shevy> I think I begin to understand
<shevy> with this:
<shevy> $:.unshift(File.dirname(__FILE__))
<shevy> you append to $LOAD_PATH right?
<shevy> and then you can just require files from there that reside in subdirectories?
tesmar [tesmar!~tesmar@adsl-74-242-254-82.rmo.bellsouth.net] has joined #ruby
kirun_ [kirun_!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
<apeiros_> devdazed: ugh…
<apeiros_> shevy: just `require 'foo'`
tesmar [tesmar!~tesmar@adsl-74-242-254-82.rmo.bellsouth.net] has joined #ruby
<apeiros_> if you're doing test-runs you can use -I (capital i) to add the lib dir to the load path
<apeiros_> e.g. ruby -Ilib, or irb -Ilib
alex__c2022 [alex__c2022!~alex@207.239.64.154] has joined #ruby
<devdazed> apeiros_: guess i misunderstood the question
<explodes> OSX Lion: gem install terminitor && terminitor init >> `report_activate_error': Could not find RubyGem rake (>= 0.8.1)
norex [norex!~quassel@41-135-90-128.dsl.mweb.co.za] has joined #ruby
<devdazed> explodes, have you seen https://github.com/achiu/consular
jetblack [jetblack!~jetblack@99-32-20-118.lightspeed.elgnil.sbcglobal.net] has joined #ruby
spyvrsspy [spyvrsspy!~nonenone@209.145.177.162] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
<explodes> I already have my 15 terminator scripts :( Is terminator not compatible with Lion?
<apeiros_> try gem install rake
<apeiros_> though, terminitor should list that as a dependency…
<explodes> It does
<apeiros_> or which line am I missing?
<devdazed> rake isn't in the gemspec
<explodes> Oh, well rake is isinstalled
<explodes> Where are gem executables installed by default?
tacho [tacho!u3728@gateway/web/irccloud.com/x-wcppyofsybcwnxdi] has joined #ruby
confounds [confounds!~confounds@208.113.46.214] has joined #ruby
<explodes> Maybe I need to add rake to PATH first
pantsman- [pantsman-!~pantsman@2.25.203.134] has joined #ruby
jay_lee [jay_lee!~jay@adsl-69-231-215-134.dsl.irvnca.pacbell.net] has joined #ruby
jay_lee [jay_lee!~jay@adsl-69-231-215-134.dsl.irvnca.pacbell.net] has quit ["Leaving"]
<explodes> Oh rake is on the path
jgrimes [jgrimes!~jg@cpe-071-070-140-012.nc.res.rr.com] has joined #ruby
<explodes> Ok, I give up on terminator. gem install consular
Averenix [Averenix!~q@203-173-10-9.perm.iinet.net.au] has joined #ruby
<explodes> consular init :: command 'consular' not found
<TandemAdam> does anyone else hate that ruby doesn't have a good way to do multiline comments?
Averenix [Averenix!~q@203-173-10-9.perm.iinet.net.au] has quit [#ruby]
ikaros [ikaros!~ikaros@dslb-084-059-073-057.pools.arcor-ip.net] has joined #ruby
<Creeture> TandemAdam: Just as good as anything else. Use the rubydoc syntax of =begin =end
<Creeture> or "if 0" a block
aziz_light [aziz_light!~aziz_ligh@85-168-220-242.rev.numericable.fr] has joined #ruby
<Creeture> My bad…it's ruby. 'if nil'
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
<Creeture> 0 is true.
<nemski> :)
<TandemAdam> Creeture: imho I think /* */ in other languages is a much more elegant way of doing it
<TandemAdam> even <!-- --> is better than =begin -end
<nemski> it's all about the flexible grammar
<nemski> got to make sacrafices
<Creeture> I think I disagree with you, but think that's as far as the argument should go. :) Never liked /* */ - it's awkward and pain in the nuts to match those characters in vi.
<tommylommykins> /me does not like /* */
<nemski> ///*
* tommylommykins always mixes round the / and the *
manizzle [manizzle!~manizzle@dsl081-053-082.sfo1.dsl.speakeasy.net] has joined #ruby
<TandemAdam> yeah, it's just disappointing that ruby doesn't have the MOST elegant solution for this
* tommylommykins would prefer something different to =begin=end though
<TandemAdam> tommylommykins: yeah for sure
<Creeture> So if nil { } then. That's elegant.
<nemski> TandemAdam: you can just use Here documents
<Creeture> It's even block-match happy.
<nemski> define your own deliminator
Jake232 [Jake232!~textual@5e0ed40d.bb.sky.com] has joined #ruby
<tommylommykins> uhh
<Creeture> I'll always love "#if 0" in C. That's the best one.
<tommylommykins> but what about "if nil {end end end end end end end}"
<tommylommykins> Does that not break the parser?
<Creeture> Nah. It's smarter than that.
levity_island [levity_island!~lawrence@216.156.82.154.ptr.us.xo.net] has joined #ruby
<Creeture> Well…maybe of course it does.
<tommylommykins> irb(main):001:0> if nil {end end}
<tommylommykins> SyntaxError: compile error
<tommylommykins> (irb):1: syntax error, unexpected '{', expecting kTHEN or ':' or '\n' or ';'
<tommylommykins> if nil {end end}
<Creeture> Outsmarted by the language.
<levity_island> when listing dependencies for a gem that uses Bundler: should i do it in the gemspec, Gemfile, or some combination of the two? what about e.g. dependencies only for running tests?
<tommylommykins> not really a comment then?
<Creeture> Nope. Just a runtime no-op.
Draco_ [Draco_!~draco@dsl-69-171-130-117.acanac.net] has joined #ruby
randym [randym!~randym@EM114-48-50-222.pool.e-mobile.ne.jp] has joined #ruby
<Creeture> With a compile error built in for fun.
<chilversc> I just use an editor with multiline comment/uncomment support
<tommylommykins> mmm, if the parser fails at recognising that I meant it to be a comment, then it's not acomment?
<Creeture> Made it all the way to the end of the day without being wrong until now.
Targen [Targen!~iguana@159.90.11.250] has joined #ruby
<chilversc> bonus is, you can comment a commented section and not get an error
<Creeture> yeah - nested =begin =end doesn't work either. You could always just delete the code.
<Creeture> That works every time.
bbttxu [bbttxu!~adam@pool-71-96-208-205.dfw.dsl-w.verizon.net] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
phantasm66 [phantasm66!~phantasm6@146-115-132-39.c3-0.nwt-ubr1.sbo-nwt.ma.cable.rcn.com] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
peterwal_ [peterwal_!~peterwald@174.46.144.3] has joined #ruby
d2dchat [d2dchat!~d2dchat@c-98-209-18-197.hsd1.mi.comcast.net] has joined #ruby
notbrent [notbrent!~notbrent@186.85.88.56] has joined #ruby
amacgregor [amacgregor!~amacgrego@CPE00222dcb0a53-CM00222dcb0a4f.cpe.net.cable.rogers.com] has joined #ruby
tilung [tilung!~plt@5ac424d9.bb.sky.com] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
matti [matti!matti@madwifi/support/matti] has joined #ruby
looopy [looopy!~looopy@pool-141-156-50-58.washdc.btas.verizon.net] has joined #ruby
quest88_ [quest88_!~quest88@12.181.53.99] has joined #ruby
cdepue [cdepue!~cdepue@200.117.90.63] has joined #ruby
michael_mbp [michael_mbp!~Marin@112.134.196.0] has joined #ruby
ecolitan [ecolitan!~ecolitan@aaron.glamus.de] has joined #ruby
ecolitan [ecolitan!~ecolitan@aaron.glamus.de] has joined #ruby
ecolitan [ecolitan!~ecolitan@aaron.glamus.de] has joined #ruby
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
Amirh [Amirh!~amir@2.181.29.98] has joined #ruby
tesmar [tesmar!~tesmar@adsl-74-242-254-82.rmo.bellsouth.net] has joined #ruby
craigglennie [craigglennie!~craigglen@173-167-99-61-sfba.hfc.comcastbusiness.net] has joined #ruby
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
Jay_Levitt [Jay_Levitt!~Jay_Levit@c-24-63-250-125.hsd1.ma.comcast.net] has joined #ruby
Clooth [Clooth!~Clooth@ZYYYCDLIX.gprs.sl-laajakaista.fi] has joined #ruby
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
skrewler_ [skrewler_!~skrewler@209.213.206.58] has joined #ruby
maz3 [maz3!58cb110b@gateway/web/freenode/ip.88.203.17.11] has joined #ruby
<maz3> hi
<maz3> i need some help with ruby
<incluye> nowai
<maz3> i have a variable which is choice = gets. I want to then do a case statement if the choice = a and another case statement if the choice = b
<maz3> how do i do this?
mnajem [mnajem!~mnajem@120.141.69.176] has joined #ruby
peterwald [peterwald!~peterwald@99-4-181-140.lightspeed.gnvlsc.sbcglobal.net] has joined #ruby
<maz3> Usually with Java I do switch(choice)
<maz3> then case 'a':
hadees [hadees!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
<incluye> case choice
<incluye> when "a"
<incluye> when "b"
<incluye> etc.
<incluye> also, ruby doesn't have "break" statements for case blocks
jonathanrwallace [jonathanrwallace!~jonathanr@99-11-165-168.lightspeed.tukrga.sbcglobal.net] has joined #ruby
skillachie [skillachie!~skillachi@ool-457de73d.dyn.optonline.net] has joined #ruby
<maz3> but then in each case there already is a when
<maz3> cause this program thane 2 inputs
<incluye> what
<maz3> let me show you the program in java, and what i've written in ruby ok?
<davidcelis> all i want for christmas is for a channel observer that resubmits pastebins to gist
<maz3> its the bit where the cases start which is giving me problems
<maz3> @davidcelis I will start using gist from now on, ok?