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/
_whitelogger [_whitelogger!~whitelogg@kaunan.whitequark.org] has joined #ruby
milkpost [milkpost!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby
<i8igmac>
i fail lol... that was a stupid problem... i need to fix this "retry outside of rescue clause
<shevy>
there is hope if given enough time
<shevy>
but if you dont understand ruby it's like experimenting with a black box
<banisterfiend>
shevy: do you miss fowl
<shevy>
banisterfiend yeah
_whitelogger1 [_whitelogger1!~whitelogg@kaunan.whitequark.org] has joined #ruby
_whitelogger0 [_whitelogger0!~whitelogg@kaunan.whitequark.org] has joined #ruby
_whitelogger0 [_whitelogger0!~whitelogg@kaunan.whitequark.org] has joined #ruby
_whitelogger1 [_whitelogger1!~whitelogg@kaunan.whitequark.org] has joined #ruby
eykosioux [eykosioux!~eykosioux@5ac6bcd0.bb.sky.com] has joined #ruby
eykosioux [eykosioux!~eykosioux@5ac6bcd0.bb.sky.com] has joined #ruby
_whitelogger0 [_whitelogger0!~whitelogg@kaunan.whitequark.org] has joined #ruby
eykosioux [eykosioux!~eykosioux@5ac6bcd0.bb.sky.com] has joined #ruby
<shevy>
skyrim is evil
<shevy>
it eats people
_whitelogger0 [_whitelogger0!~whitelogg@kaunan.whitequark.org] has joined #ruby
_whitelogger [_whitelogger!~whitelogg@kaunan.whitequark.org] has joined #ruby
<Phrogz>
bugty_: You'll never get that answer out of me, never!
<Phrogz>
i8igmac: You need to pare down your problem to the simplest reproducible test case, so you don't get confused by irrelevent details.
twock [twock!~twock@rrcs-24-227-222-61.sw.biz.rr.com] has joined #ruby
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
rebagliatte [rebagliatte!~rebagliat@r186-53-90-63.dialup.adsl.anteldata.net.uy] has joined #ruby
chromaticwt [chromaticwt!~user@71-32-106-187.albq.qwest.net] has quit ["ERC Version 5.3 (IRC client for Emacs)"]
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
artOfWar [artOfWar!~artofwar@nat/yahoo/x-omzaqcfptymjqlrg] has joined #ruby
cableray [cableray!~cableray@wl-dhcp199-134.Mines.EDU] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby
rebagliatte [rebagliatte!~rebagliat@r186-53-90-63.dialup.adsl.anteldata.net.uy] has quit [#ruby]
banister_ [banister_!~baniseter@115.189.34.200] has joined #ruby
banister_ [banister_!~baniseter@115.189.34.200] has joined #ruby
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby
dotnull [dotnull!~dot_null@173-31-158-182.client.mchsi.com] has joined #ruby
badabim_ [badabim_!~badabim@17.212.167.10] has joined #ruby
Hanmac1 [Hanmac1!~hanmac@p508450BF.dip0.t-ipconnect.de] has joined #ruby
mkscrg [mkscrg!~mkscrg@pool-108-41-134-165.nycmny.fios.verizon.net] has joined #ruby
p0y [p0y!~p0y@122.52.126.66] has joined #ruby
MissionCritical [MissionCritical!~MissionCr@unaffiliated/missioncritical] has joined #ruby
dotnull [dotnull!~dot_null@173-31-158-182.client.mchsi.com] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
epochwolf [epochwolf!~epochwolf@unaffiliated/epochwolf] has joined #ruby
gen0cide_ [gen0cide_!~Security@Wilkins3.static.monkeybrains.net] has joined #ruby
dagnachew [dagnachew!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
Orii [Orii!~user1@pool-71-251-145-50.hrbgpa.fios.verizon.net] has joined #ruby
<newbold>
is there something like sinatra... but for email?
<newbold>
I know that sounds like a weird question
<newbold>
but is there a way to easily route incoming email to _something_ that lets Ruby work with it?
<arex\>
how about using ruby to poll a mailserver (pop/imap)?
<newbold>
arex\: ah, I could see how that might be far easier to do :)
<Telmo>
I saw a mail server written in ruby in github the other day
<Orii>
hey can someone help me with this program im working on? its a temp conversion program that has the user give the temp and then asks what type of conversion its supposed to do but things arnt working well. http://pastebin.com/mMcwbTPp = paste of code
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
<Orii>
actually im sorry that output is wrong. i had the celsius and fahrenheit conversions seperate to see what was up
Dangr_ [Dangr_!~sseellff@c-24-13-180-185.hsd1.il.comcast.net] has joined #ruby
NinoScript [NinoScript!~anonymous@pc-50-243-241-201.cm.vtr.net] has joined #ruby
<aces1up>
can someone help me with this bit of code.. wondering what the bind method does in it.. http://pastebin.com/RZPwRrc8
randym [randym!~randym@EM114-48-116-128.pool.e-mobile.ne.jp] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@75-162-54-195.desm.qwest.net] has joined #ruby
stringoO [stringoO!~JLstring@bas1-toronto42-1279598654.dsl.bell.ca] has joined #ruby
<Hanmac>
aces1up: normaly you can access parent class functinos with super, but only the direct parent, with bind you can bind an unbound method to an obejct from an class much higher in the ancestor tree
<wallerdev>
Orii: you need to be careful to avoid integer division
<wallerdev>
Orii: for example on this line you have (temp.to_f*(9/5)+32)
<wallerdev>
(9/5) will happen first since it's in parenthesis, so that will be 1
<wallerdev>
you should do (9.0/5.0) or remove the parenthesis
<Hanmac>
and be very careful with float compare ... (0/0.0) == (0/0.0) returns false
<wallerdev>
well you shouldn't be dividing by 0 haha
robie1373 [robie1373!~robie1373@ip68-100-225-212.dc.dc.cox.net] has joined #ruby
<Orii>
never hurts to try
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
<Hanmac>
dividing by 0.0 works, and compare works too ... only 0/0.0 == 0/0.0 false
milkpost [milkpost!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
radic [radic!~radic@dslb-178-002-211-138.pools.arcor-ip.net] has joined #ruby
<Hanmac>
because of my favorit float number :P
davidcelis [davidcelis!~david@c-76-115-58-79.hsd1.or.comcast.net] has joined #ruby
<Orii>
ruby is addicting. much more fun then python....although me and python didnt work so well together way back then
<Hanmac>
Orii: have you seen the function nan?
<Orii>
nope
milkpost [milkpost!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
<Orii>
havent seen much of ruby
<Orii>
just started yesterday
<Orii>
i guess you can call it started
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
<Hanmac>
float as some special cases: 3/0.0 => Infinity and -3/0.0 => -Infinity ... ruby can calc with that
<Orii>
amazing
<Hanmac>
but 0/0.0 is a even more special case ... it returns NaN ... sort form for not a number
<Orii>
what other secrets does ruby hold O_O?
<Hanmac>
and the big rule says that NaN is so "unspecific" that it is not equal to any number, even itself
<Hanmac>
so NaN == NaN #=> false, for this case you need .nan?
arex\ [arex\!q@158.36.150.14] has quit [#ruby]
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
<Orii>
that is kind of cool
bugty_ [bugty_!~syskkk@120.65.35.245] has quit ["Leaving"]
<Orii>
im very sorry Hanmac but im about to pass out on the keyboard. its 3:50 here so i must rest. thanks for filling my head with wisdom and amazing secrets of ruby
<Orii>
ruby will be here tommorow :) so later and thanks again
<Hanmac>
next lession tomorrow: "the thirdteen secret hooks of ruby"
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
philcrissman [philcrissman!~philcriss@c-174-53-217-149.hsd1.mn.comcast.net] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.254.122.106] has joined #ruby
adeponte [adeponte!~adeponte@pool-173-51-131-197.lsanca.fios.verizon.net] has joined #ruby
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
rebaglia_ [rebaglia_!~rebagliat@r186-53-72-96.dialup.adsl.anteldata.net.uy] has joined #ruby
kenperkins [kenperkins!~textual@50-47-18-37.evrt.wa.frontiernet.net] has joined #ruby
kawa_xxx [kawa_xxx!~kawa_xxx@FLH9Aan096.tky.mesh.ad.jp] has joined #ruby
fayimora [fayimora!~fayimora@2a01:388:201:3721:4cf1:60b4:a77:fedb] has joined #ruby
stepitime [stepitime!~stepitime@209-33-232-193.dsl.infowest.net] has joined #ruby
milkpost [milkpost!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
fayimora [fayimora!~fayimora@2a01:388:201:3721:b091:31a3:32:2e3b] has joined #ruby
fayimora [fayimora!~fayimora@95.175.159.48] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
havenn [havenn!~skipper@216.3.99.206] has joined #ruby
<shevy>
hehe
<shevy>
*lesson and *thirteen
gigamonkey [gigamonkey!~user@adsl-99-35-217-233.dsl.pltn13.sbcglobal.net] has joined #ruby
yekta [yekta!~yekta@c-24-1-182-219.hsd1.il.comcast.net] has quit [#ruby]
<Hanmac>
as you see my english is not perfect ... my local time is 5:00 AM
[[thufir]] [[[thufir]]!~thufir@184.65.42.92] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
Mrono [Mrono!~mrono@unaffiliated/mrono] has joined #ruby
rippa [rippa!~splitta@85.158.54.234] has joined #ruby
throne [throne!~thr0ne@ip68-100-225-212.dc.dc.cox.net] has joined #ruby
zakwilson [zakwilson!~quassel@24-236-35-99.nm.warpdriveonline.com] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
xiaotian [xiaotian!~guoxiaoti@50.46.242.212] has joined #ruby
skrewler [skrewler!~skrewler@70-36-139-140.dsl.dynamic.sonic.net] has joined #ruby
milkpost [milkpost!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
milkpost [milkpost!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
cobragoat [cobragoat!~cobragoat@69.37.118.64] has joined #ruby
Gushings [Gushings!~electric@66.147.232.65] has joined #ruby
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby
<Gushings>
Anyone know why doing @@somevariable.length() is giving me unexpected values?
<Gushings>
somevariable is an array.. I'm looking for it's size.
<Gushings>
Getting values like .4 and E4
poisonar1s [poisonar1s!~poisonarm@pool-96-228-6-106.rcmdva.east.verizon.net] has joined #ruby
<Hanmac>
what have you required?
<[[thufir]]>
what does @@somevariable.length() give?
<[[thufir]]>
puts
<Gushings>
I have done a number of additions with puts after
<Gushings>
Giving values like 4
<Gushings>
FE4E1
<Gushings>
.1
<Gushings>
FF1
<Gushings>
.1
<[[thufir]]>
I don't think you're printing what you think you're printing.
<heftig>
code snippet?
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
janissary [janissary!~user@adsl-98-85-0-232.mco.bellsouth.net] has joined #ruby
<Gushings>
def add_new_record()
<Gushings>
@@record_array << Record.new()
<Gushings>
puts @@record_array.length()
<Gushings>
return (@@record_array.length() - 1)
<Gushings>
end
<Gushings>
record is just an object.
<Phrogz>
Gushings: Please don't paste code in the channel. http://pastie.org
<Gushings>
Okay, thank you
<heftig>
Gushings: those empty parentheses are superfluous
<[[thufir]]>
outside of add_new_record, what values are you getting? I agree that's odd.
<Phrogz>
On that code: 1) it's idiomatic not to put parens on a method call that takes no arguments 2) it's idiomatic, and better, not to put the "return" keyword at the end of a method.
minijupe [minijupe!~benlieb@adsl-74-243-183-66.ard.bellsouth.net] has joined #ruby
<Gushings>
I came from java, I know they are, it's habit.
<[[thufir]]>
also, what happens if you print the entire object with pp
<Phrogz>
And 3) Are you *sure* that you really want a class variable there? :)
<Gushings>
I am porting code Phrogz, it's the only way to do it now that I could find, planning on refactoring it later. :)
<Phrogz>
OK
<[[thufir]]>
that return might be causing weirdness.
<Gushings>
I don't know how to pp, let me look it up and get back to you.
<Phrogz>
Gushings: require 'pp' and then pp someObject
<Gushings>
does that return a string, that I need to put, or does that automatically put?
<[[thufir]]>
I think more pp's. before and after this method would shed light on the problem. that being said, I'm still learning :)
<[[thufir]]>
it puts the object, but "nice"
<Phrogz>
Gushings: It outputs a string to STDOUT
<Hanmac>
i think he should pastie the entire class
* [[thufir]]
agree Hanmac
<Hanmac>
[[thufir]]: that line "i came from java" i think i heard it to much ... IMO java is a bad lanuage for begining ... it curupts you and you does not understand any other language
josefig [josefig!~josef@187.156.91.147] has joined #ruby
josefig [josefig!~josef@unaffiliated/josefig] has joined #ruby
<[[thufir]]>
lol. you just described me
c0rn [c0rn!~c0rn@adsl-69-110-5-79.dsl.pltn13.pacbell.net] has joined #ruby
<[[thufir]]>
I find rubydocs imcomprehensible.
<shevy>
Gushings I think pp calls .pretty_print on a string object
Karmaon [Karmaon!~john@gateway/tor-sasl/karmaon] has joined #ruby
medik [medik!~medik@host-95-199-18-228.mobileonline.telia.com] has joined #ruby
<[[thufir]]>
coming from java, it just seems hard to figure out what things do. In java, most everything is with either parens or dot operator, and almost always used in in a consistent fashion. not so in ruby. my pet peeve.
<shevy>
not sure what you mean
<shevy>
object.method
<shevy>
that works in ruby throughout
<Phrogz>
shevy: No, it calls pretty_inspect
<shevy>
oh I see
<banisterfiend>
[[thufir]]: what is confusing u specificallly
<[[thufir]]>
what I mean is that in ruby there's additional, err, "stuff"? things? operators? more than one way to skin a cat.
gianlucadv [gianlucadv!~gianlucad@host78-84-dynamic.44-79-r.retail.telecomitalia.it] has joined #ruby
<shevy>
?!?!
* [[thufir]]
goes off to get his current ruby script
<shevy>
yeah well
<shevy>
skin(cat)
<shevy>
cat.skin
<Gushings>
could this have anything to do with it?
<[[thufir]]>
line 24 is a bit of a mystery. I'm not sure what's being passed around, although i do see some symbols. other than that, not sure what's happening.
<banister_>
[[thufir]]: wy dont you read a book instead of trying to guess
<[[thufir]]>
why are the symbols grouped with {}?
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<shevy>
pastebin is hard to read
<banister_>
[[thufir]]: because it's a 'hash', if you'd read a book you'd know that
<shevy>
use the default on http://pastie.org/ it makes it a lot easier to see what is going on
<shevy>
also I am not sure what you mean with line 24
<shevy>
it is commented out isn't it?
<shevy>
but then again I don't use =begin myself to document anything so who knows
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
<[[thufir]]>
yes, line 24 is commented out. it's just a mishmash which I couldn't get working. what I mean, is why pass a hash? It's just a general problem I have in understanding that. In java, you'd make an object, and pass that obj.
<banister_>
[[thufir]]: a hash is an object
<banister_>
[[thufir]]: you'd just giving it inline
<banister_>
you're*
<[[thufir]]>
yeah,I see your point.
<banister_>
[[thufir]]: also a has is often teh way ruby provides 'named parameters'
ntyp [ntyp!~derchille@94.75.228.23] has joined #ruby
fixl [fixl!~fixl@203-158-37-72.dyn.iinet.net.au] has joined #ruby
Asher [Asher!~asher@98.158.127.150] has joined #ruby
kenperkins [kenperkins!~textual@50-47-18-37.evrt.wa.frontiernet.net] has joined #ruby
<[[thufir]]>
ok, that's interesting.
jackhammer2022 [jackhammer2022!~textual@c-24-34-124-94.hsd1.ma.comcast.net] has joined #ruby
randym [randym!~randym@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
<shevy>
pretty everything in ruby is an object
<shevy>
and you have to remember that ruby gives you the freedom to omit certain syntax
<shevy>
object.method({ :name => 'John'})
<shevy>
object.method( :name => 'John')
<shevy>
object.method :name => 'John'
<shevy>
these three should be equivalent
<shevy>
but if it is easier for your brain, translate it to the first way
<shevy>
hmm let me add a ' ' still :)
<Hanmac>
and object.method(name: 'John') for ruby > 1.9
<shevy>
object.method( :name => 'John' )
<shevy>
now it's visually better :P
luciano [luciano!~luciano@c951895b.virtua.com.br] has joined #ruby
<banister_>
shevy: shouldn't :name => 'Marcus' ?
<luciano>
I'm writing a little CGI program in Ruby. Is there a way to read non standard HTTP header fields in Ruby?
<shevy>
banister_ it can be anything
<[[thufir]]>
another rubyism I dont' get is like so: page = @agent.get 'http://<url>.com/<organization>/<repo-name>/tickets/1' why isn't that page = @agent.get('http://<url>.com/<organization>/<repo-name>/tickets/1') how can it be? just breaks my brain.
<rippa>
parentheses are optional
<rippa>
what not to get
<[[thufir]]>
why? how so? is that because of c?
<Hanmac>
but in this case i whould use them
kawa_xxx [kawa_xxx!~kawa_xxx@FLH9Aan096.tky.mesh.ad.jp] has joined #ruby
<rippa>
parentheses are only needed for readability or disambiguation
<shevy>
[[thufir]] did you not read what I wrote
<shevy>
"<shevy> and you have to remember that ruby gives you the freedom to omit certain syntax"
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
<shevy>
noone stops you from using the ()
hadees [hadees!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
<Hanmac>
an broken keyboard can stop him
<[[thufir]]>
heh. I guess what I mean is, that the syntax seems harder to read. At least for me.
<shevy>
nothing can stop a dedicated man
<shevy>
except for laziness
<shevy>
and segfaults
taipres [taipres!~taipres@2001:5c0:1400:a::519] has joined #ruby
<shevy>
"block_given?" is just a conditional check whether a block was passed to your method
<[[thufir]]>
that helps with that
<[[thufir]]>
blocks I mean :)
<Phrogz>
In JavaScript, it would be Array,prototype.each = function( callback ){ for (var i=0;i<this.length;++i) callback(this[i]) }; myArray = [1,2,3]; myArray.each(function(n){ console.log(n) });
Fishy [Fishy!~fleisch@pool-108-40-0-161.bltmmd.fios.verizon.net] has joined #ruby
<Phrogz>
Ruby's syntax just makes blocks far, far more convenient to use.
<shevy>
[[thufir]] you could even try to pass blocks to blocks ... but it gets kinda confusing... the simpler the better really http://pastie.org/3254519
cableray [cableray!~cableray@wl-dhcp159-109.Mines.EDU] has joined #ruby
<[[thufir]]>
I'm going to keep those code samples about.
<[[thufir]]>
thanks phrogz and shevy, et al
<shevy>
remember to keep things simple and structured
<Hanmac>
blocks are one of few objects that are not serializeable
<shevy>
hmm
tonini [tonini!~zastav@edge.garaio.com] has joined #ruby
<Okasu>
how can i define binary method like "arg + arg"(not arg.+ arg)?
<rippa>
def +
badabim [badabim!~badabim@c-98-207-235-20.hsd1.ca.comcast.net] has joined #ruby
hamfz_ [hamfz_!~hamfz@c-68-62-113-11.hsd1.al.comcast.net] has joined #ruby
<fourcolors>
and I would like to return the value of "query" and "language"
<fourcolors>
ha.. I swear I do
<fourcolors>
so if i did something like q = {"search"=>{"query"=>"method", "language"=>""}}
<fourcolors>
then q.key("search") it returns nil
<fourcolors>
how can I navigate this hash? I need to basically get the query and language values if they exist
<banisterfiend>
fourcolors: q["search"]["query"]
abstrusenick [abstrusenick!~abstrusen@180.241.134.204] has joined #ruby
<fourcolors>
ugg.. ok so i'm dumb. A typo was making it break that I kept typing over and over again
<banisterfiend>
hehe
<jlogsdon>
typos: the bane of every developers existence
<jlogsdon>
at least there's no mysterious : instead of ; shit
<fourcolors>
ya im pretty happy I don't type ; everywhere
heftig [heftig!~Jan@archlinux/developer/heftig] has joined #ruby
p0y [p0y!~p0y@122.52.126.66] has joined #ruby
<davidcelis>
you dont?
<davidcelis>
l2ruby
ershad__ [ershad__!~ershad@117.204.109.120] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.134.204] has joined #ruby
gregorg [gregorg!~Greg@78.155.152.6] has joined #ruby
gregorg [gregorg!~Greg@unaffiliated/gregorg] has joined #ruby
banisterfiend [banisterfiend!~baniseter@222.153.223.40] has joined #ruby
thone [thone!~thone@g225085180.adsl.alicedsl.de] has joined #ruby
gregorg_taf [gregorg_taf!~Greg@78.155.152.6] has joined #ruby
gregorg_taf [gregorg_taf!~Greg@78.155.152.6] has joined #ruby
enherit [enherit!~enherit@66-214-13-183.dhcp.lnbh.ca.charter.com] has joined #ruby
<[[thufir]]>
l2ruby?
abstrusenick [abstrusenick!~abstrusen@180.241.173.131] has joined #ruby
skim1776 [skim1776!~sergey@m212-96-64-111.cust.tele2.kz] has joined #ruby
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
`gregorg` [`gregorg`!~Greg@78.155.152.6] has joined #ruby
<davidcelis>
learn 2 ruby
<davidcelis>
if you're not semicoloning everywhere, you aren't rubying right
`gregorg` [`gregorg`!~Greg@78.155.152.6] has joined #ruby
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.131] has joined #ruby
frerich2 [frerich2!~frerich@mail.froglogic.com] has joined #ruby
<[[thufir]]>
lol
eighty4 [eighty4!~eighty4@unaffiliated/eighty4] has joined #ruby
`gregorg` [`gregorg`!~Greg@78.155.152.6] has joined #ruby
<davidcelis>
how do you think everybody does those "HEY LOOKIT WUT I DID IN ONE LINE OF CODE" tricks?
abstrusenick [abstrusenick!~abstrusen@180.241.173.131] has joined #ruby
<davidcelis>
they semicolon the shit out of their shit
<davidcelis>
damn dirty cheaters
ershad__ [ershad__!~ershad@117.204.106.105] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.131] has joined #ruby
nivoc [nivoc!~matthias@adsl-75-26-136-230.dsl.pltn13.sbcglobal.net] has joined #ruby
`gregorg` [`gregorg`!~Greg@78.155.152.6] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
yxhuvud [yxhuvud!mongo@h-5-47.a212.priv.bahnhof.se] has joined #ruby
banisterfiend [banisterfiend!~baniseter@222.153.223.46] has joined #ruby
maletor [maletor!~maletor@c-69-181-24-86.hsd1.ca.comcast.net] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.131] has joined #ruby
ph^ [ph^!~ph^@79.135.7.162] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.131] has joined #ruby
ershad__ [ershad__!~ershad@117.204.106.105] has joined #ruby
Synthead [Synthead!~max@c-71-204-121-215.hsd1.ga.comcast.net] has joined #ruby
ershad_ [ershad_!~ershad@117.204.106.105] has joined #ruby
<shevy>
hehe
<shevy>
davidcelis> they semicolon the shit out of their shit
<shevy>
^^^ best statement on #ruby ever
ershad [ershad!~ershad@117.204.106.105] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.173.131] has joined #ruby
trivol [trivol!~aurelien@2a01:e35:139a:f150:50d5:6ef3:9e46:4ac3] has joined #ruby
<cobragoat>
for some reason using respond.do |format| RestClient.post content-type "application/json" is being deteted as XML even tho curl and net/http are working
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
Indian_ [Indian_!~Indian@unaffiliated/londonmet050] has joined #ruby
scx [scx!~Administr@abui165.neoplus.adsl.tpnet.pl] has joined #ruby
<scx>
hello
<scx>
what does this loop do?:
gregorg [gregorg!~Greg@78.155.152.6] has joined #ruby
gregorg [gregorg!~Greg@unaffiliated/gregorg] has joined #ruby
<scx>
@@t[$1.to_i] = [] unless @@t[$1.to_i]
aknewhope [aknewhope!~aknewhope@cpe-75-82-205-249.socal.res.rr.com] has joined #ruby
<heftig>
that's not a loop
<davidcelis>
not even a little bit
zommi [zommi!quassel@nat/ibm/x-msqkezoismzfjbup] has joined #ruby
<scx>
so what is "[] unless array[i]"?
<heftig>
@@t[$1.to_i] ||= []
jbpros [jbpros!~jbpros@137-178-112-217.dyn.adsl.belcenter.be] has joined #ruby
<heftig>
same as this.
<scx>
heftig: ok, thx
vladyn [vladyn!~Adium@78.83.241.70] has joined #ruby
<davidcelis>
its called a conditional statement...
<davidcelis>
`unless` is the opposite of `if`
PaulIIIIIIII [PaulIIIIIIII!PaulIIIIII@82.131.60.164.cable.starman.ee] has joined #ruby
<[[thufir]]>
@@t[$1.to_i] isn't that an iteration?
<davidcelis>
no?
<davidcelis>
how is that an iteration?
<davidcelis>
theres no iterating happening
<[[thufir]]>
I thought it was like puts foo.1.to.5 #horrible ruby
jhunter [jhunter!jfigga@c-67-169-75-5.hsd1.ca.comcast.net] has joined #ruby
xiaotian [xiaotian!~guoxiaoti@50.46.242.212] has joined #ruby
Locke23rus [Locke23rus!~quassel@188.162.163.41] has joined #ruby
<banseljaj>
[[thufir]], {to_i} is a single method whoch converts a string to an integer.
<banseljaj>
note the difference between the underscore and the dot.
<davidcelis>
well
<davidcelis>
it converts the calling object to an integer
<davidcelis>
doesnt have to be a string
<banseljaj>
{foo.1.to.5} =/= {foo.to_5}
<banseljaj>
davidcelis, Indeed. I was oversimplifying.
<[[thufir]]>
ah.. thx
<[[thufir]]>
to_i , to_s right. got it.
<scx>
so it just do: if ! @@t[$1.to_i] then @@t[$1.to_i] = []
<scx>
?
provideal [provideal!~hornp@p4FFF8371.dip.t-dialin.net] has joined #ruby
<davidcelis>
don
<davidcelis>
don't do that
<davidcelis>
don't use "then"
cobragoat [cobragoat!~cobragoat@69.37.118.64] has quit ["Leaving"]
<scx>
davidcelis: why?
<[[thufir]]>
put at least one semicolon in there ;)
CodeZombie [CodeZombie!~CodeZombi@65.19.245.153] has joined #ruby
<davidcelis>
scx: there is never a need to use then, it's a wasted call and wasted characters
<davidcelis>
you could do @@t[$1.to_i] = [] if !@@t[$1.to_i]
<scx>
davidcelis: but result is the same?
<davidcelis>
scx: yes
<davidcelis>
but thats bad ruby
<davidcelis>
@@t is kind of bad also, why is it called @@t? what the hell is that?
<scx>
i just want to know, what exacly "@@t[$1.to_i] = [] unless @@t[$1.to_i]" do
<scx>
davidcelis: yes, i know, but it isnt my code
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
<scx>
i have to only rewrite a small part of it
<davidcelis>
scx: It assigns an empty variable to @@t[$1.to_i] unless that variable already has a value that isn't nil or falsey
<davidcelis>
read ruby like english
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
<scx>
davidcelis: ok, thx
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
nivoc_ [nivoc_!~matthias@ipc-hosting.de] has joined #ruby
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
VictorMartins [VictorMartins!~VictorMar@87.196.149.191] has joined #ruby
trend [trend!~trend@76.91.169.147] has joined #ruby
<trend>
any good free ruby podcasts?
<trend>
video preferred :)
bier [bier!~bier@p5085DAF0.dip.t-dialin.net] has joined #ruby
<shevy>
scx that is really ugly code man
<shevy>
people who write such code are suspect
stoor [stoor!~stoor@095-097-012-177.static.chello.nl] has joined #ruby
cyri_ [cyri_!~cyri_@149.93.119.80.rev.sfr.net] has joined #ruby
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
Natch| [Natch|!~natch@178.73.217.238] has joined #ruby
codespectator [codespectator!~codespect@109.176.146.59] has joined #ruby
tolland [tolland!~tolland@vs802.rosehosting.com] has joined #ruby
<tolland>
hi all
klaustsen [klaustsen!~klaustsen@62.109.36.140] has joined #ruby
<tolland>
I seem to have a confusing mess of deplicates of various gem libs in the /usr/lib and /usr/lib64 hierarchies on my system, im not sure which is in use
<tolland>
i only have ruby.x86_64 installed, so I am not sure why rubygems would install to /usr/lib
<tolland>
they are not linked
<tolland>
any suggestions?
<skim1776>
hey, are there any "idiomatically clean" gems in ruby to learn the code?
tobyo [tobyo!~tobyo@cpe-24-165-22-166.san.res.rr.com] has joined #ruby
<RubyPanther>
tolland: normally those are not used at all, and you use either rvm or rbenv to manage multiple versions
<banseljaj>
exit
<RubyPanther>
that way you leave /usr/lib* for the OS Ruby
<RubyPanther>
and if all your non-OS Ruby apps use bundler, then you can even easily delete your gem trees if they get messy, and reinstall painlessly
mafolz [mafolz!~mafolz@dhcp50-203.start.uni-saarland.de] has joined #ruby
Tweeq [Tweeq!~Tweeq@ksdfw05.rightcompetence.com] has joined #ruby
<davidcelis>
skim1776: wut
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
<tolland>
davidcelis: I think he/she is asking, is there anything in Ruby that isn't a terrible mess of style and dependencies, that he/she might use as a best practices learning example.
<davidcelis>
like...
<davidcelis>
a book...?
<tolland>
before obviously giving up, and deciding that erlang is the new ruby ;-)
<tolland>
yes, its pretty clear that there are no good examples, _actually_ in ruby code.
<tolland>
. anyway thanks for the help.
tolland [tolland!~tolland@vs802.rosehosting.com] has quit [#ruby]
Jck_True [Jck_True!furyfire@unaffiliated/jcktrue/x-390518] has joined #ruby
janissary [janissary!~user@adsl-98-85-0-232.mco.bellsouth.net] has joined #ruby
<Jck_True>
Uhmm still in the process of learning ruby - But i've run into a small issue - how do i get both the value and the array index in a for loop?
<rippa>
don't use for loop
<Jck_True>
for element in array
<rippa>
%w[a b c].each_with_index
<aces1up>
if i have an hash of: {:myobj => obj} where obj is obviously an object.. I know symbols stay in memory... if i remove all references to the hash, does the object stay in memory due to the symbol staying in memory and referencing the object? does it get garbage collected?
<davidcelis>
never use a for loop
<davidcelis>
in ruby
<davidcelis>
_ever_
<Jck_True>
but - - Urggh Ruby is a bit mindblowing when you're moving from embedded C :P
<davidcelis>
aces1up: pretty sure it gets garbage collection
<aces1up>
k just having some memory issues and wondering if that might be it.
<Jck_True>
I got an array of dice rolls - My index indicates the value of the dice - and the assoc value indicates the number of times that dice has been rolled
<Jck_True>
Now I need todo stuff if a 6 has been rolled twice etc etc
<Jck_True>
I'll go back to the docs :S
ramu [ramu!~ramu@E218222192102.ec-userreverse.dion.ne.jp] has joined #ruby
ramu [ramu!~ramu@E218222192102.ec-userreverse.dion.ne.jp] has quit ["Leaving..."]
skim1776 [skim1776!~sergey@m212-96-64-111.cust.tele2.kz] has quit [#ruby]
ChampS666 [ChampS666!~ChampS@141.32.22.230] has joined #ruby
Spockz [Spockz!~Spockz@095-097-113-150.static.chello.nl] has joined #ruby
nd__ [nd__!~nd@mnhm-5f74dcfe.pool.mediaWays.net] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
bastilian [bastilian!~bastilian@chello213047077012.23.11.vie.surfer.at] has joined #ruby
janissary [janissary!~user@adsl-98-85-0-232.mco.bellsouth.net] has joined #ruby
bwright [bwright!~bwright@c122-106-254-100.belrs3.nsw.optusnet.com.au] has joined #ruby
nerdy [nerdy!~textual@66-44-118-195.c3-0.grg-ubr1.lnh-grg.md.cable.rcn.com] has joined #ruby
LMolr [LMolr!~quassel@87.19.33.245] has joined #ruby
skim1776 [skim1776!~sergey@m212-96-64-111.cust.tele2.kz] has joined #ruby
fromishps [fromishps!~Adium@103.1.164.39] has joined #ruby
fromishps [fromishps!~Adium@103.1.164.39] has quit [#ruby]
ephemerian [ephemerian!~ian@82-69-1-248.dsl.in-addr.zen.co.uk] has joined #ruby
alup [alup!~alup@193.92.123.5] has joined #ruby
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
skim1776 [skim1776!~sergey@m212-96-64-111.cust.tele2.kz] has quit [#ruby]
BiHi [BiHi!~bihi@did75-17-88-165-129-29.fbx.proxad.net] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
gianlucadv [gianlucadv!~gianlucad@st-dellaved.statistica.unimib.it] has joined #ruby
<RubyPanther>
for loop is just sugar, it converts it to an #each it is baby-Ruby for incoming Perl hackers
<RubyPanther>
in poor taste? certainly. actually bad? no.
davidpk [davidpk!~r00t@149.7.51.250] has joined #ruby
<RubyPanther>
it is only bad in that your backtraces will list it as an #each so you have to know what it really does
* banisterfiend
deletes RubyPanther from the world
livelace [livelace!~livelace@62.192.242.235] has joined #ruby
InBar [InBar!~v@77.242.201.52] has joined #ruby
<RubyPanther>
aces1up: the symbols don't cause a problem for the hash to get collected, but collection happens mostly when the method exits, so if you have more than like... 3 lines in your method, that is probably why you have memory problems. Even just pasting the insides of loops into a method, so the inside of the loop just calls a method, can actually save a _huge_ amount of memory
pantsman [pantsman!~pantsman@2.25.187.234] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
<RubyPanther>
because the loops are closures, so if you do the work directly inside the loop block, all those closures build up waiting for the method to finish. You're done with them, but Ruby doesn't know that.
<RubyPanther>
_why saved me a gig of ram on that one once
vladyn1 [vladyn1!~Adium@78.83.241.70] has joined #ruby
<RubyPanther>
most people seem to just not believe that it possible to paste to a new method and save ram, it is funny
cyri__ [cyri__!~cyri_@232.93.119.80.rev.sfr.net] has joined #ruby
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
MekkisFreenode_ [MekkisFreenode_!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
<heftig>
RubyPanther: most people don't run into memory problems, I believe
ylluminate [ylluminate!~ylluminat@rrcs-24-123-53-166.central.biz.rr.com] has joined #ruby
shevy [shevy!~shevy@91-113-95-182.adsl.highway.telekom.at] has joined #ruby
vladyn [vladyn!~Adium@78.83.241.70] has joined #ruby
Pathou [Pathou!~androirc@80.214.8.159] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
ikaros [ikaros!~ikaros@studpool-wlan-75-124.fs.fbi.h-da.de] has joined #ruby
<[[thufir]]>
RubyPanther: sounds like premature optimization to me
<RubyPanther>
[[thufir]]: sounds like reciting a cliche out of context to me
<RubyPanther>
[[thufir]]: you do know, right, that the premature optimization quote was saying you should not hand code your loops in assembly until you actually are sure there is a bottleneck... right?
<[[thufir]]>
it applies to keeping methods to <3 lines as well.
<RubyPanther>
it was certainly not saying, "don't try to optimize if you are having memory issues" or "don't use your experience to select efficient algorithms" or "don't worry about performance until you get called at 3am and the site is slashdotted"
<RubyPanther>
No, it does not, nor does it apply to "do one thing and do it well" in the shell
<RubyPanther>
it was not a universal maxim, it was talking about hand coding loops
robotmay [robotmay!~robotmay@94.30.13.228] has joined #ruby
<[[thufir]]>
that first is the point. Are you having memory issues? and the point about hand coding loops *does* apply, as analogy.
<[[thufir]]>
oh well.
<RubyPanther>
well he was having a problem, so even if your point wasn't crazy in the general sense, in the specific sense of this case where this guy was asking for help and I was giving it, if there was a way to hand code his loops in ASM to make them take less memory, he really _should_ according to the age old quote, it not being premature since the bottleneck is already choked out
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
Karmaon [Karmaon!~john@gateway/tor-sasl/karmaon] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
mk03 [mk03!~mk03@61.245.119.34.er.eaccess.ne.jp] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
KillerFox [KillerFox!~rn@home.protection-fault.ch] has joined #ruby
m4dc0d3r [m4dc0d3r!~sascha@80-121-48-255.adsl.highway.telekom.at] has joined #ruby
<[[thufir]]>
oh, not in any was was I knocking your advice or anything like that. I'm a noob and know it ;)
<[[thufir]]>
RubyPanther: it just struck me as a bit odd, that's all.
Natch| [Natch|!~natch@178.73.217.238] has joined #ruby
<RubyPanther>
[[thufir]]: that it is odd is why people need to learn it :) It is odd indeed! Very few languages have this combination of reference counting GC and loops creating closures in the scope of the method
<RubyPanther>
like in Perl you would mostly have declared loop-local variables that would get collected at the end of the loop, but in Ruby those stay after the loop until the method exits (or GC is called manually, which is not portable or safe)
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
virunga [virunga!~virunga@151.64.17.124] has joined #ruby
virunga [virunga!~virunga@151.64.17.124] has quit [#ruby]
<RubyPanther>
we get punished hard in memory usage for every line of procedural style we inflict. It is not enough to have procedural chunks tucked away inside of instance methods, each line should be in an OO style
Natch| [Natch|!~natch@178.73.217.238] has joined #ruby
fixl [fixl!~fixl@203-158-37-72.dyn.iinet.net.au] has joined #ruby
<[[thufir]]>
what do you mean by reference counting?
<[[thufir]]>
why would loop-local variables *not* get gc? I always assumed they were. that's rather the point of scope, or a big point at least.
<RubyPanther>
because we don't _have_ loop local variables, we have closures
<heftig>
RubyPanther: block variables don't survive the block, though
<[[thufir]]>
hmm, ok.
<heftig>
er
<RubyPanther>
heftig: true, but the block survives the end of the loop! survives until the method returns
<heftig>
also, ruby does not reference-count
tvo [tvo!~tvo@wlan-145-94-191-224.wlan.tudelft.nl] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
<heftig>
RubyPanther: do you have a code sample where this kind of optimization would be effective?
robbinn [robbinn!c136435d@gateway/web/freenode/ip.193.54.67.93] has joined #ruby
Akylios [Akylios!~amy@CPE-123-211-144-41.lnse3.woo.bigpond.net.au] has joined #ruby
<RubyPanther>
heftig: no, people crawl out of the woodwork to rail against it so they can just try it themselves IMO. In my real-life example, _why saved my over a gig of RAM.
<[[thufir]]>
isn't the contents of a loop a block?
<[[thufir]]>
aren't I should say
<RubyPanther>
and sure, it is "mark and sweep" not reference-count, but it is the same here
banisterfiend [banisterfiend!~baniseter@222.153.223.34] has joined #ruby
z2fyza [z2fyza!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby
dazoakley [dazoakley!~dazoakley@hocuspokus.vm.bytemark.co.uk] has joined #ruby
x0F [x0F!~x0F@unaffiliated/x0f] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
<robbinn>
hi
<robbinn>
how create a array of Hash
<robbinn>
?
cachemoney [cachemoney!~cachemone@71-94-132-42.static.mtpk.ca.charter.com] has joined #ruby
TomJ [TomJ!~TomJ@unaffiliated/tomj] has joined #ruby
<thomasfedb>
robbinn, [{}]
<davidcelis>
[Hash]
<davidcelis>
there you go, an array containing HAsh
<robbinn>
tab[{}] = Hash[%w ...]
<robbinn>
that didn t work
<davidcelis>
what
<davidcelis>
dude no
<davidcelis>
thats some java shit you're doing right there
<davidcelis>
{} is not an array index
<davidcelis>
tab[i] = ...
<davidcelis>
where i is a numeric index
<RubyPanther>
robbinn: %w... already gives you an array, try asking about your goals instead of your implementation because you don't seem to know what implementation you need
luhar [luhar!~rahul@117.213.25.110] has joined #ruby
<robbinn>
that work
<robbinn>
thx
tvw [tvw!~tv@212.79.9.150] has joined #ruby
<robbinn>
last question
rickmasta [rickmasta!~rickmasta@pool-71-183-247-164.nycmny.fios.verizon.net] has joined #ruby
NinoScript [NinoScript!~anonymous@pc-50-243-241-201.cm.vtr.net] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
idletom [idletom!b@173-30-162-172.client.mchsi.com] has joined #ruby
Ammar01 [Ammar01!~hassaa10@gatej.mh.bbc.co.uk] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
tuxaddicted [tuxaddicted!~tuxaddict@202.60.13.34] has joined #ruby
<robbinn>
how redirect puts in a file
<robbinn>
i can't user that ruby.rb >> file but my text is in utf8
vondruch [vondruch!vondruch@nat/redhat/x-iqitrhtdslzqzbmd] has joined #ruby
dennda [dennda!~dennda@ubuntu/member/dennda] has quit ["Thanks"]
<thomasfedb>
[[thufir]], i think that's normal
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
zastaph [zastaph!zastaph@unaffiliated/zastaph] has joined #ruby
<[[thufir]]>
hmm,so not bug? ah, Marshal only works with objects without singleton methods.
<[[thufir]]>
I prefer not to use YAML. Any other options? I prefer a binary for this, apparent, singleton.
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has quit [#ruby]
bwright [bwright!~bwright@c122-106-254-100.belrs3.nsw.optusnet.com.au] has joined #ruby
paradoja [paradoja!~paradoja@89.6.103.21] has joined #ruby
<thomasfedb>
[[thufir]], the problem is that signletons can't be re-instanciated from anywhere.
<thomasfedb>
[[thufir]], is it essential that you marshal this object?
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.43.246.mtnl.net.in] has joined #ruby
<[[thufir]]>
right, you don't want two singletons, of course. or even three! It's not the marshal, per se, but more that I want to persist an actual object, rather than text file of attributes.
<[[thufir]]>
not a requirement, just a taste preference of mine.
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.43.246.mtnl.net.in] has quit [#ruby]
<thomasfedb>
[[thufir]], ok. can you give my any more info?
<RubyPanther>
[[thufir]]: Ruby doesn't use that flavor
<[[thufir]]>
pastie
<thomasfedb>
[[thufir]], if you can use an alternate ruby implimentation then perhaps you can use maglev - it has object persistance
<RubyPanther>
yeah indeed, if you don't want Ruby you can always use almost-Ruby ;)
<[[thufir]]>
http://pastebin.mozilla.org/1462832 heh, yeah, I don't think it really matters at the end of day. I'm probably being Java-silly.
niklasb [niklasb!~codeslay0@scc-wkit-clx-217-219.scc.kit.edu] has joined #ruby
<RubyPanther>
The idea that you can persist the "actual" object, and still do so when it has singletons... ignores what singletons are supposed to mean
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
<RubyPanther>
The point where you marshal it, now you already have two of them
remu [remu!~remu@209.43.1.25] has joined #ruby
<RubyPanther>
persisting singletons without creating a singleton-killing-paradox would require that marshal have side effects and blow up the original
<[[thufir]]>
I didn't realize it was a singleton until just now. that first linked indicated a bug in ruby. yes, I get the point, tho.
<RubyPanther>
a bug in Ruby 1.8.0 mentioned in a post from `03, anyways
<thomasfedb>
[[thufir]], maglev is cool though =P
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
<[[thufir]]>
I think I'll just use yml, which is pretty neat anyhow. I'll save maglev for another night ;)
<thomasfedb>
[[thufir]], well advised
stoffus [stoffus!~stoffus@2001:9b0:1:dead:129a:ddff:fe58:6835] has joined #ruby
<Hanmac>
[[thufir]]: i design my objects without singleton stuff when i want to marschal it, i define the wanted methods in a Module, and then i extend it to the object
<[[thufir]]>
now, what are the criteria for deciding whether to use marshal, yml, etc in terms of designing obj's?
<[[thufir]]>
like, certain types of objects should be marshaled, but not these other types?
<thomasfedb>
[[thufir]], why are you marshalling objects?
<thomasfedb>
[[thufir]], at all...
<[[thufir]]>
oh, I wanted to download the rss feed just the one time instead of hitting the poor guys server every five minutes.
<thomasfedb>
[[thufir]], and this requires you to marshal objects?
<[[thufir]]>
well, I thought that was best approach. guess not. lol.
<thomasfedb>
[[thufir]], get a database
<thomasfedb>
=P
<[[thufir]]>
heh, yeah. I figure to ?sanitize? the data a bit first, though. yes?
ershad [ershad!~ershad@117.204.106.105] has joined #ruby
ershad_ [ershad_!~ershad@117.204.106.105] has joined #ruby
ershad [ershad!~ershad@117.204.106.105] has joined #ruby
FluxiFlax2023 [FluxiFlax2023!~ali.jawad@193.227.186.146] has joined #ruby
<FluxiFlax2023>
Hi not sure if this is the correct place to ask, I did install ruby, rubygems, rails and passenger and generated the apache2-passenger-module and loaded it into apache, after that I create the "demo smoke blog" but when I go to the URL ruby pages are dsplayend in plain text ...see http://www.sortmyexpense.com/blog/Rakefile
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
Squarepy [Squarepy!~Luuk@unaffiliated/squarepy] has joined #ruby
stoor [stoor!~stoor@095-097-012-177.static.chello.nl] has joined #ruby
kakaskin [kakaskin!~CLDG@178.120.31.184] has joined #ruby
faber [faber!~faber@ppp-131-41.26-151.libero.it] has joined #ruby
davidpk [davidpk!~r00t@149.7.51.250] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
spuz [spuz!~alexs@80.169.35.118] has joined #ruby
p0y [p0y!~p0y@125.212.56.114] has joined #ruby
jcromartie [jcromartie!~jcromarti@c-69-140-238-182.hsd1.md.comcast.net] has joined #ruby
Hanmac1 [Hanmac1!~hanmac@p508456ED.dip0.t-ipconnect.de] has joined #ruby
banisterfiend [banisterfiend!~baniseter@222.153.223.47] has joined #ruby
<robotmay>
What would be the best way to compare two arrays of dates? I'm basically checking for items that exist in both arrays
<robotmay>
I tried subtracting one from the other and comparing the length, but that doesn't seem to work
<banisterfiend>
robotmay: array1 & array2
<robotmay>
banisterfiend: Ooh, what exactly does that do?
<banisterfiend>
robotmay: set intersection
<robotmay>
banisterfiend: Awesome, never used that before. Thanks :)
lorandi [lorandi!~lorandi@201-68-82-55.dsl.telesp.net.br] has joined #ruby
<[[thufir]]>
array1 | array2 would be union?
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
charnel [charnel!~cem@195.174.50.238] has joined #ruby
<charnel>
in a 2 dimensional array what is the best way to sum the first element of each array. I remember an alternative to blocks. But could not decide how to use lambda.
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
<heftig>
a.map(&:first).inject(:+)
<heftig>
though probably worse than a.inject { |m,x| m + x.first }
<heftig>
er
<heftig>
a.inject(0) { |m,x| m + x.first }
<charnel>
heftig, thanks.
<charnel>
but I want the first element of each array in the main array ie : [[3, "label"], [4, "label"]] How to get 7 ? This I guess gets the first array
<charnel>
sorry got it :)
TomJ_ [TomJ_!~TomJ@host-78-147-97-126.as13285.net] has joined #ruby
TomJ_ [TomJ_!~TomJ@unaffiliated/tomj] has joined #ruby
skim1776 [skim1776!~sergey@178.88.83.125] has joined #ruby
<skim1776>
is there any material on how to organize the code in the project?
sayakb [sayakb!~sayakb@kde/sayakb] has joined #ruby
<banisterfiend>
skim1776: there are two main approaches, the german approach (practiced by heftig and others) and the manhattan approach (practiced by americans and british & japanese). Each one has its benefits and awkward aspects, and each one can take your project in different directions with interesting ramifications down the line..like an opening move in a game of chess.
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
Johnnus_ [Johnnus_!~Johnnus_@62.109.36.140] has joined #ruby
Johnnus_ [Johnnus_!~Johnnus_@62.109.36.140] has quit [#ruby]
<heftig>
banisterfiend: what.
nari [nari!~nari@p62e58e.totrnt01.ap.so-net.ne.jp] has joined #ruby
jmeeuwen [jmeeuwen!~kanarip@white.kolabsys.com] has joined #ruby
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby
dkannan [dkannan!u480@gateway/web/irccloud.com/x-ipjbrwvnkhgzfmcp] has joined #ruby
michael_mbp [michael_mbp!~Marin@62.215.214.4] has joined #ruby
canton8 [canton8!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
<skim1776>
banisterfiend, what kind of approaches are you talking about?
skim1776 [skim1776!~sergey@178.88.83.125] has quit [#ruby]
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.155.81] has joined #ruby
zommi [zommi!quassel@nat/ibm/x-dleetsjbldmdxxwg] has joined #ruby
ctp [ctp!~ctp@213.163.64.43] has joined #ruby
danibx [danibx!~danibx@200.175.180.88.static.gvt.net.br] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
faber [faber!~faber@ppp-131-41.26-151.libero.it] has joined #ruby
Natch| [Natch|!~natch@178.73.217.238] has joined #ruby
BiHi [BiHi!~bihi@did75-17-88-165-129-29.fbx.proxad.net] has joined #ruby
alup [alup!~alup@193.92.123.5] has joined #ruby
djdb [djdb!~digitalbo@linux.minsk.tutby.com] has joined #ruby
cableray [cableray!~cableray@wl-dhcp159-109.Mines.EDU] has joined #ruby
rippa [rippa!~splitta@85.158.54.234] has joined #ruby
DarthGandalf [DarthGandalf!~Vetinari@znc/developer/DarthGandalf] has joined #ruby
jds [jds!~jds@188-220-60-85.zone11.bethere.co.uk] has joined #ruby
cynosure [cynosure!~cynosure@centrumnet.hu] has joined #ruby
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
mitchty [mitchty!~mitchty@ec2-50-19-41-37.compute-1.amazonaws.com] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@125.162.60.168] has joined #ruby
senny [senny!~senny@edge.garaio.com] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
faber [faber!~faber@ppp-131-41.26-151.libero.it] has joined #ruby
Amirh [Amirh!~amir@89.144.178.192] has joined #ruby
<Amirh>
I just witnessed something beautiful in ruby.
<banisterfiend>
Amirh: share
<Amirh>
it's just a different interpretation of what you guys already know :
<banisterfiend>
Amirh: tell me
<Amirh>
Object.superclass is BaiscObject
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
<Amirh>
and:
cek [cek!~cek@crius.pantheon.fused.net] has joined #ruby
<Amirh>
BasicObject.superclass is nill
<Amirh>
nil
<Amirh>
that's Taosim and/or Zenbuddhism
<cek>
propose faster way to craft xml other than with nokogiri. need hash like fashion
<Amirh>
the grand emptiness
<Amirh>
something like God but different in essense
<banisterfiend>
Amirh: haha
<Amirh>
banisterfiend: any idea?
<cek>
alright, seems that active_support has to_xml. great!
<banisterfiend>
Amirh: actually it's just saying that BasicObject does not hav ea superclass ;)
<banisterfiend>
not that the superclass is nil ;)
<Amirh>
the exactly
<Amirh>
how can nothing can create the world? banisterfiend
<Amirh>
the grand emptiness in Tao and Zen
<banisterfiend>
Amirh: form is emptiness and emptiness is form
<banisterfiend>
Amirh: and the relative meets the absolute like an arrow does its target
<Amirh>
what?
<Amirh>
the last one I mean
<Amirh>
banisterfiend: as I said it's another interpretation.
<banisterfiend>
Amirh: it's interesting
ikaros [ikaros!~ikaros@studpool-wlan-75-124.fs.fbi.h-da.de] has joined #ruby
<heftig>
[1,2,3,4].select.do < 3 # => [1,2] ; [1,2,3].map.do + 1 # => [2,3,4] ; neat, but probably not going to get seriously used
LMolr [LMolr!~quassel@87.19.33.245] has joined #ruby
palcu [palcu!~alex@89.122.187.223] has joined #ruby
JStoker [JStoker!jstoker@unaffiliated/jstoker] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
charnel [charnel!~cem@195.174.50.238] has joined #ruby
LockeVendetta [LockeVendetta!c2418a78@gateway/web/freenode/ip.194.65.138.120] has joined #ruby
ershad [ershad!~ershad@117.204.106.105] has joined #ruby
<heftig>
yeah, this let's you do [1,"2",3].select.do.is_a?(String)
<LockeVendetta>
hi, does anyone knows how can i have access (if that's even possible) to some method my_method arguments on a callback like before_filter?
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-218-131.hsd1.mi.comcast.net] has joined #ruby
<heftig>
banisterfiend: ampex does more, though
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
<[[thufir]]>
ERROR: While executing gem ... (NoMethodError) undefined method `call' for nil:NilClass when "gem install activerecord" ?
<charnel>
how can I loop through a 2 dimensional array add one element with calculation at the end of each element of the array
cousine [cousine!~cousine@196.221.245.118] has joined #ruby
<banisterfiend>
heftig: here's a question for u
<banisterfiend>
heftig: given an arbitrary Binding object, return the associated block (if there is one) for that frame ;)
<banisterfiend>
or for anyone
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
<heftig>
banisterfiend: so you mean:
<heftig>
def a; binding; end; given x = a { :foo }, take x and get the proc returning :foo?
<banisterfiend>
heftig: yes
<heftig>
do you already know if this is possible?
<heftig>
oh neat
<heftig>
x.eval "yield" already segfaults
<banisterfiend>
heftig: :P
<banisterfiend>
hehe
<banisterfiend>
heftig: in other words, yes it's possible, but ruby doesn't let us do it anyway ;)
`brendan [`brendan!~b@66-208-246-34-ubr02b-waldlk01-mi.hfc.comcastbusiness.net] has joined #ruby
sunkencityryleh [sunkencityryleh!~joel@h55n2c1o1036.bredband.skanova.com] has joined #ruby
<banisterfiend>
heftig: this shoudl work: x.eval("Proc.new")
<banisterfiend>
but it segfaults also
adac [adac!~adac@85-127-41-251.dynamic.xdsl-line.inode.at] has joined #ruby
<adac>
if i have an array @my_array ...how can I add an element at the very first position?
<banisterfiend>
adac: unshift
<adac>
banisterfiend, thank you a lot!
<heftig>
hm
<heftig>
rubinius has x.variables.block, a #<Rubinius::BlockEnvironment>
hasham2 [hasham2!~hasham@175.110.120.228] has joined #ruby
<heftig>
and x.variables.block.call_on_instance(self) runs it
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
Buck [Buck!~Buck@unaffiliated/buck] has quit ["Leaving"]
<banisterfiend>
heftig: i think these should be exposed on the Binding object
<banisterfiend>
heftig: binding.block.call
<banisterfiend>
it's silly the only really method on Binding is eval
<banisterfiend>
real*
<heftig>
so use rubinius :p
<banisterfiend>
heftig: no i just write C extensions to expose it to MRI:)
lorandi [lorandi!lorandi@nat/ibm/x-vtkfidamhkdfwgxp] has joined #ruby
ctp_ [ctp_!~ctp@dslc-082-083-154-105.pools.arcor-ip.net] has joined #ruby
sandstrom [sandstrom!~sandstrom@unaffiliated/sandstrom] has joined #ruby
<sandstrom>
How can I insert an element between all current elements in an array? E.g. [1,1,1] => [1, 9, 1, 9, 1] (where 9 is inserted)
<sandstrom>
(without using each_with_index or some other cumbersome solution, I'd prefer something elegant similar to zip)
<banisterfiend>
sandstrom: use zip
<banisterfiend>
[1,1,1].zip([9].cycle)
<banisterfiend>
oh
<banisterfiend>
hehe
<canton7>
.flatten
<banisterfiend>
+ flatten
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<heftig>
[1,1,1].flat_map { |x| [x,9] }
<sandstrom>
banisterfiend: how would the + flatten code read, I don't understand exactly how that would work.
<heftig>
[1,1,1].zip([9].cycle).flatten
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
<heftig>
but both return [1,9,1,9,1,9], so you'll have to drop the last element again
<sandstrom>
throws TypeError: can't convert Enumerable::Enumerator into Array
<heftig>
sandstrom: needs 1.9
<sandstrom>
okay
skim1776 [skim1776!~Miranda@178.88.83.125] has joined #ruby
Karmaon [Karmaon!~john@gateway/tor-sasl/karmaon] has joined #ruby
<heftig>
a = [1,1,1].each; Enumerator.new { |e| loop { e.yield a.next; e.yield 9 if a.peek } }.to_a
<sandstrom>
thanks for your help! got it working with [1,1,1].zip([9] * a.length).flatten (based on your suggestions)
<heftig>
ew, horrible.
pxjorge [pxjorge!~pxjorge@a89-152-235-119.cpe.netcabo.pt] has joined #ruby
<heftig>
(what i just made)
cynosure [cynosure!~cynosure@centrumnet.hu] has joined #ruby
provideal [provideal!~hornp@p4FFF8371.dip.t-dialin.net] has joined #ruby
<sandstrom>
or better [1,1,1].zip([9] * (a.length-1)).flatten
<Tasser>
a.join(" 9 ").split
<Tasser>
a.join(" 9 ").split.map(&:to_i)
nanderoo [nanderoo!~nanders@38.124.137.226] has joined #ruby
vraa [vraa!~vraa@99-20-202-44.lightspeed.hstntx.sbcglobal.net] has joined #ruby
<sandstrom>
Tasser: cleaver!
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
<sandstrom>
*clever
<heftig>
but only works with integers
<Tasser>
&:to_f
<heftig>
[Object.new,Object.new,Object.new]
<Tasser>
heftig, yeah, it's more based on statically typed ideas
<Tasser>
but since we often code that way anyway
<banisterfiend>
Tasser: this might sound like a weird request, but heftig speaks fluent german, could you retype your last sentence in german for him ? (in channel so we can all see it)
<heftig>
why for me?
<banisterfiend>
heftig: because you're german
<heftig>
i speak fluent english!
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<banisterfiend>
yes, but i want to see some german in this channel, just a bit :)
<Tasser>
banisterfiend, "funktioniert nur mit Integern"
<banisterfiend>
Tasser: hmm i didnt see any of those weird characters i wanted to see
<provideal>
banisterfiend: Was amüsiert Dich an deutschen Umlauten?
<banisterfiend>
Tasser: thanks though
<banisterfiend>
provideal: thanks!
<Tasser>
banisterfiend, öäü <- ?
<banisterfiend>
:))
<provideal>
ß
<Tasser>
provideal, that's only german, not swiss-german
enroxorz [enroxorz!~enroxorz@unaffiliated/enroxorz] has joined #ruby
<provideal>
sure, yeah.
mvangala [mvangala!~mvangala@134.192.133.86] has joined #ruby
csherin [csherin!~csherin@202.164.151.110] has joined #ruby
cynosure [cynosure!~cynosure@centrumnet.hu] has joined #ruby
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
stoor [stoor!~stoor@ip4da85716.direct-adsl.nl] has joined #ruby
Tweeq [Tweeq!~Tweeq@c-bf2fe655.02-221-6b73641.cust.bredbandsbolaget.se] has joined #ruby
Ownatik [Ownatik!~yoyoyoy@69.196.16.186] has joined #ruby
<Ownatik>
Hi, I've seen code like this from time to time but i'd need to be explain what it's actually testing for:
<Ownatik>
if respond_to?(:namespace=)
<Tasser>
Ownatik, if the object responds to a method :namespace= which is something like obj.namespace =
<Tasser>
responding in the sense that the method exists and is pubilc
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has quit ["WeeChat 0.3.6"]
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
<Ownatik>
Ok I'm getting the respond_to?, what confuses me is the namespace =
<Ownatik>
I know it's looking for something in there
<Ownatik>
but i'm not getting exactly what it's looking for and why
<canton7>
"namespace=" is the name of the method which is called when you run "myclass.namespace = 'value'"
<Ownatik>
ok
max_ [max_!~max@50-76-231-54-static.hfc.comcastbusiness.net] has joined #ruby
<canton7>
so "myclass.respond_to?(:namespace=)" will return true if you can call "myclass.namespace = 'value'" without it erroring, essentially
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
robotmay [robotmay!~robotmay@94.30.13.228] has joined #ruby
<Ownatik>
ok good
<Ownatik>
thank you
<Ownatik>
both
<heftig>
at least not with a NoMethodError
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
Synthead [Synthead!~max@50-76-231-54-static.hfc.comcastbusiness.net] has joined #ruby
mk03 [mk03!~mk03@61.245.119.34.er.eaccess.ne.jp] has joined #ruby
jds_ [jds_!~jds@188-220-60-85.zone11.bethere.co.uk] has joined #ruby
<Ownatik>
Another question related to the same example
gigamonk` [gigamonk`!~user@adsl-99-179-46-105.dsl.pltn13.sbcglobal.net] has joined #ruby
<Ownatik>
The gem I linked above, essentially it adds another inner class to the Redis class right?
fayimora [fayimora!~fayimora@95.175.159.48] has joined #ruby
<Ownatik>
Something is still not clear in my head with the concept of inner classes
<Ownatik>
and how it's used
ikaros [ikaros!~ikaros@dslb-094-219-214-087.pools.arcor-ip.net] has joined #ruby
bhavesh_a_p [bhavesh_a_p!~bhavesh_a@210.211.251.20] has joined #ruby
linoj_ [linoj_!~linoj@sn1-pat-1.m2s.com] has joined #ruby
cantbecool [cantbecool!~cantbecoo@38.98.246.130] has joined #ruby
p0y [p0y!~p0y@125.212.56.114] has joined #ruby
cek [cek!~cek@crius.pantheon.fused.net] has joined #ruby
vladyn [vladyn!~Adium@78.83.241.70] has joined #ruby
<cek>
kinda stuck with to_xml method. I want to overrride the tag processing.
<cek>
what's the other gem that would allow me to easily craft xml
yekta [yekta!~yekta@c-24-1-182-219.hsd1.il.comcast.net] has joined #ruby
<Ownatik>
nokogiri I think
<cek>
nokogiri lacks tutorials and overall documentation
<cek>
it's api is documented, but not user side
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
jgarvey [jgarvey!~jgarvey@cpe-174-097-248-211.nc.res.rr.com] has joined #ruby
gianlucadv [gianlucadv!~gianlucad@rna.bio.disco.unimib.it] has joined #ruby
davidpk [davidpk!~r00t@149.7.51.250] has joined #ruby
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby
vraa [vraa!~vraa@h147.20.185.173.dynamic.ip.windstream.net] has joined #ruby
Nss [Nss!~nss@193.205.142.161] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
rebagliatte [rebagliatte!~rebagliat@r186-53-72-96.dialup.adsl.anteldata.net.uy] has joined #ruby
intacta [intacta!~intacta@128-74-133-45.broadband.corbina.ru] has joined #ruby
geekbri [geekbri!~geekbri@208.252.10.190] has joined #ruby
krz [krz!~foobar@unaffiliated/krz] has joined #ruby
philcrissman [philcrissman!~philcriss@206.57.45.116] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@host-208-68-238-122.biznesshosting.net] has joined #ruby
bbttxu [bbttxu!~adam@24-178-215-34.static.ftwo.tx.charter.com] has joined #ruby
Jippi [Jippi!~jippignu@109.202.139.50] has joined #ruby
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby
<JonnieCache>
Ownatik: Inner classes, classes defined in the body of another class, dont really mean anything in ruby
<JonnieCache>
youre free to put a class definition inside another class definition, but it doesnt have any effect on namespacing or anything iirc
<JonnieCache>
ok actually it does affect namespacing, but nothing else, ie. it doesnt affect instantiation or inheritance or anything like in java
rippa [rippa!~rippa@109-161-67-90.pppoe.yaroslavl.ru] has joined #ruby
akem [akem!~akem@253.195.84.79.rev.sfr.net] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
Ankhers [Ankhers!~user@76-10-149-67.dsl.teksavvy.com] has joined #ruby
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
<provideal>
Is there a thing like an 'inherited' __FILE__, i.e., a __FILE__ that's different in subclasses?
robyurkowski [robyurkowski!~robyurkow@64.254.250.82] has joined #ruby
jackerran [jackerran!~jackerran@fw.luckie.net] has joined #ruby
<adac>
if I open a file like hat: "File.open(File.expand_path('~') + "/my.log") { |f| f.read }" then of course i get the fiele's content as it is expected. Now I would liek to retrieve the content from bottom up. is this possible somehow?
Synthead [Synthead!~max@50-76-231-54-static.hfc.comcastbusiness.net] has joined #ruby
niklasb [niklasb!~codeslay0@p5B3103AD.dip0.t-ipconnect.de] has joined #ruby
robbinn [robbinn!c136435d@gateway/web/freenode/ip.193.54.67.93] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@75-162-54-195.desm.qwest.net] has joined #ruby
intacta [intacta!~intacta@128-74-133-45.broadband.corbina.ru] has joined #ruby
Natch| [Natch|!~natch@178.73.218.168] has joined #ruby
kpshek [kpshek!~kpshek@159.140.254.97] has joined #ruby
addisaden_ [addisaden_!~addisaden@xdsl-89-0-91-114.netcologne.de] has joined #ruby
zommi [zommi!quassel@nat/ibm/x-sdjvtzaasihpctri] has joined #ruby
Paoc_ [Paoc_!~paoc@pc-29-167-104-200.cm.vtr.net] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<addisaden_>
Hi @all | which packages have i to install in debian to use rubysdl?
<robbinn>
what is the best xml parseur in ruby ?
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
trivol [trivol!~aurelien@gra94-1-81-57-175-179.fbx.proxad.net] has joined #ruby
macmartine [macmartine!~macmartin@069-064-227-254.pdx.net] has joined #ruby
<JonnieCache>
robbinn: nokogiri
niklasb [niklasb!~codeslay0@p5B3103AD.dip0.t-ipconnect.de] has joined #ruby
Weddy [Weddy!~wedtm@173-12-163-78-oregon.hfc.comcastbusiness.net] has joined #ruby
adac [adac!~adac@85-127-41-251.dynamic.xdsl-line.inode.at] has joined #ruby
evantravers [evantravers!~textual@fw.luckie.net] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@76-10-149-67.dsl.teksavvy.com] has joined #ruby
gimireh [gimireh!~gimireh@49.244.141.230] has joined #ruby
kenperkins [kenperkins!~textual@50-47-18-37.evrt.wa.frontiernet.net] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
axl_ [axl_!~axl@75-149-152-225-Minnesota.hfc.comcastbusiness.net] has joined #ruby
theRoUS [theRoUS!~KenCoar@dsl093-240-159.ral1.dsl.speakeasy.net] has joined #ruby
theRoUS [theRoUS!~KenCoar@apache/committer/coar] has joined #ruby
gimireh [gimireh!~gimireh@49.244.141.230] has quit ["Leaving"]
roblally [roblally!~roblally@195-11-205-194.suip.mezzonet.net] has joined #ruby
crodas [crodas!~crodas@git.crodas.org] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
axl_ [axl_!~axl@75-149-152-225-Minnesota.hfc.comcastbusiness.net] has joined #ruby
stepitime [stepitime!~stepitime@209-33-232-193.dsl.infowest.net] has joined #ruby
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
cobragoat [cobragoat!~cobragoat@mobile-198-228-194-251.mycingular.net] has joined #ruby
<thomasfedb>
linduxed, you specs on maker.rb are insufficient.
<thomasfedb>
linduxed, you'll find that marker.number_match_count is returning a negative number.
<linduxed>
thomasfedb: oh
<linduxed>
thomasfedb: that could explain things
<thomasfedb>
linduxed, personally I would stub out this function inside the specs for game.rb
<linduxed>
"stub out"?
<thomasfedb>
linduxed, did you read the error I wonder?
<thomasfedb>
linduxed, never heard of mocking and stubbing? google it.
<thomasfedb>
linduxed, i use "double ruby" or "rr" with rspec myself.
<linduxed>
thomasfedb: i did read it, but i didn't know if it had something to do with array position or something else
spanner [spanner!~quassel@128.249.96.10] has joined #ruby
alx- [alx-!~Alex@108.162.180.72] has joined #ruby
<thomasfedb>
linduxed, i said that "*" (aka the multiplication method) had received a negative argument. which is obviously impossible with a string.
<linduxed>
thomasfedb: thank you, now i understand it
<thomasfedb>
linduxed, good. i still suggest stubbing
csavola [csavola!~csavola@76-10-149-67.dsl.teksavvy.com] has joined #ruby
<linduxed>
thomasfedb: i'm about 100 pages into the RSpec book, which is 420 pages long
GiambalaGiambala [GiambalaGiambala!~virunga@151.64.24.102] has joined #ruby
<linduxed>
thomasfedb: something tells me that i'll get to that eventually ;-)
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
<thomasfedb>
linduxed, you're actually reading that book?
<thomasfedb>
linduxed, learn't rspec on the job myself.
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<robbinn>
hi
<linduxed>
thomasfedb: yeah, i'm plowing through it pretty quick
<linduxed>
thomasfedb: pretty fun book
<robbinn>
how resolve unicode probleme with rexml
<thomasfedb>
linduxed, good.
Ox61737476 [Ox61737476!~asteve@unaffiliated/kxsteve] has joined #ruby
<linduxed>
thomasfedb: and it helps me a lot because i think i'm pretty shit at programming
<thomasfedb>
robbinn, i have no idea
<thomasfedb>
robbinn, though i suggest that you elevate your degree of specificity
<linduxed>
thomasfedb: i've already learnt some refactoring concepts that i wouldn't have figured out on my own, my code would be awfully procedural, when it should be object oriented
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
<thomasfedb>
linduxed, OO is awesome once you "get it"
<Ox61737476>
where s3 is an instance of right_aws
<thomasfedb>
Ox61737476, does it work?
<Ox61737476>
thomasfedb: in 1.8.7 it does; in 1.9.2 it hangs; and i'm not sure why
<linduxed>
thomasfedb: well that's _exactly_ why i read this book and "Well-Grounded Rubyist"... i don't get it yet
<Ox61737476>
i can get out a chunk at a time
<Ox61737476>
and then an eventual timeout
<thomasfedb>
Ox61737476, ok. I'll look. Would have been better if that had been you question.
<thomasfedb>
Ox61737476, i don't see anything that should break in 1.9.2 specifically. does the gem support 1.9.2 ?
<thomasfedb>
linduxed, it took me about a year to really understand it. luckily that year was the same year that I was 13. =P
techhelp [techhelp!~Dan@firebox.rsmart.com] has joined #ruby
<Ox61737476>
thomasfedb: yes, it should
<linduxed>
thomasfedb: good for you, i'm 23
Synthead [Synthead!~max@50-76-231-54-static.hfc.comcastbusiness.net] has joined #ruby
<thomasfedb>
Ox61737476, i suggest stackoverflow. I can't really help you, sorry.
<linduxed>
...
<thomasfedb>
linduxed, just getting into ruby then? working as a dev?
<linduxed>
student
<thomasfedb>
linduxed, ah ok.
mayfield [mayfield!~mayfield@173.226.142.142] has joined #ruby
davidpk [davidpk!~r00t@149.7.51.250] has joined #ruby
<thomasfedb>
linduxed, university myself. though currently at a summer job - writing ruby
<linduxed>
it's a bit complicated... but in a nutshell, i've gotten by either writing bad code or relying on lab-partners
<linduxed>
so i decided that maybe i should actually learn to code for realy
<linduxed>
*real
addisaden [addisaden!~addisaden@xdsl-89-0-91-114.netcologne.de] has joined #ruby
<thomasfedb>
linduxed, eek!
tolland [tolland!~tolland@vs802.rosehosting.com] has joined #ruby
<linduxed>
or well that's not completely true
<thomasfedb>
linduxed, sure. i suggest you go and write a OO representation of a rubix cube at some point.
<linduxed>
i never write bad code
<linduxed>
*wrote
<linduxed>
instead i choked and didn't write anything at all
<linduxed>
because i wanted to do it right from the start... but didn't know how to code
<linduxed>
so yeah
<linduxed>
time to shape up a bit
Ox61737476 [Ox61737476!~asteve@unaffiliated/kxsteve] has quit [#ruby]
<thomasfedb>
linduxed, good on you.
<thomasfedb>
linduxed, ruby is a good language if you want OO. but i'd suggest you also learn some C++
<linduxed>
i do know some haskell, java and prolog
luxurymo_ [luxurymo_!~luxurymod@rrcs-184-75-21-21.nyc.biz.rr.com] has joined #ruby
addisaden_ [addisaden_!~addisaden@xdsl-89-0-91-114.netcologne.de] has joined #ruby
joe-mac1 [joe-mac1!~mickysanc@clients1.berklee.edu] has joined #ruby
<linduxed>
but c++ and C have escaped me for the most part
<thomasfedb>
linduxed, just because it gives you an oppertunity to code things like linked-lists from scratch, pointer stuff
<linduxed>
yeah i guess
<linduxed>
well
<thomasfedb>
linduxed, i approve of haskell and prolog. java gives me the shits
<linduxed>
yeah i don't like java that much either
addisaden [addisaden!~addisaden@xdsl-89-0-91-114.netcologne.de] has joined #ruby
<linduxed>
but it's ok
<joe-mac1>
say I finish processing arguments with getoptlong in ruby 1.8, I need to now shift to the end of the typical getopt style arguments so that I can access from the end end of those to the end of the remaining arguments which are not getopt style... what variable contains the integer of the length of the getopt arguments?
<thomasfedb>
linduxed, you language agnostic yet?
<linduxed>
i don't like to code in it, but it's ok
<linduxed>
thomasfedb: in the sense of "i'll pick the right language for the right job"?
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
Ammar01 [Ammar01!~hassaa10@gatek.thls.bbc.co.uk] has joined #ruby
davidcelis [davidcelis!~david@c-76-115-58-79.hsd1.or.comcast.net] has joined #ruby
<thomasfedb>
linduxed, in the sense that if i gave you a hunk of code to maintain in some random language you'd not seen before you'd cope
<linduxed>
nope
notjohn [notjohn!~john@WS1-DSL-208-102-253-169.fuse.net] has joined #ruby
anykey__ [anykey__!~eric_wood@tacs.cs.tamu.edu] has joined #ruby
<linduxed>
too shit at coding atm
<linduxed>
up until a month or two ago, i coded too little
<thomasfedb>
linduxed, ok. what's your major?
<linduxed>
worked too little
<linduxed>
thomasfedb: CS
addisaden [addisaden!~addisaden@xdsl-89-0-91-114.netcologne.de] has joined #ruby
<thomasfedb>
linduxed, ok. i'm looking to be getting that. about to start first year uni.
<linduxed>
where?
<thomasfedb>
linduxed, Australia
<linduxed>
oh
<linduxed>
other side of the world then
<thomasfedb>
linduxed, though I have applied for Harvard, MIT and Yale. We'll see how that goes then.
<linduxed>
wow, ambitions i see
<thomasfedb>
linduxed, i guess
<joe-mac1>
waste of money. get your BS at a regular school, advanced degrees at top tier like the ones you mentiioned
ershad [ershad!~ershad@117.204.106.105] has joined #ruby
<thomasfedb>
joe-mac1, the financial aid is pretty good, and my seccond degree is probably going to be medicine - so I'll do that at a local school
scx [scx!~Administr@abui165.neoplus.adsl.tpnet.pl] has joined #ruby
<thomasfedb>
joe-mac1, seeing as this is where i want to practice
<robert_>
so, given two strings
<thomasfedb>
robert_, if you're a magician then you'll join them together
<thomasfedb>
def magic(str1, str2); str1 + str2; end
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<robert_>
haha
pootpoot [pootpoot!~pootpoot@38.108.250.130] has joined #ruby
<robert_>
I'm not allowed to express a thought in two pieces?
<linduxed>
FFFFFUUUUUUU
<robert_>
fqdn-host.domain.com and domain.com, can I somehow extract JUST 'fqdn-host.' from 'fqdn-host.domain.com' ?
<linduxed>
one damn @ sign
<thomasfedb>
robert_, you should end your first line with a continuation. like this -> \
<thomasfedb>
see, nifty eh?
<linduxed>
that's all it took to fuck up the entire code
<linduxed>
oh well, that's done now
<robbinn>
how check if a value is null or not ?
<robert_>
oh, I see. :p
Karmaon [Karmaon!~john@gateway/tor-sasl/karmaon] has joined #ruby
Gushings [Gushings!~electric@66.147.232.65] has joined #ruby
<robert_>
that.. does nothing.
<Gushings>
Is it okay to access an array with a fixnum?
<joe-mac1>
some states even have free rides to state school if you maintain a B average... I think georgia does that
<joe-mac1>
but you have to be a georgia resident iirc
DFectuoso [DFectuoso!~DFectuoso@fixed-203-141-49.iusacell.net] has joined #ruby
<thomasfedb>
joe-mac1, problem is that back here everybody knows about Harvard, Yale, Berkeley, MIT. They don't know all the other schools, Carnegie Mellon would fall on deaf ears
<JonnieCache>
what? rides on the bus you mean?
<joe-mac1>
carnegie mellon has the best EE/CS program in our country
<thomasfedb>
joe-mac1, I know.
<thomasfedb>
joe-mac1, if I was doing graduate studies in CS I'd go there.
<thomasfedb>
joe-mac1, but they don't do aid for international students.
<thomasfedb>
(at undergrad level)
<thomasfedb>
Gushings, yes.
<joe-mac1>
o I c
<thomasfedb>
robert_, maybe I meant a "$" instead of "^"
<thomasfedb>
robert_, basically i want to force it to match the end of the string
stepitime [stepitime!~stepitime@66.7.121.170] has joined #ruby
ckrailo [ckrailo!~ckrailo@208.86.167.247] has joined #ruby
davidpk [davidpk!~r00t@149.7.51.250] has joined #ruby
gianlucadv [gianlucadv!~gianlucad@2.197.146.117] has joined #ruby
<provideal>
I LOVE RUBY: pp.map{|f|f.map(&:main)}.map(&:uniq).select{|f|f.length > 1}.count -- now, do this with Java!
mk03 [mk03!~mk03@61.245.119.34.er.eaccess.ne.jp] has joined #ruby
JohnBat26 [JohnBat26!~Eugene@80.251.120.55] has joined #ruby
<JonnieCache>
not very readable though is it
ewag [ewag!~ewagner@office-gw.cmh.aotech.net] has joined #ruby
<provideal>
I just needed the actual number.
pdtpatrick_ [pdtpatrick_!~pdtpatric@ip72-211-207-15.oc.oc.cox.net] has joined #ruby
<thomasfedb>
provideal, that's Morse code implemented in ruby
<provideal>
thomasfedb: neat!
<thomasfedb>
Gushings, no worries
d2dchat [d2dchat!~d2dchat@c-98-209-18-197.hsd1.mi.comcast.net] has joined #ruby
<Mon_Ouie>
You can probably do it just like pp.count { |f| f.map(&:main).uniq.length > 1 }
<Gushings>
If I'm getting segmentation faults with one of my gems, does it mean there is a larger problem outside my code?
<thomasfedb>
Gushings, maybe.
<Mon_Ouie>
Gushings: Segmentation faults are very rare in plain Ruby code. The most likely cause of it is a bug in a C extension.
<Gushings>
Ah, that would make sense.
<Gushings>
Thank you.
p0y [p0y!~p0y@125.212.56.114] has joined #ruby
p0y_ [p0y_!~p0y@112.210.82.218] has joined #ruby
LiquidInsect [LiquidInsect!~billabney@50-0-135-178.dedicated.static.sonic.net] has joined #ruby
taii [taii!~tai@85-127-72-17.dynamic.xdsl-line.inode.at] has joined #ruby
dazoakley [dazoakley!~dazoakley@hocuspokus.vm.bytemark.co.uk] has quit [#ruby]
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
peterhil [peterhil!~peterhil@xdsl-77-86-196-131.nebulazone.fi] has joined #ruby
alexch [alexch!~alex@79.112.123.80] has joined #ruby
blueadept [blueadept!~blueadept@unaffiliated/blueadept] 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
alexch [alexch!~alex@79.112.123.80] has quit [#ruby]
strife25 [strife25!strife25@nat/ibm/x-iffjoogkbbyjktdn] has joined #ruby
fr0gprince_ [fr0gprince_!Bart@178-85-90-223.dynamic.upc.nl] has joined #ruby
bbttxu [bbttxu!~adam@pool-71-96-208-205.dfw.dsl-w.verizon.net] 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
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby
rebagliatte [rebagliatte!~rebagliat@r186-53-125-222.dialup.adsl.anteldata.net.uy] has quit [#ruby]
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
Bart_ [Bart_!~fr0gprinc@178-85-90-223.dynamic.upc.nl] has joined #ruby
fr0gprince_mac [fr0gprince_mac!~fr0gprinc@178-85-90-223.dynamic.upc.nl] has joined #ruby
skaczor_ [skaczor_!~quassel@mail.prognosoft.biz] has joined #ruby
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
artOfWar [artOfWar!~artofwar@nat/yahoo/x-qkqhbatgrckidvwn] has joined #ruby
<JonnieCache>
aaaaargh apple included postgres in the new OSX
<JonnieCache>
fuck you apple
LiquidInsect [LiquidInsect!~billabney@50-0-135-178.dedicated.static.sonic.net] has joined #ruby
<JonnieCache>
postgres is great and all but this shit just gets in my way
<JonnieCache>
when im trying to kick my own postgres into shape
flippingbits [flippingbits!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
<DefV>
fix it with brew :-/
blaze_boy [blaze_boy!c4db3311@gateway/web/freenode/ip.196.219.51.17] has joined #ruby
<blaze_boy>
How to full version of ruby docs on linux ubuntu ?
lorandi [lorandi!lorandi@nat/ibm/x-wubdlznfdvgzzule] has joined #ruby
<Tasser>
blaze_boy, ruby-doc
remink_ [remink_!~remink@unaffiliated/remink] has joined #ruby
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.34.206.mtnl.net.in] has joined #ruby
alxch [alxch!~alxch@79.112.123.80] has joined #ruby
sean_ [sean_!~seanmccan@S010600179a35aaf7.ed.shawcable.net] has joined #ruby
alxch [alxch!~alxch@79.112.123.80] has quit ["Leaving"]
mcriddles [mcriddles!~mcriddles@IGLD-84-229-201-153.inter.net.il] has joined #ruby
<mcriddles>
hello people
remink_ [remink_!~remink@unaffiliated/remink] has joined #ruby
d2dchat [d2dchat!~d2dchat@c-98-209-18-197.hsd1.mi.comcast.net] has joined #ruby
lkba [lkba!~AndChat@bos181.neoplus.adsl.tpnet.pl] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-218-131.hsd1.mi.comcast.net] has joined #ruby
thepix [thepix!~pix@178-37-132-222.adsl.inetia.pl] has joined #ruby
Paoc_ [Paoc_!~paoc@pc-29-167-104-200.cm.vtr.net] has joined #ruby
Phrogz [Phrogz!~phrogz@184-96-128-49.hlrn.qwest.net] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
virunga [virunga!~virunga@151.64.24.102] has joined #ruby
GiambalaGiambala [GiambalaGiambala!~virunga@151.64.56.162] has joined #ruby
kevinbond [kevinbond!~kevinbond@68.204.50.112] has joined #ruby
gianlucadv [gianlucadv!~gianlucad@109.54.242.126] has joined #ruby
kf8a [kf8a!~kf8a@user-33c730.user.msu.edu] has joined #ruby
tolland [tolland!~tolland@vs802.rosehosting.com] has quit [#ruby]
youdonotexist [youdonotexist!~youdonote@192.206.158.10] has joined #ruby
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
virunga [virunga!~virunga@151.64.58.76] has joined #ruby
distax [distax!~distax@141.99.96.134] has joined #ruby
enroxorz [enroxorz!~enroxorz@unaffiliated/enroxorz] has quit [#ruby]
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
fayimora [fayimora!~fayimora@lt38-201.eecs.qmul.ac.uk] has joined #ruby
Sailias [Sailias!~jonathan@s72-38-77-178.static.comm.cgocable.net] has joined #ruby
<blaze_boy>
Tasser : there is no suck package in synaptic
cbuxton [cbuxton!~Adium@nat/partnerpedia/x-vzypyfyvvuvilbag] has joined #ruby
n3m [n3m!~bla@88-117-30-169.adsl.highway.telekom.at] has joined #ruby
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
jrodicus [jrodicus!~jrodicus@72.32.115.230] has joined #ruby
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
Illiux [Illiux!~nol@mc-wireless-pittnet-150-212-10-24.wireless.pitt.edu] has joined #ruby
gogo_it [gogo_it!~joshuaman@38.104.99.146] has joined #ruby
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
<gogo_it>
Can am used to using xpath with Nokugiri, but I need to use Hpricot, on this current project. I've never used Hpricot and am very confused by it. is there a why to convert an xpath into a format Hpricot can use?
minijupe [minijupe!~benlieb@adsl-74-243-183-66.ard.bellsouth.net] has joined #ruby
LiquidInsect [LiquidInsect!~billabney@50-0-135-178.dedicated.static.sonic.net] has joined #ruby
kenperkins [kenperkins!~textual@174-24-134-155.tukw.qwest.net] has joined #ruby
ping-pong [ping-pong!~qwerty@212-30-218-200.static.simnet.is] has joined #ruby
stef_204 [stef_204!~kvirc@unaffiliated/stef-204/x-384198] has joined #ruby
cemycc [cemycc!~cemycc@89.41.213.8] has joined #ruby
gogo_it [gogo_it!~joshuaman@38.104.99.146] has quit [#ruby]
<linduxed>
whad does the %w in %w[1 2 3 4] mean?
<heftig>
word literal
<linduxed>
still don't understand
<heftig>
splits the string into words and makes an array
davidcelis [davidcelis!~david@70-89-180-6-smc-or.hfc.comcastbusiness.net] has joined #ruby
<linduxed>
so that's the same as ["1","2","3","4"]
<linduxed>
?
<heftig>
yes
<linduxed>
ok
<heftig>
you can choose the delimiter, by the way
<heftig>
%w"1 2 3 4" would work, too
<heftig>
or %wX1 2 3 4X
<heftig>
ah, whoops
<heftig>
that doesn't
<heftig>
but %w@1 2 3 4@ does
<rippa>
I like %w<1 2 3 4> myself
<rippa>
[] looks too much like array literal
<rippa>
or #[] method
<heftig>
it's an array literal
fayimora [fayimora!~fayimora@lt38-201.eecs.qmul.ac.uk] has joined #ruby
LiquidIn1ect [LiquidIn1ect!~billabney@50-0-135-178.dedicated.static.sonic.net] has joined #ruby
MasterIdler_ [MasterIdler_!~MasterIdl@69-196-169-67.dsl.teksavvy.com] has joined #ruby
jtrudeau [jtrudeau!~jeff@12.206.220.2] has joined #ruby
codespectator [codespectator!~codespect@host-84-13-152-223.opaltelecom.net] has joined #ruby
maletor [maletor!~maletor@74.115.25.139] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@76-10-149-67.dsl.teksavvy.com] has joined #ruby
fayimora [fayimora!~fayimora@lt38-201.eecs.qmul.ac.uk] has joined #ruby
tbrock [tbrock!~tbrock@74.113.160.178] has joined #ruby
techhelp [techhelp!~Dan@firebox.rsmart.com] has quit ["Leaving"]
techhelp [techhelp!~Dan@firebox.rsmart.com] has joined #ruby
tbrock [tbrock!~tbrock@74.113.160.178] has quit [#ruby]
CannedCorn [CannedCorn!~tbrock@74.113.160.178] has joined #ruby
<CannedCorn>
what is the best book for learning ruby
<CannedCorn>
I'm reading learning ruby (oreilly) and it sucks / is outdated
LiquidInsect [LiquidInsect!~billabney@50-0-135-178.dedicated.static.sonic.net] has joined #ruby
alex__c2022 [alex__c2022!~alex@207.239.64.154] has joined #ruby
<davidcelis>
well grounded rubyist is one i see mentioned often
<davidcelis>
as is Metaprogramming Ruby
ghanima [ghanima!~ghanima@163.192.12.4] has joined #ruby
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
hadees [hadees!~hadees@64.132.24.248] has joined #ruby
lukasz_k1recki [lukasz_k1recki!~Lukasz_Ko@94.228.68.145] has joined #ruby
<CannedCorn>
more advanced or for beginners?
Araxia_ [Araxia_!~Araxia@173-164-68-213-Oregon.hfc.comcastbusiness.net] has joined #ruby
eldariof [eldariof!~CLD@81.200.20.184] has joined #ruby
<CannedCorn>
seems dated also, 2010
zenergi [zenergi!~zenergi@pdpc/supporter/student/zenergi] has joined #ruby
<Illiux>
So I'm learning ruby via koans. And I was cruising along going "this is pretty cool but not that epic" and then about_iteration blew my mind. Just wanted to say.
invsblduck [invsblduck!~brett@173.227.0.2] has joined #ruby
GiambalaGiambala [GiambalaGiambala!~virunga@151.64.11.94] has joined #ruby
<n3m>
Is there a tool for ruby that shows you where a method is defined/called in my project? Preferably something that understands ruby and is able to distinguish methods with the same name in different scopes.
josefig [josefig!~josef@187.156.91.147] has joined #ruby
josefig [josefig!~josef@unaffiliated/josefig] has joined #ruby
LMolr [LMolr!~quassel@87.19.33.245] has joined #ruby
<davidcelis>
CannedCorn: 2010's not that dated, actually
<davidcelis>
plenty of people still use those two books; they cover ruby 1.9
hubble [hubble!~hubble@173-165-61-105-Illinois.hfc.comcastbusiness.net] has joined #ruby
<hubble>
If an API requires a Base64.encode64() representation of an image
<hubble>
is it okay to simple read and encode the tempfile
<hubble>
from a multipart form?
peleteiro [peleteiro!~peleteiro@201.7.186.67] has joined #ruby
<hubble>
Base64.encode64(image.tempfile.read)
fayimora [fayimora!~fayimora@lt38-201.eecs.qmul.ac.uk] has joined #ruby
<hubble>
where @tempfile=#<File:/var/folders/dk/dkxXfLBmEGGdfM-QtS8LeE+++TU/-Tmp-/RackMultipart20120126-5658-1ms8w9f>
<hubble>
does that work?
josh [josh!~josh@74-95-43-126-Oregon.hfc.comcastbusiness.net] has joined #ruby
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
lethargus [lethargus!cc593502@gateway/web/freenode/ip.204.89.53.2] has joined #ruby
tuxaddicted [tuxaddicted!~tuxaddict@202.60.13.34] has joined #ruby
lukasz_k_ [lukasz_k_!~lukasz@94.228.68.145] has joined #ruby
tuxaddicted [tuxaddicted!~tuxaddict@202.60.13.34] has joined #ruby
tuxaddicted [tuxaddicted!~tuxaddict@202.60.13.34] has joined #ruby
adac [adac!~adac@85-127-41-251.dynamic.xdsl-line.inode.at] has joined #ruby
stkowski [stkowski!~stkowski@12.207.16.130] has joined #ruby
mayfield [mayfield!~mayfield@cpe-173-172-188-87.satx.res.rr.com] has joined #ruby
crodas [crodas!~crodas@git.crodas.org] has joined #ruby
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby
spinagon [spinagon!~rippa@109-161-124-124.pppoe.yaroslavl.ru] has joined #ruby
wyhaines [wyhaines!~wyhaines@mo-65-173-76-11.sta.embarqhsd.net] has joined #ruby
Illiux [Illiux!~nol@fq-wireless-pittnet-150-212-2-253.wireless.pitt.edu] has joined #ruby
codespectator [codespectator!~codespect@host-84-13-152-223.opaltelecom.net] has joined #ruby
phantomfake [phantomfake!~i@pool-71-190-229-236.nycmny.fios.verizon.net] has joined #ruby
phantomfake [phantomfake!~i@pool-71-190-229-236.nycmny.fios.verizon.net] has joined #ruby
phantomfake [phantomfake!~i@pool-71-190-229-236.nycmny.fios.verizon.net] has joined #ruby
Spockz [Spockz!~Spockz@21pc198.sshunet.nl] has joined #ruby
DFectuoso [DFectuoso!~DFectuoso@fixed-203-141-49.iusacell.net] has joined #ruby
Tweeq [Tweeq!~Tweeq@h155n3-ks-a31.ias.bredband.telia.com] has joined #ruby
mayfield [mayfield!~mayfield@cpe-173-172-188-87.satx.res.rr.com] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
aakashvd [aakashvd!~aakashvd@triband-mum-59.184.31.79.mtnl.net.in] has joined #ruby
eywu [eywu!~Adium@205-170-107-4.dia.static.qwest.net] has joined #ruby
logic [logic!~logic@unaffiliated/bitch333z] has joined #ruby
<logic>
hey guys sup..
tuxaddicted [tuxaddicted!~tuxaddict@202.60.13.34] has joined #ruby
a_a_g [a_a_g!~aag@115.109.14.4] has joined #ruby
<logic>
How do I run any kind of scripts in side a particular folder with ruby?
apeiros_ [apeiros_!~apeiros@77-58-113-31.dclient.hispeed.ch] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
lorandi [lorandi!~lorandi@201-68-82-55.dsl.telesp.net.br] has joined #ruby
sieson [sieson!~sasan@173.227.31.82] has joined #ruby
<sieson>
does anyone know a good gem that can convert mongodb data to mysql?
amerine [amerine!~mturner@67.204.184.82] has joined #ruby
Illiux_ [Illiux_!~nol@fq-wireless-pittnet-150-212-2-253.wireless.pitt.edu] has joined #ruby
strife25 [strife25!strife25@nat/ibm/x-lhppweqdpfpxhrzz] has joined #ruby
ikaros [ikaros!~ikaros@dslb-094-219-214-087.pools.arcor-ip.net] has joined #ruby
<addisaden>
@sieson i dont think there is such a gem
<addisaden>
but dont know
azbarcea_ [azbarcea_!~quassel@79.114.122.35] has joined #ruby
apeiros [apeiros!~apeiros@77-58-113-31.dclient.hispeed.ch] has joined #ruby
<sieson>
addisaden: thats what I thought too, I cant find any gems on rubygems.org
Illiux [Illiux!~nol@fq-wireless-pittnet-150-212-2-253.wireless.pitt.edu] has joined #ruby
sieson [sieson!~sasan@173.227.31.82] has quit [#ruby]
Illiux [Illiux!~nol@fq-wireless-pittnet-150-212-2-253.wireless.pitt.edu] has joined #ruby
mads- [mads-!~mads@2808ds1-by.0.fullrate.dk] has quit [#ruby]
<addisaden>
sieson: sql and nosql is really diffrent. maybe you can write such a gem, but don't have every feature of it
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
Illiux [Illiux!~nol@fq-wireless-pittnet-150-212-2-253.wireless.pitt.edu] has joined #ruby
<addisaden>
rails have a databaselayer. mabe you can use this stuff?
voodoofish430 [voodoofish430!~mtorres@208.76.2.200] has joined #ruby
Illiux [Illiux!~nol@fq-wireless-pittnet-150-212-2-253.wireless.pitt.edu] has joined #ruby
ahovatte [ahovatte!~root@li75-12.members.linode.com] has joined #ruby
_2easy [_2easy!~nofuture@89-79-244-137.dynamic.chello.pl] has joined #ruby
SegFaultAX|work [SegFaultAX|work!~mkbernard@173.228.45.162] has joined #ruby
hasrb [hasrb!~hasrb@99.179.103.235] has joined #ruby
<hasrb>
Is there a gem or recommended way to test against multiple rubies? Assuming integration with RVM or rbenv is necessary. Similar to the appraisal gem but just for Ruby.
<burgestrand>
hasrb: rvm has helper methods for running certain commands against all rubies, and even “rvm tests” and “rvm specs”
<hasrb>
burgestrand: have you used multiruby? Haven't seen those commands, I'll look into them
<burgestrand>
hasrb: no I haven^t
Paoc_ [Paoc_!~paoc@pc-29-167-104-200.cm.vtr.net] has joined #ruby
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
benwoody [benwoody!~ben@ln.benwoodall.com] has joined #ruby
<hasrb>
burgestrand: the RVM commands are much simpler, thanks for pointing those out
samsonjs [samsonjs!~samsonjs@S01060026f31b8198.gv.shawcable.net] has joined #ruby
<burgestrand>
hasrb: :)
enherit [enherit!~enherit@216.3.99.206] has joined #ruby
stephenjudkins [stephenjudkins!~stephen@97-115-115-172.ptld.qwest.net] has joined #ruby
idletom [idletom!b@173-30-162-172.client.mchsi.com] has joined #ruby
zastaph [zastaph!zastaph@unaffiliated/zastaph] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
dasfugufish [dasfugufish!~Adium@174-27-233-214.slkc.qwest.net] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@213.152.255.138] has joined #ruby
a_a_g [a_a_g!~aag@115.109.14.4] has quit [#ruby]
yxhuvud [yxhuvud!mongo@h-5-47.a212.priv.bahnhof.se] has joined #ruby
airhorns [airhorns!~airhorns@67.210.173.114] has joined #ruby
<joe-mac1>
if I pass a method to Array.map(), as like whatever.map(&:name).size, what scope is that method name expected to be in?
<ccooke>
joe-mac1: the local scope you're calling from
<joe-mac1>
basically, I have an array of threads and I want to get the size of the threads that are alive... trying soemthing like threads.map(&:alive).size but I am fairly certain that won't work
<spinagon>
it just sends symbol to objects
<spinagon>
what scope are you talking about?
<ccooke>
joe-mac1: :alive is just a symbol. & just means "call the to_proc method on whatever I'm passed and use the result"
nivoc [nivoc!~matthias@ipc-hosting.de] has joined #ruby
<ccooke>
joe-mac1: there's nothing special about the usage
<joe-mac1>
ok
<yxhuvud>
joe-mac1: size will always be the number of threads in that case.
<ccooke>
joe-mac1: in particular, :alive does not know that it's a method name. It's just a Symbol object.
<joe-mac1>
ah ok
<ccooke>
symbols are used to *identify* methods because they're immutable, memory-efficient lightweight strings.
alfism [alfism!~alfism@2620:149:4:1201:ec6d:e798:b4cf:f152] has joined #ruby
BSaboia [BSaboia!~brunosabo@187.58.70.115] has joined #ruby
<joe-mac1>
ccooke: understood
<joe-mac1>
so in that example, to_proc :alive will be called for each member of the threads array?
<joe-mac1>
ok I think I am following the notation now
<joe-mac1>
thanks
rippa [rippa!~rippa@109-161-124-124.pppoe.yaroslavl.ru] has joined #ruby
addisaden_ [addisaden_!~addisaden@xdsl-89-0-83-51.netcologne.de] has joined #ruby
<ccooke>
joe-mac1: not quite
ianbrandt [ianbrandt!~ianbrandt@99-111-99-153.uvs.sndgca.sbcglobal.net] has joined #ruby
<ccooke>
:alive.to_proc returns a Proc object roughly equivalent to: Proc.new { |object| object.send( self ) }
<ccooke>
that Proc is passed to the .map
acadavid [acadavid!~acadavid@190.250.226.7] has joined #ruby
<joe-mac1>
ccooke: awesome.. thanks for the clarification... I've used this stuff before without understanding it fully but now I need to heh
<ccooke>
joe-mac1: the great thing is, you can define to_proc on any object... and then use the & notation
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
<ccooke>
One script that did a *ton* of regexes, I defined to_proc on Regexp and ended up doing array.map &/regex/
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
<joe-mac1>
oh that is really sweet
<ccooke>
(note that for most uses, there's array.select or array.grep)
brngardner [brngardner!~brngardne@lawn-143-215-125-232.lawn.gatech.edu] has joined #ruby
dschn [dschn!~dschn@c-064-186-242-006.sd2.redwire.net] has joined #ruby
Synthead [Synthead!~max@50-76-231-54-static.hfc.comcastbusiness.net] has joined #ruby
savage- [savage-!~savage-@istep.static.monkeybrains.net] has joined #ruby
<ccooke>
(this was a script that applied regex transformations to a huge dataset. The to_proc is Proc.new { |obj| self.match(obj) }, so returning a match object or nil.)
xiaotian [xiaotian!~guoxiaoti@4.30.138.134] has joined #ruby
<CannedCorn>
hey guys, i asked a while back but my buffer got blown out, whats the best ruby book that covers 1.9, spent a lot of time reading a book where everyting was old and didn't work
<CannedCorn>
for someone begining / intermediate level
lorandi [lorandi!~lorandi@201-68-82-55.dsl.telesp.net.br] has joined #ruby
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
jbw [jbw!~jbw@dsl-044-084.cust.imagine.ie] has joined #ruby
banisterfiend [banisterfiend!~baniseter@222.153.223.42] has joined #ruby
award85 [award85!~itsame@c-69-181-38-133.hsd1.ca.comcast.net] has joined #ruby
award85 [award85!~itsame@unaffiliated/award85] has joined #ruby
Transformer [Transformer!~Transform@ool-4a59e397.dyn.optonline.net] has joined #ruby
ilyam [ilyam!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby
jergason [jergason!~jergason@208.97.56.66] has joined #ruby
stephans [stephans!~stephans@209.66.114.6] has joined #ruby
<CannedCorn>
is there a way to skip the setup step in a test
<burgestrand>
SegFaultAX|work: there is a difference, I made this with a coworker a while back to understand it: https://gist.github.com/1216026
<CannedCorn>
so it applies to all tests but one particular one for example
ChampS666 [ChampS666!~ChampS@p54B4D5DD.dip.t-dialin.net] has joined #ruby
<burgestrand>
SegFaultAX|work: I suggest you read the info at the two links defined in comments at the bottom of the file
z2fyza [z2fyza!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby
brngardner [brngardner!~brngardne@lawn-143-215-125-232.lawn.gatech.edu] has joined #ruby
asteve [asteve!~asteve@unaffiliated/kxsteve] has joined #ruby
<asteve>
is there something different about file streaming in ruby 1.9.2?
<SegFaultAX|work>
burgestrand: I'm flipping through my copy of metaprogramming ruby because I really can't remember if the difference was covered there.
Paoc_ [Paoc_!~paoc@pc-29-167-104-200.cm.vtr.net] has joined #ruby
<deryl>
i have that book, but haven't gotten to read it yet
<deryl>
been stuck in FreeSWITCH 1.0.6 book, Cucumber Book, and RSpec book for the last month or so
gh0stz [gh0stz!c0926547@gateway/web/freenode/ip.192.146.101.71] has joined #ruby
gogo_it [gogo_it!~joshuaman@38.104.99.146] has joined #ruby
hron84 [hron84!~hron@catv-80-99-178-192.catv.broadband.hu] has joined #ruby
gogo_it [gogo_it!~joshuaman@38.104.99.146] has quit [#ruby]
gogo_it [gogo_it!~joshuaman@38.104.99.146] has joined #ruby
canton8 [canton8!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
<gogo_it>
How do you set the location of a file saved with mechanize? I use agent.get(file_url), but it saves the file in a path I do not want. I tried agent.get(fileurl).save_as("file.pdf"), but this didn't work.
cjs226 [cjs226!~cjs226@rrcs-71-40-79-154.sw.biz.rr.com] has joined #ruby
<SegFaultAX|work>
burgestrand: Ah, the difference is subtle! The instance_eval assigns the receivers /eigenclass/ as the definee instead of the class itself.
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
Illiux [Illiux!~nol@lt-wireless-pittnet-150-212-72-25.wireless.pitt.edu] has joined #ruby
p1d [p1d!~p1d@dslb-088-067-021-142.pools.arcor-ip.net] has joined #ruby
Targen [Targen!~iguana@159.90.11.250] has joined #ruby
<burgestrand>
SegFaultAX|work: yeah, as opposed to class_eval, there’s a difference in constant lookup in instance_eval vs << as well I believe
bhaug [bhaug!~user@c-24-16-144-221.hsd1.wa.comcast.net] has joined #ruby
<SegFaultAX|work>
Ffffuuuu
<SegFaultAX|work>
burgestrand: So is << shorthand for class_eval or instance_eval or neither?
<burgestrand>
SegFaultAX|work: similar to instance_eval, but not short-hand for it
<SegFaultAX|work>
Because class << self opens the eigen class in general, but what if I do class << MyKlass, who is the definee?
<SegFaultAX|work>
Is it the eigenclass of the class object?
<burgestrand>
class << MyClass; def my_method; end defines the same method as def MyClass.my_method
soko [soko!~user@unaffiliated/soko] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
<SegFaultAX|work>
burgestrand: So then it's like class_eval in that method.
samuel02 [samuel02!~samuel02@c-46-162-87-154.cust.bredband2.com] has joined #ruby
<SegFaultAX|work>
Because if it was self.my_method, that'd be the MyKlass eigenclass.
<soko>
What's the most consice way to ensure a hash has a certain set of keys?
eignerchris [eignerchris!~eignerchr@wsip-24-120-218-98.lv.lv.cox.net] has joined #ruby
Jakee` [Jakee`!~Jakee`@5ad317fe.bb.sky.com] has joined #ruby
cableray [cableray!~cableray@c-98-245-93-250.hsd1.co.comcast.net] has joined #ruby
cantbecool [cantbecool!~cantbecoo@38.98.246.130] has joined #ruby
VictorMartins [VictorMartins!~VictorMar@87-196-149-191.net.novis.pt] has joined #ruby
<gogo_it>
gogo_it: Anyone familiar with mechanize and how to specify the file path of a download using agent.pluggable_parser.pdf = Mechanize::FileSaver?
<SegFaultAX|work>
soko: That's not what you asked.
<SegFaultAX|work>
soko: Do you mean, "some set of keys X is a subset of the keys of Y" or "X is the set of keys of Y"?
jrodicus [jrodicus!~jrodicus@72.32.115.230] has joined #ruby
<apeiros>
soko: hashes can have the keys in any order
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
<apeiros>
(required_keys - hash.keys).empty? # if true, all keys listed in required_keys are in hash, but hash can contain additional keys
minijupe [minijupe!~benlieb@24-158-56-15.static.ahvl.nc.charter.com] has joined #ruby
<SegFaultAX|work>
apeiros: I thought 1.9.2+ maintained assertion order (not that you should rely on that)
<SegFaultAX|work>
Insertion order*
<apeiros>
SegFaultAX|work: sure, it retains order. but that doesn't mean that your hash comes in the order of your keys-array.
fayimora [fayimora!~fayimora@95.175.159.48] has joined #ruby
<SegFaultAX|work>
apeiros: Huh?
<SegFaultAX|work>
apeiros: Hashes don't have order. But the keys might, depending on the version of Ruby.
<apeiros>
SegFaultAX|work: um, yes, as of 1.9, hashes have order.
<SegFaultAX|work>
apeiros: I think you may have just contradicted yourself.
<apeiros>
no, I think you misunderstand what I'm saying.
<SegFaultAX|work>
{bar: 1, foo: 2}.keys /may/ == [:foo, :bar] is my point. But also that you shouldn't rely on that fact.
<SegFaultAX|work>
I may.
<apeiros>
SegFaultAX|work: {bar: 1, foo: 2}.keys WILL == [:foo, :bar] (in 1.9). that's not the point, though.
lorandi [lorandi!~lorandi@186.240.111.106] has joined #ruby
<apeiros>
the point is, that if you tell your user, "your hash must contain the keys :foo and :bar", then it does NOT mean that the user will provide a hash with the keys in the order YOU expect it.
<apeiros>
since you only told the user about the keys. but you did not tell him about the order.
<apeiros>
that'd be an additional condition.
<SegFaultAX|work>
apeiros: Sorry, I don't think my point was clear. I was saying that "hash can have the keys in any order" may be incorect. Depending on the version of Ruby it can be random or in insertion order (which is also effectively random most of the time, which is why you shouldn't rely on it).
<apeiros>
SegFaultAX|work: first part agreed. second part - if it's a requirement, you can absolutely rely on it.
ctp [ctp!~ctp@p5B324129.dip.t-dialin.net] has joined #ruby
<apeiros>
it's not too difficult to force a hash to be in the order you want it.
cableray [cableray!~cableray@c-98-245-93-250.hsd1.co.comcast.net] has joined #ruby
eignerchris [eignerchris!~eignerchr@wsip-24-120-218-98.lv.lv.cox.net] has joined #ruby
<SegFaultAX|work>
Yea, like working with keys as sets and forget the order :)
<apeiros>
but anyway - I guess we both doubt that that's what soko wanted
<apeiros>
and we both say that if soko tests for == [key1, key2], he'd require the keys to be in order. which most likely is not what he wants.
<apeiros>
*tests for .keys == …
danibx [danibx!~danibx@200.175.180.88.static.gvt.net.br] has joined #ruby
adac [adac!~adac@85-127-41-251.dynamic.xdsl-line.inode.at] has joined #ruby
<apeiros>
so, soko - what do you want? :)
<apeiros>
that the hash contains *at least* the keys you want?
<apeiros>
that the hash contains *exactly* the keys you want?
<apeiros>
or that the hash contains only keys out of a set of keys?
* apeiros
huggles Object#bbedit :D
jlogsdon [jlogsdon!~jlogsdon@76-218-124-129.lightspeed.sntcca.sbcglobal.net] has joined #ruby
hooper [hooper!~hooper@204.28.122.20] has joined #ruby
jlogsdon [jlogsdon!~jlogsdon@50.0.84.226] has joined #ruby
sdferfx [sdferfx!~jeff@gateway/tor-sasl/sdferfx] has joined #ruby
<sdferfx>
Hello. What is the favored way to call a shell command from within Ruby?
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
Paoc_ [Paoc_!~paoc@pc-29-167-104-200.cm.vtr.net] has joined #ruby
<aces1up>
anyone here used eventmachine? this might be more of a general profiling question.. I would like to know the longest running methods.. ex. the time most spend in what particular method on a per thread basis.. as i want to track the eventmachine thread, and find possible bottlenecks slowing up the reactor.
<apeiros>
sdferfx: that'd depend a lot on your specific needs
<SegFaultAX|work>
sdferfx: Both system() and `` are used. Depends on what you're doing.
<sdferfx>
apeiros, I need to call another Ruby script from shell, get its pid and its exit code, and I need to time it so I can kill it if it takes too long
<sdferfx>
on that note I also need to know if there is a favored timer gem
<apeiros>
sdferfx: the problem with timing will be that with pure ruby, you can only measure the real time passed for another executable.
<apeiros>
instead of CPU time
<apeiros>
within ruby, you can use Benchmark (part of stdlib) to get CPU time.
<sdferfx>
apeiros, that's ok, I don't want to measure the CPU time right now; we are only discussing real time, not a load control mechanism at the moment, just meant to clear obviously hung job
<apeiros>
as for pid - I'm not sure, but I think only open4 gives the pid as well
<apeiros>
exit status is almost always in $?
<apeiros>
if it's another ruby script, you could also use fork { load(script) }
ctp [ctp!~ctp@2001:6f8:126f:1:fd91:5cd:cd9f:b2b4] has joined #ruby
joe-mac1 [joe-mac1!~mickysanc@clients1.berklee.edu] has quit [#ruby]
<apeiros>
or rather: pid = fork { load(script); exit }
<sdferfx>
apeiros, and what's the benefit of that? fork returns a pid?
jbpros [jbpros!~jbpros@137-178-112-217.dyn.adsl.belcenter.be] has joined #ruby
<aces1up>
apeiros any suggestions for profiling time spent in each function on a per threads basis?
<aces1up>
function = method
ctp [ctp!~ctp@p5B324129.dip.t-dialin.net] has joined #ruby
<sdferfx>
Alsol, preferred normal timer if I don't need CPU time? Benchmark good for that too?
stephans [stephans!~stephans@209.66.114.6] has joined #ruby
<apeiros>
aces1up: no. I don't know which profiling tools provide useful information wrt threads.
brngardner [brngardner!~brngardne@lawn-143-215-125-232.lawn.gatech.edu] has joined #ruby
<apeiros>
sdferfx: Time#- is sufficent for that.
<apeiros>
unless you're on a sucky OS and need high resolution.
Illiux [Illiux!~nol@lt-wireless-pittnet-150-212-72-25.wireless.pitt.edu] has joined #ruby
<sdferfx>
apeiros, on Linux, don't need microseconds or antyhign
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby
<apeiros>
well, Time#- would give you even microseconds. so should be fine.
<sdferfx>
What does #- in Time#- mean?
<apeiros>
Klass#instance_method
<apeiros>
Klass::class_method
stephenjudkins [stephenjudkins!~stephen@189.sub-174-253-218.myvzw.com] has joined #ruby
<apeiros>
documentation-notation. can be used to query `ri` in your shell. just type `ri Time#-` in your shell.
<apeiros>
(requires that you've properly installed the ruby docs - `rvm docs generate` if you use rvm)
<sdferfx>
hmm, ok. Does the - just mean the constructor?
<SegFaultAX|work>
In other words, the built in Time class probably has sufficient functionality for what you're trying to accomplish
<apeiros>
sdferfx: no, - means "minus".
tomzx [tomzx!~tomzx@dsl-136-201.aei.ca] has joined #ruby
<apeiros>
as in `diff = a - b`
sean__ [sean__!~seanmccan@S01060024017513da.ed.shawcable.net] has joined #ruby
<sdferfx>
right, that's a language operator, though, right? does ruby allow you to override those?
<apeiros>
no, it's not an operator.
<apeiros>
it's a normal method.
<SegFaultAX|work>
sdferfx: Language operator?
<apeiros>
so yes, ruby allows to define them.
<apeiros>
`a - b` is syntax sugar for `a.-(b)`
<SegFaultAX|work>
Methinks we have a C++ developer in our midst.
ilyam_ [ilyam_!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby
<apeiros>
SegFaultAX|work: you know /me in irc? :)
* apeiros
thinks SegFaultAX|work might find it interesting…
<apeiros>
sooooo… you're being pretentious… I see…
<apeiros>
:)
<Illiux>
"Methinks" doesn't strike me as a pretentious word
<SegFaultAX|work>
Illiux: It doesn't? Damn it. I'll have to find one then.
<apeiros>
Illiux: you read too much shakespeare…
<Illiux>
Well, at the same time I did manage to somehow learn the archaic meaning of "artifice" instead of, you know, the one everyone else uses
<Illiux>
So maybe I'm not in a position to judge.
<SegFaultAX|work>
Illiux: ... Don't leave us hanging.
brngardner [brngardner!~brngardne@lawn-143-215-125-232.lawn.gatech.edu] has joined #ruby
<Illiux>
its not too exciting. When I hear "artifice" the meaning that comes to mind is "especially clever and cool engineering"
<rippa>
A crafty but underhanded deception.
<rippa>
A trick played out as an ingenious, but artful, ruse.
<rippa>
A strategic maneuver that uses some clever means to avoid detection or capture.
<rippa>
A tactical move to gain advantage.
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
<Illiux>
Basically, I don't get any of the "underhanded" notions when I hear it
<Illiux>
I just get clever craftsmanship
<Illiux>
unless I take the time to stop and think when I see it
d3vic3 [d3vic3!~quimzed@41.226.110.23] has joined #ruby
<Illiux>
Also SegFaultAX|work, according to what I've seen on internet discussions, isn't being in #python and #ruby simultaneously some kind of crime?
paissad [paissad!~paissad@89-92-16-151.hfc.dyn.abo.bbox.fr] has joined #ruby
<rippa>
Illiux: high treason
<rippa>
also heresy
<rippa>
*BLAM
<Illiux>
rippa: ah but to which one is it a crime?
<rippa>
to both
<rippa>
you double agent
<Illiux>
the only reason I'm in both is that I'm currently learning ruby and thus haven't had a chance to judge it
<Illiux>
I don't think SegFault has a similar excuse ;P
adac [adac!~adac@85-127-41-251.dynamic.xdsl-line.inode.at] has joined #ruby
alex__c2022 [alex__c2022!~alex@207.239.64.154] has joined #ruby
<sdferfx>
Hmm, how would I get the time five minutes from now? I have tried Time.now + 5.minutes but this fails. I have tried Time.now + 2.days which I have seen recommended elsewhere but this also fails. In Python you would do this by creating a timedelta object with a value of 5 min and adding it to time. How can I do something like that in Ruby?
havenn [havenn!~skipper@rrcs-24-43-6-141.west.biz.rr.com] has joined #ruby
<RubyPanther>
ar·ti·fice/ˈärtəfis/ Noun:Clever or cunning devices or expedients, esp. as used to trick or deceive others: "artifice and outright fakery".
yekta [yekta!~yekta@c-24-1-182-219.hsd1.il.comcast.net] has joined #ruby
<RubyPanther>
even if if it was merely clever, and not deceptive, that would already be insulting in programming terms
LMolr_ [LMolr_!~quassel@87.19.33.245] has joined #ruby
<Illiux>
yeah, I tend to use it as something between 'clever craftsmanship' and 'excellent craftsmanship'
<apeiros>
sdferfx: "fails" as a problem description is a failure.
Shamgar [Shamgar!~mbainter@sourcemage/mage/Shamgar] has joined #ruby
<Illiux>
RubyPanther: though yeah, with modern definitions calling someone's work artifice is calling it a purposely obfuscated hack >.>
<RubyPanther>
Illiux: let me translate that to computer terminology for you: "I tend to use it as something between 'over-complicated, unmaintainable craftsmanship' and 'excellent craftsmanship'
artOfWar [artOfWar!~artofwar@nat/yahoo/x-mdoeyftedatrjynx] has joined #ruby
<RubyPanther>
clever is not a positive, it is a _giant_ negative
<apeiros>
sdferfx: you're not using rails I gather?
<apeiros>
5.minutes is a railsism
<sdferfx>
apeiros, not at the moment, i am trying on the shell. I think the real project does use Rails
<apeiros>
sdferfx: `ri Time#+` will tell you that the second summand is considered to be in seconds.
<sdferfx>
how do I do it in real Ruby?
geppelt_ [geppelt_!3e60bbfa@gateway/web/freenode/ip.62.96.187.250] has joined #ruby
<sdferfx>
ok
<sdferfx>
ri Time only has one method recorded btw
Jakee` [Jakee`!~Jakee`@5ad317fe.bb.sky.com] has joined #ruby
<apeiros>
sdferfx: means you haven't installed the docs.
<Illiux>
RubyPanther: 'clever' doesn't have to mean unclear or unelegant imho, it's a term that one could apply to a notably clear and elegant solution to something
<geppelt_>
Hello, I am working with my 7 year old nephew on a science fair project, and with the latest rvm update we have run into some problem... can anyone help us?
<apeiros>
rvm docs generate -- if you use rvm.
bbttxu [bbttxu!~adam@129.120.52.229] has joined #ruby
<RubyPanther>
Illiux: it isn't that it _had_ to mean that, it is that there is a broad consensus that it _does_ mean that.
<apeiros>
geppelt_: nobody can know that… ask the question and we shall see…
<RubyPanther>
If you want to make up your own word for apples, that is fine, but don't expect to be able to communicate well
xec-- [xec--!~xec@188.95.241.142] has joined #ruby
<sdferfx>
apeiros, how do I install the docs?
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
imsplitbit [imsplitbit!~imsplitbi@64.39.5.119] has joined #ruby
<apeiros>
sdferfx: 21:25 apeiros: rvm docs generate -- if you use rvm.
<RubyPanther>
It is important to understand the terms because somebody might say, "that looks like a clever hack, why didn't you do foo instead?" If you don't understand the word "clever" there is a negative, you'll think they're complimenting you and asking for insight into your thought process. They're not, they saying you have a problem, and offering a suggestion as to a better approach.
<sdferfx>
ah, missed it, sorry
<sdferfx>
thanks
<Illiux>
RubyPanther: the original conversation on 'artifice' wasn't in the context of programming. I was just noting that somehow I managed to learn it in a significantly different sense than it is used in the modern day, and haven't managed to change my initial reaction upon reading it from that
<apeiros>
sdferfx: in the meantime you can use rdoc.info
<geppelt_>
We are doing a project on how Siri could be a tool for assisted living, and we have been playing around with SiriProxy to develop an example. I was able to understand the plugin part. Anyways, we ran into a problem and I redid the vurtuale mechine and now I am not able to get SiriProxy to start with the new rvm. I found some solutions online, but none worked for me.
<RubyPanther>
And it also is a part of geek human, an English major (for example) might see your program and say, "oh, how clever!" and they mean it in a good way. So then you have a choice, you can say "thanks" or you can be a smart ass, "I hope not!"
<RubyPanther>
Illiux: if it is in a programming channel, the context is ___guaranteed___ to be programming.
msch [msch!~msch@static.74.108.46.78.clients.your-server.de] has joined #ruby
<msch>
hi, anyone got any experience with minitest/spec? I'd like to execute a DB cleanup before/after each test.
<jeffsmykil_>
I'm trying to get this: "id" : "node#foo" out of this: puts ('"id": node#'{[i]})
<jeffsmykil_>
but im having no luck
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
<geppelt_>
Sazs it is not able to find /usr/bin/env/ but when I am able to find the file
<RubyPanther>
jeffsmykil_: single quotes don't get interpolated
<apeiros>
geppelt_: I probably can't help you. but in order to allow somebody else to help you, you should describe the problem you ran into.
<jeffsmykil_>
so not like JS RubyPanther?
<geppelt_>
how to I direct a message? sorry, I am new at this.
<jeffsmykil_>
I need to escape them
jlogsdon_ [jlogsdon_!~jlogsdon@50.0.84.226] has joined #ruby
<apeiros>
geppelt_: in most clients, either /query nickname, or /msg nickname messagetext
<RubyPanther>
jeffsmykil_: try this puts '"id": node#%d' % i
<apeiros>
but generally it's preferred if you ask stuff in the channel.
<RubyPanther>
something like that, <3 sprintf
<geppelt_>
Okay, then i will
<jeffsmykil_>
RubyPanther: that puts no qoutes around the second part
<jeffsmykil_>
RubyPanther: Im not sure I understand the syntax either
<RubyPanther>
jeffsmykil_: sure '"id" : "node#%d"' % i # same
msch [msch!~msch@static.74.108.46.78.clients.your-server.de] has quit [#ruby]
<jeffsmykil_>
what does the %d and % do?
<RubyPanther>
jeffsmykil_: format_string % replacement_object_or_array is the same as sprintf(format, replacement)
dadada [dadada!~pagovor@krlh-5f7359f8.pool.mediaWays.net] has joined #ruby
<dadada>
hey
<dadada>
using ruby on openwrt, installed ncurses ruby module ruby-gems, all from repository of openwrt
<RubyPanther>
jeffsmykil_: you can use any sprintf reference, even a C one, they're all about the same.... %d is like digit or something
<dadada>
now I tried a sample ruby file and it files on the require statement where the ncurses lib is loaded
<jeffsmykil_>
RubyPanther: k im kind of slow, ill give it a try
<jeffsmykil_>
thanks
<geppelt_>
I was following the instructions on idownloadblog. I was able to figure out a "hello world" plugin to demonstrate our example. But we started having problems with it conecting over a bridged network. So I redid the virtual machine. but when we went back to re install SiriProxy, rmv had been updated, and now it is not working with SiriProxy. T>he last command is "rvmsudo siriproxy server" but I get the error "/usr/bin/env: siriproxy: N
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
<RubyPanther>
a common one is for money, where you need 2 decimal places including any zeros: "$%.2f" % 1.234 => "$1.23"
Amirh [Amirh!~amir@89.144.178.192] has joined #ruby
<Amirh>
what a day
<geppelt_>
I found a few post about redirecting the PATH in your bash_profile, but it does not look like the updated rmv does anything with the bash.
<Amirh>
I was sleeping most of it
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
nacengineer [nacengineer!~dsoutha@165.219.88.72] has joined #ruby
<RubyPanther>
geppelt_: presumably you have a sucky IRC client that doesn't wrap too-long lines for you, and there was something important after: but I get the error "/usr/bin/env: siriproxy: N
<geppelt_>
I am online
<geppelt_>
"/usr/bin/env: siriproxy: No such file or directory".
ChampS666 [ChampS666!~ChampS@p54B4DD04.dip.t-dialin.net] has joined #ruby
npinchot [npinchot!~nate@d118-75-247-69.col.wideopenwest.com] has joined #ruby
<geppelt_>
The old version of RMV asked you to echo out some stuff after it installed, and the new one does not do that and depends on the source file which adds nothing to the batch. Also the thing about the unfindable fiel.
iaj [iaj!~iaj@static.136.47.47.78.clients.your-server.de] has joined #ruby
<RubyPanther>
geppelt_: likely problems: 1) you're using a .rvmrc or whatever its called and you reinstalled to a different ruby than you needed 2) your PATH is wrong in .bash_profile 3) you didn't add the source "$HOME/.rvm/scripts/rvm" line to both .bash_profile and .bashrc
<deryl>
actually just add to .bashrc and add if [ -f "$HOME/.bashrc" ]; then source $HOME/.bashrc fi in your .bash_profile
marvin_ [marvin_!~shikhai@pD9F4D227.dip0.t-ipconnect.de] has joined #ruby
<deryl>
thats 3 lines. if to then is 1, source is 2, fi is 3 (if you're not used to bash)
<geppelt_>
Okay, the instructions served after you install rmv in terminal say nothing about adding anything like the previous version
<deryl>
geppelt_: because you're expected to follow the tutorial on rvm.beginrescueend.com/rvm/install
<deryl>
which clearly DOES tell you :)
<marvin_>
hey
<geppelt_>
I did
<geppelt_>
Adding those to the batch files do nothing.
<deryl>
then why are you constantly referring to the terminal? the tutorial tells you
<deryl>
did you log out then back in or source your .bash_profile?
<deryl>
just adding does nothing, those are ONLY sourced at login time
<RubyPanther>
geppelt_: check 1) first, it is the most likely
<deryl>
there are certain levels of knowledge that rvm expects, like that .bash_profile and .bashrc are only sourced at login, as are group memberships (for multi-tenancy installs)
palcu [palcu!~alex@89.122.187.223] has joined #ruby
<geppelt_>
Okay, I will try that, but when you exit out of terminal and reopen it, even after installing rvm, the rvm commands, like "rvm -v" do not work like they did before. It is like it was never installed. Sorry, I am now knowledgeable with this kind of stuff, but I want to understand what I am doing, not just following steps.
<deryl>
are you using that gnome-terminal by chance?
<sdferfx>
How can I execute a function/block/some other unit of code every x seconds?
Azure [Azure!~azt@unaffiliated/azure] has joined #ruby
<deryl>
see the troubleshooting section for dealing with gnome-terminal
<deryl>
the problem is it doesn't reread the profile OR the rc
<geppelt_>
Is there a way to make it reread? And it is Ubuntu so my guess is that it is Gnome
<deryl>
also please tell me you put the instructions in .bash_profile or .bashrc and NOT .profile. .profile is for sh or bash when run in sh-compatibility mode
<RubyPanther>
lack of correct login mode sent me back to xterm my first day trying gnome-terminal... got what I deserved for not using what was already working well! lol
booginga [booginga!~booginga@204-15-4-10-static.webjogger.net] has joined #ruby
<deryl>
yeah see the instructions on the rvm site. we cover that
<deryl>
RubyPanther: hehe
<RubyPanther>
$ ps axu | grep xterm | wc -l
<RubyPanther>
13
<deryl>
damn it. let me ask michal where he put the gnome-terminal instructions
<geppelt_>
Okay, cool. And yes I did put it there. And I executed the .profile like it said in the install 'source .../.profile'
nanderoo [nanderoo!~nanders@38.124.137.226] has quit [#ruby]
<deryl>
no it does not say the .profile (unless the gnome-terminal instructions say to do that
<deryl>
because bash doesn't use .profile
<RubyPanther>
IME you can't just source it, you often need a totally new terminal session
<deryl>
thats ONLY for sh or bash in sh-compatability mode. (I know, I wrote the docs)
<geppelt_>
It does, I am not smart enough with computers to make this stuff up
davidsiegel [davidsiegel!~Adium@2600:c04:1021:11:9d69:ae0b:fbac:e2fd] has joined #ruby
<deryl>
no it said /etc/profile.d/ says NOTHING about .profile
<deryl>
and thats only for multi-tenancy installs because of what RubyPanther jut said
<deryl>
please see that page i just gave you
<deryl>
in your case you need to checkmark that bo
<davidsiegel>
Hey, does anyone here have experience running Ruby on Windows? I have calls to system/sh in a Rakefile and "mkdir -p" is not working for some reason
<deryl>
AND move your sourcing line for rvm to your .bash_profile OR add the if statement i gave you earlier to your .bash_profile and the sourcing line to .bashrc
<RubyPanther>
rvm is probably much better for most users, but I can say... with rvm it seemed I was always having to update it and do maintenance, but I've been using rbenv for months without any maintenance at all... presumably because it has less features.
<deryl>
RubyPanther: only if you're constantly upgrading to get new features with rvm.
<RubyPanther>
deryl: no, it was when it would quit working
<deryl>
and rbenv's shim approach is sheer crapola and the RVM project has proven that time and time again.
<deryl>
RubyPanther: hoq would it 'quit working'?
<RubyPanther>
well, see, FUD isn't going to switch anybody back ;)
<deryl>
if you don't modify the environment or rvm itself it doesn't just stop working
<RubyPanther>
presumably the "NO! it has no problems!" approach will just drive more people to ask, "what are the benefits of rbenv after all?"
<deryl>
RubyPanther: hardly FUD. we had to dispell the fud rbenv project put out from the beginning which stephenson did JUSt to garner support for his project
<deryl>
oh please
<deryl>
you as usual overstep and make it out that i said rvm had no problems at all.
DFectuoso [DFectuoso!~DFectuoso@fixed-203-141-49.iusacell.net] has joined #ruby
<deryl>
and i never said anything of the kind
<RubyPanther>
nonono, I was a happy rvm user, and it kept having problems, and the first answer is always "did you update?"
ePirat [ePirat!~ePirat@unaffiliated/epirat] has joined #ruby
<deryl>
nevermind. not arguing with you which it always gets reduced to
nacengineer [nacengineer!~dsoutha@165.219.88.72] has joined #ruby
<RubyPanther>
well "I'm right and you're wrong" can't invalidate my experience
<sdferfx>
http://dpaste.com/693697/ <--- I get that if I try to use an EventMachine periodic timer. Can someone tell me what I'm doing wrong? the tutorials I have looked at never directly instantiate an eventmachine var/object
<deryl>
i'm out of the conversation with you RubyPanther. it never is a fulfilling debate. it always gets reduced to you are always right everyone else is always wrong, and i've other things on my plate than combatting that.
<deryl>
geppelt_: anyways, just folllow the gnome stuff i pointed you at and the if statement i gave you
<deryl>
then log out then back in and it should work for you
<apeiros>
deryl: matches my experience with arguing/discussing with RubyPanther
<deryl>
though you should not have to log ou if you COMPETELY close gnome-terminal and restart it
<RubyPanther>
it is a fact that RVM has fixed huge numbers of bugs that people really were hitting, and over and over again people are told to update when there is a problem... instead of "you fix the problem by..." no you update and it goes away because it was a bug. Okay. And then the update command, one of the most used commands sadly, even changed
<apeiros>
deryl: also besides the troubles of lion+xcode4.2, my experience wrt rvm is the opposite. I never had to update, I'm quite lazy about it, and it all still "just works"™
<deryl>
RubyPanther: sinc I'm *on* the RVM development team, am one of the *main* contributers, I know exactly the state of RVM. nto getting into this with you
<deryl>
s/nto/not/
<RubyPanther>
Like I said, for most users it is better, most people don't what to have to say "rbenv which ruby" instead of "which ruby"
<deryl>
apeiros: yeah the 4.2 stuff hamstrung us for a bit
<deryl>
damned apple ;)
brngardner [brngardner!~brngardne@lawn-143-215-125-232.lawn.gatech.edu] has joined #ruby
<apeiros>
deryl: I can imagine. I wouldn't exactly blame rvm for it either. lots of tools are having issues with it.
<RubyPanther>
deryl: if you're _on_ the dev team, please be _humble_ when somebody is recommending something else instead of being mean and accusing them of not even having an experience
* apeiros
still waits for valgrind :(
<deryl>
RubyPanther: you of all people are the LAST one to tell ANYONE to be humble
<deryl>
eat some of your own pie
<deryl>
./ignore RubyPanther ALL
<RubyPanther>
It's not like I tripped and then blamed rvm, I went to #rvm and was told "known bug, update" numerous times
<deryl>
damn it, keep hitting the damned . all the time
<RubyPanther>
You're going to ignore people for choosing somebody else's software? Are you trying to blacklist rbenv?
<apeiros>
RubyPanther: so, your problem got fixed. methinks you got served well then…
Evixion [Evixion!Evixion@tn-67-236-5-224.dhcp.embarqhsd.net] has joined #ruby
<deryl>
he's still on about it? would have thought seeing that i was ignoring him would have ended it. then agian it *is* RubyPanther. should know better by now
<RubyPanther>
apeiros: sure, if there was not an alternative, but the experience also led me to try out rvenv for a day, which stretched to weeks and months, and I can say that doing less makes it a much better tool IMO, for experienced *nix people.
<apeiros>
deryl: yeah, he thinks you ignore him because he uses another tool… talk about denial…
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<RubyPanther>
deryl: no, claiming you did an ignore on somebody does not cause the rest of the world to bow down and cast them out, that is silly
<deryl>
oh geez. use what you want. you want to use an inferior tool, who am I to argue with him? But anyways.. I'm off to do some studying. enjoy
<apeiros>
cya deryl
<geppelt_>
I know what I saw
<deryl>
apeiros: and if hes still spouting about me, tell him to move along. *I*have ;)
<RubyPanther>
Note to readers: be humble when defending software you contributed to... don't be "that guy."
mengu_ [mengu_!~mengu@unaffiliated/mengu] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
beakerman [beakerman!~beakerman@c-76-118-172-173.hsd1.nh.comcast.net] has joined #ruby
<RubyPanther>
Well, rbenv certainly does _less_ than rvm! That much is clear. If that is good or bad is an important decision. I would ask this, was bash broken before rvm? If not, perhaps the tool the does the _least_ and overcomes the ruby versioning warts is the best tool
<RubyPanther>
Before bundler I wouldn't have given up the gemset features from RVM, but with bundler I don't even need gemsets at all anymore
<geppelt_>
For those who would like to know deryl does not know what he is talking about look here: http://db.tt/tPod8CrT
Nss [Nss!~nss@host241-19-dynamic.53-79-r.retail.telecomitalia.it] has joined #ruby
<deryl>
ahh the reason why is you had no .bash_profile prior to installing rvm, so rvm looked for .profile and updatd IT instead
<deryl>
something that *I* was not aware of as its a VERY recent addition
<deryl>
michal just explained it to me. so in this instance, yes. i did not know what i was talking about because i was unaware of that recent addition
<RubyPanther>
There are _always_ a giant stack of VERY recent additions that users (and contributors!?) don't know about...
<deryl>
geppelt_: so for that, I apologize
tvw [tvw!~tv@e176002032.adsl.alicedsl.de] has joined #ruby
<deryl>
its supposed to be that if no .bash_profile exists it will put it in .profile (because presumably you're not running bash since *most* distributions create a .bash_profile)
<RubyPanther>
That's the biggest advantage of rbenv, it is not ambitious, and it is not being developed at a rapid pace. It exists, it works, it probably won't need updating.
<RubyPanther>
it is BOFH-friendly
<geppelt_>
And deryl, sorry for being a dick, just my nature.
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<gogo_it>
Is there any reason why mechanize would act differently with a local html page vs a normal webpage? I wrote my script based on a local url "file:///Users/me/page.html", but when I changed to the same exact hosted page "http://domain.com/page.html", my page.search returns nil for my hosted, but not for my local. any ideas?
<deryl>
geppelt_: hehe trust me, you're tame compared to many i know or to me when i get going
<deryl>
I'ma rude bastard when I get ticked. no worries ;)
lupine_85 [lupine_85!~lupine_85@2001:41c8:51:8::10] has joined #ruby
lupine_85 [lupine_85!~lupine_85@unaffiliated/lupine-85/x-7392152] has joined #ruby
c0rn [c0rn!~c0rn@adsl-69-110-5-79.dsl.pltn13.pacbell.net] has joined #ruby
<RubyPanther>
gogo_it: file: links are not just local http: links, there are various things that won't be the same... you might want to put it behind a webserver and user http://localhost/... instead
danibx [danibx!~danibx@187.104.236.95] has joined #ruby
carlyle [carlyle!~carlyle@24-178-149-21.dhcp.spbg.sc.charter.com] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<geppelt_>
Question: can a PATH change potentially fix a missing file error?
s0ber [s0ber!~s0ber@114-36-235-136.dynamic.hinet.net] has joined #ruby
y3llow_ [y3llow_!~y3llow@114-36-235-136.dynamic.hinet.net] has joined #ruby
y3llow [y3llow!~y3llow@114-36-235-136.dynamic.hinet.net] has joined #ruby
RORgasm [RORgasm!~rorgasm@nyv-exweb.iac.com] has joined #ruby
y3llow [y3llow!~y3llow@114-36-235-136.dynamic.hinet.net] has joined #ruby
dhodgkin [dhodgkin!~dhodgkin@cpe-76-178-249-57.maine.res.rr.com] has joined #ruby
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
nebiros [nebiros!~neb@unaffiliated/nebiros] has joined #ruby
y3llow [y3llow!~y3llow@114-36-235-136.dynamic.hinet.net] has joined #ruby
<nebiros>
hey, if I define a setter like def my=(my), when I do this in the class initialize method: def initialize(my = ""); @my = my; end; the setter isn't executed
shadoi [shadoi!~Adium@2001:5a8:4:68e0:6d02:41f9:d865:88bd] has joined #ruby
<nebiros>
there's a way to accoplish this
<nebiros>
?
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-61-141.mco.bellsouth.net] has joined #ruby
<LiquidInsect>
you didn't execute the setter method in your initialize method, you just set the instance variable directly
<LiquidInsect>
which accomplishes the same thing
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-61-141.mco.bellsouth.net] has quit [#ruby]
<LiquidInsect>
assuming that's all your setter does
y3llow [y3llow!~y3llow@114-36-235-136.dynamic.hinet.net] has joined #ruby
<nebiros>
LiquidInsect: well, I want that my setter do some stuff
<LiquidInsect>
Then don't do @my = whatever, do my = whatever
<nebiros>
hum, you'r right
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
<LiquidInsect>
@my is your instance variable, by setting it directly you're not calling the method my= that you defined
<nebiros>
cool, thanks :)
taii [taii!~tai@85-127-72-17.dynamic.xdsl-line.inode.at] has joined #ruby
brngardner [brngardner!~brngardne@c-98-192-3-166.hsd1.ga.comcast.net] has joined #ruby
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
xec- [xec-!~xec@54.109-247-17.customer.lyse.net] has joined #ruby
Jakee` [Jakee`!~Jakee`@5ad317fe.bb.sky.com] has joined #ruby
Ankhers [Ankhers!~user@76-10-149-67.dsl.teksavvy.com] has joined #ruby
Nss [Nss!~nss@host241-19-dynamic.53-79-r.retail.telecomitalia.it] has joined #ruby
wallerdev [wallerdev!~wallerdev@72.44.102.30] has joined #ruby
cmasseraf [cmasseraf!~cmasseraf@187.106.201.26] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
Johnnus_ [Johnnus_!~Johnnus_@c80-217-133-221.bredband.comhem.se] has joined #ruby
virunga [virunga!~virunga@151.64.11.94] has joined #ruby
jcromartie [jcromartie!~jcromarti@216.59.120.146] has joined #ruby
daniel_hinojosa [daniel_hinojosa!~danno@67-0-117-93.albq.qwest.net] has joined #ruby
jergason [jergason!~jergason@128.187.144.154] has joined #ruby
jcro [jcro!~jcromarti@216.59.120.146] has joined #ruby
cmasseraf [cmasseraf!~cmasseraf@187.106.201.26] has joined #ruby
stephenjudkins [stephenjudkins!~stephen@c-76-105-239-160.hsd1.or.comcast.net] has joined #ruby
asteve [asteve!~asteve@unaffiliated/kxsteve] has quit [#ruby]
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
<Amirh>
Object class inherits from BasicObject. Then how can Object is an instance of a class called Class?
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
<Johnnus_>
I've got some sinatra problems, but I suspect it's more ruby related and that i don't understand namespacing correctly. could someone have a look? The code goes something like this: http://pastie.org/private/mk47bz7kksid6vzromin2a
danblack [danblack!~dragonhea@gentoo/developer/dragonheart] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<hron84>
Amirh: because BasicObject is a Class?
<hron84>
Amirh: anyway, all class is a class, it is independent from the inheritance hierarchy
<hron84>
again
<Amirh>
hmm
<hron84>
Amirh: anyway, all class is a Class, it is independent from the inheritance hierarchy
yours_truly [yours_truly!~yours@c-208-90-102-250.netflash.net] has joined #ruby
<hron84>
and
<hron84>
ehh, nope
<Amirh>
hron84: that's confusing. I think it's a parallel concept.
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
<hron84>
Amirh: i think not. BasicObject is a Class
<Amirh>
seems like you inherit from your father but you're an instance of the Human.
<hron84>
because your father is a Human
<Amirh>
Object is not an instance of BasicObject
skaczor [skaczor!~quassel@mail.prognosoft.biz] has joined #ruby
<hron84>
Amirh: wait
<hron84>
Object's instances are BasicObject
<Amirh>
Object inherits from BasicObject
<hron84>
Object is a class
<Amirh>
what?!
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<Amirh>
hron84: oh Ok. it's just trying to say that a class in an object itself.
<hron84>
even in ruby you can get static methods via inheritance, usually inheritance is interpreted on classes instances. So, class Monkey; end; class Human < Monkey; end; Human.new.is_a? Monkey
<hron84>
but not Human.is_a? Monkey
<Amirh>
yeah
bigkm [bigkm!~bigkm@203-206-185-71.perm.iinet.net.au] has joined #ruby
Nisstyre [Nisstyre!~yours@c-208-90-102-250.netflash.net] has joined #ruby
soko [soko!~user@unaffiliated/soko] has joined #ruby
David_____ [David_____!~david@linode.uk.to] has joined #ruby
abentspoon [abentspoon!~micah@173.247.201.130] has joined #ruby
ccooke [ccooke!~ccooke@spirit.gkhs.net] has joined #ruby
davidsiegel [davidsiegel!~Adium@2600:c04:1021:11:9d69:ae0b:fbac:e2fd] has quit [#ruby]
jlogsdon [jlogsdon!~jlogsdon@50.0.84.226] has joined #ruby
skaczor_ [skaczor_!~quassel@mail.prognosoft.biz] has joined #ruby
tweequla [tweequla!~Tweeq@h155n3-ks-a31.ias.bredband.telia.com] has joined #ruby
<Amirh>
hron84: Class.new.methods.sort and Object.new.methods.sort. the first one has more supported methods.
skaczor [skaczor!~quassel@mail.prognosoft.biz] has joined #ruby
<hron84>
Amirh: the extra methods - i think - included in Object.methods.sort
<Amirh>
it's seems the Class class is somewhere down the Object in the hierarchy.
<Amirh>
hron84: no Class.methods.sort has more
eywu1 [eywu1!~Adium@205-170-107-4.dia.static.qwest.net] has joined #ruby
<hron84>
but be careful with #methods it is very-very verbose
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
<hron84>
#public_methods is better to discover.
<apeiros>
hron84: #methods doesn't list private methods
<sdferfx>
http://dpaste.com/693697/ <--- I get that if I try to use an EventMachine periodic timer. Can someone tell me what I'm doing wrong? the tutorials I have looked at never directly instantiate an eventmachine var/object
<apeiros>
I usually do .methods-Object.methods, tho
Raboo [Raboo!~rabi@nikson.dataphone.se] has quit [#ruby]
<hron84>
apeiros: yeah, #methods list all inherited - and maybe unusable - methods.
<apeiros>
you can use #methods(false)
<apeiros>
that'll list all methods on the singleton class
<apeiros>
also obj.class.instance_methods(false)
wilmoore [wilmoore!~wilmoore@70-89-165-49-ISTS-co.hfc.comcastbusiness.net] has joined #ruby
J4ckOfAllSpades [J4ckOfAllSpades!~jasdeepja@c-98-207-73-250.hsd1.ca.comcast.net] has joined #ruby
<Amirh>
apeiros: I don't get the idea of the Class class. it's like inheriting from your explicit superclass and Class class. I know ruby only supports single inheritance.
sonkei [sonkei!~sonkei@d14-69-26-171.try.wideopenwest.com] has joined #ruby
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
<apeiros>
Amirh: rubys root is a bit circular
<apeiros>
class Class < Module
<apeiros>
that's the most relevant
<apeiros>
the other relevant is: Class.is_a?(Object)
<Amirh>
very postmodern architecture apeiros
<apeiros>
and for fun's sake: Class.is_a?(Class)
<apeiros>
and for even more fun: Module.is_a?(Class)
<apeiros>
but remember, Class subclasses Module - so hen/egg problem there, same with Object/Class - Class is an Object and Object is a Class.
<Amirh>
ruby is based on postmodernism.
<Amirh>
that's why I really enjoy it.
<apeiros>
I always thought it was dadaistic…
bbttxu [bbttxu!~adam@pool-71-96-208-205.dfw.dsl-w.verizon.net] has joined #ruby
<Amirh>
apeiros: where are you from dude?
<apeiros>
I'm swiss. u?
<Amirh>
apeiros: that's why you remember dadaism. those dudes had gathered in swiss during word war 2. I'm from Iran.
eignerchris [eignerchris!~eignerchr@wsip-24-120-218-98.lv.lv.cox.net] has joined #ruby
pantsman [pantsman!~pantsman@2.25.204.248] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
<sdferfx>
what's the conventional way to test a variable for nil?
booginga [booginga!~booginga@204-15-4-10-static.webjogger.net] has quit ["Leaving"]
<apeiros>
if you don't care for `false` as a different case, just: if foo then …
<canton7>
element.nil? Though remember that only nil and false evaluate to boolean false, so it's often sufficient to use just "if foo..."
<apeiros>
or unless foo then …
<apeiros>
nil is conditionally false (only nil and false are)
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
<RubyPanther>
nil is a false condition, which is not conditional.
Hanmac [Hanmac!~hanmac@p508456ED.dip0.t-ipconnect.de] has joined #ruby
mengu [mengu!~mengu@78.188.203.234] has joined #ruby
robie1373 [robie1373!~robie1373@ip68-100-225-212.dc.dc.cox.net] has joined #ruby
wroathe [wroathe!~wroathe@75-146-189-233-Minnesota.hfc.comcastbusiness.net] has joined #ruby
<wroathe>
Besides the pickaxe book what books do you all recommend?
award85 [award85!~itsame@c-69-181-38-133.hsd1.ca.comcast.net] has joined #ruby
award85 [award85!~itsame@unaffiliated/award85] has joined #ruby
jlogsdon_ [jlogsdon_!~jlogsdon@50.0.84.226] has joined #ruby
<savage->
The Well Grounded Rubyist by David A. Black
alex__c2022 [alex__c2022!~alex@207.239.64.154] has joined #ruby
<savage->
Metaprogramming Ruby by Paolo Perrotta.
<savage->
Eloquent Ruby by Russ Olsen.
nwonknu [nwonknu!c18c2a8d@gateway/web/freenode/ip.193.140.42.141] has joined #ruby
closedbracket [closedbracket!~closedbra@smtp.goodmortgage.com] has joined #ruby
closedbracket [closedbracket!~closedbra@smtp.goodmortgage.com] has joined #ruby
<robie1373>
I'm a total beginner at ruby and found Beginning Ruby: From Novice to Professional by Peter Cooper very helpful
conor_ireland [conor_ireland!~conor_ire@89.100.121.49] has joined #ruby
stephenjudkins [stephenjudkins!~stephen@67.139.75.158] has joined #ruby
ceej [ceej!~anonymous@cpe-72-190-40-203.tx.res.rr.com] has joined #ruby
<wroathe>
I'm looking for something a little more advanced than the pickaxe or poignant books
<shevy>
wroathe work through "Chris pine learn to program"... when it is too easy for you, download the source, add new things to it, upload it to the masses :)
<wroathe>
Ok. Thanks :)
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
<shevy>
hmm perhaps I should do the latter
<RubyPanther>
wroathe: I recommend Matz' book
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby
taipres [taipres!~taipres@2001:5c0:1400:a::163] has joined #ruby
havenn [havenn!~skipper@pool-71-189-127-140.lsanca.fios.verizon.net] has joined #ruby
<RubyPanther>
Black's book is a reasonable post-pickaxe choice too, but it is somewhat brief. It goes more into good practices than pickaxe, but is not really much more advanced.
c0rn [c0rn!~c0rn@adsl-69-110-5-79.dsl.pltn13.pacbell.net] has joined #ruby
sonkei [sonkei!~sonkei@d14-69-26-171.try.wideopenwest.com] has joined #ruby
<sdferfx>
If I do Process:waitpid2(), is there a way I can do something while that process executes? I still want to track that process, but I want to fork it and have it not consume my whole thing
stephenjudkins [stephenjudkins!~stephen@67.139.75.158] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
<apeiros>
sdferfx: use it non-blocking
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
<sdferfx>
apeiros, I don't know how
<wroathe>
RubyPanther: I will probably check out Matz book next.
<wroathe>
I appreciate it :)
<sdferfx>
Can you tell me where I can learn? Google for "ruby non-blocking" seems unfruitful
eywu [eywu!~Adium@205-170-107-4.dia.static.qwest.net] has joined #ruby
<apeiros>
Process::WNOHANG, you can pass it as one of the flags
jlogsdon [jlogsdon!~jlogsdon@50.0.84.226] has joined #ruby
<Hanmac>
poignant-guide is funny but not 1.9 currect
<sdferfx>
looking at open4. Can someone explain this to me: Thread.new{ y t.pid => t.exitstatus } ? does this mean the function y is called with those arguments? I guess not., I don't know everything. Dang.
<robert_>
how do I tell if a string is an IP address or a hostname?
sonkei [sonkei!~sonkei@d14-69-26-171.try.wideopenwest.com] has joined #ruby
gogo_it [gogo_it!~joshuaman@38.104.99.146] has quit [#ruby]