Natch| [Natch|!~natch@178.73.218.202] has joined #ruby-lang
lianj [lianj!~lianj@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
lianj [lianj!~lianj@subtle/user/lianj] has joined #ruby-lang
ryanf [ryanf!~revfitz@50.0.160.40] has joined #ruby-lang
<zenspider>
Harzilein: patches welcome
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<shevy>
Harzilein, yeah the old problem of code vs. documentation... like the chicken egg problem. what comes first? usually the code, then the docu
perryh [perryh!~perryh@unaffiliated/perry753] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
<Harzilein>
meh
<Harzilein>
ronn does not allow block level elements inside the definition list's definitions
<Harzilein>
they are allowed according to the html spec
<Harzilein>
<dl><dt>foo</dt><dd><ul><li>foo</li></ul></dd></dl> leads to
<Harzilein>
warn: unrecognized inline tag: "ul"
<injekt>
Harzilein: open an issue?
<Harzilein>
i guess
<injekt>
ronn is ryans right?
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby-lang
<Harzilein>
yes
<Harzilein>
hmm
<injekt>
Harzilein: ping him on twitter he's usually responsive
<josh9>
i have a simple acceptance test (capybara+minitest) that should fail but it's passing... http://pastebin.com/NUEfYmq4 any clues?
WillMarshall [WillMarshall!~willmarsh@ppp121-44-64-47.lns20.syd6.internode.on.net] has joined #ruby-lang
<petercooper>
there's a good reason for that..
<petercooper>
an awesome tool in these situations is the save_page method
<petercooper>
which will save a copy of what capybara actually sees
<burgestrand>
save_and_open_page is also sweet :)
<petercooper>
in short, though, the dev mode error page sinatra is spitting out includes your method's source in the backtrace
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
<petercooper>
it is, although the content isn't actually displayed on the page in this case
<Harzilein>
hmm... it looks that at least when i fix the other problems with my markup i can make my case work by tightening the selector from "li" to ">li". the warning still appears but i get correct markup
<Harzilein>
hmm
<Harzilein>
or not
<Harzilein>
html is fine, roff isn't
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.42] has joined #ruby-lang
<zenspider>
josh9: you should probably test that you got a 200 first
<josh9>
zenspider: good idea
<josh9>
i get 500
<burgestrand>
josh9: did you read petercoopers’ reply?
<josh9>
no
<petercooper>
I gave you the answer, lol
<burgestrand>
josh9: do that, just a few lines up :)
<josh9>
petercooper: sorry. i don't get notifications if my name is not there (:
<josh9>
thanks. reading it now
<josh9>
petercooper: burgestrand it is indeed awesome, but i am not going to manualy view the html page.. is the solution is having 2 assertions? assert_equal 200, page.status_code and assert has_content?("hello world")
<petercooper>
Just to clarify, my entire point was that 'hello world' /is/ on the page so that's why it passed :-)
<josh9>
petercooper: oh...
<petercooper>
sinatra error pages in dev mode pump out a looooot of stuff :)
<petercooper>
but in short, yes
<burgestrand>
josh9: ^
<burgestrand>
You make sure its’ successful, then you check the contents
<josh9>
petercooper: maybe i can change the verbosity of those errors
<burgestrand>
However, often all the assertions combined pretty much do that for me
<josh9>
i guess i should have a single test just for 200, and the rest of the tests for more content
<josh9>
there is an interesting method in capybara - has_text? that will only check for VISIBLE content. but from some reason i get: undefined method `has_text?
<burgestrand>
I’m not sure how the assertions work with minitest, but often I do my assertions on *page*
<burgestrand>
So, page.has_content?('h2', :text => 'Bluergh')
<burgestrand>
josh9: ^
<burgestrand>
Ah, neat, Capybara::DSL should actually contain all those.
<burgestrand>
And that includes has_text?
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
<burgestrand>
josh9: I know, and it should be a method in Capybara::DSL so it should not make a difference
datanoise [datanoise!~datanoise@24-145-66-018-dhcp.mia.fl.atlanticbb.net] has joined #ruby-lang
<josh9>
burgestrand: what version of capy are u using? has_content? accepts only 1 argument
burgestrand1 [burgestrand1!~burgestra@81-229-85-235-no66.tbcn.telia.com] has joined #ruby-lang
phaedrix [phaedrix!~phaedrix@c-24-22-86-235.hsd1.or.comcast.net] has joined #ruby-lang
sora_h [sora_h!~sora_h@mayfield.privs.net] has joined #ruby-lang
spuk [spuk!~spuk@189.101.217.200] has joined #ruby-lang
<andrewvos>
hey anyone here use a vpn in the uk to watch netflix etc?
eggman2001 [eggman2001!~shig@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
<eggman2001>
if I have a catch block, is there a way I can do a throw without an exception being raised?
<andrewvos>
eggman2001: Why?
<andrewvos>
eggman2001: There would be no point in that.
<eggman2001>
basically, if a certain condition is met, I want abandon the current iteration
<heftig>
continue
<andrewvos>
Yeah what he said
<jarib>
uhm, next
<jarib>
not continue
<postmodern>
just to make sure im not doing some dumb here, i wrote a regexp to match IP octets, but it's not performing maximal munch, and only matching the '2'
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<josh9>
andrewvos: intersting. is there audio/video
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
<andrewvos>
josh9: Not sure what you mean?
<josh9>
andrewvos: it's a presentation, right
<josh9>
?
<andrewvos>
josh9: Not sure.
<andrewvos>
Ok I take it back. Webmachine is pretty cool, but some things about it kind of worry me.
<andrewvos>
I mean it's a step forward.
<andrewvos>
I think.
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
<yfeldblum>
why?
<andrewvos>
yfeldblum: Why what?
<andrewvos>
Which part?
<yfeldblum>
"it's [Webmachine is] a step forward" - why?
infid [infid!~infid@rrcs-24-43-240-138.west.biz.rr.com] has joined #ruby-lang
<andrewvos>
Well because there's so little you have to code for firstly.
<andrewvos>
It just seems to bring us back to the way http is meant to work.
<andrewvos>
And I tend to like things that lock you in to working a specific way.
<andrewvos>
If that way is better of course.
<andrewvos>
I mean I've been working with an aPI recently that would return a 200 whenever you saved something to it. Regardless of whether there was an error or not.
<andrewvos>
And you could just say the generic "bad programmers did that", but that doesn't fix my immediate problem.
phaedrix [phaedrix!~phaedrix@c-24-22-86-235.hsd1.or.comcast.net] has joined #ruby-lang
<andrewvos>
yfeldblum: Good enough answer?
<yfeldblum>
haha not even close ... how would webmachine help with the case of an API always responding with 200? and is that its only use case?
<andrewvos>
yfeldblum: Well because I feel that if the developer was using webmachine they wouldn't forget to return a 500 on an errror, for example.
<andrewvos>
No, of course that isn't it's only use case but I feel it is a great one.
cartercheng [cartercheng!~carterche@173-11-117-109-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
<yfeldblum>
is that not true with other frameworks?
<andrewvos>
Well, for the 500/200 case yes. Most frameworks at least.
<andrewvos>
One that comes up a lot is when I request /posts/123 instead of a 404 I get a 500.
<yfeldblum>
based on that presentation, if i were to describe webmachine and its use-cases, i would say: "it's an http-first framework that provides obvious hooks and guidance for building a correct http endpoint; there are a lot of other concerns (templates, assets, persistence, etc) that it doesn't cover at all"
<andrewvos>
yfeldblum: Sure. I would of courseargue that maybe persistence shouldn't need to be part of your web framework.
<yfeldblum>
not part of a web framework, sure, but certainly part of a full-stack application framework which exposes itself in multiple ways, including as an http endpoint
<yfeldblum>
and by full-stack, i mean it includes unicorn in its gemfile and has a unicorn config in addition to a config.ru
<yfeldblum>
andrewvos, the 404/500 deal is easily handled with rescue_with in rails, although i guess it's "advanced"
valeri_ufo [valeri_ufo!~valeri_uf@deadlink.in] has joined #ruby-lang
<andrewvos>
yfeldblum: Honestly, I haven't done much rails so I couldn't comment.
<yfeldblum>
although webmachine seems to make that distinction more obvious
<andrewvos>
yfeldblum: Yeah, and that's what I love about it.
<andrewvos>
yfeldblum: A developer that doesn't even know how http is meant to work would find herself returning the correct error codes.
<yfeldblum>
on the whole, i would prefer it if the developer that doesn't know http were to learn http ...
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<yfeldblum>
having a framework that makes doing the right http thing easier is a bonus, but not a substitute
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
<andrewvos>
yfeldblum: Yeah I appreciate your stance.
<yfeldblum>
the other frameworks do need to put more effort into guiding users toward understanding http and building correct http endpoints
<andrewvos>
Normally there's the "hire better developers" and the "force developers to do the right thing camps". I think a bit of both is good.
<yfeldblum>
i prefer having frameworks making doing the right thing (writing correct http endpoints) easier; but there's no way to force someone to do the right thing; someone who just doesn't get it will always find a hundred ways to screw it up
<andrewvos>
Indeed.
<andrewvos>
And that's what I see webmachine doing.
eggman2001 [eggman2001!~shig@user-387hpcb.cable.mindspring.com] has quit [#ruby-lang]
<andrewvos>
I may take this back, but: humans shouldn't have to remember what http status codes are for.
ryanf [ryanf!~revfitz@adsl-71-141-89-169.dsl.snfc21.sbcglobal.net] has joined #ruby-lang
infid [infid!~infid@99-95-168-48.lightspeed.sndgca.sbcglobal.net] has joined #ruby-lang
xuser [xuser!~xuser@unaffiliated/xuser] has joined #ruby-lang
xuser [xuser!~xuser@unaffiliated/xuser] has quit [#ruby-lang]
mkscrg [mkscrg!~mkscrg@76-218-100-21.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
datanoise [datanoise!~datanoise@24-145-66-018-dhcp.mia.fl.atlanticbb.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
aBound [aBound!~levy@cpe-76-169-9-64.socal.res.rr.com] has joined #ruby-lang
jredville [jredville!~james@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
Indian_ [Indian_!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
naz [naz!~n@70.44.2.190.res-cmts.bus.ptd.net] has joined #ruby-lang
sush24 [sush24!~suhas@59.92.207.211] has joined #ruby-lang
<sush24>
hi .... im very new to ruby.. I'm trying to understand a bit of code... what does "<<" do?
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
<rue>
It's a method, so what it does depends on the object you're sending it to
<rue>
It's usually an append operation (or, for numbers, a bit shift)
<savage->
it's also used to open up an object's singleton class
<sush24>
hmm... append makes sense... its used in a loop...
kyrylo [kyrylo!~kyrylo@46.118.222.153] has joined #ruby-lang
<savage->
sush24: I recommend reading: The Well Grounded Rubyist by David A. Black, then Eloquent Ruby by Russ Olsen, then Metaprogramming Ruby by Paolo Perrotta, and then use the Pickaxe book as a reference.
<sush24>
rue: thanks... i could read it with a bit of googling i guess...
<sush24>
savage-: thanks... I'll check them out.
me345 [me345!~me345@adsl-71-131-128-130.dsl.sntc01.pacbell.net] has joined #ruby-lang
thone [thone!~thone@g230186102.adsl.alicedsl.de] has joined #ruby-lang
ryanf_ [ryanf_!~revfitz@adsl-64-160-39-203.dsl.snfc21.pacbell.net] has joined #ruby-lang
<erikh>
rue: what does underwear have to do with ruby
jredville [jredville!~james@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
shevy [shevy!~shevy@178-190-194-56.adsl.highway.telekom.at] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@host226.190-31-167.telecom.net.ar] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
shtirlic [shtirlic!~shtirlic@188.134.7.124] has joined #ruby-lang
rippa [rippa!~rippa@93-181-234-105.adsl.yaroslavl.ru] has joined #ruby-lang
cartercheng [cartercheng!~carterche@173-11-117-109-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-17-181.a149.priv.bahnhof.se] has joined #ruby-lang
Weems [Weems!~frodo@unaffiliated/weems] has joined #ruby-lang
demeth [demeth!~leto@c83-249-208-141.bredband.comhem.se] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.237.138] has joined #ruby-lang
Pip [Pip!~Pip@host-89-156-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
dRbiG [dRbiG!drbig@insomniac.pl] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<mimay>
can't figure out why the error when doing the class_eval :-(
cartercheng [cartercheng!~carterche@173-11-117-109-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
solars [solars!~solars@mk089144206030.a1.net] has joined #ruby-lang
<shevy>
you are a brave man :)
<mimay>
to me?
gianlucadv [gianlucadv!~gianlucad@host87-78-dynamic.50-79-r.retail.telecomitalia.it] has joined #ruby-lang
<shevy>
yeah
<mimay>
why? :-)
<shevy>
class_eval is a sign of braveness
<mimay>
hehe
<mimay>
but need to get stylize method out of the String class. Don't like it if it stays there.
datanoise [datanoise!~datanoise@24-145-66-018-dhcp.mia.fl.atlanticbb.net] has joined #ruby-lang
datanoise [datanoise!~datanoise@24-145-66-018-dhcp.mia.fl.atlanticbb.net] has joined #ruby-lang
benanne [benanne!~rijdier@41.104-241-81.adsl-dyn.isp.belgacom.be] has joined #ruby-lang
<shevy>
I think eval makes code often way too difficult to understand
<mimay>
yes, sometimes you get totally loss. In this case the first example works fine. The second (with the stylize method outside the String class and a plain class_eval to find it), it works, but something weird with the returned value
jimmyy111 [jimmyy111!jimmy@112.238.26.196] has joined #ruby-lang
gasbakid [gasbakid!~gasbakid@41.96.66.91] has joined #ruby-lang
<queeway>
Thanks :-)
gasbakid [gasbakid!~gasbakid@41.96.66.91] has joined #ruby-lang
replore [replore!~replore@ntkngw298122.kngw.nt.ftth.ppp.infoweb.ne.jp] has joined #ruby-lang
AsaA [AsaA!~AsaA@pool-173-58-89-188.lsanca.fios.verizon.net] has joined #ruby-lang
<AsaA>
omg i am so frustrated right now. I can't seem to understand the difference between string and string literal!
<AsaA>
can someone please help me
<AsaA>
i need an example of a srting, and an example of a string literal
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
<AsaA>
can someone tell me the difference between string and string literal? are they the same thing?
<AsaA>
are the terms used interchangeably?
<shevy>
AsaA what the fuck is a string literal
<shevy>
AsaA just think in terms of string objects
<shevy>
and forget string literals
<AsaA>
This is what it says in the book im reading :"A string is a collection of textual characters. When a string is embedded directly into code, using quotation marks as earlier, the construction is called a string literal." but i dont get it
<shevy>
I dont get that sentence either
<AsaA>
strings include quotation marks right?
<shevy>
what even does it mean embedded into code
<shevy>
sure
<shevy>
'abc def ? I am still a string'
<AsaA>
yea "whatever" is a string right?
<shevy>
yeah
<AsaA>
in the book it says whatever without the quoation marks is a string
<AsaA>
thats why im confused
<shevy>
perhaps it was a variable
<shevy>
whatever = "whatever"
wpgreenway [wpgreenway!~wpgreenwa@c-98-193-194-48.hsd1.tn.comcast.net] has joined #ruby-lang
<AsaA>
okay this is the book definition: String: A collection of characters such as Hello, world! or Ruby is cool.
replore [replore!~replore@ntkngw298122.kngw.nt.ftth.ppp.infoweb.ne.jp] has joined #ruby-lang
<AsaA>
how come there is no quotation marks
<shevy>
I do not know
<shevy>
but the world won't come to an end just because the book omitted them
robbyoconnor [robbyoconnor!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
<AsaA>
but there should be quotation marks right?
<shevy>
yeah
<AsaA>
but im still at a lost with string literals T_T
<AsaA>
seems like people use the two terms interchangeably
<AsaA>
shevy you said string literals are string objects. if "abc" is a string, and also a string object, then "abc" is a string literal? Thus, string and string literal are used interchangeably? LOL I AM FRUSTRATED RIGHT NOW
<manveru>
AsaA: well, it's a bit hard to explain without showing you how a ruby interpreter works
<shevy>
AsaA, you are obsessed with string literals
<manveru>
ruby basically sees "abc" and creates code that makes a string object with that content
<shevy>
I think String literal may be a formal notation to define what is between those delimiters
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-94-145.ssp.dialog.net.pl] has joined #ruby-lang
AsaA [AsaA!~AsaA@pool-173-58-89-188.lsanca.fios.verizon.net] has joined #ruby-lang
<AsaA>
okay i concluded it doesnt even matter
<yorickpeterse>
Happy 2012 fellow geeks!
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby-lang
RomyEatsDrupal [RomyEatsDrupal!~stickycak@64.202.138.67] has joined #ruby-lang
codelurker [codelurker!~codelurke@c-65-96-208-17.hsd1.ma.comcast.net] has joined #ruby-lang
replore [replore!~replore@ntkngw298122.kngw.nt.ftth.ppp.infoweb.ne.jp] has joined #ruby-lang
<shevy>
hmm
<shevy>
say you have raw text
<shevy>
and you want to display that on a webpage... naturally via <pre> works quite ok ... but that text is also a bit boring when using merely <pre> alone
<shevy>
is there anything to "spice" up text automagically?
<Jake232>
eventmachine must have some significant startup time. It takes me 35 seconds to startup and scrape 50 pages, and 24 to startup and scrape 8
ltd [ltd!~z@zx.io] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
jredville [jredville!~james@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang