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/
your_nick [your_nick!~your_nick@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
`brendan [`brendan!~b@64-121-18-195.c3-0.upd-ubr1.trpr-upd.pa.cable.rcn.com] has joined #ruby
kuzushi [kuzushi!~kuzushi@ip98-165-117-197.ph.ph.cox.net] has joined #ruby
operant666 [operant666!~vajrapani@c-69-181-26-39.hsd1.ca.comcast.net] has joined #ruby
jlogsdon [jlogsdon!~jlogsdon@c-67-169-79-114.hsd1.ca.comcast.net] has joined #ruby
modder [modder!modder@79.133.201.85] has joined #ruby
<linduxed> when trying to do "rvm install 1.9.1" it fails with the last relevant line in the log being ossl.c:118:1: error: unknown type name 'STACK'
<linduxed> i've got the openssl package installed on my system
<linduxed> /usr/include/openssl/stack.h is present
<vajrapani666> I'm trying to create an AMQP-based messaging relay using event-machine , and web-sockets.. I've found a way to run both the AMQP handler and the web socket handler using event machine, but i have had a harder time finding a Non-Blocking http server library that shows how it can be used within EM.run … Instead i see a lot of things regarding non-blocking rack middleware (e.g. goliath?) .. i need to find a framework to help serv
<vajrapani666> pages from an EM.run loop, or I need to find out how to run an EM.run loop within a rack app.. any hints?
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
<canton7> vajrapani666, iirc, thin (and rainbows?) run on top of eventmachine, so you might have some luck there
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
<linduxed> ok, different question
<linduxed> when in a ruby/rails repo, is there some way to know what ruby version it was built with, so that i can set that properly with rvm?
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
atmosx [atmosx!~atmosx@kovo.d-net.cz] has joined #ruby
<i8degrees> also perhaps RAILS_VERSION is more so along the lines ..
<i8degrees> s/RAILS/RUBY :)
Targen [Targen!~iguana@190.39.181.108] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
azureye [azureye!~azureye@wrls-249-20-235.wrls-client.fas.harvard.edu] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
virunga [virunga!~virunga@151.64.63.239] has joined #ruby
gianlucadv [gianlucadv!~user@host78-84-dynamic.44-79-r.retail.telecomitalia.it] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@nmd.sbx11041.miamifl.wayport.net] has joined #ruby
banister`sleep [banister`sleep!~baniseter@118.82.185.158] has joined #ruby
s_segawa [s_segawa!~s_segawa@221x251x236x110.ap221.ftth.ucom.ne.jp] has joined #ruby
cyri__ [cyri__!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby
randym [randym!~randym@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
randym [randym!~randym@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
fserb [fserb!~fserb@178-83-225-18.dynamic.hispeed.ch] has joined #ruby
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby
josefig [josefig!~josef@189.154.66.64] has joined #ruby
josefig [josefig!~josef@unaffiliated/josefig] has joined #ruby
geaif [geaif!~geaif@xdsl-188-155-129-176.adslplus.ch] has joined #ruby
replore_ [replore_!~replore@203.152.213.161.static.zoot.jp] has joined #ruby
dotnull [dotnull!~dot_null@173-31-158-182.client.mchsi.com] has joined #ruby
flip_digits [flip_digits!~textual@c-71-199-243-97.hsd1.fl.comcast.net] has joined #ruby
<[[thufir]]> http://pastebin.mozilla.org/1459268 is returning all the div elements, which is good. However, how do separate out a particular div?
Seisatsu [Seisatsu!~seisatsu@c-98-207-236-44.hsd1.ca.comcast.net] has joined #ruby
<canton7> [[thufir]], #find maybe?
<[[thufir]]> div[@class="sectionHeaderText"] I think...?
<canton7> also, minor points, but lines 21-32 can be replaced by a statement modifier: "emails << email unless email.empty?"
<canton7> I haven't used nokigiri, so I'm afraid I don't know what format it produces stuff in
MrKeuner [MrKeuner!~MrKeuner@unaffiliated/mrkeuner] has quit ["Ex-Chat"]
<[[thufir]]> sample output of all the divs: http://pastebin.mozilla.org/1459269 I think I got it. we'll see! seems to be an xpath thing.
<[[thufir]]> oh, thanks for the suggestion on emails line 21
<canton7> I make random style comments about everyone's pastes -- it's nothing personal :)
v0n [v0n!~v4n@modemcable144.68-81-70.mc.videotron.ca] has joined #ruby
<[[thufir]]> lol
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
atmosx [atmosx!~atmosx@kovo.d-net.cz] has joined #ruby
<atmosx> hi
<atmosx> what is the fastest/easiest way to convert this into a simple array of words -> [["asteris"], ["atmat"], ["dens"]] ?
<canton7> atmosx, words.flatten
<atmosx> oh
<atmosx> i never knew of this on
<atmosx> e
<canton7> my attitude to ruby methods has become "there's probably a method to do this... open the relevant man page" :P I was going to go with words.map{ |w| w[0] }, but then I spotted that one
<atmosx> oh my oh my, that's magical
<atmosx> I was doing some words.each {|x| …} experiments hehe but that's magic :-p thanks
<canton7> heh, no worries
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
<atmosx> I even took a look on x = Array.new ; puts x.methods; on irb
<canton7> yeah, that's always handy
<atmosx> but didn't help hehe I just review the ones I knew didn't pay attention to flatten
<atmosx> :D
<canton7> personally, my steps are "google for 'Ruby <classname>', look at left-hand menu bar of the first result. In this instance, "Ruby Array" gave me the array doc page (http://ruby-doc.org/core-1.9.3/Array.html)
<Boohbah> i like Array.sample :)
<canton7> that's pretty cool
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
<canton7> Enumerable#partition was extremely useful the other day
swarley [swarley!~swarley@ip70-186-215-170.hr.hr.cox.net] has joined #ruby
<swarley> So I know there is "String".next
<swarley> but how would i go about getting the opposite of next?
<canton7> swarley, http://snippets.dzone.com/posts/show/2474 looks interesting
<[[thufir]]> for scraping html, does it make sense to use jtidy or similar to make it xml first? does it matter?
<swarley> Hm, that seems like something that would naturally be included in the stdlib if next was a part of it
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
<canton7> it appears from the command at the top, though, that it's not possible to write an implementation that has expected behaviour for all cases, which might well be why it wasn't included
<canton7> *comment at the top
<swarley> Oh, indeed
nari [nari!~nari@2001:268:306:1:f2de:f1ff:fe55:2de0] has joined #ruby
AnarchoTroll [AnarchoTroll!~c@c-71-197-218-142.hsd1.wa.comcast.net] has joined #ruby
<newbold> canton7: app #2 is working http://simple-weather.herokuapp.com :D
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
<Boohbah> [[thufir]]: xml sucks :)
<canton7> newbold, aye, I was admiring it earlier today. You're certainly churning them out
<newbold> canton7: learning a ton along the way
<newbold> though I probably need to stop and go through some docs, why's guide, tryruby.org etc
<[[thufir]]> Boohbah: heh. what ya got against xml? schema seems a bit steep, tho, gotta admit.
<[[thufir]]> newbold: progress is progress
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<canton7> newbold, my learning crutch was O'Reilly's The Ruby Programming Language. It's not free, but it's a good resource
<newbold> canton7: ah, I saw that book the other day but didn't buy it --- I thought I'd do more research on books first
<[[thufir]]> yeah, I've looked at that. thanks tho.
<canton7> [[thufir]], tried JSON? :P
<newbold> good to get a recommendation though
<newbold> [[thufir]]: not going to work for you?
<canton7> newbold, I haven't tried any others, so there may well be better resources out there
<[[thufir]]> slowly but surely. well, slowly at least.
<canton7> this one lives on my desk, though
<Boohbah> canton7: i have that book too, it's great
<canton7> :)
<newbold> [[thufir]]: the next best thing for scraping html would be to just use regular expressions
<Asher> regexp don't work for html
<newbold> Asher: eh? what do you mean?
<Asher> there are all sorts of situations where html content will break your regexp
<newbold> oh
<canton7> html isn't regular, so regular expressions are the wrong tool
<Asher> better to use something like nokogiri
<canton7> fine for parsing out single tags... You'll get headaches after that
<newbold> yeah, single tags are all I've ever done before, and in very predictable circumstances
<newbold> but now I can see how that would be a pain with some output :/
<Asher> what is the goal hre?
<Asher> *here
<[[thufir]]> Asher: one sec. I'll paste so you can see
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
<[[thufir]]> code: http://pastebin.mozilla.org/1459285 output: http://pastebin.mozilla.org/1459284 trying to isolate on value=userbody of the div's. something along the lines of userbody = html.xpath('//div[@value="userbody"]') I want to grab userbody content.
iamjarvo [iamjarvo!~Adium@pool-71-162-141-201.phlapa.fios.verizon.net] has joined #ruby
<[[thufir]]> the html I'm keying on is: <div id="userbody">
mikeric [mikeric!~mike@96.49.104.175] has joined #ruby
<Asher> html.css( 'div' ).map { |this_div| this_div[ 'value' ] }
<Asher> why not use that?
<Asher> you only want the ones wehre value is "userbody"?
<Asher> html.css( 'div' ).map { |this_div| this_div[ 'value' ] == "userbody" }
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
<[[thufir]]> only where value is "userbody" yes
<[[thufir]]> ok, will do. thanks. buy why css and not xpath?
<Asher> xpath is for searching xml elements… all you want is a standard html element that is already described in the css doc hierarchy
fayimora [fayimora!~fayimora@95.175.159.12] has joined #ruby
<[[thufir]]> I thought it was odd to use xpath for html. thanks.
manizzle [manizzle!~manizzle@pcp046799pcs.pcv.reshall.calpoly.edu] has joined #ruby
<Asher> you can use xpath it's just not necessary
TheTFEF [TheTFEF!~JS@unaffiliated/thetfef] has joined #ruby
randym [randym!~randym@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.51] has joined #ruby
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
tomzx_ [tomzx_!~tomzx@dsl-136-35.aei.ca] has joined #ruby
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
TheTFEF [TheTFEF!~JS@unaffiliated/thetfef] has joined #ruby
<newbold> hmmm, so when I do erb :index in sinatra, do I need to do something else to make it so that variables are passed through to the template?
<newbold> oh, nevermind
<newbold> evidently I need to put a @ in front of those variables
<newbold> _this_ is why I need to stop and learn more... I have no idea what @ means
<Asher> it means instance variable
<Asher> and yes that is a good sign :)
<newbold> Asher: can I put ruby code in an erb template file beyond just simple variables?
<newbold> like if statements and stuff?
<Asher> i think so but i've never used erb
<shevy> newbold the huge problem with erb is that it is insanely ugly
<newbold> hmm
<newbold> I hadn't noticed yet, but yeah, I guess so
<shevy> one @ just denotes an instance variable. you can think of it as a global available that is however only available within a given class
<shevy> a global *variable
<newbold> aren't regular variables without the @ also available within a class?
<shevy> lemme show you code
seb_ [seb_!~seb@lns-bzn-45-82-65-166-115.adsl.proxad.net] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
<shevy> you can see @var is available in other methods too
<shevy> var however is not
<newbold> ahhhh
<newbold> I gotcha
<shevy> 20
<shevy> test.rb:10:in `test': undefined local variable or method `var' for #<Test:0xb768b980 @var=20> (NameError)
<shevy> from test.rb:16
<newbold> a method is a function within a class, right?
<shevy> well yeah
<shevy> more or less
<newbold> not only am I just now learning Ruby, but I'm learning OOP concepts too :P
<shevy> its tied to an object
beilabs [beilabs!~jonathan@ppp59-167-171-134.static.internode.on.net] has joined #ruby
<josefig> what would be the correct form to do this: sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config ??
<shevy> there are no real functions in Ruby as far as I know, it is always a method tied to an object
<shevy> if you start irb, and define methods there, it is tied to class Object
<shevy> not sure about anonymous methods though
<shevy> or method(:some_method)
<[[thufir]]> Asher: got it working with xpath, I was using the attributes incorrectly: http://pastebin.mozilla.org/1459418
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<Muz> 02:04 < shevy> one @ just denotes an instance variable. you can think of it as a global available that is however only available within a given class # Er, that's not correct at all.
<Asher> cool xpath will work, as i said
<Muz> @ is a variable which is visible to a single instance of a class, across methods.
<newbold> where do you put CSS files referenced by erb templates?
<Muz> @@ would be a variable which is shared across all instances of a class, across methods.
<newbold> in views or public?
<shevy> what was the wrong part Muz ;)
<newbold> I guess it'd be public, if the UA has to access it
<Muz> shevy: claiming it's 'global' is misleading, given the distinction between @var, and @@var.
<Muz> And subsequently $var, which is truly variable.
<Muz> Err, global.
mengu [mengu!~mengu@78.182.67.120] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
<newbold> is there any obvious way to optimize this, or does it look OK at this point? http://pastie.org/3234500
<shevy> newbold does not look that bad
<newbold> yay!
<shevy> but since //xml_api_reply/weather/ repeats itself
<shevy> you could store it in a constant
<newbold> ah, smart
<shevy> WEATHER = '//xml_api_reply/weather/'
<newbold> never defined a constant before
<newbold> al, that's easy enough
<shevy> @temperature = doc.xpath(WEATHER+'current_conditions/temp_f/@data').first.content
<newbold> are constants always uppercase? or is that just convention?
<shevy> only the first character is important
<shevy> could be
<shevy> Weather =
<shevy> too
<shevy> or
<shevy> WeAtHeR
<newbold> so as long as the first char is uppercase, it's treated as a constant? and constants are available globally?
<shevy> or
<shevy> We_At_He
<shevy> yeah. well, they still live in a namespace
<shevy> module Foo
<shevy> Bla = 'hi there'
<shevy> end
<shevy> to access Bla you would have to do
<shevy> Foo::Bla
<shevy> or
<shevy> include Foo; Bla
<shevy> whereas if you use $bla it would be available everywhere
Guest90356 [Guest90356!~v2px@91-64-192-244-dynip.superkabel.de] has quit ["WeeChat 0.3.5"]
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
yakko [yakko!~quassel@177.17.219.167] has quit ["http://quassel-irc.org - Chat comfortably. Anywhere."]
<Muz> Constants are also available by any class that inherits from the class in which the constant was defined.
<newbold> this is fascinating
randym [randym!~randym@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
jsonperl [jsonperl!43af0489@gateway/web/freenode/ip.67.175.4.137] has joined #ruby
<jsonperl> anyone here have some chops with ruby c extensions?
<Muz> Numeric::Foo = "1234" # This will then let you call Integer::Foo, and it will return "1234" as Integer inherits from the Numeric class
<newbold> shevy: oh wow, you can use constants in double-quoted strings! toooo awesome
<newbold> "hello NAME"
<shevy> what is that newbold
<shevy> that looks like a string to me
<newbold> it worked when I tested it
<shevy> what exactly worked ;)
<newbold> "hello NAME" => "hello whatever" if NAME = 'whatever'
<shevy> what
<shevy> and by the way
<shevy> = is assignment
<Muz> Erm, that should output "hello NAME" quite literally.
<newbold> oh wait
<newbold> yeah, false alarm
<shevy> if you want to check, you would use if FOO == "bla"
<Muz> IDeally, you'd want # "Hello #{NAME}"
<newbold> pay no attention to the noob who forgot to restart foreman after making a change
<shevy> what is foreman
<newbold> shevy: it's what I use to stage ruby apps locally before pushing them to heroku
<shevy> hmm weird
marknyc [marknyc!~Grom@207-237-59-125.c3-0.elm-ubr1.qens-elm.ny.cable.rcn.com] has joined #ruby
<jsonperl> c extensions?
<jsonperl> anyone?
<Muz> You've asked if anyone has "some chops", I have no idea what that means. Perhaps if you tried explaining your problem instead of prefacing your actual question with a needless one, you'd get some help.
<jsonperl> fair enough
<jsonperl> so i'm moving bits of a class down into c, since i'm doing some fairly heavy lifting
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
<jsonperl> im calling it the "kernel"
<jsonperl> and i'd like to have a kernel per ruby class...
<jsonperl> i'm unclear how to maintain state for this kernel
raincole_ [raincole_!~raincole@2001:288:5239:1:224:2bff:fe75:2f60] has joined #ruby
<jsonperl> using something like: int chunk_count; and then setting that, it appears that it's overwritten when I instantiate a new one
<jsonperl> i can use rb_ivar_get and rb_ivar_get if i HAVE to, but ruby doesn't need access to this data... any idea what best practices are for "instance variables" in a c extension
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
SegFault1X [SegFault1X!~SegFaultA@c-98-248-241-85.hsd1.ca.comcast.net] has joined #ruby
cheesedanish [cheesedanish!~somebody@CPE001c1057f507-CM001868521c78.cpe.net.cable.rogers.com] has joined #ruby
<banister`sleep> jsonperl: sounds you're doing weird stuff
<jsonperl> how so
<jsonperl> Goes like this:
<jsonperl> mySuperClass contains instance of mySuperClass kernel
<banister`sleep> jsonperl: you dont need to write your entire class in C
<jsonperl> which internally handles certain array and bit twiddling operations
<banister`sleep> jsonperl: you just need to write the methods in C which need the performance boost
<jsonperl> well in my case i need to maintain the data in c
pu22l3r [pu22l3r!~pu22l3r@108-196-10-55.lightspeed.tukrga.sbcglobal.net] has joined #ruby
<banister`sleep> jsonperl: then look into data wrapped structs
<newbold> so these two things do the same thing: http://pastie.org/3234590 ... is there any way to combine them?
<banister`sleep> jsonperl: go here and search for 'wrapping C structures' http://ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html
<banister`sleep> jsonperl: alternatively,look into RubyInline instead
<jsonperl> k, cool i'll have a look see
jrist [jrist!~jrist@71-212-215-38.hlrn.qwest.net] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
CreativeEmbassy [CreativeEmbassy!~CreativeE@pool-209-158-5-18.altnpa.east.verizon.net] has joined #ruby
Hanmac1 [Hanmac1!~hanmac@p508451F6.dip0.t-ipconnect.de] has joined #ruby
Animawish [Animawish!~Adium@71-36-75-222.slkc.qwest.net] has joined #ruby
daidoji [daidoji!~123fakema@108-206-96-25.lightspeed.okldca.sbcglobal.net] has joined #ruby
wmoxam [wmoxam!~wmoxam@184.175.15.252] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
<Animawish> what's the method to put something into an array
pencilcheck [pencilcheck!~pen@223-143-216-125.dynamic.hinet.net] has joined #ruby
p0y [p0y!~p0y@122.52.126.66] has joined #ruby
<banister`sleep> Animawish: << or push
dracco88 [dracco88!~dracco@cpe-24-193-104-210.nyc.res.rr.com] has joined #ruby
<daidoji> or assignment?
<Animawish> thanks :3
gigamonkey [gigamonkey!~user@adsl-76-254-17-226.dsl.pltn13.sbcglobal.net] has joined #ruby
matthias_ [matthias_!~matthias@ipc-hosting.de] has joined #ruby
<matthias_> hey
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
<newbold> hey matthias_
DummyAccount [DummyAccount!~Jared@75-134-212-75.dhcp.trcy.mi.charter.com] has joined #ruby
voodoofish4301 [voodoofish4301!~mtorres@adsl-99-93-149-204.dsl.lsan03.sbcglobal.net] has joined #ruby
x77686d [x77686d!~whm@h-67-101-188-178.phndaz91.static.covad.net] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby
voodoofish430 [voodoofish430!~mtorres@il-la.la.idealab.com] has joined #ruby
<Animawish> if I've got a .each loop going, is there a way to make an item go through twice?
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
dwon [dwon!~dwon@75-119-251-37.dsl.teksavvy.com] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
<banister`sleep> Animawish: use redo
<banister`sleep> probalby dont
mztriz [mztriz!~mztriz@74-136-75-114.dhcp.insightbb.com] has quit [#ruby]
CreativeEmbassy [CreativeEmbassy!~CreativeE@pool-209-158-5-18.altnpa.east.verizon.net] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
matthias_ [matthias_!~matthias@ipc-hosting.de] has joined #ruby
<matthias_> join #rails
zak007 [zak007!zoubair.ar@105.143.100.96] has joined #ruby
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
Illusioneer [Illusioneer!~Adium@c-69-136-109-228.hsd1.nj.comcast.net] has joined #ruby
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
mikeric [mikeric!~mike@S0106c03f0e8b23f3.vc.shawcable.net] has joined #ruby
jlogsdon_ [jlogsdon_!~jlogsdon@c-67-169-79-114.hsd1.ca.comcast.net] has joined #ruby
<Animawish> so I want to see if a string contains anything that I have in an array. for instance, item = "ban!ana" array = ["!", "?"]
<Animawish> would I do something like if item.include? array
<Asher> you'd have to iterate the array and ask for each member
<Asher> if you only want to know if it contains one of them (at least)
<Asher> then you can break as soon as you match one
<newbold> could you do something with intersection?
<Asher> you have to iterate one or the other and test for each until you match
<Asher> however you do it
<Animawish> I was worried that that was the case
<Asher> why worried
<Animawish> work :P
<newbold> wait I found it
<newbold> "banana".split('') & "apple".split('')
<newbold> ["a"]
<newbold> :D
<newbold> maybe you could use that, Animawish
<newbold> >> "ban!ana".split('') & "!?".split('')
<newbold> => ["!"]
i8igmac [i8igmac!~bigmac@c-67-185-190-112.hsd1.wa.comcast.net] has joined #ruby
<newbold> Animawish: did that work for you?
matthias_ [matthias_!~matthias@adsl-75-26-136-230.dsl.pltn13.sbcglobal.net] has joined #ruby
<Animawish> I'm messing around with it right now
<newbold> Animawish: I'm like < 2 days into learning Ruby but I think you could make it work
<newbold> Animawish: did you just want to detect the presence of a char, or do replacement/filtering, or act in a certain way depending on which char?
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby
<Animawish> I want it to pull out the char and then stick it at the end
quest88 [quest88!~quest88@c-98-207-205-137.hsd1.ca.comcast.net] has joined #ruby
tomzx [tomzx!~tomzx@dsl-136-35.aei.ca] has joined #ruby
friskd [friskd!~friskd@71-95-209-242.static.mtpk.ca.charter.com] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.51] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
radic [radic!~radic@dslb-178-002-235-210.pools.arcor-ip.net] has joined #ruby
<havenn> Animawish: Something like?: array.any? { |match| puts match if item.include? match }
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
enherit [enherit!~enherit@66-214-13-183.dhcp.lnbh.ca.charter.com] has joined #ruby
<newbold> grrrr I'm soooo cloose
<newbold> str = "ban!ana" ; check = ["!", "?"] ; matches = str.split('') & check ; str.tr(check, '') + matches.join('')
tsd_usa [tsd_usa!~daniel_d@cpe-74-66-139-160.nyc.res.rr.com] has joined #ruby
<newbold> but you can't tr on an array :/
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
<newbold> str = "ban!ana" ; check = ["!", "?"] ; matches = str.split('') & check ; str.tr(check.split(''), '') + matches.join('')
<newbold> oh wait
<newbold> got it!
<newbold> >> str = "ban!ana" ; check = ["!", "?"] ; matches = str.split('') & check ; str.tr(check.join(''), '') + matches.join('')
<newbold> => "banana!"
<newbold> Animawish: ^
<havenn> array = ["!", "?"]; item = *"ban!ana".each_char; array.any? { |match| puts match if item.include? match } #=> !
wmoxam [wmoxam!~wmoxam@184.175.15.252] has joined #ruby
<newbold> havenn: yours looks more awesome :/
<newbold> havenn: when I run yours it says 'false'
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
imbric [imbric!~chris@66.250.143.158] has joined #ruby
<newbold> oh wait
<newbold> I see
<havenn> newbold: err, remove the 'puts' and will be less wierdo
<newbold> havenn: so your code isolates the matched chars
<newbold> but it doesn't remove them from the original string or add them to the end?
<newbold> like MY AWESOME CODE does? :P
<havenn> this = Set["!", "?"]; that=Set["b", "a", "n", "!", "a"]; this.intersection(that).first #=> "!"
adeponte [adeponte!~adeponte@pool-173-51-131-197.lsanca.fios.verizon.net] has joined #ruby
<havenn> err, first gotta: require "set"
<newbold> ah but you're still not doing the two other requested things --- removing the matched chars from the original string and appending them
<newbold> <Animawish> I want it to pull out the char and then stick it at the end
<Animawish> how do I turn your code into a check for an if statement
<newbold> Animawish: who's code?
<Animawish> yours
<newbold> what do you need the if statement for? what are you checking?
<Animawish> to see if there's punctuation in it in the first place
<newbold> hmm
<Animawish> here's my messy ass code at this point https://gist.github.com/1651280
<newbold> Animawish: >> str = "ban!ana" ; check = ["x", "y"] ; matches = str.split('') & check ; if matches.empty? then puts "no matches" else puts "matches" end ; matches
<newbold> no matches
<newbold> => []
wookiehangover [wookiehangover!~wookiehan@c-67-161-138-118.hsd1.co.comcast.net] has joined #ruby
<newbold> basically... if matches.empty? then ___code if empty___ else ___code if not empty___ end
QKO_ [QKO_!~reaVer@banzai.speedxs.nl] has joined #ruby
inteq [inteq!~justin.si@adsl-98-88-29-211.asm.bellsouth.net] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
<newbold> Animawish: looking at your code
bassplayerdoug [bassplayerdoug!~bassplaye@97-85-153-116.static.stls.mo.charter.com] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-218-131.hsd1.mi.comcast.net] has joined #ruby
p1d_ [p1d_!~p1d@dslb-088-065-174-242.pools.arcor-ip.net] has joined #ruby
rippa [rippa!~splitta@85.158.54.234] has joined #ruby
<otherj> is there some kind of helper or something for for loops that allows me to do something only on the last record?
<Animawish> gasp I did it
<Animawish> almost
<Animawish> can .join have arguments
<Animawish> yes it can
<Animawish> woooo
<Animawish> thanks for the help guys :3
<newbold> Animawish: nice job :) I'm still learning and your code is interesting
<newbold> otherj: looping in an array?
<otherj> yeah
<Animawish> I've been trying to learn ruby off and on for the last couple of years, this is my first "big" project
ABK [ABK!~abhishekk@14.140.107.130] has joined #ruby
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
<newbold> otherj: so you really just want to change the last record, right? you don't care about the others?
<otherj> yeah. i mean, i'm putting the output into a javascript array, so the last record just can't have the ,
bookpage [bookpage!~bookpage@202-180-91-31.callplus.net.nz] has joined #ruby
<bookpage> why wont line.gsub(/\\n/,'') replace all of the \n's in my string?
<newbold> otherj: still thinking
<newbold> bookpage: line.tr("\n", '')
<havenn> newbold: My new answer =P, time to smoke: villians = ["!", "?"]; crowd = *"ban!ana".each_char; villians.each { |villian| crowd.delete(villian) and crowd << villian }; crowd.join #=>
<havenn> => "banana!"
<newbold> havenn: ah, you most certainly win :P
<newbold> very elegant
<newbold> otherj: >> arr = ["one", "two", "three"] ; arr[-1] = "four" ; arr
<newbold> => ["one", "two", "four"]
<newbold> otherj: so you could do arr[-1].tr(',' '') to remove the comma
<bookpage> newbold: that says error in tr: invalid byte sequence in UTF-8 (ArgumentError)
<newbold> bookpage: maybe something went wrong with the copy/paste? works over here
<newbold> >> "hello
<newbold> goodbye".tr("\n", '')
<newbold> => "hellogoodbye"
akem [akem!~akem@unaffiliated/akem] has joined #ruby
<otherj> hm, ok. thanks
matthias_ [matthias_!~matthias@ipc-hosting.de] has joined #ruby
jaysern [jaysern!~jaysern@108-90-40-248.lightspeed.sntcca.sbcglobal.net] has joined #ruby
<jaysern> how come arr.collect{|x| x.strip } doesnt strip out newlines at the end ?
your_nick [your_nick!~your_nick@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
<bookpage> newbold, maybe it's something different, im trying to do it on a line I've just read from a file
icrazyhack [icrazyhack!~horieyui@183.93.198.19] has joined #ruby
<newbold> bookpage: ahhh... hmm. maybe tr isn't multibyte safe? not sure
<newbold> bookpage: try gsub("\n", '')
<newbold> jaysern: the docs suggest that it does
<bookpage> exact same error
<newbold> bookpage: hmmm, sec
<havenn> "\nthis\nthat".delete "\n" #=> "thisthat"
<jaysern> im probably missing something obvious, as I just started learnined Ruby. http://pastie.org/3234974
<newbold> bookpage: stick this at the top of your line: # encoding: utf-8
<newbold> bookpage: er, at the top of your script
<newbold> jaysern: ah, I think you need a ! somewhere
<bookpage> still the same error - this is before i even declar my module right?
<newbold> jaysern: I'm new too, but from what I can see, it looks like your operation IS working... but it's not actually modifying the original array
<jaysern> a ! where?
<newbold> jaysern: let me see..
<jaysern> but i thought collect actually modifies the array
<newbold> oh, maybe it does
<newbold> you probably know more than me :P
<jaysern> "each" doesn't but "collect" is supposed to
<jaysern> naw, i literally jsut started this afternoon
<newbold> jaysern: for the fun of it, try arr.collect{|x| x.strip!}
i8degrees [i8degrees!~i8degrees@ip70-178-131-208.ks.ks.cox.net] has joined #ruby
<newbold> just to see what happens (if anything)
<jaysern> hey that worked!
<newbold> yay!
<jaysern> what's with the ! ?
<havenn> bang
<rippa> though
<havenn> arr.map &:strip!
<rippa> collect does not modify original array
<newbold> I think the ! says "do this, yo."
<rippa> collect! does
<havenn> arr.map! &:strip!
<newbold> like, modify the original stuff
<rippa> arr.each {|x| x.strip!}
<newbold> isn't ! ruby's way of saying "warning! you're making changes to your object!"
<sgronblo> Am I just not looking carefully enough or does 1.8.7's CSV not have a way to write to CSV?
<rippa> would work also
<rippa> you don't even need map in that case
<rippa> map creates new array
<rippa> map! modifies existing
<jaysern> what's the difference between collect and map if adding a ! works in both cases
<newbold> what does collect do?
<jaysern> im still confused about its usage
<rippa> jaysern: it's alias
<rippa> same method
<matthias_> no ! means make it and throw an error if it falis
<rippa> map is just shorter
<rippa> matthias_: no
<jaysern> sorry
<jaysern> i mean difference between collect and each
<rippa> ! means this method can have consequences
<rippa> jaysern: map returns array
<rippa> new
<rippa> b = a.map {something}
<rippa> you have a and new array b
<jaysern> right
<newbold> collect just looks weird
<newbold> I don't think you want to use it :P
<Boohbah> ! means that is will modify an object passed to it instead of instantiating a new one
<matthias_> hmm ok i heard diffrently - but maybe you are right
<newbold> jaysern: "each" literally means "each element of the array"
<newbold> so what rippa said: arr.each {|x| x.strip!}
Sigma00 [Sigma00!~freenode@thankyouforhelpingushelpyouhelpusall.net] has joined #ruby
<newbold> that's the easiest way of doing what you're trying to do
<jaysern> k thanks
<matthias_> No boohbah, thats not general enough
<matthias_> what if there are no arguments
<newbold> jaysern: arr.each {|x| x.strip!} ... "for each thing in the array represented by x, get rid of the newlines and crap associated with x and store the new value of x in place of the old one within the array"
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby
<newbold> hmm that gives me an idea
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has quit ["Leaving"]
<newbold> there should be a thing where you can paste a line of Ruby code and get a semi-human readable explanation like that
<newbold> ah nevermind, I guess I should just learn what the code means :P
openpercept [openpercept!~openperce@fedora/openpercept] has joined #ruby
<bookpage> oh god newbold: well it looks like it was defaulting to UTF-8 anyway... I didn't know what it should've been since i piped it from a mysql query... turns out if i use ISO-8859-1 then it works without error :) thanks!
<newbold> bookpage: crazy!
<rippa> newbold: wrong
<newbold> bookpage: you'd think a \n would be a \n anywhere and the encoding of the content wouldn't matter
<newbold> rippa: aww :(
<rippa> each does not store anything
<newbold> rippa: be gentle, I'm a total noob
<rippa> strip! modifies original string
<rippa> array is not changed
<newbold> ohh
<rippa> strings inside are
<newbold> rippa: how would you change the array then?
<rippa> map! stores new value
<newbold> gotcha
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
<newbold> wait, in the same array or in a new one?
<rippa> in same
<newbold> ah ok.
<rippa> map! modifies original, map creates new
Shrink [Shrink!~sgupta@114.143.48.234] has joined #ruby
Shrink [Shrink!~sgupta@redhat/shrink] has joined #ruby
<newbold> rippa: is there a way when doing .each { |x| ... } to get the index position of x?
<newbold> or is that info not associated with x?
minijupe [minijupe!~benlieb@adsl-74-243-170-217.ard.bellsouth.net] has joined #ruby
<tsd_usa> you can use each_with_index
<newbold> tsd_usa: oh, badass
<newbold> love it
_marvin [_marvin!~shikhai@pD9F4D7A7.dip0.t-ipconnect.de] has joined #ruby
<tsd_usa> :) newbold
<newbold> jaysern: so, this works too then:
<newbold> >> arr = ["one\n", "two\n", "three\n"] ; arr.each_with_index { |x, y| arr[y].strip! } ; arr
<newbold> => ["one", "two", "three"]
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
<newbold> it's not as elegant as a map I guess, but it shows another way to modify the original array in place
<jaysern> x is the index?
<newbold> y is
<newbold> x is the string
<jaysern> ah
<jaysern> yes
wedtm [wedtm!~wedtm@173-12-163-78-oregon.hfc.comcastbusiness.net] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has quit [#ruby]
<ryanf> newbold: again, note that you aren't modifying the array in place
<ryanf> you're modifying the strings
<ryanf> if there were references to those strings in other places outside the array, those would change too
<ryanf> oh I see, I didn't fully get the context. yeah, using each_with_index like that doesn't make any difference
adeponte [adeponte!~adeponte@pool-173-51-131-197.lsanca.fios.verizon.net] has joined #ruby
<ryanf> calling "arr[y].strip!" is exactly the same as calling "x.strip!"
<ryanf> because arr[y] is the same object as x
<newbold> ryanf: but in my example...
<newbold> >> arr = ["one\n", "two\n", "three\n"] ; arr.each_with_index { |x, y| arr[y].strip! } ; arr
<newbold> => ["one", "two", "three"]
<newbold> arr now contains the modified strings
<newbold> so wasn't the array modified?
<jaysern> puts "making coffee" if customer.would_like_coffee? <-- when does one end a statement with a question mark ?
<newbold> jaysern: well, the question mark is a special part of a method
<newbold> jaysern: it's not, like, a thing you can use arbitrarily
<newbold> like .nil and .nil? are two different things
bassplayerdoug [bassplayerdoug!~bassplaye@97-85-153-116.static.stls.mo.charter.com] has joined #ruby
<jaysern> so you only use ? on a variable that's an instance of a class ?
<newbold> jaysern: well, not necessarily... the ? is just a special indicator, like !
<ryanf> jaysern: ? and ! are part of the name of the method
<newbold> ah
<newbold> stuff that ends in ? will return a boolean
<ryanf> by convention
bwright [bwright!~bwright@c122-106-254-100.belrs3.nsw.optusnet.com.au] has joined #ruby
<ryanf> you are free to make methods with names ending in ? that don't return booleans, and the language won't stop you
<jaysern> interesting.
<newbold> so whatever.nil? could return true or false; which is handier than doing if whatever == nil
<ryanf> anyway newbold to answer your question
<jaysern> so what's .nil and .nil?
<ryanf> think of those strings as rocks.
<ryanf> the array is like uh
<ryanf> something that has strings attached to it which are attached to the rocks
<ryanf> if you did arr.map! { |s| s.strip }, you aren't changing the rocks, but you're removing the strings from the existing rocks and attaching them to new ones
<ryanf> if you do arr.each { |s| s.strip! }, you are actually like, I don't know, putting some paint or something on the existing rocks
<ryanf> in both cases, looking at the array afterwards will appear the same
<newbold> ryanf: oh, wow.
<ryanf> but in one case you changed the strings themselves, and in the other you just changed the array to point to some new strings
<newbold> jeez.
<ryanf> does that make any sense? I know it's a terrible analogy
<newbold> jaysern: I don't think .nil is a thing
<ryanf> yeah there is no .nil
<newbold> ryanf: no, it does make sense
<newbold> ryanf: I'm just a total OOP noob :/
<newbold> so these concepts don't come easily to me, heh
<newbold> ryanf: I guess my question now is... is there any technical way to tell the difference between an array that's had it's strings painted over vs. one that had them changed in place?
<newbold> or, in other words, does this technical distinction ever have any serious meaning in any contexts?
<ryanf> well, there's an .object_id method on every object, and that will change if you make new objects instead of mutating them in place
<ryanf> but more importantly
<newbold> jaysern: nil itself is a null value, .nil? is a method that returns boolean true or false if the value is nil
<ryanf> you could have other references to the same objects somewhere else
<newbold> ryanf: ahhhh
<newbold> now I see how you could really screw yourself
<ryanf> yeah
<newbold> if you thought you made changes to stuff, and later on find that it didn't change
<newbold> at least the way you thought it did
<jaysern> i actually didn't get the rock and strings analogy :x
<ryanf> yeah although I think what's more dangerous in practice is mutating stuff without thinking about other references to it
<ryanf> like for example, if you have a method that takes a string as an argument and you call gsub! on that string
<RubyPanther> it made no sense, but he stuck with it until he got to references at least
<ryanf> that will be reflected in the context where you called the method
fayimora [fayimora!~fayimora@95.175.159.12] has joined #ruby
<ryanf> in retrospect it was a bad idea to use "strings" to mean references when we were talking about Strings
<ryanf> but, you know, you win some, etc
<newbold> woah, String != string?
<newbold> what's a String?
<ryanf> just a string, like, you know, some text
<ryanf> newbold: I just mean vs the string connecting the array to the rocks
<newbold> ohhh ok heh
<RubyPanther> In Ruby, everything is a reference. Unless it is a Fixnum. Or a couple other things.
<banister`sleep> shevy: btw i unbanned u from #pry about 5 mins after i banned u ;)
<banister`sleep> i wasn't serious
<banister`sleep> shevy: feel free to rejoin
bassplayerdoug [bassplayerdoug!~bassplaye@97-85-153-116.static.stls.mo.charter.com] has joined #ruby
matthias_ [matthias_!~matthias@ipc-hosting.de] has joined #ruby
<newbold> hmmm
<newbold> so I've just run into a situation where I need to store some data, I guess in an array... or a hash? not sure what a hash is yet
<newbold> but it'll be two "columns", like this: "Light rain","and raining lightly"
<newbold> what's the best approach?
Illusioneer1 [Illusioneer1!~Adium@c-69-136-109-228.hsd1.nj.comcast.net] has joined #ruby
<dhs227> newbold: a hash is like a chain of unique keys. The difference between hash and set is, hash must have a unique id
<newbold> ah
<dhs227> the benefit is, hash tend to have more fash access speed for searching/replace
pdtpatrick_ [pdtpatrick_!~pdtpatric@ip72-211-207-15.oc.oc.cox.net] has joined #ruby
<newbold> I'm going to store the data in a text file, and load it into... something
<newbold> I guess that's the part I'm having trouble with
<newbold> in PHP i'd do it as a simple array with a key value pair
<dhs227> if you wanna manage objects in hash, just make sure each and every of these objects have unique key value.
<newbold> they will
<newbold> so are hashes the answer?
<dhs227> yup
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby
<newbold> I just need a way to easily replace an instance of STRING with some_other_string, where the text file will have a line like STRING,some_other_string
Animawish [Animawish!~Adium@71-36-75-222.slkc.qwest.net] has quit [#ruby]
matthias_ [matthias_!~matthias@ipc-hosting.de] has quit [#ruby]
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
TomJ [TomJ!~TomJ@unaffiliated/tomj] has joined #ruby
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
tsd_usa [tsd_usa!~daniel_d@cpe-74-66-139-160.nyc.res.rr.com] has joined #ruby
lkba [lkba!~AndChat@bpc198.neoplus.adsl.tpnet.pl] has joined #ruby
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
dnyy [dnyy!~dnyy@c-98-237-138-38.hsd1.wa.comcast.net] has joined #ruby
aj910martin [aj910martin!~abhinavja@108-81-105-79.lightspeed.sntcca.sbcglobal.net] has joined #ruby
ksinkar [ksinkar!~ksinkar@123.201.117.198] has joined #ruby
aj910martin [aj910martin!~abhinavja@108-81-105-79.lightspeed.sntcca.sbcglobal.net] has quit [#ruby]
tonini [tonini!~zastav@edge.garaio.com] has joined #ruby
bwright [bwright!~bwright@c122-106-254-100.belrs3.nsw.optusnet.com.au] has joined #ruby
<wallerdev> bah ruby is so slow!
<wallerdev> haha
tobyo [tobyo!~tobyo@cpe-24-165-22-166.san.res.rr.com] has joined #ruby
a_a_g [a_a_g!~aag@203.123.164.34] has joined #ruby
Shrink [Shrink!sgupta@nat/redhat/x-ofwobvdtfnjdwogy] has joined #ruby
Shrink [Shrink!sgupta@redhat/shrink] has joined #ruby
colint__ [colint__!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
fayimora [fayimora!~fayimora@2a01:388:201:3721:f47b:9e29:b338:6d80] has joined #ruby
<josefig> wallerdev, uh?
<wallerdev> you heard me :)
fayimora_ [fayimora_!~fayimora@2a01:388:201:3721:30dd:8855:90b:d837] has joined #ruby
<josefig> wallerdev, nice to know your point of view.
<wallerdev> for sure
<wallerdev> my enumerable map is taking over a second
<wallerdev> and it is making me sad
h4mz1d [h4mz1d!~hamfz@c-68-62-113-11.hsd1.al.comcast.net] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.51] has joined #ruby
<josefig> wallerdev, but it's not always the programming language the responsable; implementation, hardware, other resources, etc.
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
<josefig> It happened to me.
michael_mbp_ [michael_mbp_!~Marin@62.215.214.4] has joined #ruby
djdb [djdb!~digitalbo@linux.minsk.tutby.com] has joined #ruby
<wallerdev> haha don't get me wrong, i love ruby and I'm looking at how i can optimize the data
araujo [araujo!~araujo@190.73.44.29] has joined #ruby
araujo [araujo!~araujo@gentoo/developer/araujo] has joined #ruby
michael_mbp__ [michael_mbp__!~Marin@62.215.214.4] has joined #ruby
<josefig> wallerdev, right, but that's why I'm telling you, maybe something related with: implementation, hardware or other resources, you'd have to check those things.
michael_mbp_ [michael_mbp_!~Marin@62.215.214.4] has joined #ruby
<josefig> it happened to me with some data reader, was because of the implementation.
michael_mbp__ [michael_mbp__!~Marin@62.215.214.4] has joined #ruby
<wallerdev> well I'm literally timing an enumerable#map inside of a map that reads some ruby attributes and creates arrays
<wallerdev> its just a lot of data
michael_mbp__ [michael_mbp__!~Marin@62.215.214.4] has joined #ruby
<josefig> wallerdev, right.. hum, that's a good challenge.. :)
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
<wallerdev> i suppose i could cache all the data
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
<idarkside> is this possible
michael_mbp___ [michael_mbp___!~Marin@62.215.214.4] has joined #ruby
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
michael_mbp_ [michael_mbp_!~Marin@62.215.214.4] has joined #ruby
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
Locke23rus [Locke23rus!~quassel@128-70-95-104.broadband.corbina.ru] has joined #ruby
<josefig> idarkside, I don't understand at all your question, could you be more explicit please? and is in PHP ? or what?
intacta [intacta!~intacta@128-74-131-202.broadband.corbina.ru] has joined #ruby
<wallerdev> yeah i think he's in the wrong channel
<wallerdev> thats not valid ruby
<josefig> yup, idarkside I invite you to type: /join ##php and expain over there.
fullsailor [fullsailor!~fullsailo@ip24-250-174-76.ga.at.cox.net] has joined #ruby
<idarkside> josefig im trying to call the script in a ruby process
<josefig> idarkside, so, paste bin the snippet.
<idarkside> upon startup i would like the process to call license.php and check for active or inactive if the status reads active then i would like the script to put "License Valid" if its reads inactive i would like the process to die
<idarkside> :)
<wallerdev> have you written any ruby to tackle the problem yet?
<[[thufir]]> gem won't install: http://pastebin.mozilla.org/1459539 need to upgrade ruby?
<josefig> idarkside, when you say 'call license.php' what you mean? like a HTTP Headers?
trend [trend!~trend@76.91.169.147] has joined #ruby
<idarkside> read the contents
<wallerdev> [[thufir]]: you need to install the ruby-dev package
<idarkside> josefig^^
<idarkside> and
<idarkside> that is active and inactivew
<josefig> idarkside, that's a var_dump in PHP, I suggest you to do a simple call with HTTP Headers like when you call a REST call or something like that, because I don't really understand your question.
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
<idarkside> ok lemme try this
<idarkside> when you view the file on the web it says active or inactive
yxhuvud [yxhuvud!mongo@h-5-47.a212.priv.bahnhof.se] has joined #ruby
<wallerdev> that will show you how to download a webpage and loop through the lines
<idarkside> i got the gem but im a php coder not a ruby coder so i was hoping for sum1 to help me with the string
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
<josefig> idarkside, refer to the link wallerdev just gave it to you.
<wallerdev> well i don't think anyone is going to do it for you, so if you want to do this in ruby you might want to check out the link
<idarkside> ty
<idarkside> ill look
<wallerdev> otherwise you can do it in a language you're more familiar with
<idarkside> my script is already in ruby
<[[thufir]]> wallerdev: thx
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
<idarkside> `initialize': No such file or directory - http://idarkside.co.uk/license.php (Errno::ENOENT)
<idarkside> from test.rb:1:in `open'
<idarkside> from test.rb:1:in `<main>'
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
Modification [Modification!~IceChat77@75-171-97-44.phnx.qwest.net] has joined #ruby
<Modification> I need help
wenbert [wenbert!~wenbert@122.52.153.52] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
<josefig> Modification, pastebin it or pastie.org and provide the link.
icrazyhack [icrazyhack!~horieyui@183.60.101.86] has joined #ruby
<josefig> Modification, worked for me just like this http://pastie.org/3235398
Targen [Targen!~iguana@190.39.181.108] has joined #ruby
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
horieyui [horieyui!~horieyui@183.93.198.19] has joined #ruby
<Modification> hmm
<Modification> u sure?
yxhuvud [yxhuvud!mongo@h-5-47.a212.priv.bahnhof.se] has joined #ruby
<josefig> Modification, yep, what is the problem from your side? check on the channel, it joined and says the msg.
eko [eko!~eko@unaffiliated/eko] has joined #ruby
<josefig> let me try on this, wait
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby
ModsBot-debug [ModsBot-debug!~ANON@189.154.66.64] has joined #ruby
<ModsBot-debug> Hello from IRB Bot
<josefig> ^
<Modification> :O
<Modification> u did that?
<josefig> yup
<josefig> that's what you needed, right? or what's the problem? I don't understand.
<Modification> mine connects too..
d3b4g [d3b4g!~d3b4g@123.176.25.98] has joined #ruby
<Modification> but responding to commands.. how do I intergrate them with the code?
raincole_ [raincole_!~raincole@2001:288:5239:1:224:2bff:fe75:2f60] has joined #ruby
ModsBot [ModsBot!~ANON@75-171-97-44.phnx.qwest.net] has joined #ruby
<ModsBot> Hello from IRB Bot
<Modification> :O
<Modification> no way
<Modification> it worked :D
<Modification> h
<Modification> hmm..
hemanth [hemanth!~hemanth@121.244.159.130] has joined #ruby
<josefig> lol, well that depends upon what you need, reading the streaming and do anything with that.
<Modification> I need it to respond to little commands like
<Modification> !hello
<Modification> and it says hello back
<hemanth> one of the channel owners had shared a video tut link in the channel, dam i have lost it
krz [krz!~foobar@unaffiliated/krz] has joined #ruby
ModsBot [ModsBot!~ANON@75-171-97-44.phnx.qwest.net] has joined #ruby
<ModsBot> Hello Everyone
<Modification> well at least that part works..
<Modification> how do I fix the ping requests?
<josefig> Modification, there are many bots already created.. why don't download one of those?
<Modification> it cant respond the pings and gets disconnected...
<Modification> idk where to search.. I cant find anything.. on hawkee.com
<Modification> brb
<josefig> Modification, google is your friend, look at this: https://github.com/RISCfuture/autumn
<josefig> kk
<Modification> how do I load it?
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
vaneda [vaneda!~vaneda@cpe-173-169-236-105.tampabay.res.rr.com] has joined #ruby
<Modification> See? it won't work on my friend's server
<Modification> it doesn't say Hello Everyone
heftig [heftig!~Jan@archlinux/developer/heftig] has joined #ruby
<banister`sleep> heftig: hey hefty boy
<Modification> and that ^^ it timesout
<Modification> how do I fix that
<[[thufir]]> which gem is missing for undefined local variable or method `http' ?
mikeric [mikeric!~mike@96.49.104.11] has joined #ruby
<banister`sleep> [[thufir]]: gem install i_dont_know_what_im_doing_help
<[[thufir]]> I have net/http(s) and uri
<[[thufir]]> eh
<Modification> wait I think I fixed it just now..
ModsBot [ModsBot!~ANON@75-171-97-44.phnx.qwest.net] has joined #ruby
<ModsBot> Hello Everyone
<Modification> now we wait...
<Modification> it took 252 seconds last time..
<Modification> k just got pinged..
<Modification> waiting for teh pong.. *crosses fingers*
<Modification> seems to be working... :)
<Modification> k those two problems.. solved..
<Modification> now how do I program it to respond to stuff?
<Modification> DAMN!!
<Modification> piece of crap..
<Modification> -_-
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
ModsBot [ModsBot!~ANON@75-171-97-44.phnx.qwest.net] has joined #ruby
<ModsBot> Hello Everyone
<Modification> I swear this thing is frustrating.. like it said.. requires patience...
<Modification> :D
thone_ [thone_!~thone@g225084100.adsl.alicedsl.de] has joined #ruby
<Modification> i gtg soon...
<Modification> -_-
<Modification> how many here took the ruby in twenty coursE?
<Modification> :D
<Modification> would a bot made with ruby be considered a rubot?
<Boohbah> please don't test your bot in this channel
raincole_ [raincole_!~raincole@2001:288:5239:1:224:2bff:fe75:2f60] has joined #ruby
crescendo [crescendo!~eric@unaffiliated/crescendo] has joined #ruby
ca_bud [ca_bud!~joshuaman@205-178-60-158.c3-0.snb-ubr1.chi-snb.il.cable.rcn.com] has joined #ruby
<Modification> I don't know where to test it at...
<ca_bud> what do I change to allow passenger to use ruby 1.9.3 vs the current version 1.9.2
senny [senny!~senny@edge.garaio.com] has joined #ruby
<ca_bud> I have RVM installed and have set the .rvmrc files in the webapp, but it still does not change what passenger uses
<Modification> anyone know which channel use to test bots?
senny [senny!~senny@edge.garaio.com] has joined #ruby
<rippa> any empty channel
<Modification> I go to #flood
tk_ [tk_!~tk@p083005.doubleroute.jp] has joined #ruby
mafolz [mafolz!~mafolz@dhcp50-203.start.uni-saarland.de] has joined #ruby
<[[thufir]]> bad uri from: url = URI.parse 'https://#{user}:#{pword}@mail.google.com/' so how to concatenate those together so that the pword and user are passed(?) into the url?
<[[thufir]]> ah. use << ?
azbarcea [azbarcea!~quassel@79.114.19.188] has joined #ruby
matled [matled!~matled@85.131.246.184] has joined #ruby
<drizz> url = URI.parse "https://#{user}:#{pword}@mail.google.com/"
<Modification> could someone find me a simple premade script for a ruby bot... Its hard finding one...
stoffus [stoffus!~stoffus@2001:9b0:1:dead:129a:ddff:fe58:6835] has joined #ruby
palcu [palcu!~alex@89.122.187.223] has joined #ruby
<[[thufir]]> drizz: I tried that, except with single quotes. is that why it didn't work?
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
thebastl [thebastl!bastl@ve621924175.ihrserver.de] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
<[[thufir]]> drizz: thanks, that's what it was.
<Modification> they are not working...
<Modification> -_- im the dumbest person ever!! cant even write a simple bot..
<Modification> :(
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
<banister`sleep> Modification: you have a good heart though
<[[thufir]]> can't convert true into string: http://pastebin.mozilla.org/1459575 code: http://pastebin.mozilla.org/1459574 now is that a problem with the conditional? I'm not seeing a conversion.
alx- [alx-!~Alex@108.162.180.72] has joined #ruby
<drizz> [[thufir]]: yes
<Modification> well okay goodnight I will try tomorrow..
<[[thufir]]> heh. fair enough. can you give a hint?
fixl [fixl!~fixl@203-158-35-152.dyn.iinet.net.au] has joined #ruby
Locke23rus_ [Locke23rus_!~quassel@128-70-125-206.broadband.corbina.ru] has joined #ruby
openpercept [openpercept!~openperce@fedora/openpercept] has joined #ruby
<heftig> banister`sleep: sup
<banister`sleep> heftig: im learning german
<banister`sleep> heftig: i've been stuck on 'und' for the last couple of weeks tho
<heftig> i tried learning japanese
<heftig> i suck at it
Shrink [Shrink!sgupta@redhat/shrink] has joined #ruby
<rippa> I only learned kana
<rippa> too lazy
nd_____ [nd_____!~nd@mnhm-4d018e3c.pool.mediaWays.net] has joined #ruby
wikimatze [wikimatze!~chatzilla@62.225.103.117] has joined #ruby
<[[thufir]]> for (File.directory? RootCA && http.use_ssl?) when I read http://ruby-doc.org/core-1.9.3/File.html#method-c-directory-3F I read that be that File.directory will return true or false in the context of an if/else. is that correct?
CodyMaverick [CodyMaverick!~cody@80.249.82.205] has joined #ruby
<[[thufir]]> ah, should I be passing an argument such as if(File.directory?("ruby") ) ? but, what argument in this context? hmm.
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
ph^ [ph^!~ph^@79.135.7.162] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
cyri_ [cyri_!~cyri_@149.93.119.80.rev.sfr.net] has joined #ruby
jbpros [jbpros!~jbpros@39-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
Deiu [Deiu!~deiu@157.159.103.224] has joined #ruby
Deiu [Deiu!~deiu@unaffiliated/deiu] has joined #ruby
JohnBat26 [JohnBat26!~Eugene@89.175.77.79] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
Deiu [Deiu!~deiu@unaffiliated/deiu] has quit ["Leaving"]
senthil [senthil!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has joined #ruby
pi3r [pi3r!~pi3r@LSt-Amand-152-32-39-189.w80-11.abo.wanadoo.fr] has joined #ruby
thecreators [thecreators!~rskagy@cpe-65-27-201-150.cinci.res.rr.com] has joined #ruby
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
BiHi [BiHi!~bihi@did75-17-88-165-129-29.fbx.proxad.net] has joined #ruby
jbpros [jbpros!~jbpros@39-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
justmejustme [justmejustme!~justmejus@c83-254-248-138.bredband.comhem.se] has joined #ruby
ChampS666 [ChampS666!~ChampS@wlan1-125.zw.fh-zwickau.de] has joined #ruby
h4mz1d [h4mz1d!~hamfz@c-68-62-113-11.hsd1.al.comcast.net] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
intacta [intacta!~intacta@128-74-131-202.broadband.corbina.ru] has joined #ruby
openpercept [openpercept!~openperce@fedora/openpercept] has joined #ruby
bastilian [bastilian!~bastilian@chello213047077012.23.11.vie.surfer.at] has joined #ruby
cantbecool [cantbecool!~cantbecoo@c-68-37-164-255.hsd1.nj.comcast.net] has joined #ruby
bastilian [bastilian!~bastilian@chello213047077012.23.11.vie.surfer.at] has joined #ruby
cantbecool [cantbecool!~cantbecoo@c-68-37-164-255.hsd1.nj.comcast.net] has joined #ruby
QKO_ [QKO_!~reaVer@banzai.speedxs.nl] has joined #ruby
Deiu [Deiu!~deiu@unaffiliated/deiu] has joined #ruby
Deiu [Deiu!~deiu@unaffiliated/deiu] has quit [#ruby]
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
heftig [heftig!~Jan@archlinux/developer/heftig] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
fixl [fixl!~fixl@203-158-35-152.dyn.iinet.net.au] has joined #ruby
madgraphics [madgraphics!~madgraphi@mail.11labo.net] has joined #ruby
ephemerian [ephemerian!~ian@82-69-1-248.dsl.in-addr.zen.co.uk] has joined #ruby
Ammar01 [Ammar01!~hassaa10@gatek.thls.bbc.co.uk] has joined #ruby
dazoakley [dazoakley!~dazoakley@hocuspokus.vm.bytemark.co.uk] has joined #ruby
bassplayerdoug [bassplayerdoug!~bassplaye@97-85-153-116.static.stls.mo.charter.com] has joined #ruby
nari [nari!~nari@2001:268:306:3:6680:99ff:fe23:576c] has joined #ruby
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
trivol [trivol!~aurelien@81.57.175.21] has joined #ruby
madgraphics [madgraphics!~madgraphi@mail.11labo.net] has joined #ruby
symb0l [symb0l!~symb0l@c-50-131-187-183.hsd1.ca.comcast.net] has joined #ruby
QKO_ [QKO_!~reaVer@banzai.speedxs.nl] has joined #ruby
shevy [shevy!~shevy@178-190-73-145.adsl.highway.telekom.at] has joined #ruby
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
jmcphers [jmcphers!~jmcphers@61.14.141.35] has joined #ruby
hardyboy [hardyboy!736e0874@gateway/web/freenode/ip.115.110.8.116] has joined #ruby
<hardyboy> Hai friends.... Hope you all had a great weeked :)
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
<hardyboy> friends... am new to ruby
<hardyboy> how can i simplify and make this code short? https://gist.github.com/1662060
madgraphic [madgraphic!~madgraphi@mail.11labo.net] has joined #ruby
<hardyboy> please help me with some ruby magic
<hardyboy> how can i simplify and make this code short? https://gist.github.com/1662060
madgraphics [madgraphics!~madgraphi@mail.11labo.net] has joined #ruby
<hardyboy> madgraphics: how can i simplify and make this code short? https://gist.github.com/1662060
clockwize [clockwize!~clockwize@81.19.48.130] has joined #ruby
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
madgraphic [madgraphic!~madgraphi@mail.11labo.net] has joined #ruby
<hardyboy> clockwize: c0rn: how can i simplify and make this code short? https://gist.github.com/1662060
<hardyboy> will anyone please help me :(
<clockwize> why are you incrementing value at all?
robotmay [robotmay!~robotmay@94.30.13.228] has joined #ruby
<clockwize> just do if user.role.title == "Retiree" ; flash[:error] = "Cannot send invitation to a Retiree" ; return redirect_to invite_community_path(@community) ; end
dazoakley [dazoakley!~dazoakley@hocuspokus.vm.bytemark.co.uk] has joined #ruby
madgraphics [madgraphics!~madgraphi@mail.11labo.net] has joined #ruby
EddieS [EddieS!~ed@212.59.167.161] has joined #ruby
<_marvin> hi
davidpk [davidpk!~r00t@5e0a02e9.bb.sky.com] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
quarizztice_ [quarizztice_!~nickbuff@176.74.57.52] has joined #ruby
quarizztice_ [quarizztice_!~nickbuff@176.74.57.52] has quit [#ruby]
fayimora [fayimora!~fayimora@95.175.159.12] has joined #ruby
quarizztice_ [quarizztice_!~nickbuff@176.74.57.52] has joined #ruby
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
randym [randym!~randym@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
matti [matti!matti@madwifi/support/matti] has joined #ruby
x0F_ [x0F_!~x0F@unaffiliated/x0f] has joined #ruby
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
p0y_ [p0y_!~p0y@122.52.126.66] has joined #ruby
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
jbpros [jbpros!~jbpros@39-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
ksinkar [ksinkar!~ksinkar@123.201.117.198] has joined #ruby
geaif [geaif!~geaif@xdsl-188-155-129-176.adslplus.ch] has joined #ruby
gianlucadv [gianlucadv!~user@st-dellaved.statistica.unimib.it] has joined #ruby
palcu [palcu!~alex@89.122.187.223] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
Barakas [Barakas!~v@77.242.201.52] has joined #ruby
symb0l [symb0l!~symb0l@c-50-131-187-183.hsd1.ca.comcast.net] has joined #ruby
niklasb [niklasb!~codeslay0@p5B310BD2.dip0.t-ipconnect.de] has joined #ruby
csherin [csherin!~csherin@115.111.177.122] has joined #ruby
openpercept [openpercept!~openperce@fedora/openpercept] has joined #ruby
workmad3 [workmad3!~workmad3@vpn222.its.manchester.ac.uk] has joined #ruby
mylifeisfine [mylifeisfine!736e0874@gateway/web/freenode/ip.115.110.8.116] has joined #ruby
<mylifeisfine> hai friends... :)
<mylifeisfine> need a small help... is it possible to simplify this line of conditional comparison further ?
<mylifeisfine> if current_user.role.title.strip == "Retired" && @user.role.title.strip != "Retired"
<mylifeisfine> Anyone any suggestions ??
<RubyPanther> mylifeisfine: just assign it, t = current_user.role.title.strip ; if t == ... && t = ...
<banister`sleep> RubyPanther: talk to me
<mylifeisfine> RubyPanther: ok but still thats again an assignment... i just do this comparison at one place.. so it will be 3 lines of code instad of 1 line.. is it possible to simplify this line again ?
<mylifeisfine> banister`sleep: any ideas ?
gianlucadv [gianlucadv!~dellavedo@st-dellaved.statistica.unimib.it] has joined #ruby
ex0a [ex0a!~high@unaffiliated/ex0a] has joined #ruby
<shevy> mylifeisfine it is a little bit odd that you have to work on a string and apply .strip on it on your own
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
<mylifeisfine> shevy: thats because it does a comparison with the bd value and when a user enters a value.. u never know if it takes a whitespace or two with it into the db..
<RubyPanther> mylifeisfine: you're fighting the simplification but having a temp var is always going to be the simplest, for both the human and the computer
<mylifeisfine> shevy: sorry db not bd
<shevy> hmm
<RubyPanther> if you want some golfed thing it will be _more_ complex
<shevy> I dont really understand it, but for me it seems easier to use a proper setter that strips all whitespace anyway.
<mylifeisfine> shevy: so could you just give me an example i mean how exactly can i do that?
<banister`sleep> mylifeisfine: i'll help you if you can get RubyPanther to talk to me
<shevy> do what
<banister`sleep> shevy: you can rejoin #pry btw, i only banned u for like 5 mins, and i wasnt serious
<banister`sleep> :)
<shevy> I am still a sad man, but I shall rejoin one day
<mylifeisfine> shevy: oh k u saying that u wud have a setter in the model for stripping the data at the time of accepting the data ryt ? :) thats a good idea !1
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
<shevy> mylifeisfine: you could try to reshuffle the logic if you dont like your above code
<banister`sleep> shevy: why are you sad
<shevy> mylifeisfine: well, if you have to call .strip everywhere, I wonder, because it seems unnecessary to me, unless you do indeed need to care about whitespace (but I still did not understand why you really need the whitespace)
<mylifeisfine> banister`sleep: why do u want RubyPanther to talk to you? ;) You can always talk to me and catch up with me https://twitter.com/#!/mithun_sasi
<shevy> I am also not sure about the difference between .... current_user and @user
<ex0a> i'm trying to fix a function in waveform.rb ( http://pastie.org/3236292 ) that is due to there only being one channel of audio but i'm not experienced in ruby and was hoping one of you could give me an idea on how to recover after it fails to add the float into an array (i assume that's what the error msg is saying?)
<shevy> what I usually do, when I need some sanitized @variable, is to just define one setter, and do the sanitization thing within that setter on my own
<mylifeisfine> shevy: i dnt need a whitespace :) and thats why i do a strip while comparing the db value :)
<shevy> and only use that setter when @variable is modified
<shevy> yeah but that is odd to me :)
<shevy> when you have to call .strip every time
<mylifeisfine> shevy: by the way what does the sanitizer gem do? the same thing?
gianlucadv [gianlucadv!~dellavedo@st-dellaved.statistica.unimib.it] has joined #ruby
<shevy> no idea what it does. there are way too many gems out there
<mylifeisfine> shevy: ya but the name suggests that it does something similar to that :0
<mylifeisfine> :)
<shevy> ex0a, something tries to call a [] method on Float
<mylifeisfine> shevy: curent-user is the one who is accessing and @user is the one whose he is accessing like for example accessing profile.. :)
<shevy> peak = frame[channel].abs if frame[channel].abs > peak <--- I guess frame is a Float
<shevy> sounds confusing mylifeisfine but if it makes sense to you, I guess it's fine
<shevy> my golden rule of coding is the zombie rule
mk03 [mk03!~mk03@61.245.119.34.er.eaccess.ne.jp] has joined #ruby
<shevy> code must be understandable to zombies, else the code is wrong
<mylifeisfine> shevy: its like if the role of current user is retiree then he can only access other retirees items and profiles alone :) so I am checking that :)
<shevy> hmmm
<ex0a> shevy: okay doing some reading ty
<shevy> if foo == "Retired" && foo != "Retired"
<RubyPanther> mylifeisfine: that code should never exist like that, it should be in one of the models
<shevy> dont think you can get much shorter than that
<shevy> but that is all kinda ugly to zombies
<banister`sleep> mylifeisfine: you made a grammatical error in your last tweet
<banister`sleep> mylifeisfine: that alone is enough to turn me strongly against you
<RubyPanther> it would be like if current_user.can_haz(@user,"Retired")
<mylifeisfine> RubyPanther: hmm... but the thing is iam playing around with a project thats already been coded and deployed so i got make my changes within the limited flexibility
<shevy> well using one method seems better than checking for two values
<RubyPanther> mylifeisfine: you can always add methods to classes
<RubyPanther> the worst case is having to name your stuff poorly so you don't collide
<mylifeisfine> RubyPanther: the way u tell me i must have a method in my user model that returns the users roles and then compare it in the controller than doing it explicity in the controller!! Am i ryt?
<RubyPanther> mylifeisfine: right, the controller should not be deciding what it means for access to be allowed, it should only be setting up the state and asking the models what is allowed
zalesz [zalesz!~zalesz@user-164-126-96-187.play-internet.pl] has joined #ruby
<RubyPanther> allowed is business logic, goes in model
<mylifeisfine> so in User.. i will do something like def user_role user.role.title end :) As simple as that
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<mylifeisfine> RubyPanther: https://twitter.com/#!/mithun_sasi
<mylifeisfine> RubyPanther: so in User.. i will do something like def user_role user.role.title end :) As simple as that
<mylifeisfine> RubyPanther: Are you a RailsPanther ? :)
<RubyPanther> mylifeisfine: why do you keep spamming a twitter link?
<shevy> lol
<shevy> yeah change your nick panther!!!
G [G!njones@torea.jnet.net.nz] has joined #ruby
<mylifeisfine> RubyPanther: am sorry when i pressed CTRL+V i got pasted accidently
<RubyPanther> mylifeisfine: no, thankfully I rarely have to use rails anymore
<shevy> funny things happen randomly
<mylifeisfine> shevy: you too to RubyShevy :)
<shevy> hmm I like short nicks
<RubyPanther> now I write point of sale systems, so you can just call me POSPanther
<mylifeisfine> RubyPanther: : Its just been half an year since i started working on rails and the only thing i love abt RoR is ruby and not a stuff from rails.. i hate it ;(
<shevy> take tommylommykins here ... noone can remember this dude
<shevy> I found ruby before rails, luckily
<mylifeisfine> i wanna move on... miss the good old days when i use to develop using J2EE :( sadly
<mylifeisfine> shevy: you work on ruby ?
<shevy> cool what was J2EE like?
<shevy> well I use ruby for every programming-related task so far
<RubyPanther> mylifeisfine: IMO there are only two reasons to use rails, 1) it is Ruby 2) it is a known name and considered business friendly
<mylifeisfine> shevy: Its so much fun... u gt to do each and everything on ur own even the db queries unkline rails in which its spoon feeding u dnt really have any challnge as such..
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
<mylifeisfine> RubyPanther: I have made up my mind to either switch to android programming or go for higher studies.. may be an MS !! :0
<RubyPanther> I do enjoy using AR outside Rails, though
<mylifeisfine> RubyPanther: AR ?
<RubyPanther> ActiveRecord
<shevy> mylifeisfine: right now I am looking at this explosion of warnings http://pastie.org/3236356 and will probably rewrite this until all those warnings are gone, for some reason I seem to require the same files at least twice
<mylifeisfine> RubyPanther: hmmm...
<mylifeisfine> shevy: what is this abt /
<RubyPanther> if I get stuck interfacing with SQL Server I can just use odbc+AR and pow! from turd sandwich to roses, that quick
<mylifeisfine> shevy: are you oveerriding the method somewhere ? :-/
<mylifeisfine> RubyPanther: thats being lazy and not staying awake until u get things right the hard way :P
<shevy> mylifeisfine no idea, I started this like 2 years ago and no longer know what's going on really
<RubyPanther> exactly, the three virtues of a programmer, laziness, impatience, hubris.
<mylifeisfine> RubyPanther: and you being proud abt it ? :D
<mylifeisfine> RubyPanther: impatience is a good virtue though
<RubyPanther> That's the hubris.
<mylifeisfine> RubyPanther: its like wanting things done anyhow and as quickly as possible but it sometimes can lead to error since u rnt patient enough to test your codes from all quarters
<mylifeisfine> shevy: that sounds like an old tale... coming back to an old code after 2 loioong years :)
<RubyPanther> mylifeisfine: if you're truly lazy, you take enough precautions to prevent that sort of problem
<mylifeisfine> RubyPanther: that sounds too ironical :)
<shevy> mylifeisfine well, at least this is all in ruby
<shevy> I couldn't go back to PHP :(
<RubyPanther> like in the original Pragmatic Programmer book, where they teach you not to build out features you don't need, but to design your app assuming that you'll need to extend it and build out features later. Preemptive laziness.
<mylifeisfine> shevy: what in this world is stopping you.. go for php and get yourself hired by http://facebook.com :)
<shevy> naaah
<shevy> I couldn't work for things I hate (and don't use and never will use)
jlogsdon [jlogsdon!~jlogsdon@c-67-169-79-114.hsd1.ca.comcast.net] has joined #ruby
<mylifeisfine> shevy: fair enough :)
doug- [doug-!~bassplaye@97-85-153-116.static.stls.mo.charter.com] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
<RubyPanther> Those are the best work projects, the worst are ones partially related to a hobby or personal interest/need so then when you try to take a break from work, your hobby brings it right back in your face
<shevy> hmm
<shevy> I found it best when a project can keep me curious over many months
<shevy> else I abandon it at a later point again
prtksxna [prtksxna!~prtksxna@27.7.18.120] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
faber [faber!~faber@adsl-ull-69-202.50-151.net24.it] has joined #ruby
nari [nari!~nari@p62e58e.totrnt01.ap.so-net.ne.jp] has joined #ruby
<shevy> hmmm
<shevy> where does .pretty_inspect come from...
ChampS666 [ChampS666!~ChampS@wlan1-125.zw.fh-zwickau.de] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.51] has joined #ruby
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
DruMn [DruMn!~fland@46.109.100.148] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
<[[thufir]]> net/http.rb:1060:in `request': undefined method `closed?': http://pastebin.mozilla.org/1459678 code: http://pastebin.mozilla.org/1459679 how else can the request be made? so far as I can tell it's a valid request.
Wilhelm_ [Wilhelm_!~textual@oyt234.internetdsl.tpnet.pl] has joined #ruby
lorandi [lorandi!~lorandi@201-68-82-55.dsl.telesp.net.br] has joined #ruby
sj26 [sj26!sj26@sj26.com] has joined #ruby
shadoi [shadoi!~Adium@c-71-202-122-8.hsd1.ca.comcast.net] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<[[thufir]]> do you have to use sockets for https?
jensn [jensn!~Jens@ip233-1.wireless.lu.se] has joined #ruby
JonnieCache [JonnieCache!~jonnie@87.252.60.35] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
d3b4g [d3b4g!~d3b4g@123.176.25.98] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
nanderoo [nanderoo!~nanders@38.124.137.226] has joined #ruby
cantbecool [cantbecool!~cantbecoo@c-68-37-164-255.hsd1.nj.comcast.net] has joined #ruby
rickmasta [rickmasta!~rickmasta@pool-71-183-247-164.nycmny.fios.verizon.net] has joined #ruby
wikimatze [wikimatze!~chatzilla@62.225.103.117] has joined #ruby
gianlucadv_ [gianlucadv_!~gianlucad@st-dellaved.statistica.unimib.it] has joined #ruby
mylifeisfine [mylifeisfine!736e0874@gateway/web/freenode/ip.115.110.8.116] has joined #ruby
<mylifeisfine> Hai friends... I am new to ruby had a small doubt what is difference between self.role.title.strip! and self.role.title.strip
<mylifeisfine> RubyPanther: help me boss :)
<mylifeisfine> i mean strip with ! and without ! ???
<RubyPanther> mylifeisfine: the one with the ! modifies the receiver, the other one makes a copy and operates on that.
<RubyPanther> good timing, I was watching videos of feral children
<mylifeisfine> so if i do self.role.title.strip! it will modify the data ryt so i shud be doing it without ! in the controller to compare values without whitespaces?
<mylifeisfine> RubyPanther: ^
gianlucadv [gianlucadv!~gianlucad@st-dellaved.statistica.unimib.it] has joined #ruby
<RubyPanther> mylifeisfine: well, you do have to know if you want to modify the receiver or not, or you have bigger problems
<mylifeisfine> RubyPanther: i just wana compare values without whitespaces so.. i shudnt be using !
rflorianobr [rflorianobr!~rfloriano@200.146.45.59.dynamic.adsl.gvt.net.br] has joined #ruby
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
ChampS666 [ChampS666!~ChampS@wlan1-125.zw.fh-zwickau.de] has joined #ruby
<mylifeisfine> is there a cleaner way of comparing two strings than to do variable != "Value"
banister_ [banister_!~baniseter@118.82.185.158] has joined #ruby
<mylifeisfine> is there a cleaner way of comparing two strings than to do variable != "Value"
ikaros [ikaros!~ikaros@studpool-wlan-75-202.fs.fbi.h-da.de] has joined #ruby
<shevy> mylifeisfine perhaps do_something unless x == y
<rippa> what's not clean about that?
<mylifeisfine> rippa: its clean but i wasnt sure if this is the ryt way to do things in an enterprise web app view page ?? :)
<mylifeisfine> rippa: if there is a better conventional way of doing it :)
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
rickmasta [rickmasta!~rickmasta@pool-71-183-247-164.nycmny.fios.verizon.net] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
manhunter [manhunter!~manhunter@unaffiliated/manhunter] has joined #ruby
<JonnieCache> yeah you could say its not good to do that in a view as its not clear why youre doing the comparison
<JonnieCache> itd be perhaps better to have an appropriately named helper make that comparison and return the result so the view will be clearer
<manhunter> is there any offtopic channel for ruby?
<mylifeisfine> JonnieCache: i wanna make some links invisible for certain users :)
<RubyPanther> often you only want single methods ending in ? in conditionals unless you're in an instance method (in rails I would restrict that further to model methods)
jensn [jensn!~Jens@ip233-1.wireless.lu.se] has joined #ruby
<mylifeisfine> RubyPanther: so how can I write this as a method in my model if user.role.title.strip == "Retired"
`brendan [`brendan!~b@66-208-246-34-ubr02b-waldlk01-mi.hfc.comcastbusiness.net] has joined #ruby
<`brendan> morning
<manhunter> is there any offtopic channel for ruby?
<shevy> manhunter sure. every non-ruby channel.
le-mon_g [le-mon_g!~yazou@s15769874.onlinehome-server.info] has joined #ruby
GoogleGuy [GoogleGuy!~ChromeOS@unaffiliated/googleguy] has joined #ruby
<shevy> mylifeisfine, seems you don't get rid of .strip ;)
<mylifeisfine> def (text)? self.role.title.strip.eql? "Retiree" end
<shevy> what is the ()
<RubyPanther> def retired? ; !!(self.role.title =~ /\A\s*retired\s*\Z/i) end
<shevy> you do know that
<shevy> def foo(arg) is the usual convention right? :P
<mylifeisfine> shevy: def (text)? self.role.title.strip.eql? "Retiree" end
<shevy> !!!
<shevy> what are you doing man!
<mylifeisfine> RubyPanther: if i wanna pass an argument? thats why i have (parameter)
<mylifeisfine> def (text)? self.role.title.strip.eql? "text" end
<RubyPanther> def can_haz? stuffs; !!(self.role.title =~ /\A\s*#{stuffs}\s*\Z/i) end
<shevy> !!!!!!!!!!!!!!!!
<mylifeisfine> RubyPanther: ^
<shevy> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<mylifeisfine> shevy: what happened? does the method make sense now ?
<shevy> this is not valid ruby man
<RubyPanther> the good news, at least it isn't valid python, either
<mylifeisfine> shevy: then how will the method be ? :( I am a learner forgiv me
<shevy> mylifeisfine a method needs a name, right?
<shevy> and the name comes first after "def" ok?
<RubyPanther> mylifeisfine: the ? is just part of the name, you can also use ! at the end :)
<shevy> and after you gave it a name, you can define what arguments it takes
<mylifeisfine> shevy: sorry missed to add it : here you go def role_name(text)? self.role.title.strip.eql? "text" end
thecreators [thecreators!~rskagy@cpe-65-27-201-150.cinci.res.rr.com] has joined #ruby
<mylifeisfine> RubyPanther: please define the correct method :( am tired :)
<shevy> that is a bit better mylifeisfine
xperience [xperience!~xperience@rrcs-97-78-155-76.se.biz.rr.com] has joined #ruby
<shevy> but
<shevy> it is still not correct
<mylifeisfine> shevy: is that correct the king of ruby shevy ?? :)
<mylifeisfine> shevy: why so ?
<shevy> you need to start reading what people type man
<RubyPanther> mylifeisfine: take off the quotes and you're there, assuming whitespace
<shevy> <RubyPanther> mylifeisfine: the ? is just part of the name, you can also use ! at the end :)
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
<shevy> the "?" is part of the name
jtrudeau [jtrudeau!~jeff@75-150-71-83-NewEngland.hfc.comcastbusiness.net] has joined #ruby
<shevy> def role_name(text)? must be def role_name?(text)
<mylifeisfine> shevy: its a boolean method returning true or false so I added ? is it wrong/
<mylifeisfine> shevy: ok got it :)
<shevy> look man
<shevy> ruby does not care if it is a boolean method or not
<shevy> it is just part of the method name
<shevy> it is a convention by people that a method with a "?" should return a boolean value
<shevy> but ruby itself cares 0 about this convention
<mylifeisfine> shevy: then why do ppl use ? after method name.. ??
<shevy> ask them
<mylifeisfine> shevy: ok got it
<shevy> perhaps they like to think with that scheme
<shevy> when you look at other people's code, you could assume that it returns a bool
<shevy> I myself use it more in the context of a query
<canton7> it's just convention -- you can tell, just by looking at the method name, that it's going to return a boolean
dross [dross!~dross@unaffiliated/dross] has joined #ruby
<shevy> def colour?
<shevy> return @colour
<shevy> end
tesmar [tesmar!~tesmar@rrcs-70-62-109-131.midsouth.biz.rr.com] has joined #ruby
<mylifeisfine> shevy: there was one more mistake in my function that u missed to catch hold of it shud have been self.role.title.strip.eql? text rather than self.role.title.strip.eql? "text"
<shevy> yeah man
<shevy> it is a pyramid build on top of straw
<shevy> :)
<mylifeisfine> shevy: :) thanks for yor help now my method is lkike this finally
philcrissman [philcrissman!~philcriss@206.57.45.116] has joined #ruby
<mylifeisfine> def role_name?(role) self.role.title.strip.eql?role end
<shevy> see? you get better quickly
<mylifeisfine> so i can do if current_user?("Retired")
<mylifeisfine> shevy: thanks for your help ^ thats ryt no ?
<RubyPanther> class Woah ; define_method :'!derp??' do |xxx|; "uhmm.... %s" % xxx end end ; Woah.new.send '!derp??', !!?!??!:??=> "uhmm.... !"
atmosx [atmosx!~atmosx@kovo.d-net.cz] has joined #ruby
aBionic [aBionic!~abhishekk@14.140.107.130] has joined #ruby
sj26 [sj26!sj26@sj26.com] has joined #ruby
<RubyPanther> brought to you by the letter wtf
clockwize [clockwize!~clockwize@81.19.48.130] has joined #ruby
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
ePirat [ePirat!~ePirat@p4FC5DA0A.dip.t-dialin.net] has joined #ruby
ePirat [ePirat!~ePirat@unaffiliated/epirat] has joined #ruby
stylewalka [stylewalka!~michelk@mail.interoil.ch] has joined #ruby
<atmosx> is there any way to align this output? http://pastebin.com/yWcpz7ue
<atmosx> I tried double \t in puts but looks equally bad as single <tab> \t
<stylewalka> Hi, I'am new to ruby; I would like to parse a file, which looks like: "KEY1 {attr1 = value1 \n KEY2 {attr2 = value2}}" Thanks for any pointers or suggestions
dkr [dkr!~dkr@67.132.255.16] has joined #ruby
<shevy> atmosx you can use sprintf perhaps
<banister_> stylewalka: ruby doesnt have pointers
<atmosx> sprintf ?
<atmosx> hmmm
<shevy> atmosx, '%3s' % '1' will become ' 1'
<atmosx> using the same syntax?
<shevy> atmosx:
<shevy> x = 'abc'
v0n [v0n!~v4n@2607:fad8:4:0:21e:8cff:fe4d:2f7d] has joined #ruby
<shevy> '%15s' % x # => " abc"
<shevy> you see how it works?
<shevy> I would re-assemble the "Table: #{x}\t\tEntries: #{count}\tLast Tweet: #{date}"
<shevy> but you can embed the % into it too
radmacd [radmacd!~radmacd@cable-mtl-24.246.173-210.electronicbox.net] has joined #ruby
<shevy> I just hate to see many #{} in strings :P
fortysixandtwo [fortysixandtwo!~textual@77.40.186.166] has joined #ruby
bbttxu [bbttxu!~adam@pool-71-96-208-205.dfw.dsl-w.verizon.net] has joined #ruby
strife25 [strife25!strife25@nat/ibm/x-djroofsklqvoblcz] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
<atmosx> shevy: yeah got it
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
<atmosx> shevy: but isn't that the 'standard' way of doing it? printf and variations reminds me of 'C'
<atmosx> not that I'm good with it, but I can write simple things
<shevy> hmm dunno, there are more ways
ChampS666 [ChampS666!~ChampS@wlan1-125.zw.fh-zwickau.de] has joined #ruby
<shevy> .align or .pad or .ljust or something like that
<shevy> or was it .center
<shevy> :P
<shevy> in python it could work like:
<shevy> string = "%s %d\t%3.2f %-8s" % ("Values:",42,56.89732,"tot")
<shevy> in perl ...
<shevy> $result = sprintf("%08d", $number);
akem [akem!~akem@unaffiliated/akem] has joined #ruby
fermion [fermion!~fermion@4.59.1.2] has joined #ruby
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
<shevy> hah
<shevy> in PHP ...
<shevy> $anzahl = 5; $ort = 'Baum'; $format = 'Es sind %d Affen auf dem %s'; printf($format, $anzahl, $ort);
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
<atmosx> shevy: excellent thanks :-D
sbanwart [sbanwart!~sbanwart@66.6.175.18] has joined #ruby
<shevy> I think sprintf() is ok
<shevy> though I myself use mostly % when I have to do formatting
<shevy> there is some gem that focuses on string formatting too, I think
<atmosx> well yeah but requiring an extra gem is a kind of pain
<shevy> true
<shevy> :)
elliot98 [elliot98!~elliot@87.68.159.165] has joined #ruby
elliot98 [elliot98!~elliot@unaffiliated/elliot98] has joined #ruby
cantbecool [cantbecool!~cantbecoo@38.98.246.130] has joined #ruby
<mylifeisfine> shevy: if user.role_title?(text) similarly to see if "not equal to" i must do if !user.role.title?(text) am I ryt ?? :)
enroxorz [enroxorz!~enroxorz@unaffiliated/enroxorz] has joined #ruby
fortysixandtwo [fortysixandtwo!~fortysixa@77.40.186.166] has joined #ruby
moshee [moshee!~moshee@c-50-135-229-127.hsd1.wa.comcast.net] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
workmad3_ [workmad3_!~workmad3@vpn49.its.manchester.ac.uk] has joined #ruby
yekta [yekta!~yekta@c-24-1-182-219.hsd1.il.comcast.net] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
manhunter [manhunter!~manhunter@unaffiliated/manhunter] has quit [#ruby]
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has joined #ruby
whlie [whlie!~yaaic@201.255.230.188] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has quit [#ruby]
nacengineer [nacengineer!~dsoutha@165.219.88.72] has joined #ruby
bwlang [bwlang!~anonymous@70-91-134-14-ma-ne.hfc.comcastbusiness.net] has joined #ruby
wenbert [wenbert!~wenbert@120.28.231.65] has joined #ruby
strife25 [strife25!strife25@nat/ibm/x-hpdbneelwjeahchn] has joined #ruby
notjohn [notjohn!~john@cpe-174-103-133-37.cinci.res.rr.com] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
glacius0 [glacius0!~glacius@remote.pba.edu] has joined #ruby
cmasseraf [cmasseraf!~ColdFusio@187.106.195.233] has joined #ruby
kf8a [kf8a!~kf8a@user-33c730.user.msu.edu] has joined #ruby
openpercept [openpercept!~openperce@fedora/openpercept] has joined #ruby
enroxorz [enroxorz!~enroxorz@unaffiliated/enroxorz] has quit [#ruby]
<glacius0> Hi guys I am having an issue with some regex, i am so close to getting the result i want but it seems to be escaping me, could you please take a look http://pastie.org/3237135
centipedefarmer_ [centipedefarmer_!~centipede@71-34-164-159.desm.qwest.net] has joined #ruby
SegFault1X [SegFault1X!~SegFaultA@c-98-248-241-85.hsd1.ca.comcast.net] has joined #ruby
<canton7> rubular.com is handy
jasonseifer [jasonseifer!~jason@rrcs-97-79-57-135.se.biz.rr.com] has joined #ruby
<shevy> yea
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
geekbri [geekbri!~geekbri@208.252.10.190] has joined #ruby
vraa [vraa!~vraa@c-76-30-135-64.hsd1.tx.comcast.net] has joined #ruby
geekbri [geekbri!~geekbri@208.252.10.190] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<stylewalka> q
alexhanh [alexhanh!~alexhanh@li358-26.members.linode.com] has joined #ruby
<alexhanh> what was the super short syntax (without even {}-block) for .map?
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
cirbri [cirbri!~chayes@rabbit.dbplc.com] has joined #ruby
<shevy> alexhanh hmmm
<shevy> for .map really?
<shevy> .map(&:capitalize) perhaps
<alexhanh> oh that shiet, wow
andrewpthorp [andrewpthorp!~andrewpth@c-98-244-88-92.hsd1.va.comcast.net] has joined #ruby
<alexhanh> awww yea, thanks bromingo
<alexhanh> herp derp
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
alexhanh [alexhanh!~alexhanh@li358-26.members.linode.com] has quit [#ruby]
Evixion` [Evixion`!Evixion@tn-67-236-5-224.dhcp.embarqhsd.net] has joined #ruby
mkscrg [mkscrg!~mkscrg@pool-108-41-134-165.nycmny.fios.verizon.net] has joined #ruby
<cirbri> Hi there, does anyone know whether Ruby's regexps have a special key for what number of matches it's made so far... erm, like this .gsub(/s/, "\nth replacement")
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
azbarcea__ [azbarcea__!~quassel@79.114.19.188] has joined #ruby
<canton7> cirbri, use the block syntax of gsub, maybe?
Evixion [Evixion!Evixion@tn-67-236-5-224.dhcp.embarqhsd.net] has joined #ruby
<[[thufir]]> mailIds = imap.search(['ALL']) #how do you know what options are for 'ALL'? what else is there?
<[[thufir]]> 'LESS_THAN_X'?
<[[thufir]]> first 20?
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
Sailias [Sailias!~jonathan@s72-38-77-178.static.comm.cgocable.net] has joined #ruby
maasha [maasha!82e1d33d@gateway/web/freenode/ip.130.225.211.61] has joined #ruby
<maasha> hey. is there a smart way to detect the number of available cores to use for max threading of an app?
llaskin [llaskin!~Leo@c-24-128-198-93.hsd1.ma.comcast.net] has joined #ruby
<Muz> maasha: https://github.com/puppetlabs/facter may be of interest
<llaskin> given that actions is an Array with 3 elements all of type WrappedWebElement why, when I run actions.each{|action|} does each action element become an array whcih has element[0] = Fixnum(0) and element[1] = WrappedWebElement?
vladyn [vladyn!~Adium@78.83.241.70] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@host-208-68-238-122.biznesshosting.net] has joined #ruby
andrewhl [andrewhl!~andrew@24-246-14-26.cable.teksavvy.com] has joined #ruby
vladyn [vladyn!~Adium@78.83.241.70] has quit [#ruby]
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<cirbri> canton7: Yeah, I've done something along those lines -- thanks.
<canton7> llaskin, I've no idea what WrappedWebElements are, but .each doesn't modify the array it was called on, so no, nothing will change
<llaskin> canton7: so how can I get each element of the array by itself?
<llaskin> short of doing a for loop or some such?
<Sailias> llaskin, gist your code plus the output
<robert_> is there a ruby library that can read theora and vorbis which lets me stream it out over http?
<JonnieCache> you dont need to read the vorbis format to stream it over htto
<JonnieCache> http*
<JonnieCache> you just push the data down the wire
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<shevy> like how to feed a duck
<llaskin> slightly modified but basically the gist of it
<shevy> right JonnieCache!!!
<robert_> yeah, but I'm streaming multiple videos as one long video.
<robert_> I want to be able to avoid re-sending the headers each and every time
ZAQfx [ZAQfx!~fx@62.28.43.207] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
<JonnieCache> perhaps it would be easier to just chop off the headers with some simple code, rather than firing up a whole decoder suite
<canton7> llaskin, if nothing else, assume the first two if's are false, and the last one is true. Then actions is [nil, nil, something], which probably isn't what you want
<JonnieCache> but im not a video streaming expert
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby
<canton7> that said, each action is itself an array
<Sailias> llaskin, can you add a1.inspect to that?
<Sailias> llaskin, sorry, add a1, a2, a3 and inspect each
<Sailias> one of them is an array
stylewalka [stylewalka!~michelk@mail.interoil.ch] has joined #ruby
<llaskin> inside the if statements?
<Sailias> at the top, in a new file or something
<llaskin> ok put it right above the if
rippa [rippa!~rippa@109-161-78-207.pppoe.yaroslavl.ru] has joined #ruby
wroathe [wroathe!~wroathe@75-146-189-233-Minnesota.hfc.comcastbusiness.net] has joined #ruby
<llaskin> a1.inspect prints out nothing
<llaskin> but when I put a watch on it, in the IDE I am using, it definitely contains a wrapped wab element....
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<Sailias> llaskin, either a1, a2 or a3 is adding an array inside "actions". You can call actions.flatten.each if you wanted to add multiple elements into it or you can find out why you are adding an array and not expecting it
<canton7> It's probably best, in the long run, to figure out what's actually going on
eggs [eggs!~user@c-75-73-66-205.hsd1.mn.comcast.net] has quit ["ERC Version 5.3 (IRC client for Emacs)"]
a_a_g [a_a_g!~aag@203.123.164.34] has quit [#ruby]
<llaskin> ok
<Sailias> canton7, i always suggest a proper fix as an "option." But to me it's not an option, you should always understand what's happening :)
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
LMolr [LMolr!~quassel@87.19.33.245] has joined #ruby
banister`sleep [banister`sleep!~baniseter@118.82.185.158] has joined #ruby
palcu [palcu!~alex@89.122.187.223] has joined #ruby
bbttxu [bbttxu!~adam@dynamic-129-120-52-214.dynamic.unt.edu] has joined #ruby
notjohn [notjohn!~john@cpe-75-186-45-168.cinci.res.rr.com] has joined #ruby
dazoakley [dazoakley!~dazoakley@hocuspokus.vm.bytemark.co.uk] has joined #ruby
statix [statix!~statix@rrcs-208-125-52-150.nys.biz.rr.com] has joined #ruby
iamjarvo [iamjarvo!~Adium@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
Dangr_ [Dangr_!~sseellff@173-161-51-209-Illinois.hfc.comcastbusiness.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
tsd_usa [tsd_usa!~daniel_d@cpe-74-66-139-160.nyc.res.rr.com] has joined #ruby
beakerman [beakerman!~beakerman@c-76-118-172-173.hsd1.nh.comcast.net] has joined #ruby
moshef [moshef!~moshe@62.219.110.225] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<moshef> hi guys. i have array of hashes and each hash has 2 keys
<moshef> i have another array i want to merge with the first one. but if certain value (id of something) is already in the first one - just add to the hash, don't create another hash
<moshef> how do i do that?
endzYme [endzYme!~nehuanca@205.169.68.218] has joined #ruby
<moshef> guess i could also just add everything and then combine it somehow?
jackerran [jackerran!~jackerran@fw.luckie.net] has joined #ruby
ChampS666 [ChampS666!~ChampS@141.32.23.150] has joined #ruby
asteve [asteve!~asteve@unaffiliated/kxsteve] has joined #ruby
dnyy [dnyy!~dnyy@c-98-237-138-38.hsd1.wa.comcast.net] has joined #ruby
robyurkowski [robyurkowski!~robyurkow@64.254.250.82] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
adamjleonard [adamjleonard!~adamjleon@pool-108-9-169-222.tampfl.fios.verizon.net] has joined #ruby
nyuszika7h [nyuszika7h!nyuszika7h@unaffiliated/nyuszika7h] has joined #ruby
tobym [tobym!~tobym@pool-173-56-80-136.nycmny.fios.verizon.net] has joined #ruby
aenimus [aenimus!~aenimus@46.147.3.28] has joined #ruby
asteve [asteve!~asteve@unaffiliated/kxsteve] has quit [#ruby]
tobym [tobym!~tobym@pool-173-56-80-136.nycmny.fios.verizon.net] has joined #ruby
<canton7> moshef, don't quite get the question. Do all the hashes have the same keys?
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
blizzow [blizzow!~jburns@67.50.165.58] has quit [#ruby]
pootpoot [pootpoot!~pootpoot@38.108.250.130] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
fayimora [fayimora!~fayimora@lt38-201.eecs.qmul.ac.uk] has joined #ruby
<moshef> canton7: they do
<moshef> but some of them share the same value
<canton7> moshef, give me an example of two hashes? {:id => :something, :key => :val}, and {:id => :something, :key2 => :val2} ?
<moshef> canton7: just a second
provideal [provideal!~hornp@p4FFF8371.dip.t-dialin.net] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-170-217.ard.bellsouth.net] has joined #ruby
luxurymode [luxurymode!~luxurymod@rrcs-184-75-21-21.nyc.biz.rr.com] has joined #ruby
<luxurymode> Any obvious reason why puts Dir[File.join(path, '**', "*.{jpg, JPG}")].count is printing thousands less than i know it should? ;)
<luxurymode> am i doing the recursive thing correctly?
jgarvey [jgarvey!~jgarvey@cpe-174-097-248-211.nc.res.rr.com] has joined #ruby
spanner [spanner!~quassel@128.249.96.10] has joined #ruby
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
charlenopires [charlenopires!~quassel@186.194.13.186] has joined #ruby
milkpost [milkpost!~dec@192.133.84.6] has joined #ruby
ikaros [ikaros!~ikaros@dslb-188-107-220-229.pools.arcor-ip.net] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
moshef [moshef!~moshe@62.219.110.225] has joined #ruby
llaskin1 [llaskin1!~Leo@c-24-128-198-93.hsd1.ma.comcast.net] has joined #ruby
rooijaro_ [rooijaro_!~rooijaro_@216.55.51.54] has joined #ruby
Dangr_ [Dangr_!~sseellff@173-161-51-209-Illinois.hfc.comcastbusiness.net] has joined #ruby
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
<heftig> luxurymode: more than two variations of case?
supergiantrobot_ [supergiantrobot_!~supergian@cpe-174-097-169-208.nc.res.rr.com] has joined #ruby
<heftig> files ending in .jpeg or .jpe?
<luxurymode> heftig, nope apparently in my actual scrip i had spaces between the commas so that was the problem
<luxurymode> it was trying to find '*. JPG'
<luxurymode> instead of '*.JPG'
<heftig> ah, that
<heftig> yes.
<luxurymode> hehe thanks though
moshef [moshef!~moshe@62.219.110.225] has joined #ruby
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby
<rippa> luxurymode: and still got some matches?
llaskin1 [llaskin1!~Leo@c-24-128-198-93.hsd1.ma.comcast.net] has quit [#ruby]
<luxurymode> yeah was just thinking about that
<luxurymode> it did
<luxurymode> which is disturbing
<luxurymode> with spaces, i get 4000 hits
<luxurymode> without i get 10K+
<heftig> it still matched *.jpg
techhelp [techhelp!~Dan@firebox.rsmart.com] has joined #ruby
<moshef> canton7: hi, are you still around?
<canton7> hey, yeah
<moshef> first array looks like - [{:id => 12, :key => 'value'}, {:id => 13, :key => 'value2'}]
<moshef> second array looks like = [{:id => 12, :another_key => 'another_value'}, {:id => 14, :another_key => 'another_value'}]
p0y [p0y!~p0y@112.210.118.164] has joined #ruby
stringoO [stringoO!~JLstring@bas1-toronto42-1279598654.dsl.bell.ca] has joined #ruby
<moshef> what i'd like is to have a final array with something like [{:id => 12, :key => 'value', :another_key => 'another_value'}]
notjohn_ [notjohn_!~john@cpe-75-186-45-168.cinci.res.rr.com] has joined #ruby
<luxurymode> heftig, ah right. so does this mean that if i go without spaces im missing some
<luxurymode> ?
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<moshef> canton7: hope i was clear :)
<rippa> moshef: just use Hash#merge
<heftig> luxurymode: no.
<heftig> {jpg,JPG} is right
<luxurymode> k, thats wat i thought
<luxurymode> thanks heftig
<canton7> moshef yup that's clear. one min
<moshef> canton7: awesome, thanks
<luxurymode> heftig, just found 3800 duplicates :)
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
<heftig> luxurymode: Dir.glob("*/foobar", File::FNM_CASEFOLD) for case-insensitive globbing
<luxurymode> heftig, ah nice
<luxurymode> so i can get rid of the jpg,JPG
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
<luxurymode> found that i needed case-insensitive on a mac at least
<heftig> only windows is case-insensitive by default
<canton7> oks, so first off, I'd make the first array a hash, of the form {12 => {:key => 'value'}, 13 => {:key => 'value2}}. s = {}; array.each{ |a| s[a.delete(:id)] = a } would work
<canton7> moshef, ^^
<canton7> then you can do something like.. ang on, I'll pastebin
<heftig> using hash.merge
<moshef> awesome, thanks
airhorns [airhorns!~airhorns@67.210.173.114] has joined #ruby
jmuniz [jmuniz!~jmuniz@148.84.93.58] has joined #ruby
jergason [jergason!~jergason@128.187.186.2] has joined #ruby
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
alx- [alx-!~Alex@108.162.180.72] has joined #ruby
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
Synthead [Synthead!~max@50-76-231-54-static.hfc.comcastbusiness.net] has joined #ruby
<canton7> moshef, http://pastie.org/3237748
<moshef> canton7: awesome, checking out
kjs3 [kjs3!~kseefried@174.47.62.3] has joined #ruby
<canton7> rewritten to be a bit slimmer
MetaCosm [MetaCosm!u514@gateway/web/irccloud.com/x-ukpxjfeodgolbzmo] has joined #ruby
<moshef> canton7: k, but i might have another great solution :0
<moshef> :)
<canton7> hehe, cool
fcoury [fcoury!u2238@gateway/web/irccloud.com/x-npzlqfjdoezbaqrg] has joined #ruby
crankycoder [crankycoder!~crankycod@out-on-232.wireless.telus.com] has joined #ruby
imbric [imbric!~chris@seas685.wireless-pennnet.upenn.edu] has joined #ruby
zakwilson [zakwilson!~quassel@97-117-183-89.phnx.qwest.net] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
techhelp [techhelp!~Dan@firebox.rsmart.com] has quit ["Leaving"]
jaysern [jaysern!~jaysern@108-90-40-248.lightspeed.sntcca.sbcglobal.net] has joined #ruby
pootpoot [pootpoot!~pootpoot@38.108.250.130] has joined #ruby
dfr|work [dfr|work!dfr|work@nat/google/x-rqapywkuowwsbpar] has joined #ruby
youdonotexist [youdonotexist!~youdonote@192.206.158.10] has joined #ruby
evantravers [evantravers!~textual@fw.luckie.net] has joined #ruby
p0y [p0y!~p0y@125.212.56.114] has joined #ruby
blueadept [blueadept!~blueadept@pool-96-251-83-184.lsanca.dsl-w.verizon.net] has joined #ruby
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
azbarcea_____ [azbarcea_____!~quassel@79.114.90.133] has joined #ruby
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has quit [#ruby]
daniel_hinojosa [daniel_hinojosa!~danno@67-0-117-93.albq.qwest.net] has joined #ruby
denysonique_ [denysonique_!u484@gateway/web/irccloud.com/x-wunfwobwbwbdqeia] has joined #ruby
MoMo [MoMo!u1590@gateway/web/irccloud.com/x-ikgopkepscoysjpt] has joined #ruby
ziggles [ziggles!~ziggles@173-11-100-54-SFBA.hfc.comcastbusiness.net] has joined #ruby
blooberr [blooberr!u5163@gateway/web/irccloud.com/x-inphcchfekntacyo] has joined #ruby
hornairs [hornairs!~airhorns@67.210.173.114] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
d2dchat [d2dchat!~d2dchat@173-167-14-1-michigan.hfc.comcastbusiness.net] has joined #ruby
GSpotAssassin [GSpotAssassin!u4086@gateway/web/irccloud.com/x-ukiowaqiziyqakxq] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
MetaCosm [MetaCosm!u514@gateway/web/irccloud.com/x-joqnthsywnlyahdr] has joined #ruby
notbrent [notbrent!u5121@gateway/web/irccloud.com/x-ykkipvwxhjkavjuk] has joined #ruby
moeSeth [moeSeth!u1029@gateway/web/irccloud.com/x-fuexzofdlytnozwy] has joined #ruby
centipedefarmer_ [centipedefarmer_!~centipede@71-34-164-159.desm.qwest.net] has joined #ruby
stephans [stephans!~stephans@2602:304:cd9d:1180:1982:c56f:570f:9f34] has joined #ruby
jsonperl [jsonperl!4a0808ce@gateway/web/freenode/ip.74.8.8.206] has joined #ruby
<jsonperl> im having a problem with data_get_struct... i think i'm not understanding correctly
amar_key [amar_key!u2605@gateway/web/irccloud.com/x-ojxkhallrgraunkb] has joined #ruby
<jsonperl> in my initialization process i set up a zone struct and store it
<jsonperl> Data_Wrap_Struct(cZone, NULL, free_chunks, &zone);
Shamgar [Shamgar!~mbainter@sourcemage/mage/Shamgar] has joined #ruby
<jsonperl> my attempt at retrieving:
<jsonperl> static Zone get_zone_struct(VALUE self) { Zone *z; Data_Get_Struct(self, Zone, z);
newbold [newbold!u5179@gateway/web/irccloud.com/x-kcydcgegrjsvvbgs] has joined #ruby
<jsonperl> since that method is defined with rb_define_method though, self is an instance of the class
<jsonperl> which seems incorrect
yekta [yekta!~yekta@c-24-1-182-219.hsd1.il.comcast.net] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
josefig [josefig!~josef@189.154.66.64] has joined #ruby
josefig [josefig!~josef@unaffiliated/josefig] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
cantbecool [cantbecool!~cantbecoo@38.98.246.130] has joined #ruby
boodle [boodle!~boodle@174.46.129.34] has joined #ruby
RegEchse [RegEchse!~regechse@h1985974.stratoserver.net] has joined #ruby
tvw [tvw!~tv@89.204.137.58] has joined #ruby
airhorns [airhorns!~airhorns@67.210.173.114] has joined #ruby
pooja [pooja!u4977@gateway/web/irccloud.com/x-dymgsbpxgbdslyoi] has joined #ruby
hashpuppy [hashpuppy!~hashpuppy@unaffiliated/hashpuppy] has joined #ruby
<hashpuppy> i have an array of strings. i want to return false as soon as one of these strings is not a number. what method am i looking for?
tomzx [tomzx!~tomzx@dsl-136-35.aei.ca] has joined #ruby
<hashpuppy> otherwise true
CreativeEmbassy [CreativeEmbassy!~CreativeE@h142.127.232.68.dynamic.ip.windstream.net] has joined #ruby
SeanTAllen [SeanTAllen!u4855@gateway/web/irccloud.com/x-dvvnvnohenemyelc] has joined #ruby
jsonperl1 [jsonperl1!~Adium@74.8.8.206] has joined #ruby
mgolisch [mgolisch!~michi@85.93.11.18] has joined #ruby
savage- [savage-!~savage-@istep.static.monkeybrains.net] has joined #ruby
apeiros_ [apeiros_!~apeiros@77-58-113-31.dclient.hispeed.ch] has joined #ruby
<mgolisch> is there some way to execute a ruby script without the interpreter trying to run it using the shebang in the file?
dkannan [dkannan!u480@gateway/web/irccloud.com/x-oyyefzyubaymeieu] has joined #ruby
<Hanmac> hashpuppy: array.all? {|s| s.match(/\d+/) }
<apeiros_> mgolisch: you can also use `ruby myscript.rb`
<hashpuppy> Hanmac: thanks!
flagg0204 [flagg0204!~ianderson@sea02-v600-nat.marchex.com] has joined #ruby
<mgolisch> iam running it like so ruby.exe somescript someargs
<mgolisch> and for some reason it tries to execute it using whatever is in the shebang line
<apeiros_> mgolisch: that should definitively not be the case
<apeiros_> how do you figure?
savage- [savage-!~savage-@istep.static.monkeybrains.net] has joined #ruby
apok [apok!~apok@96.24.67.22] has joined #ruby
<mgolisch> apeiros_: hm i call it like that and it says cannot exec foo fatal
flagg0204 [flagg0204!~ianderson@sea02-v600-nat.marchex.com] has joined #ruby
thepix [thepix!~pix@static-81-219-160-123.devs.futuro.pl] has joined #ruby
tsd_usa [tsd_usa!~daniel_d@cpe-74-66-139-160.nyc.res.rr.com] has joined #ruby
<mgolisch> it has no rb extension though
<mgolisch> maybe thats why
<apeiros_> no, that shouldn't matter
devdazed [devdazed!~devdazed@static-96-239-59-191.nycmny.fios.verizon.net] has joined #ruby
jergason [jergason!~jergason@otherlab.cs.byu.edu] has joined #ruby
quest88 [quest88!~quest88@12.181.53.123] has joined #ruby
devdazed [devdazed!~devdazed@static-96-239-59-191.nycmny.fios.verizon.net] has quit [#ruby]
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
davidboy [davidboy!u3228@gateway/web/irccloud.com/x-czgprgxkfnqvjtdc] has joined #ruby
relix [relix!u2146@gateway/web/irccloud.com/x-uagxstrrykvonjwd] has joined #ruby
devdazed [devdazed!~devdazed@static-96-239-59-191.nycmny.fios.verizon.net] has joined #ruby
fcoury [fcoury!u2238@gateway/web/irccloud.com/x-qmidrdguikmiqkoa] has joined #ruby
srid [srid!u3297@unaffiliated/srid] has joined #ruby
srid [srid!u3297@gateway/web/irccloud.com/x-ftafkmneqzkcfxvy] has joined #ruby
shaatar [shaatar!u648@gateway/web/irccloud.com/x-eunjqzedxyqojnke] has joined #ruby
enherit [enherit!~enherit@216.3.99.206] has joined #ruby
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby
Vendethiel [Vendethiel!~Vendethie@31.196.140.88.rev.sfr.net] has joined #ruby
kapowaz [kapowaz!u546@gateway/web/irccloud.com/x-hwbsklssspsgmuzl] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
flagg0204 [flagg0204!~ianderson@sea02-v600-nat.marchex.com] has joined #ruby
ChampS666 [ChampS666!~ChampS@wlan1-33.zw.fh-zwickau.de] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@74-84-107-90.client.mchsi.com] has joined #ruby
Planet_EN [Planet_EN!~nkhan@87.200.52.125] has joined #ruby
<Planet_EN> everytime I do rvm use 1.8.7 I get this: "RVM is not a function, selecting rubies with 'rvm use ...' will not work."
<Planet_EN> I know I should ask it in #rvm but seems like everyone's dead over there
MoMo [MoMo!u1590@gateway/web/irccloud.com/x-apgrmqgxfdhdrbax] has joined #ruby
eignerchris [eignerchris!~eignerchr@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
<mgolisch> hm seems like if a shebang exists it tries to run it using that
<mgolisch> is there some way to turn that off?
tsd_usa [tsd_usa!~daniel_d@cpe-74-66-139-160.nyc.res.rr.com] has joined #ruby
kenperkins [kenperkins!~textual@174-24-134-155.tukw.qwest.net] has joined #ruby
jergason [jergason!~jergason@otherlab.cs.byu.edu] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
crankycoder [crankycoder!~crankycod@24-246-44-226.cable.teksavvy.com] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
pdtpatrick [pdtpatrick!~pdtpatric@12.249.4.226] has joined #ruby
arnihermann [arnihermann!u1395@gateway/web/irccloud.com/x-czxulouzwbjyuogv] has joined #ruby
pvh [pvh!u717@gateway/web/irccloud.com/x-cyqczsuqwnshtpym] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
virunga [virunga!~virunga@151.64.63.250] has joined #ruby
centipedefarmer_ [centipedefarmer_!~centipede@74-84-107-90.client.mchsi.com] has joined #ruby
Targen [Targen!~iguana@159.90.11.250] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
RORgasm [RORgasm!~rorgasm@nyv-exweb.iac.com] has joined #ruby
RORgasm [RORgasm!~rorgasm@nyv-exweb.iac.com] has joined #ruby
gianlucadv [gianlucadv!~gianlucad@109.53.109.168] has joined #ruby
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
a_a_g [a_a_g!~aag@204.124.203.100] has joined #ruby
dnordstrom [dnordstrom!~dnordstro@h37059.upc-h.chello.nl] has joined #ruby
al3xnull [al3xnull!~al3xnull@cpe-76-188-178-7.neo.res.rr.com] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has quit [#ruby]
perturbedpanda [perturbedpanda!~perturbed@matthewabrown.com] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.184] has joined #ruby
maletor [maletor!~maletor@74.115.25.139] has joined #ruby
<Planet_EN> exit
al3xnull [al3xnull!~al3xnull@cpe-76-188-178-7.neo.res.rr.com] has joined #ruby
davidcelis [davidcelis!~david@70-89-180-6-smc-or.hfc.comcastbusiness.net] has joined #ruby
tsd_usa [tsd_usa!~daniel_d@cpe-74-66-139-160.nyc.res.rr.com] has quit [#ruby]
<mgolisch> perl seem to do the same
<mgolisch> why in hell would i want to interpret the shebang if i call the script using ruby..
a_a_g [a_a_g!~aag@204.124.203.100] has joined #ruby
a_a_g [a_a_g!~aag@204.124.203.100] has quit [#ruby]
bier [bier!~bier@p54A5AA45.dip.t-dialin.net] has joined #ruby
jcromartie [jcromartie!~jcromarti@c-69-140-238-182.hsd1.md.comcast.net] has joined #ruby
<jcromartie> halp
asuka [asuka!asuka@home.hadiko.uni-karlsruhe.de] has joined #ruby
<jcromartie> how do i have codes to make rails app plz email codes
<jcromartie> OK, but seriously. Is there a good place to read up on conventions for the file/folder structure of a Ruby command-line tool in regards to lib/bin directories, etc.?
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
eywu [eywu!~Adium@205-170-107-4.dia.static.qwest.net] has joined #ruby
<Gate> jcromartie: something like: http://guides.rubygems.org/patterns/
<jcromartie> awesome
<jcromartie> I have packaged things like this as a gem before
<jcromartie> that seems to be easy
<jcromartie> but this is a great guide
<jcromartie> now, if I am correct, RubyGems just sets up Ruby's lib path to include all of your installed gems' lib dirs?
<apeiros_> no, but the effect of what it actually does is similar
al3xnull [al3xnull!~al3xnull@cpe-76-188-178-7.neo.res.rr.com] has joined #ruby
<apeiros_> it also installs executables, and depending on your setup, they can be used directly
<jcromartie> ah, well yes it overloads require doesn't it?
<apeiros_> there's no overloading in ruby. it redefines it.
apok_ [apok_!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
<jcromartie> that's what I mean
<mgolisch> so could someone think of a way i could run my script without interpreting the shebang?
freelanceful [freelanceful!~jamesfend@c-71-228-225-167.hsd1.tn.comcast.net] has joined #ruby
<apeiros_> well, you could remove the shebang
DruMn [DruMn!~fland@46.109.100.148] has quit [#ruby]
<mgolisch> but i need it so it would be used when called from cygwin bash
<mgolisch> :(
voodoofish430 [voodoofish430!~mtorres@208.76.2.200] has joined #ruby
michael_mbp [michael_mbp!~Marin@95.66.67.135] has joined #ruby
krainboltgreene [krainboltgreene!u5202@gateway/web/irccloud.com/x-djzgsepetbzrzgmz] has joined #ruby
michaelgamble [michaelgamble!~michaelga@97.107.57.17] has joined #ruby
alfism [alfism!~alfism@2620:149:4:1201:549a:66f3:8b86:19c3] has joined #ruby
<jcromartie> let's say I am developing gems for my company: would it make sense to have each gem include a /lib/my_company/my_gem directory? or is that going to cause confusion?
<michaelgamble> Hey I'm a first time user of anything in ruby
<michaelgamble> i think its a ruby on rails project I'm trying to get running, but I'm hitting this wall
<jcromartie> i.e. when there are multiple gems like gem_x/lib/my_company/gem_x/ and gem_y/lib/my_company/gem_y/
<michaelgamble> would anyone mind checking that link and giving me an idea on how i might resolve the issue
RORgasm_ [RORgasm_!~rorgasm@nyv-exweb.iac.com] has joined #ruby
josh [josh!~josh@74-95-43-126-Oregon.hfc.comcastbusiness.net] has joined #ruby
<michaelgamble> rails
<michaelgamble> oops
<jcromartie> michaelgamble: did you try doing what the error message told you to do?
<jcromartie> https://github.com/roman/rots.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
<jcromartie> i.e., did you run "bundle install" yet?
<michaelgamble> yeah i tried that but when i ran the bundle install it would fail
<michaelgamble> I'm not exactly sure the error message, let me re-try and see what the message was
dasfugufish [dasfugufish!~Adium@174.27.233.214] has joined #ruby
kenichi [kenichi!~kenichi@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
kpshek [kpshek!~kpshek@159.140.254.97] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
<jaysern> how does the ruby interpreter know where to look for a module? is there a config file somewhere that specifics this? perhaps in /etc ?
SegFaultAX|work [SegFaultAX|work!~mkbernard@173.228.45.162] has joined #ruby
Araxia_ [Araxia_!~Araxia@173-164-68-213-Oregon.hfc.comcastbusiness.net] has joined #ruby
pootpoot [pootpoot!~pootpoot@38.108.250.130] has joined #ruby
<freelanceful> anyone know how to force_ssl for devise sign in pages?
<freelanceful> can't find anything
matthias_ [matthias_!~matthias@adsl-75-26-136-230.dsl.pltn13.sbcglobal.net] has joined #ruby
<matthias_> hey
kenichi [kenichi!~kenichi@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
<michaelgamble> ok so just so I'm understanding whats going on, i have a Gemfile, that is what outlines what installs during a "bundle install" command?
strife25 [strife25!strife25@nat/ibm/x-lkxffrlksrplazch] has joined #ruby
patricksroberts [patricksroberts!u3278@gateway/web/irccloud.com/x-zhdvzukkwnwurpch] has joined #ruby
<michaelgamble> (now I'm running bundle install and i get no error)
matled [matled!~matled@85.131.246.184] has joined #ruby
fermion [fermion!~fermion@206-15-64-254.static.twtelecom.net] has joined #ruby
<philcrissman> michaelgamble: yes; the Gemfile tells bundler what to install and/or update.
<jcromartie> jaysern: try here http://ruby-doc.org/docs/ProgrammingRuby/html/rubyworld.html in the section "Where Ruby Finds Its Modules"
<jcromartie> that's what I'm reading ATM
<jaysern> will do, thanks
Targen [Targen!~iguana@159.90.11.250] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
<michaelgamble> so here is my Gemfile
<michaelgamble> it seems to have reference to the rot repository in it.. so I'm not really sure why it would be asking for it
sepp2k [sepp2k!~sexy@g230249118.adsl.alicedsl.de] has joined #ruby
gentz [gentz!ilab@ancient.webfoundation.net] has joined #ruby
<michaelgamble> is it cause its in that "group" block that its not running that line?
adamkittelson [adamkittelson!~adamkitte@50.0.132.2] has joined #ruby
x77686d [x77686d!~whm@h-67-101-188-178.phndaz91.static.covad.net] has joined #ruby
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby
PhilK [PhilK!~PhilK@108-94-166-51.lightspeed.sntcca.sbcglobal.net] has joined #ruby
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
ninor [ninor!~ninor@unaffiliated/ninor] has joined #ruby
eywu [eywu!~Adium@205-170-107-4.dia.static.qwest.net] has quit [#ruby]
CoverSlide [CoverSlide!~richard@216.2.249.50] has joined #ruby
QKO_ [QKO_!~reaVer@banzai.speedxs.nl] has joined #ruby
stkowski [stkowski!~stkowski@ns25.8x8.com] has joined #ruby
bwlang [bwlang!~anonymous@70-91-134-14-ma-ne.hfc.comcastbusiness.net] has joined #ruby
gioele [gioele!~gioele@unaffiliated/gioele] has joined #ruby
csavola [csavola!~csavola@76-10-149-67.dsl.teksavvy.com] has joined #ruby
<CodeZombie> could someone take a look at this for me? I've put my question, and my scopes into a gist, since it's a pretty long question. https://gist.github.com/e77cbc76865e91c40a58
linoj_ [linoj_!~linoj@sn1-pat-1.m2s.com] has joined #ruby
elitheeli [elitheeli!~elitheeli@c-50-133-239-242.hsd1.ma.comcast.net] has joined #ruby
<elitheeli> Hi, ignoring all coding styles and best practices, is there a shorter (measured by number of characters) way to drop the first character from a string than "s=s[1..-1]"?
<epochwolf|vps> code golf is a sin against good design :/
nyuszika7h [nyuszika7h!nyuszika7h@unaffiliated/nyuszika7h] has joined #ruby
<apeiros_> s.shift
<apeiros_> oh, from a string
<apeiros_> s[0,1]="" # might be shorter
<apeiros_> oh, fun, since 1.9, s[0]="" works too
ghanima [ghanima!~ghanima@163.192.12.2] has joined #ruby
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby
<elitheeli> apeiros_: awesome, thanks
<elitheeli> epochwolf|vps: don't worry, it's not for a real project
gentz [gentz!ilab@ancient.webfoundation.net] has joined #ruby
<apeiros_> is it for a surreal project then?
<apeiros_> or an imaginary?
pdtpatrick [pdtpatrick!~pdtpatric@12.249.4.226] has joined #ruby
<davidcelis> absurdist, i hope
iamjarvo [iamjarvo!~Adium@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby
badabim [badabim!~badabim@17.212.166.202] has joined #ruby
<elitheeli> Writing the shortest cycle tag system emulator I can. Down to 61 characters, of which 15 are the input. Is there a better way to append a string to a string and then chop off the first character than "s<<t;s[0]=''"?
<luxurymode> isnt there a way to grab part of a regex, like /some reg(ex)/ and $0 will grab the ex?
<luxurymode> cant seem to get that to work
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
<elitheeli> luxurymode: if /some reg(ex)/ =~ string ; $1 ; end
crankycoder [crankycoder!~crankycod@out-on-136.wireless.telus.com] has joined #ruby
<apeiros_> luxurymode: string[/reg(ex)/, 1]
<apeiros_> avoid the $ vars. they're there, but they bite.
palcu [palcu!~alex@89.122.187.223] has joined #ruby
<luxurymode> elitheeli, thanks
<luxurymode> apeiros_, how so?
<apeiros_> luxurymode: uhm… just the way I showed you…? maybe? perhaps? eventually?
<elitheeli> luxurymode: magically set globar vars are rarely a good design decision
<elitheeli> global*
d3b4g [d3b4g!~d3b4g@123.176.25.98] has joined #ruby
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
<luxurymode> apeiros_, oh whoops, wasnt even realizing that it was a global var. yeah i avoid global vars in all languages
<luxurymode> not very OO
<elitheeli> apeiros_: next golf question: simultaneously printing a string and seeing if first char is a '1' (it'll be a '0' otherwise)… I have (p s)>'09'.
<Mon_Ouie> Why not just >'0'?
<Mon_Ouie> Which in Ruby 1.9 can be written as >?0
predator117 [predator117!~markus@p5080619E.dip.t-dialin.net] has joined #ruby
<elitheeli> Mon_Ouie: because '01'>'0'
<Mon_Ouie> Oh, nevermind
ChampS666 [ChampS666!~ChampS@p54B4A342.dip.t-dialin.net] has joined #ruby
adamkittelson [adamkittelson!~adamkitte@50.0.132.2] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<ninor> hi everyone. how's the ruby contract market where everyone's at?
bbttxu [bbttxu!~adam@dynamic-129-120-52-214.dynamic.unt.edu] has joined #ruby
zodiak [zodiak!~stef@pool-108-13-237-159.lsanca.fios.verizon.net] has joined #ruby
<ninor> im back in ruby after a few years away!
<luxurymode> where in Dir[File.join(path, '**', "*.{java}")] do i add File::FNM_CASEFOLD?
rushed [rushed!~rushed@cpe-70-116-11-35.austin.res.rr.com] has joined #ruby
<elitheeli> luxurymode: after the pattern
<luxurymode> what i thought but wasnt working
<luxurymode> might be a diff issue though
<elitheeli> it's a little more clear with #glob
<luxurymode> trying to figure it out
<elitheeli> luxurymode: I don't think Dir.[] takes flags, use Dir.glob
<luxurymode> elitheeli yeah keep getting `join': can't convert Fixnum into String (TypeError)
<elitheeli> is `path' a Fixnum?
p1d [p1d!~p1d@dslb-088-065-174-242.pools.arcor-ip.net] has joined #ruby
<luxurymode> elitheeli, no dont think so
LMolr [LMolr!~quassel@87.19.33.245] has joined #ruby
<luxurymode> im passing a file path on the command line...
<luxurymode> ARGV.each do |path|
<luxurymode> same problem with Dir.glob so somethings wrong.....
<elitheeli> luxurymode: why do you have {java} instead of just java?
<luxurymode> dunno, but it shouldnt matter
<elitheeli> luxurymode: can you put 'puts path.class.name' right before that line, just to ensure that they're strings?
cableray [cableray!~cableray@wl-dhcp183-127.Mines.EDU] has joined #ruby
jergason [jergason!~jergason@128.187.144.7] has joined #ruby
<luxurymode> String
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
shadoi [shadoi!~Adium@c-71-202-122-8.hsd1.ca.comcast.net] has joined #ruby
jbpros [jbpros!~jbpros@39-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
ronniemlr [ronniemlr!~Ronnie@c-98-255-5-80.hsd1.ca.comcast.net] has joined #ruby
banister`sleep [banister`sleep!~baniseter@118.82.185.158] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-39-233.mco.bellsouth.net] has joined #ruby
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby
apok_ [apok_!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
abentspoon [abentspoon!~micah@173.247.201.130] has joined #ruby
<elitheeli> Pull the File.join to its own line and ensure error happens there? If it still's happening, I'm stumped
<luxurymode> elitheeli, heres the full script https://gist.github.com/1664891
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
<elitheeli> luxurymode:
<elitheeli> the File::FNM… is in the wrong place
<luxurymode> oh ok
<luxurymode> where does it go?
<elitheeli> put it outside of the closing paren after File.join
<elitheeli> Dir.glob(File.join(…), File::FNM_CASEFOLD)
<luxurymode> im an idiot
<luxurymode> thanks
<luxurymode> was making it part of the regex
<luxurymode> whoops
dnyy [dnyy!~dnyy@c-98-237-138-38.hsd1.wa.comcast.net] has joined #ruby
<elitheeli> also if you give Dir.glob a block, it'll return nil
Avi` [Avi`!~mine@unaffiliated/avi/x-8629955] has joined #ruby
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
kjs31 [kjs31!~kseefried@174.47.62.3] has joined #ruby
aaroninfidel [aaroninfidel!~aaroninfi@69.38.220.155] has joined #ruby
pantsman [pantsman!~pantsman@2.25.187.234] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
manizzle [manizzle!~manizzle@pcp046799pcs.pcv.reshall.calpoly.edu] has joined #ruby
<aaroninfidel> hi there is there a ruby method to test a regexp pattern against a string and have it return 1 if it matched something or 0 if it didn't?
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<Seppman> good evening, whats the best way to implement calling a function by name, for examle have name of a function in an array, and call the function whichs name is in array[3]?
kpshek [kpshek!~kpshek@159.140.254.97] has joined #ruby
<rippa> aaroninfidel: what's wrong with default behaviour?
<aaroninfidel> rippa: what do you mean?
<rippa> string =~ /regexp/
* aaroninfidel is a total ruby noob
<rippa> returns nil if not matched
<rippa> or position if matched
jbw [jbw!~jbw@dsl-044-084.cust.imagine.ie] has joined #ruby
<Seppman> aaroninfidel: match? and test for nil
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
<apeiros_> Seppman: =~ is more efficient than .match for simple true/false matching
<rippa> why though?
<Seppman> apeiros_: ok, thanks
<aaroninfidel> Seppman: hmm
<aaroninfidel> Seppman: if I wrote a JavaScript example could you show me how to get the same result in Ruby?
<rippa> apeiros_: why is it more efficient?
<apeiros_> rippa: it doesn't need to build the matchdata obj
ckrailo [ckrailo!~ckrailo@208.86.167.247] has joined #ruby
<rippa> but it still saves that information
<rippa> in globals
<apeiros_> no
<Seppman> aaroninfidel: noe, due i dont know JS. but match and =~ essentially seem to do the same
andrewhl [andrewhl!~andrew@24-246-14-26.cable.teksavvy.com] has joined #ruby
<apeiros_> those are lazy
<rippa> oh
<rippa> nice
<rippa> so wait
<Seppman> just go with !nil is your beeing 1
<rippa> it makes a match again?
<rippa> to get that information
<rippa> or what
<apeiros_> just go with: if foo =~ /regex/ then
<apeiros_> no need to test for nilness
<apeiros_> rippa: afair it only constructs needed objects
<apeiros_> e.g. if you don't use $~, it won't create the matchdata object
invsblduck [invsblduck!~brett@173.227.0.2] has joined #ruby
<rippa> it looks ahead?
<apeiros_> if you don't use $1-9, it won't create the string objects referencing them
<apeiros_> rippa: no, global variables can actually be C functions
<apeiros_> check rubys C API
Ziioynx [Ziioynx!~nkondra@s207-216-243-126.bc.hsia.telus.net] has joined #ruby
<rippa> I just don't get how can interpreter know that $~ won't be used
<apeiros_> rippa: it doesn't need to know
<apeiros_> using $~ will invoke a C function
<apeiros_> that function will construct the matchdata if needed
<rippa> we, I thing i get it now
<rippa> it stores information about match, just doesn't build objects
<apeiros_> right
<apeiros_> at least it was that way in 1.8
<Seppman> whats the best way to implement calling a function by name, for examle have name of a function in an array, and call the function whichs name is in array[3]?
<rippa> send
<rippa> Kernel#send
<apeiros_> actually Object#send
<rippa> oops
<apeiros_> Kernel has the function-like stuff, Object has the OO stuff (things that rely on self)
<Seppman> thanks you both
<apeiros_> not that it mattered much, since docs cheat…
<Seppman> cause i want to implement some sort of irc bot and give him handlers in an array
btanaka [btanaka!~textual@17.245.90.55] has joined #ruby
<rippa> you can pass it method objects
<Seppman> method objects?
<_marvin> hi
<apeiros_> putsy = method(:puts); putsy.call("hi")
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
DarthGandalf [DarthGandalf!~Vetinari@znc/developer/DarthGandalf] has joined #ruby
<Seppman> ok, ill check those out too, thx
<apeiros_> though, blocks, really, they're the thing for callbacks
josefig [josefig!~josef@189.154.66.64] has joined #ruby
<Hanmac> apeiros_ if you are interested, it is possible with C-Gems to add hooks to global variables ... so an funcion is called when an global variable is set
<JonnieCache> yep use blocks
josefig [josefig!~josef@unaffiliated/josefig] has joined #ruby
<apeiros_> bot.on_privmsg(/hi #{botname}/) do |message| message.reply("howdy #{message.from.nickname}") end
<Seppman> apeiros_: so put the block into that array?
<JonnieCache> or tbh use all three its not hard to support all of those things
<apeiros_> Hanmac: I'm an enemy of globals, but thanks for the info :)
<apeiros_> Seppman: if you want it in an array - yes, you'd have to use either procs then or some other way.
daniel_hinojosa [daniel_hinojosa!~danno@67-0-117-93.albq.qwest.net] has joined #ruby
<Seppman> msg.match(/^PING :(.*)$/) ircbot.say "PONG #{$~[1]}" thats already what i'm doing
<Hanmac> and my favorite: "virtual" global variables: works like normal get and set, but does not hold an ruby-object it only calls the setted functions
ewag [ewag!~ewagner@office-gw.cmh.aotech.net] has joined #ruby
jhford [jhford!~freenode@johnford.info] has joined #ruby
jhford [jhford!~freenode@johnford.info] has quit ["Leaving..."]
Oddnoun [Oddnoun!~Oddnoun@cpe-75-180-25-150.columbus.res.rr.com] has joined #ruby
_marvin_ [_marvin_!u5316@gateway/web/irccloud.com/x-cbdmqmxgapgwdqas] has joined #ruby
<Seppman> ok, ill read about all those methods
<_marvin_> cool irccloud :)
<luxurymode> can i matcha regex on a file without using each_line?
<luxurymode> file.readlines?
<_marvin> i think with scan
<apeiros_> luxurymode: you can just read the complete file
<apeiros_> data = File.read(path)
<apeiros_> data =~ regex
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<_marvin> apeiros_, whats scan then useful for?
<apeiros_> _marvin: scan is on String, not on File.
Oddnoun_ [Oddnoun_!~Oddnoun@cpe-75-180-25-150.columbus.res.rr.com] has joined #ruby
<_marvin> doo :)
<luxurymode> apeiros_, thanks
hasrb [hasrb!~hasrb@108-85-134-26.lightspeed.austtx.sbcglobal.net] has joined #ruby
<luxurymode> how can i place a variable, e.g some string, passed in a block into a regex?
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
senny [senny!~senny@84-72-61-96.dclient.hispeed.ch] has joined #ruby
<luxurymode> like each do |foo| if data =~ /#foo/
<luxurymode> where #foo should be the passed var
<apeiros_> #{}
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
<apeiros_> like with strings
<luxurymode> inside the /?
<luxurymode> cool
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby
<apeiros_> notice that regex special chars are *not* escaped
<apeiros_> meaning a "." in foo will mean "any character", just as if you'd written it in the regex directly.
<rippa> Regexp.escape
<rippa> escapes
jlogsdon [jlogsdon!~jlogsdon@50.0.84.226] has joined #ruby
<elitheeli> luxurymode: you might want String#include? if the regex is just /#{foo}/ and foo will just be a string
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
TheSeparateFirst [TheSeparateFirst!~nullptr@ip72-220-216-224.sd.sd.cox.net] has joined #ruby
<luxurymode> elitheeli, gotcha. thanks
<luxurymode> now, how can i find a file if i know its base_name and i have the root path
theRoUS [theRoUS!KenCoar@nat/redhat/x-tdlpirtkuolsmkqu] has joined #ruby
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
sandstrom [sandstrom!~sandstrom@unaffiliated/sandstrom] has joined #ruby
cdepue [cdepue!~cdepue@186.8.171.186] has joined #ruby
<luxurymode> but it could be anywhere recursivel
<luxurymode> y
<luxurymode> just use glob?
cmasseraf [cmasseraf!~ColdFusio@187.106.195.233] has joined #ruby
kylemcgill [kylemcgill!~kylemcgil@static-ip-202-90-56-14.watchdog.net.nz] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
ChampS666 [ChampS666!~ChampS@p54B4BFF0.dip.t-dialin.net] has joined #ruby
seb_ [seb_!~seb@lns-bzn-45-82-65-166-115.adsl.proxad.net] has joined #ruby
wkh [wkh!~whenning@69.10.19.250] has joined #ruby
<shevy> luxurymode you can use
<gioele> luxurymode: Dir.glob('**/' + file, base) ?
<shevy> Dir['**/**'].reject {|x| x =~ /#{your_file_here}/
<shevy> }
<shevy> :)
<shevy> or rather, to Dir[] pass the path, + '**'
nd__ [nd__!~nd@mnhm-4d01a556.pool.mediaWays.net] has joined #ruby
<shevy> yeah glob should work too I think
jroes [jroes!~jroes@jroes.net] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<jroes> there a shorter way to get all the values from a dict other than STATES.map { |k,v| v } ?
<wkh> STATES.values?
<apeiros_> jroes: wow, it didn't occur to you to check Hash's docs?
<jroes> hahah
banister`sleep [banister`sleep!~baniseter@121-74-248-162.telstraclear.net] has joined #ruby
<jroes> well I looked through {}.methods and I guess I missed it
<jroes> sad day
notjohn [notjohn!~john@cpe-75-186-45-168.cinci.res.rr.com] has joined #ruby
<jroes> sorry to trouble y'all
jroes [jroes!~jroes@jroes.net] has quit [#ruby]
<luxurymode> gioele, where file is the root path?
sepp2k [sepp2k!~sexy@g230249118.adsl.alicedsl.de] has joined #ruby
Bzek [Bzek!~SK@access-46-42-16-55.kmtn.ru] has joined #ruby
crazed [crazed!~crazed@unaffiliated/cr4z3d] has joined #ruby
<gioele> luxurymode: sorry, `Dir.glob(base + '/**/' + file_you_want)`
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<luxurymode> gioele, thank you sir
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
crankycoder [crankycoder!~crankycod@out-on-136.wireless.telus.com] has joined #ruby
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
ayoub [ayoub!~ayoub@41.251.36.192] has joined #ruby
<gioele> luxurymode: have a look at my filepath gem if you are doing many path manipulations or file filtering operations
<luxurymode> gioele, whats the gem name?
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
<gioele> luxurymode: filepath :)
crazed [crazed!~crazed@unaffiliated/cr4z3d] has joined #ruby
lteo [lteo!~lteo@2607:f2f8:a288::2] has joined #ruby
gderebecki [gderebecki!~madmax@87-206-108-5.dynamic.chello.pl] has joined #ruby
senj [senj!~senj@S01060026f323bcdf.ed.shawcable.net] has joined #ruby
GreaseMonkey [GreaseMonkey!~gm@121-73-182-130.dsl.telstraclear.net] has joined #ruby
GreaseMonkey [GreaseMonkey!~gm@unaffiliated/greasemonkey] has joined #ruby
<shevy> lol
gen0cide_ [gen0cide_!~TigerBloo@67-207-96-206.static.wiline.com] has joined #ruby
<shevy> reminds me of "where are my glasses?" - "you were them on your head"
mikeric [mikeric!~mike@96.53.33.22] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
n8ji [n8ji!~n8ji@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
samsonjs [samsonjs!~samsonjs@S01060026f31b8198.gv.shawcable.net] has joined #ruby
davidpk [davidpk!~r00t@5e0a4e59.bb.sky.com] has joined #ruby
jbpros [jbpros!~jbpros@39-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
zalesz [zalesz!~zalesz@user-109-243-7-0.play-internet.pl] has joined #ruby
|PiP| [|PiP|!~PiP@CPE68efbdb817c9-CM0011aea71a92.cpe.net.cable.rogers.com] has joined #ruby
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
jaimef [jaimef!jaimef@dns.mauthesis.com] has joined #ruby
<jaimef> g
<epochwolf|vps> h
kjs3 [kjs3!~kseefried@174.47.62.3] has joined #ruby
banister`sleep [banister`sleep!~baniseter@118.82.185.158] has joined #ruby
axl_ [axl_!~axl@75-149-152-225-Minnesota.hfc.comcastbusiness.net] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
jrist [jrist!~jrist@184-96-202-249.hlrn.qwest.net] has joined #ruby
MaGiC_Reloaded [MaGiC_Reloaded!~MaGiC_Rel@188.26.254.34] has joined #ruby
<luxurymode> im searching through a bunch of java files with with this regex /public class .+ extends (.+)/ and i just wanted when i puts $1 when i see the string PLUS a space and the curly brace for opening the class "{"
vraa [vraa!~vraa@99-20-202-44.lightspeed.hstntx.sbcglobal.net] has joined #ruby
<luxurymode> how can i get exclude that? missing something basic in the regex here...
<Seppman> pip: to_s ?
<wroathe> Hey guys :) In the event that you've chained objects together (like in rails) and you're not sure if a particular object will have a method call is it better to use begin rescue end or test with respond_to?
* Seppman goes for a bed
<elitheeli> wroathe: the latter
<wroathe> Is there a reason? Or do you just prefer that?
<elitheeli> wroathe: more concise, faster, makes the semantic meaning more transparent
dnjaramba_ [dnjaramba_!~dnjaramba@41.72.193.86] has joined #ruby
<elitheeli> Although I tend to try to design things such that I always know the types of what I'm dealing with and thus what their methods are
<apeiros_> +1
<wroathe> Yeah. I inherited a codebaes that's over 100,000 lines strong and his highly coupled. It's a little bit lofty to expect method calls to work now...
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<apeiros_> sounds messy
<soulcutter> wroathe: I feel your pain. I'm not sure this is the answer you're looking for, but I'd not do either thing (begin/rescue or check respond_to). If something is supposed to respond then assume it does until the errors roll in
<RubyPanther> wroathe: the reason is that duck typing is very rubyish, it will be authoritative even if you don't know where your little duck has been, and then if there is a real error you will still get the exception normally
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
rowanu [rowanu!~rowanu@modemcable171.160-83-70.mc.videotron.ca] has joined #ruby
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby
<soulcutter> wroathe: I guess I'd be concerned that you're masking a problem by coding too defensively
<RubyPanther> it is more defensive to check sanity than to rescue everything, because rescuing everything can add bugs and can have side effects (like NOT getting rescued elsewhere)
<RubyPanther> You can't be too defensive, you can only do it wrong ;)
jlogsdon_ [jlogsdon_!~jlogsdon@50.0.84.226] has joined #ruby
<soulcutter> RubyPanther: not sure I agree on your last statement...
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
<soulcutter> kinda a nebulous topic to make generalizations about though
<apeiros_> RubyPanther: you can do it wrong by being too defensive…
QKO [QKO!~reaVer@banzai.speedxs.nl] has joined #ruby
fridim_ [fridim_!~fridim@2a01:e35:2ece:f2d0:223:4eff:fe6c:c754] has joined #ruby
matthias_ [matthias_!~matthias@ipc-hosting.de] has joined #ruby
poisonarms_ [poisonarms_!~poisonarm@pool-96-238-163-117.rcmdva.east.verizon.net] has joined #ruby
<poisonarms_> Can anyone point me in the direction of some good Ruby screencasts?
<poisonarms_> FOr learning Ruby, that is.
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
Mchl [Mchl!~Mchl@h1881165560.rev.rootvps.pl] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
<shevy> poisonarms_ no but you should learn ruby by writing scripts
<shevy> poisonarms_, work through this as quickly as possible http://pine.fm/LearnToProgram/?Chapter=01
QKO_ [QKO_!~reaVer@banzai.speedxs.nl] has joined #ruby
baroquebobcat [baroquebobcat!~nick@70-90-113-174-co.denver.hfc.comcastbusiness.net] has joined #ruby
<poisonarms_> shevy, I've completed all of RubyMonk already. I'm not new to programming, just Ruby, was looking for something a little more advanced?
stephans [stephans!~stephans@209.66.114.6] has joined #ruby
<poisonarms_> Discussions about symbols and practical uses for instances?
<poisonarms_> -s
<poisonarms_> Etc
scribbles [scribbles!~scribbles@addictedto.info] has joined #ruby
<Hanmac> symbols a good as keys for hashs
<shevy> poisonarms_ well, symbols are boring
dnjaramba_ [dnjaramba_!~dnjaramba@41.72.193.86] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-218-131.hsd1.mi.comcast.net] has joined #ruby
<poisonarms_> They're also confusing, ha.
<shevy> nono they are boring
<shevy> because people get curious about them
<shevy> but for no reason, cuz they are boring
paissad [paissad!~paissad@89-92-16-151.hfc.dyn.abo.bbox.fr] has joined #ruby
<shevy> you can't do much with symbols
vjacob [vjacob!~vjacob@94-195-174-165.zone9.bethere.co.uk] has joined #ruby
<shevy> yeah you can use them as keys in hash
<poisonarms_> Well most scripts I've looked through use them, I was just wondering if there were benefits or what?
<poisonarms_> And doesn't RoR and Sinatra use them a great deal as well?
<shevy> and a symbol always has the same object_id whereas string objects dont have the same object id, even if they have the same content
amishPa [amishPa!~x@pa-67-234-162-94.dhcp.embarqhsd.net] has joined #ruby
<poisonarms_> Would just be nice if I understood what I was looking at.
<shevy> they probably use it only as keys in hashes
<canton7> basically, comparing equality with symbols is a lot cheaper than with strings
a_a_g [a_a_g!~aag@115.109.10.216] has joined #ruby
scribbles [scribbles!~scribbles@unaffiliated/scribbles] has joined #ruby
<shevy> they are really boring poisonarms_
<shevy> yes. now you know why they are used and why they are boring
<poisonarms_> hmm
<shevy> boring boring boring
<shevy> that's the problem with ruby, people feel they need to understand everything before they can write ruby scripts
axl_ [axl_!~axl@173-11-52-113-Minnesota.hfc.comcastbusiness.net] has joined #ruby
<poisonarms_> This is my first Ruby script, ha http://codepad.org/rfRZm3Dh
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
amishPa [amishPa!~x@pa-67-234-162-94.dhcp.embarqhsd.net] has quit [#ruby]
<wmoxam> poisonarms_: symbols are just for efficentcy
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
d3b4g [d3b4g!~d3b4g@123.176.25.98] has joined #ruby
<shevy> poisonarms_ not bad, you should indent properly though
amishPa [amishPa!~x@pa-67-234-162-94.dhcp.embarqhsd.net] has joined #ruby
<elitheeli> poisonarms_: have you programmed in erlang or prolog? Symbols in Ruby are like the symbols/atoms there.
<shevy> also, I think http://pastie.org/ has the better syntax highlighting
<poisonarms_> elitheeli, I have not.
<elitheeli> poisonarms_: ah, have you used C or Java?
<wmoxam> poisonarms_: basically ruby will only ever create one instance per unique symbol, where that's not true for strings
centipedefarmer [centipedefarmer!~centipede@74-84-107-90.client.mchsi.com] has joined #ruby
d3b4g [d3b4g!~d3b4g@123.176.25.98] has joined #ruby
<poisonarms_> shevy, Which lines are'nt indented properly?
<wmoxam> poisonarms_: ex: :a.id == b.id # true
<shevy> also poisonarms_ you can use if __FILE__ == $PROGRAM_NAME before the Class.new part
<wmoxam> er
<shevy> poindontcare, look at def initialize( name, age ) vs. def speak
<wmoxam> poisonarms_: ex: :a.id == :a.id # true
<shevy> on the codepad.org site you pasted, those two methods are not indented with the same amount of tabs
<wmoxam> poisonarms_: ex: "a".id == "a".id # false
<poisonarms_> shevy, oh, yea, for some reason that happens when I copy/paste the script from Geany.
<shevy> (or spaces. But I would use 2 spaces to indent)
<poisonarms_> wmoxam, I see
<elitheeli> poisonarms_: imagine a giant enum in C containing every single possible identifier in it. That's basically what Ruby symbols are, except they all start with a colon and have a few other bits of magic to them.
n3m [n3m!~bla@188-22-20-189.adsl.highway.telekom.at] has joined #ruby
<elitheeli> poisonarms_: definitely use 2 spaces instead of tabs
<poisonarms_> I use 4 spaces.
<poisonarms_> No tabs.
<shevy> hmm
<shevy> on that codepaste though, when I copy paste the thing you wrote, I get a tab :/
<canton7> I follow "tabs for indentation, spaces for alignment", but have the tabstop set to 2 :P
ilyam [ilyam!~ilyam@2620:65:0:281:582f:26ee:b71d:cf41] has joined #ruby
Elfix [Elfix!~elfix@wikipedia/pdpc.21for7.elfix] has joined #ruby
z2fyza_ [z2fyza_!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby
<shevy> I once mixed up tabs with aligning code comments
<shevy> since that day I no longer use tabs
<elitheeli> canton7: why do you do that to yourself?
<canton7> elitheeli, I've found it to be the approach of last pain
<canton7> everyone's had their own experiences, I guess
<elitheeli> then if someone else is editing your code, alignment could get all screwy
<poisonarms_> shevy, Pastebin also has all sorts of stupid crap in my reading space that I find offensive, ha. I prefer codepad - Must just be a problem with the formatting in Geany. Just went back and fixed it.
<poisonarms_> Thanks for pointing that out.
<yxhuvud> hastebin is pretty nice imo
<shevy> yeah I would not know, I use pastie.org. the colours it offers for ruby scripts are nicest :)
<davidcelis> gist or gtfo
<elitheeli> +1
skipper [skipper!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
<poisonarms_> shevy, Oh I'm sorry, you DID say pastie.org
<shevy> I'd never say anything else! pastie.org to THE DEATH!
<poisonarms_> I like pastie, too, but I also like the code execution of codepad :P
<shevy> DIE GISTERS DIE!!!
<shevy> code execution?
<shevy> live beheading and such?
<davidcelis> shevy: ┬──┬ ノ( ゜-゜ノ)
<davidcelis> chill out bro
<poisonarms_> codepad.org compiles and executes the code you post.
<poisonarms_> and shows you the output
<shevy> argh an unreadable line attack by davidcelis
<shevy> hmm
<shevy> I see
<davidcelis> shevy: time to use UTF-8
<elitheeli> poisonarms_: so does "$ ruby filename"
<shevy> davidcelis what for?
<davidcelis> so you aren't living in the 70s
<poisonarms_> elitheeli, As opposed to pasting your code on pastie.org or pastebin.com is what I'm saying.
<shevy> yeah, I test the scripts locally before uploading or pasting
<davidcelis> theres a whole, wide world out there, shevy!
<davidcelis> a huge world filled with characters outside the scope of latin1!
<shevy> davidcelis oh and it won't work for non UTF-8 really?
<shevy> oh noes, I will not survive! :(
fridim_ [fridim_!~fridim@178.73.194.76] has joined #ruby
<poisonarms_> Well, who doesn't test locally first?
<elitheeli> poisonarms_: but it didn't even work on your site because it didn't give you file write access
kpshek [kpshek!~kpshek@159.140.254.97] has joined #ruby
theRoUS [theRoUS!KenCoar@nat/redhat/x-phrmxyjqzocthpcz] has joined #ruby
theRoUS [theRoUS!KenCoar@apache/committer/coar] has joined #ruby
<shevy> poisonarms_ hmm do you really need the code execution part of codepad.org?
xissburg [xissburg!~xissburg@187.37.249.136] has joined #ruby
<poisonarms_> The rest of the code executes, besides, that would be awfully stupid of them to give the public write privileges through their code, yea?
<poisonarms_> shevy, I don't NEED it, I just like it.
Targen [Targen!~iguana@159.90.11.250] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
xissburg [xissburg!~xissburg@187.37.249.136] has joined #ruby
<RubyPanther> you could integrate try Ruby and the newer highlighting stuff
mutandi [mutandi!~user@ip-69-33-58-25.chi.megapath.net] has joined #ruby
mutandi [mutandi!~user@ip-69-33-58-25.chi.megapath.net] has quit [#ruby]
sernin [sernin!sernin@2600:3c03::f03c:91ff:fedf:a477] has joined #ruby
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
Farkie [Farkie!~Farkie@farkie.co.uk] has joined #ruby
<shevy> poisonarms_ if you do happen to write a game in ruby, publish it on github or somewhere else :)
<shevy> I am always looking to collect ruby games
<poisonarms_> Who said anything about writing games? Haha.
<poisonarms_> Although, I have been eyeballing that implementation of SDL.
Farkie [Farkie!~Farkie@farkie.co.uk] has quit [#ruby]
cableray [cableray!~cableray@wl-dhcp176-150.Mines.EDU] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<poisonarms_> What a loser.
<wmoxam> Acer is #2!!!!
<wmoxam> Think Different
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby
<shevy> lol
<shevy> it's like the BORG
<shevy> they all use the same thing
<poisonarms_> Is there a place for Ruby in the professional world outside of RoR?
<poisonarms_> Does that get asked a lot in here?
symb0l [symb0l!~symb0l@c-50-131-187-183.hsd1.ca.comcast.net] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<matti> shevy: Hahah
cyri_ [cyri_!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby
Azure [Azure!~azt@unaffiliated/azure] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
amishPa [amishPa!~x@pa-67-234-162-94.dhcp.embarqhsd.net] has quit [#ruby]
<shevy> poisonarms_ probably RoR is the most prolific one
<wmoxam> poisonarms_: Sysadmins use it
<wmoxam> poisonarms_: I used Ruby for sysadmin scripts before Rails came out
<wmoxam> poisonarms_: and it's now used for great tools like Chef and Puppet
pedrohenriquerls [pedrohenriquerls!~pedrohenr@189.5.86.160] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<pedrohenriquerls> #porn
<pedrohenriquerls> =S
<Hanmac> i use ruby as game-engine
pedrohenriquerls [pedrohenriquerls!~pedrohenr@189.5.86.160] has quit ["Saindo"]
eignerchris [eignerchris!~eignerchr@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
<samsonjs> considering that most new development is web based the popularity of Sinatra and RoR are good for Ruby
cmasseraf [cmasseraf!~ColdFusio@187.106.195.233] has joined #ruby
davidpk [davidpk!~r00t@5e0a4e59.bb.sky.com] has joined #ruby
colossal7 [colossal7!~colossal7@75-169-53-227.slkc.qwest.net] has joined #ruby
akem [akem!~akem@253.195.84.79.rev.sfr.net] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
Chaazd [Chaazd!~tdervan@cpc19-nmal17-2-0-cust305.croy.cable.virginmedia.com] has joined #ruby
<Chaazd> i've created a class which looks up the first line in a text file. how do I make that accessible elsewhere? http://pastie.org/3239516
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby
<apeiros_> Chaazd: ? it already is accessible elsewhere…
<apeiros_> the class' code… could use some improvements…
<Chaazd> It's not giving me an error, just not printing it
peterhil [peterhil!~peterhil@xdsl-77-86-196-131.nebulazone.fi] has joined #ruby
<canton7> I re-wrote it for you :) Not tested... http://pastie.org/3239526
<davidcelis> wtf is up with your rescues
<apeiros_> probably because the way you use rescue doesn't work the way you think…
amerine [amerine!~mturner@67.204.184.82] has joined #ruby
<apeiros_> canton7: I'd open the file and rescue Errno::ENOENT instead
<canton7> everyone seems to have their own opinion on whether you check before trying, or ask for forgiveness later
<apeiros_> canton7: well, checking first, then acting is technically a race condition
<apeiros_> not that chances are big in this case…
<canton7> personally I like my approach as it doesn't introduce another block.. But yeah, good point on the race condition
<apeiros_> (but bad habits die hard)
<apeiros_> canton7: also, if one only wants the first line - use gets :)
<apeiros_> (instead of reading the full file)
<Chaazd> canton7: Genius
<canton7> I was assuming he wanted the whole lot, but only if the first line wasn't blank
<canton7> ah no
<canton7> i mis-read it
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
atmosx [atmosx!~atmosx@166.188.broadband14.iol.cz] has joined #ruby
<canton7> there we go: updated to avoid that race, and read just the first line
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<Chaazd> I'm getting an undefined varibale line_arrray
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has joined #ruby
<Chaazd> I added the first line bit too
<apeiros_> my try: http://pastie.org/3239547
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has quit [#ruby]
<canton7> you're never returning the username, I think. It's not clear, at any rate
<apeiros_> o0
<canton7> also, "if !username || username.empty?" is redundant
<apeiros_> no
<apeiros_> gets returns nil at eof
<apeiros_> nil.blank? will blow
ujifgc [ujifgc!~ujif@91.146.38.90] has joined #ruby
<Chaazd> canton7: I'm using yours
bastilian [bastilian!~bastilian@chello062178156107.9.14.vie.surfer.at] has joined #ruby
<Hanmac> why not File.readlines(path) ? without using any block?
<apeiros_> Hanmac: reads the whole file
<canton7> apeiros_, it's returning nil for me on an empty file
cableray [cableray!~cableray@wl-dhcp179-113.Mines.EDU] has joined #ruby
<apeiros_> canton7: correct. have you tried nil.empty?
<canton7> oops, massive oversight there, apologies
<apeiros_> :)
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
* apeiros_ knows his rubies ;-)
* canton7 bows to apeiros_'s ruby superiority
<apeiros_> I don't get your "you never return username"… of course I do. last statement and stuff…
ujifgc [ujifgc!~ujif@91.146.38.90] has quit [#ruby]
<canton7> I was getting yours muddling up with another tab I had open
<apeiros_> hm, but the raise is bad… the filename is in a constant - should use that for the exception. also plain RuntimeError--
<canton7> *muddled
<apeiros_> hm, and usernsame?
<Chaazd> http://pastie.org/3239578 This still doesn't work :/
<apeiros_> Chaazd: define "doesn't work"
<apeiros_> because "doesn't work" means nothing at all…
<Chaazd> It gives me undefined local method or variable first_line for Config
pantsman [pantsman!~pantsman@2.25.187.234] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
<apeiros_> ah, of course
wyhaines_ [wyhaines_!~wyhaines@66.119.51.3] has joined #ruby
<apeiros_> first_line would be block local
<canton7> yeah, block-scoping issues
<apeiros_> use any of the later pastes
josefig [josefig!~josef@unaffiliated/josefig] has joined #ruby
<canton7> use apeiros_, mine had some oversights
<apeiros_> only one, no? or did I overlook something too?
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
burgestrand1 [burgestrand1!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby
<Hanmac> Chaazd: have you try my line?
<apeiros_> Chaazd: reload it anyway. fixed your typo and using your constant in the exceptions.
<canton7> hrm, apart from config.txt being both hard-coded and defined, there's just the .empty? thing in mine I think
<apeiros_> yeah, so mostly fine :)
<apeiros_> should use yaml anyway… :D
<canton7> except it'll throw a cryptic exception whenever the file's blank, which is probably actually what he's trying to test for :P
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
<apeiros_> cryptic exceptions form character!
<canton7> depends what sort of character you want to form, at the end of the day...
<Chaazd> apeiros_: Thanks! learnt something too :)
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<luxurymode> how can i call a function defined inside of my script from within my ARGV.each do loop?
<canton7> anyways, mine's updated to be sane
<luxurymode> im getting undefined method
<canton7> luxurymode, pastie?
<luxurymode> canton7 https://gist.github.com/1665729
<atmosx> in `exists?': can't convert nil into String (TypeError) - hmmm
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
<mgolisch> can i run a script using require that does not have a rb extension?
<mgolisch> it doenst seem to work
<atmosx> any ideas why do I get that error here: http://codepad.org/cEV0kwBY
<burgestrand1> atmosx: @database is nil
matthias_ [matthias_!~matthias@ipc-hosting.de] has quit [#ruby]
<atmosx> burgestrand: okay but there's an 'else' clause there
<atmosx> should tha flow go through "else"
<canton7> luxurymode, I imagine (someone back me up here), that the method is defined after the point where it's called, and since you're not in a module/class, this makes a difference. Defining the method first fixes things
<burgestrand> atmosx: no, because the errors happen on the if
<luxurymode> what am i doing wrong here? nomethoderror for find_subactivities https://gist.github.com/1665729
<luxurymode> canton7, whoops
h4mz1d [h4mz1d!~hamfz@130.160.182.188] has joined #ruby
<luxurymode> didnt see your response sorry
<atmosx> burgestrand: oh didn't knew that
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<atmosx> burgestrand: so what is the best way to deal with this, reverse the if/else?
<atmosx> or maybe adding elsif
<burgestrand> atmosx: if @database and File.exists?(@database)
<luxurymode> canton7, crap but now i need instance variables, no? to access project_files?
<canton7> luxurymode, just write yourself a class or module, depending on what you need
<luxurymode> canton7, gotcha
ckrailo [ckrailo!~ckrailo@208.86.167.247] has joined #ruby
<luxurymode> apparently i can have instance variables right in there though, no?
taipres [taipres!~taipres@2001:5c0:1400:a::96b] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-170-217.ard.bellsouth.net] has joined #ruby
x77686d [x77686d!~whm@207.229.236.210] has joined #ruby
<luxurymode> works fine...
alex__c2022 [alex__c2022!~alex@207.239.64.154] has quit [#ruby]
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
<atmosx> burgestrand: that didn't work either
<atmosx> same error
gh0stz [gh0stz!c0926518@gateway/web/freenode/ip.192.146.101.24] has joined #ruby
zumbi_ [zumbi_!~zumbi@77.224.206.23] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE002401ce602c-CM00140494a264.cpe.net.cable.rogers.com] has joined #ruby
notjohn [notjohn!~john@cpe-174-103-133-37.cinci.res.rr.com] has joined #ruby
jlogsdon [jlogsdon!~jlogsdon@50.0.84.226] has joined #ruby
x77686d [x77686d!~whm@207.229.236.210] has joined #ruby
<burgestrand> atmosx: not same error, new line
<atmosx> what do you mean?
<burgestrand> atmosx: it’s not the same error
<atmosx> oh
<atmosx> hmmm
<atmosx> give me a sec to try something and I'll recreate it
<atmosx> and re-check if it's the same
<burgestrand> atmosx: it’s from your db = SQLite3::Database.new call
<burgestrand> atmosx: you don’t check if @database is nil there either
<atmosx> in theory I check on the first line… now apparently I've got it all wrong hehe
jlogsdon_ [jlogsdon_!~jlogsdon@50.0.84.226] has joined #ruby
[[thufir]] [[[thufir]]!~thufir@184.65.42.92] has joined #ruby
<atmosx> burgestrand: you're right
<atmosx> did you reproduce the error or did you see that comming ? (out of curiosity)
<burgestrand> atmosx: saw it coming :)
<burgestrand> atmosx: after that I reproduced to make sure I was right ;)
<atmosx> hahah okay, now please explain why it was so obvious, this is a function which in theory should create the db
<atmosx> since it does not exist :-P
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby
<burgestrand> atmosx: you never check if @database is nil
<burgestrand> atmosx: you only do it for the first condition
<burgestrand> atmosx: but in your else, @database can be nil
<burgestrand> atmosx: and then it will error
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
<burgestrand> atmosx: and it’s not necessarily obvious, I’ve just done it many times myself in the past I learn to see it
<atmosx> burgestrand: oh, nice I feel better now hehe
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<burgestrand> atmosx: it’s easier for others to see errors in your code because they have no assumptions about it, but you have since you wrote it :)
<atmosx> however, thing is @database should never be nill
<apeiros_> then ensure that in initialize
<burgestrand> apeiros_: wb :D
<apeiros_> was I gone?
<apeiros_> hi burgestrand :)
<burgestrand> apeiros_: you were gone for almost two weeks in beginning to january, were wondering where you’d gone :o
<burgestrand> apeiros_: but now you’re back so it no longer matters ^^
<apeiros_> hm, might be that I wasn't on as frequently, had and still have fought with a nasty cold. never gets serious but never getting really cured of it :-S
cynosure [cynosure!~cynosure@centrumnet.hu] has joined #ruby
fayimora [fayimora!~fayimora@2a01:388:201:3721:546f:4d9d:f091:8f6d] has joined #ruby
wroathe [wroathe!~wroathe@75-146-189-233-Minnesota.hfc.comcastbusiness.net] has joined #ruby
<burgestrand> apeiros_: naw, I did /seen on you and it was up to 13 days, you were gone I promise :p
centipedefarmer [centipedefarmer!~centipede@74-84-107-90.client.mchsi.com] has quit ["Leaving"]
<burgestrand> apeiros_: … anyhow, glad it’s just a cold :)
<burgestrand> now bedtime for me
<apeiros_> obviously I got abducted by aliens
<apeiros_> gn8, should go too I guess…
Chaazd [Chaazd!~tdervan@cpc19-nmal17-2-0-cust305.croy.cable.virginmedia.com] has quit [#ruby]
atmosx_ [atmosx_!~atmosx@166.188.broadband14.iol.cz] has joined #ruby
<atmosx_> back
<atmosx_> I saw apeiros_'s hint. Here is the entire proggie http://codepad.org/uxWwsg5u
stephans [stephans!~stephans@209.66.114.6] has joined #ruby
<atmosx_> it was working I just cut a couple of lines to make it easier to read and the install/create function stopped working
<apeiros_> atmosx_: "#{username}" is an odd way to write username.to_s
<atmosx_> @database is defined in the dbase function, if it's not userdefine (manually) it should be a predefined one...
<apeiros_> or if username should be a string, it's an even odder way to write username :)
<atmosx_> apeiros_: let me see
<fred> is there something like 'load' except it doesn't actually call the code defined in the file, just stores it in a proc or something?
<apeiros_> fred: File.read
<apeiros_> not really a proc. but load doesn't do much more than plain old eval.
<fred> apeiros_: additional qualifier: should parse it first :)
<apeiros_> no. but parsing source code doesn't take long.
<fred> (yeah, this question probably is probably premature optimisation, the root of all evil :p )
<fred> - 1x 'probably'
<apeiros_> you *could* do eval("proc {#{File.read(path)}}")
MissionCritical [MissionCritical!~MissionCr@unaffiliated/missioncritical] has joined #ruby
<atmosx> apeiros_: hehe yeah you're righ I don't know what I was thinking
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
<atmosx> I'll go home and and re-check the entire thing from there
xiaotian [xiaotian!~xiaotian@4.30.138.134] has joined #ruby
<mgolisch> does ruby handle windows path names?
<jsonperl1> make sure to use File.join
<jsonperl1> it will path correctly for the os
<jsonperl1> File.join('my', 'dir', 'is', 'sweet')
jlogsdon [jlogsdon!~jlogsdon@50.0.84.226] has joined #ruby
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
fridim_ [fridim_!~fridim@178.73.194.76] has joined #ruby
eduardordm [eduardordm!~eduardord@201.45.136.66] has joined #ruby
<rickmasta> How could I possibly round time in Ruby? Like round 4:52pm to 5pm, or 4:24 to 4pm?
molalah [molalah!~textual@4.30.138.134] has joined #ruby
milkpost [milkpost!~dec@192.133.84.6] has joined #ruby
madmax_ [madmax_!~madmax@87-206-108-5.dynamic.chello.pl] has joined #ruby
<jsonperl> would :30 round up?
akem [akem!~akem@unaffiliated/akem] has joined #ruby
x77686d [x77686d!~whm@207.229.236.210] has joined #ruby
fermion [fermion!~fermion@4.59.1.2] has joined #ruby
<milkpost> how do I get ruby to import my environment variables?
<milkpost> ahh nm
<milkpost> needed to "export"
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
x77686d [x77686d!~whm@207.229.236.210] has joined #ruby
kjs3 [kjs3!~kseefried@174.47.62.3] has joined #ruby
csavola [csavola!~csavola@76-10-149-67.dsl.teksavvy.com] has joined #ruby
jlogsdon [jlogsdon!~jlogsdon@50.0.84.226] has joined #ruby
enherit [enherit!~enherit@216.3.99.206] has joined #ruby
mztriz [mztriz!~mztriz@nkugateway.nku.edu] has joined #ruby
stkowski [stkowski!~stkowski@ns25.8x8.com] has joined #ruby
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby
molalah [molalah!~textual@4.30.138.134] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
molalah [molalah!~textual@4.30.138.134] has joined #ruby
jlogsdon [jlogsdon!~jlogsdon@32.156.5.220] has joined #ruby
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby
<apeiros_> rickmasta: Time#to_f, round, and Time::at
<apeiros_> multiply before round and divide after round as you need
Emmanuel_Chanel [Emmanuel_Chanel!star2@L057107.ppp.dion.ne.jp] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
alex__c2022 [alex__c2022!~alex@207.239.64.154] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
bigkm [bigkm!~bigkm@60-241-223-44.static.tpgi.com.au] has joined #ruby
cableray [cableray!~cableray@wl-dhcp158-180.Mines.EDU] has joined #ruby
maskell [maskell!~Mathias@c-24-18-72-83.hsd1.wa.comcast.net] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
Matthie__ [Matthie__!~Matthieu@115.146.71.1] has joined #ruby
taipres [taipres!~taipres@2001:5c0:1400:a::2e1] has joined #ruby
philcrissman [philcrissman!~philcriss@206.57.45.116] has joined #ruby
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
havenn [havenn!~skipper@ip-64-32-152-30.dsl.lax.megapath.net] has joined #ruby
eduardordm [eduardordm!~eduardord@201-24-160-228.pvoce702.dsl.brasiltelecom.net.br] has joined #ruby
shadoi1 [shadoi1!~Adium@c-71-202-122-8.hsd1.ca.comcast.net] has joined #ruby
samsonjs_ [samsonjs_!~samsonjs@S01060026f31b8198.gv.shawcable.net] has joined #ruby
stephans [stephans!~stephans@209.66.114.6] has joined #ruby
samsonjs [samsonjs!~samsonjs@S01060026f31b8198.gv.shawcable.net] has joined #ruby
bbttxu [bbttxu!~adam@pool-71-96-208-205.dfw.dsl-w.verizon.net] has joined #ruby
iamjarvo [iamjarvo!~Adium@pool-71-162-141-201.phlapa.fios.verizon.net] has joined #ruby
jsonperl [jsonperl!~Adium@74.8.8.206] has joined #ruby
apucacao [apucacao!~apucacao@thelevel.com] has joined #ruby
<epitron> rounding the seconds-representation of time seems kinda silly
<epitron> you have to do all that hard work of dividing by the hours/minutes/etc., which time already does for you
nari [nari!~nari@p62e58e.totrnt01.ap.so-net.ne.jp] has joined #ruby
<epitron> i don't understand why the Time class isn't mutable
<epitron> it would be so handy to be all, "t.min = 0"
jtgiri_ [jtgiri_!~jtgiri_@c-24-130-160-31.hsd1.ca.comcast.net] has joined #ruby