Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
tomzx [tomzx!~tomzx@dsl-59-207.aei.ca] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
<shevy> hmm
ascarter_ [ascarter_!~ascarter@209.119.253.66] has joined #ruby-lang
<shevy> I used to use a yaml file for config stuff
<shevy> with my last project, I still use yaml files... but it is more, and slowly becoming something like about:config in firefox
woollyams [woollyams!~woollyams@203-206-165-21.perm.iinet.net.au] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
knu [knu!chuck@v055125.ppp.asahi-net.or.jp] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
cyri__ [cyri__!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby-lang
bougyman [bougyman!bougyman@pdpc/supporter/gold/bougyman] has joined #ruby-lang
replore [replore!~replore@203.152.213.161.static.zoot.jp] has joined #ruby-lang
ilyam_ [ilyam_!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@2001:268:306:1:225:bcff:fedc:e1fe] has joined #ruby-lang
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
Defusal [Defusal!DeFi@196-209-88-169.dynamic.isadsl.co.za] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
ilyam [ilyam!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
<Tasser> shevy, use a ruby dsl then ;-)
<shevy> Tasser one important ability is to modify settings at runtime
yfeldblum [yfeldblum!~Jay@c-71-206-30-119.hsd1.md.comcast.net] has joined #ruby-lang
<shevy> and store them persistently
<petercooper> If XML doesn't solve your problem, you're not using enough of it.
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
<shevy> XML should have never existed
<petercooper> what about XML using utf-8?
<shevy> is that better?
<petercooper> People who want to write it in Klingon finally get their chance
<jmontross> json > xml?
<petercooper> I like YAML, though it feels a bit "kitchen sink" in terms of its scope.
<shevy> * > xml
<andrewvos> I agree with shevy for once.
<shevy> andrewvos we are like brothers :-)
<shevy> I once kept my video files collection in XML format
<shevy> <genre> Comedy </genre>
<shevy> <addition_date> 2005 </addition_date>
<shevy> that was very annoying
<samuelkadolph> Freak
<shevy> but that was the past man
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
<shevy> I am glad I got off of XML
<shevy> it's like the worst drug there is out there
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@adsl-74-161-100-70.mia.bellsouth.net] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-50-58.washdc.btas.verizon.net] has joined #ruby-lang
<andrewvos> Yeah I've seen some xml abominations in my time.
<andrewvos> Short as it may be
<andrewvos> Especially in the microsoft world
wmoxam__ [wmoxam__!~wmoxam@184.175.20.158] has joined #ruby-lang
mikeric [mikeric!~mike@96.53.33.22] has joined #ruby-lang
Austin__ [Austin__!~halostatu@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has joined #ruby-lang
<lianj> meh, ruby-openssl and ffi-openssl dont play along in the same app in my tests
jkyle_ [jkyle_!~krunk-@75-59-236-83.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
mikeric [mikeric!~mike@96.53.33.22] has joined #ruby-lang
sodani [sodani!~shig@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
stepnem [stepnem!~stepnem@176.119.broadband10.iol.cz] has joined #ruby-lang
Austin__ [Austin__!~halostatu@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has joined #ruby-lang
<sodani> If I'm reading some text in from a Google results page and there's no encoding set, how would I figure out what encoding to use? just trial and error?
<lianj> ah nevermind, it works now :D
<manveru> sodani: no meta tags?
<sodani> nope. google doesn't output them
<sodani> at least not if you're a user agent that it recognizes afaik
<shevy> I am sure people here will say ... UTF-8
<manveru> Content-Type: text/html; charset=UTF-8
<manveru> it gives you an header anyway :)
<sodani> yeah, i figured utf-8 or iso-8859-1 but those don't seem to be working right for me. or maybe I'm just not transcoding it properly
<manveru> got an example?
indeterminate [indeterminate!~sei@user-3c2h3m6.cable.mindspring.com] has joined #ruby-lang
<sodani> I'm having trouble with the registered mark on the first couple of ads on this page
<sodani> as you can see, there is no charset defined
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
<sodani> for some reason, browsers encode this properly without the charset
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
<manveru> < Content-Type: text/html; charset=ISO-8859-1
<manveru> ι ~ % curl -A 'frank' -Lv 'https://www.google.com/search?q=byetta';
<sodani> yes, but that's when you set user-agent to something that's a non-browser
<manveru> well, it blocks curl
<sodani> try setting user-agent to: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2
<manveru> and i'm too lazy to search for usual UAs
<manveru> why should i pretend to be like 6 browsers?
<sodani> the results are different
<drbrain> I see: Content-Type: text/html; charset=UTF-8
<manveru> well, either way, you should heed the Content-Type
<drbrain> but it's also returning a redirect page
<manveru> or use rchardet
<manveru> drbrain: that's what the -L is for
<drbrain> oh, maybe not
<samuelkadolph> content-type:text/html; charset=UTF-8 in Chrome
<drbrain> it was a redirect inside a <noscript>
<sodani> samuelkadolph: really. hmm
<samuelkadolph> Ya rly
<manveru> why on earth do they minify the crap out of the html and js, but leave the css all fluffy?
<sodani> samuelkadolph: weird. i'm definitely not getting that
<drbrain> I get a content type with charset for:
<drbrain> Mechanize.new { |a| a.user_agent_alias = 'Mac Safari' }.get("https://www.google.com/search?q=byetta").content_type
<drbrain> and
<drbrain> Mechanize.new { |a| a.user_agent_alias = "Mac Safari" }.get("https://www.google.com/search?q=byetta").content_type
<samuelkadolph> Content-Type: text/html; charset=ISO-8859-1 with curl using a custom agent
wmoxam [wmoxam!~wmoxam@76-10-146-148.dsl.teksavvy.com] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
* manveru just wished UA sniffing went the way of the dodo
<drbrain> it's UTF-8 even with charset=ISO-8859-1:
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
<drbrain> Mechanize.new.get("https://www.google.com/search?q=byetta").parser.css("#pa2").text; t.force_encoding Encoding::BINARY; p t.chars.to_a
<drbrain> sodani: google is lying to you, just deal with it (or use mechanize)
<manveru> UTF-8 with "Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.229 Version/11.60"
<erikh> I bring you guys the best thing ever
<manveru> lol
kain [kain!~kain@151.64.209.184] has joined #ruby-lang
<manveru> if google would just publish a *gasp* search api
<erikh> I think that's image search with safesearch off
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
<sodani> drbrain: thanks for the help
<erikh> oh. that kind of search api. so yeah, I used to work for a search data aggregation firm
<erikh> it was a low point in my life but w/e
<erikh> so they used to have a search api
<erikh> and all the SEO dorks ruined it
<erikh> the end result? about 30 vpses running squid
<erikh> and a health/auto-provisioning thingy
<erikh> oh and we had a history table of regexes for each of the engines
<erikh> lovely stuff, that.
<manveru> :)
<manveru> well, not sure how making people scrape their result pages is much better
<manveru> at least they could charge for the api
<manveru> for now i go with http://duckduckgo.com/api.html
<manveru> it's not really that useful if you actually need search results though
bougyman [bougyman!bougyman@bougyman.com] has joined #ruby-lang
<erikh> manveru: yeah, I don't get it either, I think we scraped something like 500k pages/day
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
dasil003 [dasil003!~dasil003@188.39.65.134] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
leonL [leonL!~leonl@74-115-197-34.eng.wind.ca] has joined #ruby-lang
stepnem [stepnem!~stepnem@176.119.broadband10.iol.cz] has joined #ruby-lang
snuxoll [snuxoll!~stefan@63.227.129.124] has joined #ruby-lang
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
scampbell [scampbell!~scampbell@mail.scampbell.net] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-50-58.washdc.btas.verizon.net] has joined #ruby-lang
banisterfiend [banisterfiend!~baniseter@122.63.175.121] has joined #ruby-lang
EYES_ [EYES_!~EYES@ool-18e4fb9b.dyn.optonline.net] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
EYES_ [EYES_!~EYES@ool-18e4fb9b.dyn.optonline.net] has quit [#ruby-lang]
lenilson_dias [lenilson_dias!~lenilson_@c934d67a.virtua.com.br] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-50-58.washdc.btas.verizon.net] has joined #ruby-lang
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby-lang
mikeric [mikeric!~mike@64.180.47.85] has joined #ruby-lang
mikeric_ [mikeric_!~mike@S0106c03f0e8b23f3.vc.shawcable.net] has joined #ruby-lang
mikeric [mikeric!~mike@S0106c03f0e8b23f3.vc.shawcable.net] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
<WhiteHorse> Is there an alternative way of doing #{..} in ruby?
<WhiteHorse> like the $variable of php
<petercooper> "Goodbye " + str + " world" is another
<livinded> "Goodbye "+str+" world"
<livinded> you should use #{} though
<petercooper> Or.. "Goodbye %s world" % str
<WhiteHorse> wow that was a fast response :S
<WhiteHorse> lol
<livinded> grrrr, wanna see this textmate 2 alpha
<petercooper> or.. sprintf("Goodbye %s world", str)
macmartine [macmartine!~macmartin@cpe-50-113-16-91.hawaii.res.rr.com] has joined #ruby-lang
<WhiteHorse> but i want tu put the var inside the string like in php
<theconartist> too bad
<livinded> it better fucking give me a blow job while I'm writing code after 5 years to put out just an unfinished alpha
<WhiteHorse> php is too cute in that aspect.. just: "Goodbye $str world"
<petercooper> ah, well there's another way
<petercooper> if you were using an instance variable, this would work..
<petercooper> @str = "cruel"; "Goodbye #@str world"
QaDeS [QaDeS!~mklaus@frbg-4d029531.pool.mediaWays.net] has joined #ruby-lang
<WhiteHorse> so within the same scope ?
<petercooper> livinded: You really wanna see it?
<livinded> petercooper: ya
<WhiteHorse> i mean.. everythin is an instance variable in ruby after all, isnt it?
<petercooper> no
<WhiteHorse> well i forgot the static folks
<petercooper> Something like just "str" is a local variable
<WhiteHorse> you mean: local=inside a method?
<petercooper> So like abc = 123, sure.
spuk [spuk!~spuk@189.61.116.247] has joined #ruby-lang
<WhiteHorse> instance variables start always with @?
* petercooper tries to think of some crazy edge case before committing...
<petercooper> .. but yeah.
<WhiteHorse> havent reach that lesson in my video tutorial :)
mksm [mksm!mksm@pdpc/supporter/professional/mksm] has joined #ruby-lang
towski [towski!~towski@173-13-170-161-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
bougyman [bougyman!bougyman@pdpc/supporter/gold/bougyman] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
Nisstyre [Nisstyre!~yours@infocalypse-net.info] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-205-140.slkc.qwest.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
bougyman [bougyman!bougyman@bougyman.com] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
bougyman [bougyman!bougyman@pdpc/supporter/gold/bougyman] has joined #ruby-lang
jbsan [jbsan!~jbsan@c80-216-213-130.bredband.comhem.se] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-68-34-107-252.hsd1.md.comcast.net] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.167.88.254] has joined #ruby-lang
x0F_ [x0F_!~x0F@unaffiliated/x0f] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
ascarter [ascarter!~ascarter@67-42-84-171.tukw.qwest.net] has joined #ruby-lang
twittard [twittard!~twittard@cpe-76-169-74-39.socal.res.rr.com] has joined #ruby-lang
twittard [twittard!~twittard@cpe-76-169-74-39.socal.res.rr.com] has joined #ruby-lang
twittard_ [twittard_!~twittard@cpe-76-169-74-39.socal.res.rr.com] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
mikeric [mikeric!~mike@S0106c03f0e8b23f3.vc.shawcable.net] has joined #ruby-lang
sodani [sodani!~shig@user-387hpcb.cable.mindspring.com] has quit [#ruby-lang]
rippa [rippa!~splitta@85.158.54.234] has joined #ruby-lang
sustainableweb [sustainableweb!~ivanoats@173-10-73-126-BusName-Washington.hfc.comcastbusiness.net] has joined #ruby-lang
ilyam [ilyam!~ilyam@c-67-188-113-128.hsd1.ca.comcast.net] has joined #ruby-lang
<jtoy> can I have a callback on a hash for when an element is set?
<jtoy> so can Irun code when this is run: hash[:foo] = 1
<jtoy> I want to have a hash interface like foo[:bar] = 'blah' and in the background have it go persist the data somewhere else
<kain> do it in your own class
<jtoy> can I override []= ?
<jtoy> im having trouble finding []= in the docs, what is the syntax to override []= ?
<bougyman> def foo[](other)
<jtoy> bougyman: nice, thanks
hangingclowns [hangingclowns!~Adium@58.247.100.206] has joined #ruby-lang
towski [towski!~towski@173-13-170-161-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
<hangingclowns> anyone have try to pass off a method missing to an instance variable to handle?
<jtoy> bougyman: so I cant write it in a way where i dynamically get the key value pair like def [key]=value without setting every key?
<bougyman> jtoy: irb(main):017:0> class Food;def []=(key, val); p [key, val];end;end; Food.new[:key] = :value
<bougyman> [:key, :value]
<bougyman> you mean that?
<bougyman> => :value
<jtoy> bougyman: oh, yes, exactly that
<bougyman> note it will _always_ return :value
<bougyman> i can't seem to stop that.
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
<bougyman> it's one of ruby's few surprises.
<jtoy> hmm, why does ruby do that?
<bougyman> :)
<bougyman> perhaps someone in here knows.
<bougyman> drbrain: ?
<bougyman> the assignment = seems to be a semi-primitive.
<rue> Assignment always returns rhs.
anjen [anjen!~anjen@99-29-152-246.lightspeed.bcvloh.sbcglobal.net] has joined #ruby-lang
<bougyman> rue: that's what we're discussing.
<rue> That's the reason
<bougyman> it's the what and the why.
<rue> That's all there's to it
<bougyman> tidy.
<hagabaka> but you can define []= so that it doesn't even assign anything, like that example
kain_ [kain_!~kain@151.64.209.184] has joined #ruby-lang
<rue> I suppose you could, but the expression still returns rhs
<hagabaka> I guess []= does use the primitive assignment in some way, so you can do things like a[b] += 3
<rue> It's a compiler transform, I guess you could say. It's the same for anyname=
<erikh> it's done in the ast?
<rue> [:attrasgn, [:lvar, :a], :[]=, [:arglist, [:lit, 0], [:lit, 1]]] in rbx
ryanf [ryanf!~revfitz@adsl-67-117-145-61.dsl.snfc21.pacbell.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
io_syl [io_syl!~io_syl@69.105.118.125] has joined #ruby-lang
io_syl [io_syl!~io_syl@unaffiliated/steph021] has joined #ruby-lang
ascarter [ascarter!~ascarter@67-42-84-171.tukw.qwest.net] has joined #ruby-lang
ascarter [ascarter!~ascarter@67-42-84-171.tukw.qwest.net] has joined #ruby-lang
Austin__ [Austin__!~halostatu@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.90] has joined #ruby-lang
lightcap [lightcap!~lightcap@97-115-89-163.ptld.qwest.net] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
heftig [heftig!~Jan@archlinux/developer/heftig] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-17-224.a149.priv.bahnhof.se] has joined #ruby-lang
coffeant [coffeant!~coffeant@125.34.42.254] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.243.203] has joined #ruby-lang
coffeant [coffeant!~coffeant@125.34.42.254] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.243.203] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
toretore [toretore!~toretore@195.204.240.108] has joined #ruby-lang
grafthez [grafthez!~John@78.8.207.2] has joined #ruby-lang
scottschecter [scottschecter!~scott@98.252.167.171] has joined #ruby-lang
gix [gix!~gix@e180015071.adsl.alicedsl.de] has joined #ruby-lang
<grafthez> guys, if I put something into the hash I use symbols as key like that myhash[:mykey] = 'value'. Then to get this value in the future I also use symbol as a key. Now suppose I have several places I need this value so I use this symbol several times. What about the case if suddenly I need to change this key to another value? Am I forced to look through all my code and change it by hand? Or mayeb there is something like constant in java where I have one defini
<grafthez> ton of key user everywhere I need?
hangingclowns [hangingclowns!~Adium@58.247.100.206] has quit [#ruby-lang]
towski [towski!~towski@173-13-170-161-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
AlHafoudh [AlHafoudh!~textual@dsl-static-173.212-5-200.telecom.sk] has joined #ruby-lang
<rue> grafthez: Well, there's sed. Or the edit functionality in your editor
grefab [grefab!~asx@p57BD6654.dip0.t-ipconnect.de] has joined #ruby-lang
<rue> You're just talking about refactoring, I assume
<rue> If you *did* consistently use for example a constant like MYLOOKUP = :mykey, then you could just change that, obviously
<rue> Or, more OO, if you'd wrapped the whole thing inside a method
h4ck3r [h4ck3r!~h4ck3r@14.140.43.50] has joined #ruby-lang
flatliner [flatliner!~flatlline@cshpc.rrze.uni-erlangen.de] has joined #ruby-lang
stepnem [stepnem!~stepnem@90.177.119.176] has joined #ruby-lang
<grafthez> rue, that's what I'm thinking about, to use MYLOOKUP = :mykey
<grafthez> but I wonder if this is right way and convention in ruby
<rue> Depends on the situation, but usually not
grefab [grefab!~asx@p57BD6654.dip0.t-ipconnect.de] has joined #ruby-lang
ryanf [ryanf!~revfitz@adsl-67-117-145-61.dsl.snfc21.pacbell.net] has joined #ruby-lang
thrcka [thrcka!thrcka@nat/redhat/x-gcdhmbztzphcbssj] has joined #ruby-lang
solars [solars!~solars@clnet-kmu02-090.ikbnet.co.at] has joined #ruby-lang
yorickpeterse [yorickpeterse!~yorickpet@80.79.35.95] has joined #ruby-lang
mksm [mksm!~mksm@201.20.236.65.user.ajato.com.br] has joined #ruby-lang
stepnem [stepnem!~stepnem@90.177.119.176] has joined #ruby-lang
IoGA [IoGA!~ioga@91.191.181.77] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.243.203] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
Austin__ [Austin__!~halostatu@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has quit [#ruby-lang]
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
cyri_ [cyri_!~cyri_@86.72.200.236] has joined #ruby-lang
<rue> http://redmine.ruby-lang.org/issues/5751 huh, I never noticed this!
woollyams [woollyams!~woollyams@124-168-81-150.dyn.iinet.net.au] has joined #ruby-lang
yukiy [yukiy!~yukiy@182.148.191.40] has joined #ruby-lang
Asher [Asher!~asher@c-24-126-149-16.hsd1.ga.comcast.net] has joined #ruby-lang
bjensen [bjensen!~brianj@176.20.2.148] has joined #ruby-lang
Asher1 [Asher1!~asher@98.158.127.150] has joined #ruby-lang
yukiy [yukiy!~yukiy@182.148.191.40] has quit ["Leaving"]
mikeric [mikeric!~mike@174.6.165.175] has joined #ruby-lang
zmack [zmack!~zmack@78.97.129.175] has joined #ruby-lang
molgrew [molgrew!~bozo20@85.182.139.18] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-47-158.dyn.iinet.net.au] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.253.157] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-47-158.dyn.iinet.net.au] has joined #ruby-lang
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
jordan` [jordan`!~gromit@2001:660:3302:2826:225:90ff:fe20:d9a8] has joined #ruby-lang
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
Jade [Jade!~useless@unaffiliated/jade] has joined #ruby-lang
valcker [valcker!~valcker@228-7-190-109.dsl.ovh.fr] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
michael_mbp [michael_mbp!~Marin@112.134.195.17] has joined #ruby-lang
pp01bit [pp01bit!~pp01bitDo@111.92.240.242] has joined #ruby-lang
r0bby [r0bby!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
Manhose [Manhose!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby-lang
ksinkar [ksinkar!~ksinkar@117.195.99.112] has joined #ruby-lang
Pupeno [Pupeno!~pupeno@pdpc/supporter/active/pupeno] has joined #ruby-lang
chrismcg [chrismcg!~chrismcg@unaffiliated/octopod] has joined #ruby-lang
RomD [RomD!~Roman@nrbg-d932390c.pool.mediaWays.net] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-47-158.dyn.iinet.net.au] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
workmad3 [workmad3!~workmad3@vpn176.its.manchester.ac.uk] has joined #ruby-lang
dave_miles [dave_miles!~davemiles@gatek.thls.bbc.co.uk] has joined #ruby-lang
kedare [kedare!~kedare@bau91-1-82-239-247-128.fbx.proxad.net] has joined #ruby-lang
lenilson_dias [lenilson_dias!~lenilson_@c934d329.virtua.com.br] has joined #ruby-lang
benanne [benanne!~sander@b252h039.ugent.be] has joined #ruby-lang
<shevy> hmm
<shevy> $:.unshift(File.dirname(__FILE__)) is the same as $: << File.dirname(__FILE__) ?
<shevy> guess not, the latter appends to $LOAD_PATH
<shevy> but I wonder if that would make a big difference? the latter seems more succint
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
solars [solars!~solars@clnet-kmu02-090.ikbnet.co.at] has joined #ruby-lang
<dreinull> trying to translate some rails tests to minitest. What can I do about this one: http://fpaste.org/FiEy/ Seems like I need must_throw :password but that doesnt really work
<andrewvos> dreinull: fpaste.org?
<andrewvos> dreinull: I think rspec just matches have_error_on to error_on?
<dreinull> andrewvos: yes, fpaste. Great service and pastes actually expire. Don't want to keep that stuff forever.
<andrewvos> dreinull: so just assert user.error_on?(:password)
Pip [Pip!~Pip@host-189-146-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<dreinull> andrewvos: error_on is not a minitest assertion.
<andrewvos> dreinull: I'm not saying that
<andrewvos> dreinull: I'm saying that error_on is a method on ActiveRecord::Base
<andrewvos> Sorry, "error_on?"
<andrewvos> code:assert user.error_on?(:password)
<dreinull> I'm using MongoMapper and it seems mm only uses ActiveModel so I don't inherit these methods.
jpeasy [jpeasy!~t4nkd@pool-72-64-157-228.tampfl.fios.verizon.net] has joined #ruby-lang
<dreinull> andrewvos: nevertheless I get an undefined method
<andrewvos> dreinull: Have you always been using MM?
<dreinull> andrewvos: always is a difficult word. I started porting this stuff today.
<andrewvos> dreinull: Porting to MM?
<andrewvos> dreinull: Or to minitest?
<dreinull> to minitest.
<andrewvos> Ok well you can assert against user.errors I think
<andrewvos> Not sure why error_on? isn't available. Maybe I'm dreaming it up.
pp01bit [pp01bit!~pp01bitDo@111.92.240.242] has joined #ruby-lang
<andrewvos> dreinull:
<andrewvos> So it should be #has_error_on? then
<andrewvos> According to tha
<andrewvos> t
<andrewvos> News to me
Adrieuxo [Adrieuxo!~jorixHmAI@115.64.27.246] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.243.203] has joined #ruby-lang
<dreinull> andrewvos: where do you see that?
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
gnufied1 [gnufied1!~gnufied@122.172.253.157] has joined #ruby-lang
matti [matti!matti@madwifi/support/matti] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
<jsaak> anyone used nokogiri or similar xml lib, i have a noobish question i want to have the output:"text" here -> http://pastie.org/3009652
dasil003 [dasil003!~dasil003@188.39.65.134] has joined #ruby-lang
<andrewvos> dreinull: Look for "have" on that page
<andrewvos> Holy crap I thought I may have left my headphones at home! They were just plugged into my macbook.
<andrewvos> That was close
<dreinull> andrewvos: I cahnged the test now to raise an exception, which can be done by triggering an exception upon invalid doc creation.
<dreinull> F it
gnufied [gnufied!~gnufied@122.172.253.157] has joined #ruby-lang
<molgrew> jsaak: //div/child::text()
<jsaak> thank you molgrew it works
Adrieuxo [Adrieuxo!~jorixHmAI@115.64.27.246] has joined #ruby-lang
hebz0rl [hebz0rl!~hebz0rl@95.130.165.85] has joined #ruby-lang
<andrewvos> dreinull: Ok sorry I couldn't help :)
<dreinull> F it
<dreinull> argh, wrng window
<shevy> lol
<shevy> F it too!
<dreinull> these tests again take longer than the code tested.
burgestrand [burgestrand!~burgestra@62.65.124.23] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.90] has joined #ruby-lang
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby-lang
<shevy> hehe
Pip [Pip!~Pip@host-189-146-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.223.193] has joined #ruby-lang
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
burgestrand1 [burgestrand1!~burgestra@62.65.124.23] has joined #ruby-lang
Natch| [Natch|!~natch@178.73.216.18] has joined #ruby-lang
mytrile [mytrile!~mytrile@94.26.28.135] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
<andrewvos> WHAT?? invalid attribute name `success?'
<andrewvos> Is this normal?
<andrewvos> Im using attr_reader
<andrewvos> attr_reader :success? <-- not worky
<apeiros_> you'd need an ivar named @success?
<apeiros_> and that's not valid
<andrewvos> apeiros_: Hmm
<andrewvos> apeiros_: So what can I do
<andrewvos> ?
<apeiros_> def success?; @success; end
chrismcg [chrismcg!~chrismcg@pdpc/supporter/active/chrismcg] has joined #ruby-lang
<andrewvos> apeiros_: That's a bit shit. Thanks though
<apeiros_> o0
<ddfreyne> so make a battr_{reader,writer,accessor} :P
malev [malev!~malev@190.210.138.237] has joined #ruby-lang
yalue [yalue!yalue@nat/ibm/x-xmqtsqkgpykmgmln] has joined #ruby-lang
ksinkar [ksinkar!~ksinkar@117.195.99.112] has quit ["Konversation terminated!"]
imperator [imperator!~Daniel@63-225-247-192.hlrn.qwest.net] has joined #ruby-lang
<havenn> andrewvos: How bout: attr_reader :success; alias :success? :success
jasox [jasox!~jxx@178.239.26.139] has joined #ruby-lang
<shevy> yeah
<shevy> I made my own attr for that
<shevy> but it is not very practical to carry around modified attr's in projects
<rippa> ruby makes people want elegance
<shevy> and ponies
<apeiros_> I thought unicorns
<imperator> just got here; are we wanting to do attr_reader :success?
<imperator> or attr_accessor :success?
<shevy> that would be cool
<shevy> or perhaps not hmm
<shevy> def success; @success ... and ... def success?; @success
<rippa> attr_accessor?
<rippa> derp.success?=true
<rippa> hurr
<apeiros_> class Module; alias original_attr_reader; def attr_reader(*names); names.each do |name| if name =~ /\?$/ then class_eval("def #{name}; @#{name[0..-2]}; end") else original_attr_reader name end end end
<imperator> rippa, attr_accessor :success? => derp.success= + derp.success?
<imperator> what could have been
<rippa> makes a bit of sense
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
mark_locklear [mark_locklear!~jlocklear@ab-tech-lan-to-ab-tech-gw.ncren.net] has joined #ruby-lang
yalue [yalue!yalue@nat/ibm/x-lalqxtujqamajyev] has joined #ruby-lang
judofyr [judofyr!~judofyr@195.159.219.65] has joined #ruby-lang
<imperator> i think ara howard has a lib out there with more attr* options
<apeiros_> fattr?
<imperator> sounds right; there are others i'm sure
<apeiros_> most likely. easy to reinvent wheels tend to get reinvented often.
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby-lang
rushed [rushed!~rushed@99-73-225-9.lightspeed.austtx.sbcglobal.net] has joined #ruby-lang
sepp2k [sepp2k!~sexy@g231125225.adsl.alicedsl.de] has joined #ruby-lang
RickHull [RickHull!~rhull@pool-74-101-19-173.nycmny.fios.verizon.net] has joined #ruby-lang
<andrewvos> imperator: attr_reader :success? is what I wanted to do
tommyvyo_ [tommyvyo_!~tommyvyo@38.123.129.115] has joined #ruby-lang
<imperator> andrewvos, and what did you want that to result in?
<imperator> apeiros_, gem search -r attr reveals quite a few results :)
zmack [zmack!~zmack@78.97.129.175] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
geoffw8_ [geoffw8_!~geoffw8_@host86-173-49-158.range86-173.btcentralplus.com] has joined #ruby-lang
lenilson_dias [lenilson_dias!~lenilson_@c934d329.virtua.com.br] has joined #ruby-lang
riffraff [riffraff!~riffraff@catv-80-99-174-245.catv.broadband.hu] has joined #ruby-lang
<andrewvos> imperator: Well, what would happen if I did attr_reader :success
<andrewvos> imperator: I understand it's not possible because success? is not a valid ivar name.
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
<judofyr> andrewvos: instance_variable_set(:@success?, true)
<apeiros_> judofry: you meant :'@success?' I guess
<judofyr> apieros: oops
<judofyr> yeah
<judofyr> actually, no
<judofyr> :success? is valid
<judofyr> oh wait
<judofyr> damn
<judofyr> ugh
<judofyr> @
<judofyr> NEVERMIND
* apeiros_ goes on to fry judos
<apeiros_> I think older ruby version actually didn't care at all when you used ivar_* methods, as long as it was a valid symbol
<apeiros_> so you could even have something without and '@'
<judofyr> apieros: did you actually change the ivar-table then? o_O
<judofyr> because that would be nifty
<judofyr> Object.instance_variable_get(:String) # => String
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<apeiros_> I changed nothing
<apeiros_> it just meant that you could create ivars that were unaccessible by @foo syntax
<apeiros_> similar as you can create methods using define_method which can't be invoked using obj.foo syntax
<andrewvos> Wait what?
<andrewvos> So I can do that?
<judofyr> apieros: I meant, if I did Object.instance_variable_set(:String, 1), would it actually override the constant?
<andrewvos> I am so very confused
<judofyr> andrewvos: oops: NameError: `@success?' is not allowed as an instance variable name
<judofyr> nope
<judofyr> you can't
<judofyr> weird
<judofyr> didn't realize that
<andrewvos> judofyr: Yeah. Now we're right back at step 1 :)
<apeiros_> judofry: no
<apeiros_> different scopes
<apeiros_> or lookup tables, or whatever
<judofyr> apieros: no? they are both stored in iv_tbl
<apeiros_> maybe that wasn't so back then
<apeiros_> would be a reason why they now check against the name being valid
<judofyr> yeah
anjen [anjen!~anjen@99-29-152-246.lightspeed.bcvloh.sbcglobal.net] has joined #ruby-lang
<imperator> andrewvos, it *is* possible; it's a method; we define the behavior
<imperator> has nothing to do with ivars
<andrewvos> imperator: Yarp. But an easier way is just to define th emethod
<andrewvos> Which isn't exactly elegant if I have a model class with just attr_reader properties :(
<judofyr> andrewvos: you could always create "my perfect attr" which simply attr_reader(thing.to_s.chomp("?")) :)
<andrewvos> hah
<shevy> cool imperator
<shevy> when you were young and handsome
<shevy> before you joined the EVIL side
<shevy> those were the days
<shevy> when you thought you could change ruby without using the FORCE
niklasb [niklasb!~codeslay0@p5B310703.dip0.t-ipconnect.de] has joined #ruby-lang
<shevy> hmm
<shevy> on topic of !, I rarely use methods with !
<shevy> I do however use plenty of methods with ?
<imperator> shevy, i should have assassinated the entire core team when i had the chance
<shevy> hehehe
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
<imperator> i think map! is the one i use most
<shevy> oh now that you mention that
<shevy> I do use .gsub! a lot
<shevy> hmm but still I think I use more methods with "?"
shevy2 [shevy2!~shevy@91-113-91-204.adsl.highway.telekom.at] has joined #ruby-lang
<dreinull> rest question, do I send my login credentials to a get route? After all I don't create anything, right?
<andrewvos> dreinull: Is this a design question?
<dreinull> andrewvos: somewhat, yes
<andrewvos> dreinull: I would just use basic http authentication
<andrewvos> For now
kmeehl [kmeehl!~keith@c-66-31-31-71.hsd1.ma.comcast.net] has joined #ruby-lang
<shevy> andrewvos whatcha working on
<dreinull> andrewvos: I was going to use twitter bootstrap with tthat nice bar that already has the login form
<shevy> still this thing that you didn't get to work... what was th ename
<andrewvos> dreinull: Of if it's a webiste then you will have the cookie come through anyway ;)
<andrewvos> shevy: What?
<shevy> that virtual thing!
<andrewvos> dreinull: I used twitter bootstrap for a project recently Very nice :)
<shevy> I can't remember the name right now :(
<andrewvos> shevy: Yeah got it working.
<dreinull> andrewvos: you mean I create or modify the cookie?
<andrewvos> vagrant
<shevy> ah yes
<andrewvos> dreinull: Well if you're a web app, then you're doing the rest request via JS right?
<dreinull> andrewvos: no, plain old html
<andrewvos> Yeah... So is the user logged in?
<dreinull> andrewvos: not yet
<andrewvos> dreinull: What I'm saying is that a logged in user will have the same authentication method as a user requesting /my/rest/api
dv310p3r [dv310p3r!~dv310p3r@216.199.155.226.nw.nuvox.net] has joined #ruby-lang
<andrewvos> If it's on the same domain
<dreinull> andrewvos: yes
rippa [rippa!~rippa@87-253-30-88.pppoe.yaroslavl.ru] has joined #ruby-lang
MistyM [MistyM!~mistym@50.museumforhumanrights.com] has joined #ruby-lang
io_syl [io_syl!~io_syl@unaffiliated/steph021] has joined #ruby-lang
jkyle_ [jkyle_!~krunk-@75-59-236-83.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-59-207.aei.ca] has joined #ruby-lang
outoftime [outoftime!~mat@50.57.10.189] has joined #ruby-lang
<imperator> wtf, tail command doesn't work on piped input on solaris?
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
kedare [kedare!~kedare@scuderia.internet-fr.net] has joined #ruby-lang
<imperator> git status 2> /dev/null | tail -n1 => no likey
gnufied1 [gnufied1!~gnufied@122.167.223.193] has joined #ruby-lang
<ddfreyne> solaris is oracle now so that might be why
kennyp [kennyp!~kennyp@fedora/kennyp] has joined #ruby-lang
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
* imperator slaps ddfreyne upside da head
<shevy> nono
<shevy> use the FORCE
<shevy> let him slap himself :)
<imperator> shevy, i'm your father
<shevy> lol
<apeiros_> ddfreyne: you mean tail might have gone over the 30 char limit?
<imperator> ooh, obscure ddl humor, i like it
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<shevy> at least ruby works on solaris so it cant be all bad!
<imperator> man page says it accepts stdin if no file is specified, but it doesn't seem to actually...work
<shevy> perhaps they copy/pasted that man page from linux
<apeiros_> imperator: maybe you just have to wait until EOF is reached (very useful, I know)
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby-lang
<imperator> oh holy..
<imperator> there are *two* tail commands on solaris
<imperator> apparently you have to use /usr/xpg4/bin/tail
<imperator> never knew that
<apeiros_> funny
<tobiasvl> well, i guess that depends
<tobiasvl> my solaris computer doesn't have its own xpg4 tail
Manhose [Manhose!~Manhose@193.136.33.133] has joined #ruby-lang
<imperator> tobiasvl, this is solaris 10, dunno what you've got
<imperator> it was mentioned in the manpage
<shevy> why are you guys using solaris
<imperator> shevy, cross platform compat for some of my libs
Swimming_Bird [Swimming_Bird!~textual@64.70.114.89] has joined #ruby-lang
<dr0id> lol
<dr0id> shevy is cure
<dr0id> cute
<theoros> what's a reasonable, deep enough ruby topic for a 20 minute technical talk?
<theoros> i'm having trouble thinking of something
<rippa> something with metaprogramming?
<dr0id> metaclasses
<ddfreyne> DSLs? object model?
<ddfreyne> ruby best practices?
<ddfreyne> cool ruby libraries you may not have heard of?
<theoros> maybe metaclasses and method dispatch
burgestrand [burgestrand!~burgestra@62.65.124.23] has joined #ruby-lang
rayners [rayners!~rayners@pool-71-255-192-242.bltmmd.east.verizon.net] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
<judofyr> theoros: object model is always fun (metaclasses, modules, method dispatch)
<ddfreyne> fun with procs and lambda calculus
<ddfreyne> although 20 minutes may be short ;)
cschneid [cschneid!~cschneid@72.1.92.57] has joined #ruby-lang
<ddfreyne> building a quick game with gosu
mksm [mksm!~mksm@pdpc/supporter/professional/mksm] has joined #ruby-lang
<ddfreyne> speed up your project with ffi
<ddfreyne> plenty of ideas for talks :)
RickHull [RickHull!~rhull@209.119.14.25] has joined #ruby-lang
<judofyr> speed up your love life with ddfreyne
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
Austin__ [Austin__!~halostatu@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has joined #ruby-lang
<ddfreyne> <3
slyphon_ [slyphon_!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<shevy> dr0id I am cure!!!
<dr0id> :)
<shevy> theoros how to turn a library into a larger ruby project and then add tests
<shevy> the problem with such topic is when you want to make simple things complicated
<shevy> procs... lambdas ... metaclasses... method dispatches ...
<shevy> eval*s
<shevy> though
<shevy> a nicely designed DSL would be nice, when it is elegant
mantono [mantono!~mantono@83.251.126.234] has joined #ruby-lang
<theoros> shevy: that isn't technical enough.
<theoros> and it's also vague and generic
<theoros> ddfreyne: maybe i could title the presentation Programming With Nothing ;)
<ddfreyne> I gave this presentation quite a while ago: http://www.slideshare.net/ddfreyne/metaprogramming-and-dsls
<ddfreyne> was fun :)
probst [probst!~probst@131.80-202-169.nextgentel.com] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
<shevy> eval magic!
<theoros> ruby object model should be simple enough. i was going to go with something unrelated to ruby, but i need to know it quite well to field questions, so ruby would be good
<theoros> since it's at short notice
<shevy> hey
<shevy> $:.unshift(File.dirname(__FILE__)) is the same as $: << File.dirname(__FILE__), except that the latter is shorter, and appends to the array rather than have it as first element right?
<judofyr> shevy: yes
<shevy> hmm
<shevy> ok
<ddfreyne> shevy: prepending is the word
<shevy> yeah
spectra [spectra!~spectra@debian/developer/spectra] has joined #ruby-lang
csherin [csherin!~csherin@115.111.177.122] has joined #ruby-lang
<shevy> I am turning all my larger-to-medium projects into that convention now
<shevy> I think...
jkyle_ [jkyle_!~krunk-@74.175.27.253] has joined #ruby-lang
io_syl [io_syl!~io_syl@66.201.45.155] has joined #ruby-lang
io_syl [io_syl!~io_syl@unaffiliated/steph021] has joined #ruby-lang
<shevy> or perhaps not
<shevy> need to create many lib/ directories
<shevy> :\
<theoros> ask yourself why you would want it at the beginning of $: instead of the end
<shevy> don't know
<shevy> if both work then I prefer <<
<judofyr> shevy: why do you muck with $: anyway?
<shevy> judofyr so I can use require 'name'
<judofyr> shevy: ruby -Ilib
<judofyr> shevy: rubygems will fix it for you anyway
<shevy> that does not work within a project
<judofyr> I believe that those who *uses* the project should make sure that its lib-path is correctly
<judofyr> it makes me wonder: how did it require the file that did $:.unshift(File.dirname(__FILE__))?
adam12 [adam12!~adam12@d216-121-144-209.home3.cgocable.net] has joined #ruby-lang
<ddfreyne> judofyr: that will make it difficult to use it without rubygems
<shevy> that file is the base file for "name_of_project/" directory
<shevy> "name_of_project.rb"
<shevy> I really would not know how else to use the "require 'name'" scheme than to modify $:, other than use absolute paths, or symlinks into ruby's lib dir
<judofyr> shevy: why do you require name_of_project without putting its dir in the load path first?
<shevy> ?
<shevy> but I am doing that, don't I?
<judofyr> shevy: how do you require name_of_project?
<judofyr> relative/absolute path?
<judofyr> or `require "name_of_project"`
<shevy> that confuses me
<judofyr> ddfreyne: yeah, it's probably fine in binaries
RickHull [RickHull!~rhull@pdpc/supporter/active/rickhull] has joined #ruby-lang
<judofyr> shevy: if you do `require "name_of_project"`, then the directory is already in the load path
<shevy> oh
<shevy> that only works if I modify $:
<ddfreyne> judofyr: at least I don'trequire rubygems ;)
<shevy> if I don't do that then it does not work
<imperator> don't mangle $: in your gems
<judofyr> shevy: but you need to modify $: *before* name_of_project.rb loads, right?
<imperator> because that's a global
<shevy> judofyr yeah
<shevy> well
<ddfreyne> imperator: but in binaries you pretty much need to
<shevy> name_of_project.rb first does the $: and then it calls the other .rb files in that project
<ddfreyne> (unless you're invoking it with rubygems,b ut that is not always the case)
<imperator> ddfreyne, huh?
<judofyr> shevy: but what required name_of_project.rb?
<imperator> with binaries i put the .so file under lib using a rake task
<judofyr> imperator: binaries != extensions
<ddfreyne> imperator: executables, not binaries (silly name)
<imperator> judofyr, what's your point?
<judofyr> imperator: he's talking about making bin/foo work as intended
<shevy> judofyr I am not sure what you mean there. I require that when I call it from within another project, for instance in a gtk-app.rb file, I could first call the user interface project, like with "require 'ui'", from within that gtk-app.rb
<shevy> but that ui project would be a different project
<rippa> everything is binaries
<imperator> judofyr, using rubygems?
<judofyr> shevy: my point: who ever requires "name_of_project" should be responsible for setting up its load path. not name_of_project.rb itself.
<judofyr> imperator: no, outside of rubygems
<imperator> oic
<judofyr> imperator: or, you'll probably target both
<judofyr> ddfreyne: maybe `begin; require "foo"; rescue LoadError; $:.unshift …; end` is a better pattern?
<imperator> well, within rubygems you put your executables in 'bin' and set the spec.executables dir
<imperator> and it Just Works (TM)
<ddfreyne> judofyr: but if I ./bin/nanoc then, I will get the rubygems version and not the one in ./lib :(
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
<shevy> oh
<shevy> now that you mention that
<shevy> I think I had such a similar error with rubygems
<judofyr> ddfreyne: ah
<shevy> when I install into /Programs/Ruby/Version
<judofyr> ddfreyne: I usually just ruby -Ilib anyway
<judofyr> ddfreyne: maybe I'll go for RUBYLIB="lib" too
<judofyr> (only in development of course)
<shevy> github makes reporting issues really simple
<shevy> I can't stand bugzilla anymore :\
RomD [RomD!~Roman@nrbg-d93236c7.pool.mediaWays.net] has joined #ruby-lang
<judofyr> ddfreyne: but I see your point
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
mrsolo [mrsolo!~mrsolo@adsl-99-39-150-102.dsl.pltn13.sbcglobal.net] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
scampbell [scampbell!~scampbell@c-98-224-240-62.hsd1.mi.comcast.net] has joined #ruby-lang
zomgbie [zomgbie!~jesus@213.162.68.117] has joined #ruby-lang
cjs226 [cjs226!~cjs226@rrcs-71-40-79-154.sw.biz.rr.com] has joined #ruby-lang
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
scampbell [scampbell!~scampbell@c-98-224-240-62.hsd1.mi.comcast.net] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.167.88.254] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
thone [thone!~thone@g230191031.adsl.alicedsl.de] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
solars [solars!~solars@mk089144206081.a1.net] has joined #ruby-lang
turboladen [turboladen!~kvirc@12.104.148.2] has joined #ruby-lang
<turboladen> ckgroundsteve
<turboladen> grr
<turboladen> sorry
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
stepnem [stepnem!~stepnem@176.119.broadband10.iol.cz] has joined #ruby-lang
amh345 [amh345!~amh345@CPE002129ce890a-CM0013f7c4deab.cpe.net.cable.rogers.com] has joined #ruby-lang
amh345 [amh345!~amh345@unaffiliated/amh345] has joined #ruby-lang
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
butchanton [butchanton!~butchanto@vpn-sanfran.exacttarget.com] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0CF23.dip0.t-ipconnect.de] has joined #ruby-lang
slackstation [slackstation!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
jbwiv_ [jbwiv_!~jb@cpe-098-026-172-101.triad.res.rr.com] has joined #ruby-lang
Fretta [Fretta!~Fretta@ip184-187-186-58.sb.sd.cox.net] has joined #ruby-lang
<amh345> require 'net/http' >> Net::HTTP.new(host) == yay it connects.
Skif [Skif!~Skif@72.1.92.57] has joined #ruby-lang
<amh345> but require 'net/https' >> Net::HTTP.new(host, 443) == no dice.
Skif [Skif!~Skif@72.1.92.57] has joined #ruby-lang
<amh345> i know net/https lib exists according to console. but how do i connect to an https uri?
retro2 [retro2!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
<amh345> i found this on stackoverflow. http://pastie.org/3011369 is this the correct way to do it?
<imperator> amh345, try it and find out
Kivi [Kivi!~joni@ec2-79-125-13-112.eu-west-1.compute.amazonaws.com] has joined #ruby-lang
<manveru> if you don't want to verify the certificate
<manveru> not sure why you'd use https then though
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
Squarepy [Squarepy!~Squarepy@wcw-staff-214-224.wireless.uva.nl] has joined #ruby-lang
Squarepy [Squarepy!~Squarepy@unaffiliated/squarepy] has joined #ruby-lang
lightcap [lightcap!~lightcap@97-115-90-248.ptld.qwest.net] has joined #ruby-lang
<amh345> manveru: that's the thing. i dont need to verify the cert. i just need to connect to an API via https. most of the info im finding pertains to ssl and http
<amh345> im trying to locate what i actually need. also, im on 1.8.7 for this particular app.
Pip [Pip!~Pip@host-87-156-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<manveru> ah, yeah
<manveru> there's been a lot of improvment in 1.9
<amh345> i saw :(
<amh345> booooo
<amh345> im going to move this app over to 1.9 when i have some time.
towski [towski!~towski@204-15-1-114-static.ipnetworksinc.net] has joined #ruby-lang
felipe [felipe!~felipe@unaffiliated/felipe] has joined #ruby-lang
<MistyM> Is there a quick way to list the links available in an HTML document?
heppy [heppy!~heppy@fw.baysidebusinessplaza.com] has joined #ruby-lang
DEac- [DEac-!~deac@81.16.104.86] has joined #ruby-lang
lightcap [lightcap!~lightcap@184-100-144-60.ptld.qwest.net] has joined #ruby-lang
<any-key> MistyM: you could either search with a regex or use an HTML/XML parser like Nokogiri
<any-key> the parser route might be a tad bit slower but it's by far the easiest and most reliable way in my opinion
<MistyM> I'll give Nokogiri a shot.
dejongge [dejongge!~jonke@pD9E0CF23.dip0.t-ipconnect.de] has joined #ruby-lang
cyri_ [cyri_!~cyri_@nor75-27-88-178-186-47.fbx.proxad.net] has joined #ruby-lang
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
<shevy> hmm how do you guys layout your documentation?
<shevy> up until recently I was writing documentation for every method, though it was often very very terse
<shevy> so every method had a small header
<apeiros_> MistyM: links as in <a href…> tags?
<MistyM> apeiros_: Yeah.
<apeiros_> trivial with nokogiri: Nokogiri.HTML(html).css('a') # the result is a NodeSet with all links
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
Sailias [Sailias!~jonathan@69.158.82.233] has joined #ruby-lang
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
cldwalker_ [cldwalker_!~cldwalker@c-65-96-165-236.hsd1.ma.comcast.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<MistyM> Oh, awesome, thanks!
jasox [jasox!~jxx@178.239.26.139] has joined #ruby-lang
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
firetonton [firetonton!~firetonto@163.5.131.104] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-168-154.dclient.hispeed.ch] has joined #ruby-lang
jmontross [jmontross!~Adium@static-96-236-65-137.snfcca.dsl-w.verizon.net] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
jmontross1 [jmontross1!~Adium@static-96-236-65-137.snfcca.dsl-w.verizon.net] has joined #ruby-lang
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
sepp2k [sepp2k!~sexy@g224100061.adsl.alicedsl.de] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S0106001e58eab184.vc.shawcable.net] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
<shevy> andrewvos I am bored :(
<apeiros_> shevy: i-am-bored.com
<yorickpeterse> Same here, have to do some design work but can't be fucked :[
<yorickpeterse> apeiros_: s/i-am-bored.com/reddit.com
<shevy> lol apeiros_ that actually exists!
<apeiros_> yorickpeterse: reddit is boring
<yorickpeterse> pfff
andrewhl [andrewhl!~andrew@CPE204e7f4a94cb-CM001cea3dec2e.cpe.net.cable.rogers.com] has joined #ruby-lang
<troubleman> Looking for producers to join the Ableton Artist Collaboration - http://home.no/dwaynie/collabo/
savage- [savage-!~savage-@209.118.197.220] has joined #ruby-lang
<shevy> apeiros_ are you working on anything interesting, programming related, outside of work time?
<apeiros_> shevy: not at the moment.
butchanton [butchanton!~butchanto@vpn-sanfran.exacttarget.com] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-83-57.dsl.scarlet.be] has joined #ruby-lang
<shevy> :(
<shevy> work kills creativity
<troubleman> Ableton is soon gonna support Ruby
<troubleman> So join our collab today and be an early adopter !!
<troubleman> When the minds of programmers meet with the best creative tools of the world of music, a marriage is made between this world and the next
<yorickpeterse> Not sure if this is the right place to advertise, but I could be wrong :)
<shevy> hey
<shevy> I love music
<shevy> on my todo list is "replace Hans Zimmer with a set of ruby scripts"
<yorickpeterse> ha
<shevy> would be cool to have that though :)
jmontross1 [jmontross1!~Adium@static-96-236-65-137.snfcca.dsl-w.verizon.net] has quit [#ruby-lang]
mrsolo [mrsolo!~mrsolo@adsl-68-126-188-177.dsl.pltn13.pacbell.net] has joined #ruby-lang
scottschecter [scottschecter!~scott@c-98-252-167-171.hsd1.ga.comcast.net] has joined #ruby-lang
<imperator> HW_MACHINE_ARCH has different values in sysctl.h between bsd and osx - fun times
<imperator> does ffi have any facility for parsing out macro values from .h files?
vicegrip [vicegrip!~jrpetit@206-248-134-115.dsl.teksavvy.com] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
<Tasser> apeiros_, vaportest? *duck*
spinagon [spinagon!~rippa@87-253-30-88.pppoe.yaroslavl.ru] has joined #ruby-lang
gearaholic [gearaholic!~gearaholi@c-71-238-98-243.hsd1.mi.comcast.net] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
<Tasser> # GoldStandard.new :triples => an_array_of_triples
<Tasser> ah well... wtf @ api
<Tasser> Note the usage of typical Rails hashes for better readability (also, this Gem was developed to be used in a Rails webapp).
schroedinbug [schroedinbug!~schroedin@71-212-191-172.hlrn.qwest.net] has joined #ruby-lang
<Tasser> noez :-/
flori [flori!flori@irc.ping.de] has quit [#ruby-lang]
<shevy> We Are The Rails
<shevy> Lower Your Coding Standards
<shevy> Your Bases Are Belong to Us
<Tasser> rescue Exception => e
<Tasser> ...
<shevy> hey!
<shevy> that's what the pickaxe taught me!
Manhose [Manhose!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby-lang
<imperator> shevy, did you mean ActiveBases?
<shevy> yeah that's better
cyri_ [cyri_!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby-lang
dustacio [dustacio!~dustacio@cpe-24-28-2-12.austin.res.rr.com] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@mo-71-1-98-35.dhcp.embarqhsd.net] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
robbrit [robbrit!~rob@38.108.76.250] has joined #ruby-lang
sandelius [sandelius!~textual@90-231-202-62-no214.tbcn.telia.com] has joined #ruby-lang
<ReinH_> rescue Exception? o_O
havenn [havenn!~skipper@pool-71-189-193-128.lsanca.fios.verizon.net] has joined #ruby-lang
Roujo [Roujo!~Roujo@modemcable186.146-70-69.static.videotron.ca] has joined #ruby-lang
<apeiros_> raise TheBomb; for All in YourBases; are_belong :to => us
curtism [curtism!~curtis@bas11-montreal02-1128531355.dsl.bell.ca] has joined #ruby-lang
<manveru> imperator: no, there's no way to use macros from FFI, afaik :(
<imperator> wah
<manveru> exactly
<MistyM> "%03d" % "07" #=> "007"
<MistyM> "%03d" % "08" #=> ArgumentError: invalid value for Integer(): "08"
<MistyM> Why?
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
<apeiros_> 08 is octal
<apeiros_> but there's no 8 in octal
Manhose__ [Manhose__!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby-lang
<apeiros_> funny that it works like that with a string too, though
<apeiros_> ah, because it uses Integer(), not to_i
<manveru> well %d calls Integer
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
<MistyM> Oh, I see.
geoffw8_ [geoffw8_!~geoffw8_@cpc10-heme11-2-0-cust101.9-1.cable.virginmedia.com] has joined #ruby-lang
Manhose [Manhose!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby-lang
<MistyM> Didn't occur to me it was interpreting it as octal.
thrcka_ [thrcka_!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
<MistyM> Hmm, except %d explicitly takes a decimal. And it did convert 01 through 07 as though they're decimals, not octal.
firetonton [firetonton!~firetonto@163.5.131.104] has quit [#ruby-lang]
<imperator> 007 assassinated the rest
<MistyM> Of course!
queequeg1 [queequeg1!~queequeg@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
<MistyM> 007 008 009.
wyhaines [wyhaines!~wyhaines@mo-71-1-98-35.dhcp.embarqhsd.net] has joined #ruby-lang
<apeiros_> MistyM: it happens before
<apeiros_> "08" has to be converted to an integer first
<apeiros_> try "%d" % "015"
<MistyM> Aha.
<MistyM> And you're right, 018, etc. fails too.
kedare [kedare!~kedare@onyxia.netyxia.net] has joined #ruby-lang
mrdodo [mrdodo!~mrdodo@63-211-239-34.teliax.com] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-81-150.dyn.iinet.net.au] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
havenn [havenn!~skipper@pool-71-189-193-128.lsanca.fios.verizon.net] has joined #ruby-lang
heppy [heppy!~heppy@fw.baysidebusinessplaza.com] has joined #ruby-lang
wyhaines_ [wyhaines_!~wyhaines@mo-71-50-23-63.dhcp.embarqhsd.net] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
havenn [havenn!~skipper@pool-71-189-193-128.lsanca.fios.verizon.net] has joined #ruby-lang
petercooper [petercooper!~petercoop@host-2-97-191-20.as13285.net] has joined #ruby-lang
<drbrain> corundum: strftime?
<corundum> beats me
<drbrain> corundum: strftime is http://foragoodstrftime.com/
<corundum> okay
<drbrain> corundum: strptime?
<corundum> no idea
<drbrain> corundum: strptime is http://foragoodstrftime.com/
<corundum> okies!
ilyam [ilyam!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
<imperator> ffi help needed please => https://gist.github.com/1473825
srbartlett [srbartlett!~srbartlet@124-170-47-158.dyn.iinet.net.au] has joined #ruby-lang
<imperator> oh, of course i see the issue now :|
<burgestrand> hehe
<burgestrand> ptr.size should not be a pointer ;)
<imperator> yah
heppy_ [heppy_!~heppy@fw.baysidebusinessplaza.com] has joined #ruby-lang
QaDeS [QaDeS!~mklaus@frbg-4d029531.pool.mediaWays.net] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0CF23.dip0.t-ipconnect.de] has joined #ruby-lang
<imperator> burgestrand, ok, check it out again; seems to be working but i can't seem to dig out a real value
<imperator> just get 0
<imperator> this is osx btw, that mib will have to be changed for other platforms
dasil003 [dasil003!~dasil003@2.25.216.28] has joined #ruby-lang
<burgestrand> Yeah I’m on OSX too, I get some really odd integer value
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
<burgestrand> Mind you, :size_t is not necessarily an integer
<rue> I'm pretty sure it should be
<imperator> yah, i suppose i should use :size_t for the second memory pointer, but that didn't help me
<imperator> hm, maybe i'm supposed to use a void pointer?
<yxhuvud> size_t is necessarily an integer, but not necessarily of the same signedness or size as unsigned integer.
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
<drbrain> imperator: I think so
<drbrain> sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen)
<rue> I'm pretty sure it should also be unsigned :)
<imperator> drbrain, didn't realize it was supported by ffi
<imperator> ok, changed first :int to :void, second :int to :size_t
<imperator> uh...now what?
<burgestrand> It’s a void pointer because it does not care of the size of what it’s pointing to
<burgestrand> What you say it is in FFI does not matter
<burgestrand> As long as it can hold the result
<burgestrand> Oh. Heh.
<burgestrand> imperator: you’re saying that the size of the data you can hold is 0
<drbrain> imperator: ^^
<hipe> manveru: are you still in japan, or back in germany, or in TX now, or other ? ;)
<drbrain> burgestrand: sysctlbyname sets oldp and oldlenp
<drbrain> newp and newlenp should be NULL/0 unless you want to change the value
<burgestrand> drbrain: yes, but oldlenp also specifies the size of oldp before the call
robbrit [robbrit!~rob@38.108.76.250] has quit [#ruby-lang]
<imperator> drbrain, you on osx?
<drbrain> imperator: yes
<drbrain> I changed int to long for ptr
<drbrain> and read_long
<imperator> hrm, still getting 0 here
<burgestrand> imperator: size.write_long(ptr.size)
<burgestrand> imperator: do it before the call
<imperator> bingo!
<imperator> forgot about that, dangit
<imperator> thanks!
slackstation [slackstation!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
<drbrain> imperator: for generic purposes, you should probably do:
<drbrain> sysctlbyname("hw.cpufrequency", nil, size, nil, 0) then allocate size bytes for the call with ptr
<drbrain> per the man page
<burgestrand> Ah yes, one call to retrieve the size of a buffer that could fit the entire value
<drbrain> hw.cpufrequency will probably always fit in 4 bytes, so for this a long MemoryPointer should be fine
<burgestrand> I liked your first suggestion better :o
<imperator> i suppose someday it might not fit, but by then i shall be retired :)
diegoviola [diegoviola!~diego@host-1-211.b15.cvc.com.py] has joined #ruby-lang
<imperator> good suggestion for the future though, thanks
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
hexo [hexo!~hexo@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@173.247.193.198] has joined #ruby-lang
sodani [sodani!~shig@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
jensn_ [jensn_!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
kedare_ [kedare_!~kedare@2a01:e35:2f26:5330:8011:6ad7:22bd:8d34] has joined #ruby-lang
<sodani> hello, I'm using String#match but am wondering if there are multiple matches, I can match only to the last one
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
<drbrain> sodani: scan
<sodani> drbrain: thanks
<drbrain> sodani: you can also (ab)use split in some circumstances
<apeiros_> sodani: if you need full MatchData objects: http://pastie.org/3012629
<sodani> okay, thank you
haxna [haxna!hexo@hackerspace.base48.tk] has joined #ruby-lang
<apeiros_> hm, just notice… could implement that differently: http://pastie.org/3012629
woollyams [woollyams!~woollyams@203-206-165-21.perm.iinet.net.au] has joined #ruby-lang
<apeiros_> shevy: that'd be two from the bag of tricks ^
<shevy> hmm what is $~ again?
<apeiros_> MatchData object of the last match
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
<sodani> can someone tell me why this returns an array of only size 1? 'abchttp://xyz.com/cdfhttps://abc.com'.scan(/http.*/)
<apeiros_> because the first match consumes all
<sodani> I see. now what if I want the second one (or last)?
<apeiros_> %r{http://(?:(?!http://).)*/}
<apeiros_> instead of your regex
<apeiros_> no warranties
<apeiros_> I included the :// because looking only for http is error prone
<sodani> oh but I want http or https...
<hipe> sodani: good "forward lookahead" regex
<hipe> s/good/google/ ;)
<apeiros_> %r{https?://(?:(?!https?://).)*/}
Fretta_ [Fretta_!~Fretta@ip184-187-186-58.sb.sd.cox.net] has joined #ruby-lang
ilyam_ [ilyam_!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
<sodani> okay thanks. I'll try those out
<sodani> hipe: thanks
<rue> look*ahead* == forward
ryanf [ryanf!~revfitz@50.0.160.40] has joined #ruby-lang
dasil003 [dasil003!~dasil003@2.25.216.28] has joined #ruby-lang
queequeg1_ [queequeg1_!~queequeg@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.220.90] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-168-154.dclient.hispeed.ch] has joined #ruby-lang
<WhiteHorse> I just found the FASTEST way of learning Ruby... and any language :D
<WhiteHorse> http://code.he.net/
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<erikh> now if they could just keep their datacenters up
ascarter_ [ascarter_!~ascarter@209.119.253.66] has joined #ruby-lang
ilyam [ilyam!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
Jake232 [Jake232!~textual@5e049611.bb.sky.com] has joined #ruby-lang
RickHull [RickHull!~rhull@pdpc/supporter/active/rickhull] has quit [#ruby-lang]
artOfWar_ [artOfWar_!~artofwar@nat/yahoo/x-pejuyawqjsiplzzb] has joined #ruby-lang
anjen [anjen!~anjen@99-29-152-246.lightspeed.bcvloh.sbcglobal.net] has joined #ruby-lang
mrsolo [mrsolo!~mrsolo@adsl-68-126-188-177.dsl.pltn13.pacbell.net] has joined #ruby-lang
sandelius [sandelius!~textual@90-231-202-62-no214.tbcn.telia.com] has joined #ruby-lang
jaimef [jaimef!jaimef@dns.mauthesis.com] has joined #ruby-lang
adam12 [adam12!~adam12@d216-121-144-209.home3.cgocable.net] has joined #ruby-lang
spap [spap!spap@unaffiliated/spap] has joined #ruby-lang
ilyam_ [ilyam_!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby-lang
steeljav [steeljav!~b@69.197.102.2] has joined #ruby-lang
<manveru> WhiteHorse: i don't get it
<manveru> you're basically copy&pasting and hitting a button?
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
<mrdodo> yeah thats what it seems to me
<mrdodo> where can i find somewhere to give me something like a homework assignment essentially
<mrdodo> to solve a problem with ruby
<manveru> rubyquiz has lots of those
adam12 [adam12!~adam12@d216-121-144-209.home3.cgocable.net] has joined #ruby-lang
<deryldoucette> yeah was just going to say rubyquiz
<workmad3> mrdodo: have you done the ruby koans?
<deryldoucette> think seacreature and mendicant university runs that (think thats the name of the uni)
<mrdodo> workmad3: no what is that
<workmad3> mrdodo: you could also try solving project euler problems with ruby :)
cored [cored!~homer@201.229.129.239] has joined #ruby-lang
cored [cored!~homer@unaffiliated/cored] has joined #ruby-lang
<workmad3> mrdodo: http://rubykoans.com/
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
<WhiteHorse> well.. its basically like tryruby.org but with a better set of excercises
<mrdodo> awesome thanks, is rubyquiz.com different from the pragmatic book?
<manveru> dunno
<manveru> haven't read the book
<deryldoucette> mrdodo: and there is http://puzzlenode.com/
<WhiteHorse> I think that if you dont know anything about ruby then this tutorial walk you through the basics of the language very quickly
<mrdodo> deryldoucette: thanks a bunch
<deryldoucette> mrdodo: welcome
<WhiteHorse> it just gives you a foundation very quickly so you can build upon this with other tutorials
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
slyphon_ [slyphon_!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<WhiteHorse> you all know that the most difficult part of learning a new language is the beggining, once you jump that part things start to make more sense and the learning process accelerates
<workmad3> WhiteHorse: as long as you know programming, then yes
<manveru> heh
<manveru> well, this site uses print all the time
oilpastels [oilpastels!~rafael@20151185010.user.veloxzone.com.br] has joined #ruby-lang
<workmad3> WhiteHorse: also, if the new language is a substantially different paradigm and has little crossover with anything you're familiar with, it's not just the syntax that's going to cause issues
<WhiteHorse> for me, this one is better than tryruby.org to get started
<manveru> for me, nothing beats a repl and a reference :)
kyrylo [kyrylo!~kyrylo@46.118.220.90] has joined #ruby-lang
Nisstyre [Nisstyre!~yours@infocalypse-net.info] has joined #ruby-lang
<WhiteHorse> so you have hundreds of entries in a language reference... how are you supposed to know what are the most important ones and the ones that you should learn first
<WhiteHorse> I think references are just for that.. reference
<workmad3> manveru: a repl and a reference is going to be the tough road if you're only used to say OO programming and you're trying to pick up something like haskell :)
<WhiteHorse> thats what tutorials are meant for
<workmad3> admittedly, for haskell, an intro to category theory is going to be your main reference :)
<manveru> workmad3: that's why i never got into haskell
<deryldoucette> haskell scares me because my math skills are crap
<deryldoucette> i admit it, i live by my calculator! :)
<workmad3> deryldoucette: arithmetic != maths
<workmad3> ok, I'm being told I should be getting to bed
<workmad3> my laptop is being shut to the sound of the music from jaws :/
<manveru> oO
<workmad3> night all
<manveru> cu
<cored> hello all
<cored> night
<cored> that was a funny way to leave
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
cjs226 [cjs226!~cjs226@99-61-65-242.lightspeed.austtx.sbcglobal.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
Nisstyre [Nisstyre!~yours@infocalypse-net.info] has joined #ruby-lang
Asher1 [Asher1!~asher@c-24-126-149-16.hsd1.ga.comcast.net] has joined #ruby-lang
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
Nisstyre [Nisstyre!~yours@infocalypse-net.info] has joined #ruby-lang
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
slackstation [slackstation!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
heppy [heppy!~heppy@fw.baysidebusinessplaza.com] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
<hipe> manveru: where are you these days, in terms of locality?
jaimef [jaimef!jaimef@dns.mauthesis.com] has joined #ruby-lang
jlnr [jlnr!~jlnr@lurado.com] has joined #ruby-lang