Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<whitequark> eydaimon: don't parse XML with regexps. EVER.
<whitequark> use nokogiri.
tdubz has joined #ruby-lang
yawniek has quit ["WeeChat 0.3.7-dev"]
jmcphers has joined #ruby-lang
jtoy has joined #ruby-lang
<eydaimon> whitequark: thanks, but I'm not parsing it with regexp :)
looopy has joined #ruby-lang
naz has joined #ruby-lang
symm- has joined #ruby-lang
senj has joined #ruby-lang
major_majors has joined #ruby-lang
awinters has joined #ruby-lang
wyhaines has joined #ruby-lang
eydaimon has joined #ruby-lang
savage-_ has joined #ruby-lang
robotmay has joined #ruby-lang
<petercooper> http://www.dsprobotics.com/flowstone.html is intriguing
<petercooper> Ruby based graphical programming
Austin__ has quit [#ruby-lang]
jredvill` has joined #ruby-lang
<rue> It's like LOGO, but the turtles go all the way down
<seanstickle> I've never seen the appeal of graphical programming
<petercooper> Yahoo Pipe was the closest I got to grokking it but even that turned out to be a hideous mess
<seanstickle> And the absence of any graphic programming to make a dent in the market doesn't help matters
<petercooper> Pipes, even.
<rue> seanstickle: It's because you're a programmer
<seanstickle> rue: huh?
<rue> You'd find graphical programming appealing were you not a programmer.
<seanstickle> rue: what makes you think that?
erpuds has joined #ruby-lang
havenn has joined #ruby-lang
shajith has joined #ruby-lang
looopy has joined #ruby-lang
znouza has joined #ruby-lang
<cirwin> composability is lacking in a graphical UI
<cirwin> but I do see the appeal of graphical programming
darkf has joined #ruby-lang
<petercooper> I guess I see it as being more along the lines of a DSL rather than a whole new way to achieve the same ends as regular programming.
xjiujiu has joined #ruby-lang
<petercooper> These folks seem to be pushing it as a way to interact with robots, home automation, and similar stuff. Could be ideal for a certain level of user in those fields.
<petercooper> But for building a complete web app? I think I'd freak out ;-)
<seanstickle> I suppose, in the same way you can do basic calculus by drawing.
<seanstickle> But beyond a certain point, that doesn't work.
<petercooper> Yeah
<seanstickle> Take it from the guy who learned calculus by drawing pictures for a year.
<petercooper> That said, I'm definitely all for more visualizations in development, just not as the input mechanism.
elux has joined #ruby-lang
<seanstickle> petercooper: like this guy: http://vimeo.com/36579366 ?
<petercooper> Exactly ;-)
<petercooper> Is there anyone who HASN'T seen that video!
<seanstickle> Kim Jong Un
<seanstickle> Probably...
<petercooper> he's too busy tweeting
<seanstickle> I think you mean … eating
savage- has joined #ruby-lang
chimkan_ has joined #ruby-lang
chimkan_ has joined #ruby-lang
S1kx has joined #ruby-lang
bryancp has joined #ruby-lang
* jaimef looks for a cleaner way to get hostname other than %x{ uname -n }
<heftig> jaimef: require 'socket'; Socket.gethostname
<seanstickle> require "socket"; Socket.gethostname
<seanstickle> It's literally, and I mean literally, the first result for a google search on "ruby hostname"
tenderlove has joined #ruby-lang
andrewhl has joined #ruby-lang
looopy has joined #ruby-lang
muzone has joined #ruby-lang
bryancp has joined #ruby-lang
codewrangler has joined #ruby-lang
<erikh> this may be a dumb question, but is messagepack lighter than marshal for communicating in-process?
<erikh> I get the feeling it wouldn't be, but if someone's done benchmarks..
<bougyman> .31
wmoxam has joined #ruby-lang
gix has joined #ruby-lang
<drbrain> erikh: what's messagepack?
<drbrain> erikh: Marshal uses a fairly compact encoding
QaDeS_ has joined #ruby-lang
<erikh> drbrain: it's a cross-plat/cross-lang marshal that has some performance guarantees
<erikh> basically thrift or corba that's aiming to be the opposite of thrift and corba
<drbrain> erikh: is there a spec?
<erikh> there's already a ffi binding out there for it, I've heard the occasional joe in here talk about it.
<erikh> I think ... postmodern maintains it
<drbrain> in Marshal, [1,2,3] would be three more bytes
<erikh> hrm
<drbrain> hrm, actually, more than that
<postmodern> erikh, yep that's me
<drbrain> I think 6 more
<erikh> well I'm not too worried about that, I'm more worried about the computational cost
<erikh> I guess I should just BM it
<ddfreyne> BM?
<drbrain> 2 bytes for version, one for array length, one more for each integer
<erikh> benchmark.
<postmodern> pick your serializer based on the requirements
<erikh> oh, that's a nice feature
<postmodern> like Mashal is ok if you don't need to ever interact with other languages
<drbrain> postmodern: yup
<erikh> oh I see what you're saying
<erikh> well, my use case is sending tons of little messages over the wire to an inproc 0mq system of push/pull sockets
<postmodern> also if the data will never need to worry about different versions of Ruby
<erikh> you can probably see how marshal cost might be a concern
<postmodern> erikh, JSON would even fit that use case
<erikh> I seriously doubt json would marshal faster than marshal.
<erikh> anyhow, probably a silly thing to think about. thanks for the discussion guys
sj26_ has joined #ruby-lang
slyphon_ has joined #ruby-lang
<drbrain> postmodern: the Marshal format hasn't changed since (at least) ruby 1.8
<drbrain> cross-compatibility is not a concern
znouza_ has joined #ruby-lang
<drbrain> looks like 1.6 had version 4.6 which newer versions can read
<erikh> yeah, I'm all in-process anyhow so that isn't an issue really
savage- has joined #ruby-lang
<erikh> basically just avoiding the Queue class
slaytani1 has joined #ruby-lang
jaimef_ has joined #ruby-lang
MistyM has joined #ruby-lang
fritzek_ has joined #ruby-lang
zzak has joined #ruby-lang
ahs3- has joined #ruby-lang
jbwiv has joined #ruby-lang
nacengineer has joined #ruby-lang
<whitequark> hm
<whitequark> anyone knows how to escape GVL in ffi gem?
codefriar has joined #ruby-lang
<rue> You could call the function
<whitequark> rue: look. I make a thread with WEBRick, then I call a C function which requests a page from that server
<whitequark> the C function blocks entire Ruby process
<whitequark> but I don't want it to.
<whitequark> my library is threadsafe of course, so I'm sure that GVL acquisition can be omitted in this case
<rue> rb_thread_blocking_region()?
<whitequark> sure, that would work _if I'd been using Ruby C API_
<whitequark> but I am not
<rue> It's a function
<whitequark> because I need compatibility across all major implementations and OSes, and I don't want to fuck with this
<rue> I guess you'd have to generate a wrapper, though
<whitequark> nope. attach_function ..., :blocking => true.
<rue> Oh neat, is that in the new versions?
<whitequark> mhm
<whitequark> I found this solution in a topic from 2009
<whitequark> ah yes, I think the support for attach_function was added quite recently
<whitequark> so probably yes
duckinator has joined #ruby-lang
<whitequark> blasphemy.
<whitequark> jruby dies from my perversions
<whitequark> errr
<whitequark> and rbx's ffi is incompatible with gem?
<whitequark> how sweet
duckinatorr has joined #ruby-lang
hagebake has joined #ruby-lang
hagebake has joined #ruby-lang
wmoxam_ has joined #ruby-lang
elux has joined #ruby-lang
lianj has joined #ruby-lang
heppy_ has joined #ruby-lang
hagebake has joined #ruby-lang
hagebake has joined #ruby-lang
jtoy has joined #ruby-lang
Paoc_ has joined #ruby-lang
neoesque has joined #ruby-lang
<rue> Problem remains, then
lianj has joined #ruby-lang
<whitequark> rue: fixed by snooping for the gem
<whitequark> all implementations except the gem/mri are compatible
<rue> Huzzah
<whitequark> I'll release a gem soon
<whitequark> it has an interesting technique I never seen before, through it may be not widely applicable
dv310p3r has joined #ruby-lang
gokul has joined #ruby-lang
klape has joined #ruby-lang
heppy has joined #ruby-lang
<whitequark> works on MRI 1.9.*, latest jruby and rbx.
<whitequark> on Linux, of course.
jmcphers has joined #ruby-lang
_bat has joined #ruby-lang
<rue> whitequark: So what's the thought behind building a library, but not going with a Ruby ext?
zmack_ has joined #ruby-lang
<whitequark> rue: because other implementations' support for Ruby C exts has always being flaky
<whitequark> e.g. I don't really want to know any of the details of how rb_thread_blocking_region works on non-MRI
<whitequark> and FFI is standardized and almost precisely compatible (except for, again, rb_thread_blocking_regiuon) support
<whitequark> and I don't need to muck with makefiles to make this C ext link with Qt
<whitequark> on Linux, Windows, OS X and whatever
<whitequark> I just build a simple Qt library and it just works
<whitequark> not to say I don't want to know the details of Strings on OS X
<whitequark> and so on
<whitequark> does MacRuby have even some MRI C API compatibility? I'm not sure. But I know it has a compatible FFI interface.
jxie has joined #ruby-lang
joast has joined #ruby-lang
brownies has joined #ruby-lang
igotnolegs has joined #ruby-lang
darkf_ has joined #ruby-lang
anjen has joined #ruby-lang
gnufied has joined #ruby-lang
grimshaw has joined #ruby-lang
lianj has joined #ruby-lang
duckinator has joined #ruby-lang
grimshaw has joined #ruby-lang
lianj has joined #ruby-lang
lianj has joined #ruby-lang
grimshaw has joined #ruby-lang
grimshaw has joined #ruby-lang
sebicas has joined #ruby-lang
sebicas has quit [#ruby-lang]
fredguest has joined #ruby-lang
heppy has joined #ruby-lang
cyndis has joined #ruby-lang
fredguest has joined #ruby-lang
hopkinsju has joined #ruby-lang
matti has joined #ruby-lang
matti has joined #ruby-lang
fredguest has joined #ruby-lang
rippa has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
<Banistergalaxy> Anyone here speak spanish?
<Banistergalaxy> Can they translate the spanish in this image? http://3.bp.blogspot.com/_XEumqASVqLc/TL4S506zm6I/AAAAAAAAAkk/FIhb3rrrdkQ/s1600/Sailor2.jpg
<eydaimon> if you could read it, you could put it into google translate
<eydaimon> that's illegible to me
<eydaimon> Banistergalaxy: go read http://www.amazon.com/dp/0517548232 :)
<andkerosine> "The mystery of life is a mystery"?
<andkerosine> Or maybe "the mystery of life is that we have life" or something.
twittard has joined #ruby-lang
looopy has joined #ruby-lang
andkerosine has quit [#ruby-lang]
dean_m has joined #ruby-lang
<dean_m> Hi, I am trying to find out devicve version using this regex
<dean_m> ruby-1.9.2-p290 :046 > (/.*?[\d.]+.*?([\d_.]+)/).match(c)
<dean_m> => #<MatchData "Mozilla/5.0 (Linux; U; Android 2.3.6" 1:"2.3.6">
<dean_m> But here I should only get 2.3.6 and not any other details
<dean_m> where c = Mozilla/5.0 (Linux; U; Android 2.3.6; fr-fr; Nexus One Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
DRCALKIN has joined #ruby-lang
x0F__ has joined #ruby-lang
<Asher> anyone know how to set sort order on Btree for Kyoto Cabinet?
<Asher> or where docs correspond to sort order
rippa has joined #ruby-lang
havenn has joined #ruby-lang
tomzx has joined #ruby-lang
thone has joined #ruby-lang
csherin has joined #ruby-lang
artOfWar has joined #ruby-lang
xaio has joined #ruby-lang
zmack has joined #ruby-lang
gianlucadv has joined #ruby-lang
urbanmonk has joined #ruby-lang
macmartine has joined #ruby-lang
macmartine has joined #ruby-lang
srbartlett has joined #ruby-lang
banisterfiend has joined #ruby-lang
havenn has joined #ruby-lang
fragmachine has joined #ruby-lang
<fragmachine> anyone know if gem comes installed by default on mac lion?
Gekz has joined #ruby-lang
Gekz has joined #ruby-lang
solars has joined #ruby-lang
kaiwren has joined #ruby-lang
chimkan has joined #ruby-lang
jredvill` has joined #ruby-lang
Banistertab has joined #ruby-lang
sat00 has joined #ruby-lang
rpall has joined #ruby-lang
carlosed has joined #ruby-lang
krz has joined #ruby-lang
gjaldon has joined #ruby-lang
Taranis has joined #ruby-lang
isale-eko has joined #ruby-lang
looopy has joined #ruby-lang
tbuehlmann has joined #ruby-lang
sat has joined #ruby-lang
sat has joined #ruby-lang
yxhuvud has joined #ruby-lang
UziMonkey has joined #ruby-lang
UziMonkey has joined #ruby-lang
UziMonkey has joined #ruby-lang
seanstickle has joined #ruby-lang
fireglow has joined #ruby-lang
adambeynon has joined #ruby-lang
rob_ has joined #ruby-lang
<rob_> hi
PatrixCR has joined #ruby-lang
<seanstickle> hollo
<PatrixCR> Hello
<PatrixCR> Test
PatrixCR has quit ["Quit"]
<rob_> if i do 'def SomeClass < Array' how can i access the array methods on a SomeClass object?
<burgestrand> rob_: yes
<rob_> how? :)
<burgestrand> rob_: also subclassing built-in classes is crazy and should be avoided
<rob_> oh why?
<burgestrand> rob_: oh, you call them like normal :o
Dotan has joined #ruby-lang
<burgestrand> rob_: ruby takes a few shortcuts for different methods, you’ll need to override a bunch of them to actually get your SomeClass back when doing many operations
<seanstickle> Ruby is crazy in general, but it's delightful.
<burgestrand> It’s more trouble than it’s worth; delegation is often better, or even a whole other approach
<burgestrand> There are a few rare cases that have a legitimate use for it where it could make sense, but those are few
<seanstickle> It's always worked nicely for me.
gianlucadv has joined #ruby-lang
<rob_> burgestrand: http://pastie.org/3407072
<burgestrand> rob_: what about it?
<rob_> i cant access the Hash method .has_value
<burgestrand> rob_: that’s because it does not exist
<seanstickle> has_value? not has_value
<rob_> oh, my mistake :)
<rob_> is this bad design then? http://pastie.org/3407078
<rob_> i want to compare the hashes for files in two directory structures
tekin has joined #ruby-lang
<burgestrand> rob_: for small one-off things you’re fine, but I’d say that if you’re planning on building on this I’d recommend a normal class that support the methods you need
<rob_> burgestrand: what concepts should i look up? :)
<rob_> if i initialize a class with @files = {} then won't i just have to provide access to all the Hash methods i want to access individually? it seems like it would be a pain..
<rob_> i suppose i can move the logic inside my class?
fayimora has joined #ruby-lang
<rob_> is it generally ok to call self.some_method from the initialize declaration? or should i initialize an object and then call the method afterwards?
<burgestrand> rob_: initially I’d start with this: http://pastie.org/private/t4brrwvcth8ofseolgm4dq
<burgestrand> rob_: the reason is, when you’re subclassing a core ruby class you’re making yourself Hash’s bitch, this way you keep the little bugger in check and only allow the light of day to see the storage if you let it
<burgestrand> Mind my language.
<rob_> :)
<burgestrand> Actually, you don’t even need the store in that implementation.
<rob_> the two parts of that i dont really understand are what 'super' is doing and what SimpleDelegator is
<burgestrand> rob_: super calls the same method in the parent, and in this case passes along the hash
<burgestrand> rob_: SimpleDelegator is a thin wrapper that makes it appear that Files is a Hash, making it support the same methods that it support
<manveru> rob_: implementing rsync?
<rob_> ok i think i understand SimpleDelegator but am not quite clear on 'super', it's always confused me a bit
<burgestrand> rob_: I think of it as 1-upping the current method with the parents’ implementation :)
<rob_> manveru: i want to sync a local and remote filesystem but first move any moved files on the remote side so they don't get deleted and re-uploaded :)
<rob_> burgestrand: in your first example where you do super(@store = {})
<rob_> @store becomes a Hash instance and then we inherit it's methods into Files?
<rob_> (so the same as super({}) basically?)
Dotan has joined #ruby-lang
<rob_> but this wouldnt work without being a subclass of SimpleDelegation?
<rob_> so i suppose my question is, what happens if you don't subclass SimpleDelegation? what would super achieve in that case?
<burgestrand> rob_: it’d be superfluous
<burgestrand> rob_: it might not even work at all, depending on which method you call it from
QaDeS has joined #ruby-lang
<burgestrand> Anyhow, got to go
<rob_> burgestrand: thanks for your elp :)
<rob_> help too :>
<shevy> hmm got a question about OptionParse. When I have ... two options, short and long form, like this: '-b', '--build-dir=[val]'
<shevy> will -b be used the same as --build_dir? In other words, both would require a "= value" setting?
<shevy> ruby foobar.rb -b=foo
<shevy> ruby foobar.rb --build_dir=foo
<shevy> ?
<manveru> shevy: did you try it? :P
benanne has joined #ruby-lang
<shevy> nope
<shevy> I am thinking of parsing the options on my own actually
<manveru> lol
pemeon has joined #ruby-lang
<pemeon> Hi does anybody know good equivalent for with function from JavasScript in Ruby ?
<manveru> instance_eval
<pemeon> thanks manveru I forgot about this
pemeon has quit [#ruby-lang]
<manveru> shevy: thing is, [] are optional
<shevy> aaaaah
<manveru> did you read the docs at all?
<shevy> so I guess "--build-dir" would take the default argument then?
<shevy> yeah. they suck
<manveru> "--build-dir=VAL"
<manveru> or "--build-dir VAL"
<manveru> either works
<shevy> hmm
<shevy> what about "--build-dir" without arguments?
<shevy> come to think about it, I actually barely see the "=" used
pemeon has joined #ruby-lang
<manveru> that would just ignore the arg
<shevy> manveru, do you use "foo=bla" on commandline to ruby scripts?
<manveru> no
<manveru> optionparser allows both anyway
<manveru> no matter which one you use to document the switch
<shevy> hmm
<manveru> ι ~ % ruby -roptparse -e 'OptionParser.new{|o| o.on("-f", "--foo"){|f| p f }}.parse!' -- -f bar
<manveru> true
<manveru> ι ~ % ruby -roptparse -e 'OptionParser.new{|o| o.on("-f", "--foo=DUH"){|f| p f }}.parse!' -- -f bar
<manveru> "bar"
QaDeS has joined #ruby-lang
brownies has joined #ruby-lang
h4y4shi has joined #ruby-lang
<h4y4shi> Hello
setmeaway has joined #ruby-lang
toretore has joined #ruby-lang
<Tasser> is there a method for hashes such that the result of the block is the new value?
m3nd3s has joined #ruby-lang
<manveru> no
<Tasser> can I use hash.peach {|k,v| hash[k] = v.to_s} # aka is [] thread-safe enough?
tcurdt has joined #ruby-lang
<tcurdt> I need to transfer an object ... easy - just use Marshal::dump(obj) ... but then I realized ... it needs to be on one line ... which means it needs to be encoded
<tcurdt> so Base64.encode64(Marshal::dump(obj)) ... but that's again not on one line
<tcurdt> how would you do this?
neoesque has joined #ruby-lang
<tcurdt> hex encoding/decoding of the marshal dump should be good enough I think
leriksenau has joined #ruby-lang
<tcurdt> guess I could use unpack for this ... but is there a better way to encode/decode a string to/from hex?
Stalkr_ has joined #ruby-lang
<shevy> peach? is there really a #peach method?
tcurdt has quit [#ruby-lang]
<shevy> hmm
<shevy> peach and banana
nazty has joined #ruby-lang
jamw has joined #ruby-lang
<manveru> well, in case tcurdt comes around, [Marshal.dump(obj)].pack('m0') does the trick
Fullmoon has joined #ruby-lang
Spooner has joined #ruby-lang
codefriar has joined #ruby-lang
carlosed has joined #ruby-lang
sat has joined #ruby-lang
ruxpin has quit [#ruby-lang]
Keva161 has joined #ruby-lang
stephenp has joined #ruby-lang
codewrangler has joined #ruby-lang
rushed has joined #ruby-lang
<rob_> hi is there a way to get an array of keys that have the same value from a hash?
<rob_> Hash.key() only seem's to return the first match
<manveru> rob_: select
<rob_> thanks :)
<manveru> hm
<manveru> well, that's if you know the value already
<manveru> >> {a: "foo", b: "bar", c: "foo"}.group_by{|k,v| v }["foo"]
<manveru> => [[:a, "foo"], [:c, "foo"]]
<manveru> that's another way
<manveru> transpose[0] or map(&:first) to get only the keys
gentz_ has joined #ruby-lang
jtoy has joined #ruby-lang
dejongge has joined #ruby-lang
robotmay has joined #ruby-lang
dous has joined #ruby-lang
dfr|mac has joined #ruby-lang
nark-1 has joined #ruby-lang
Sailias has joined #ruby-lang
savage- has joined #ruby-lang
knu has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
niklasb has joined #ruby-lang
fayimora has joined #ruby-lang
seanstickle has joined #ruby-lang
slimfit has joined #ruby-lang
PatrixCR has joined #ruby-lang
zmack has joined #ruby-lang
elux has joined #ruby-lang
PatrixCR has quit [#ruby-lang]
jtoy has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
chimkan has joined #ruby-lang
enebo has joined #ruby-lang
benanne has joined #ruby-lang
slimfit has joined #ruby-lang
rob_ has quit [#ruby-lang]
virunga has joined #ruby-lang
fayimora_ has joined #ruby-lang
diegoviola has joined #ruby-lang
urbanmonk has joined #ruby-lang
lordofthedance has joined #ruby-lang
<andrewvos> ruby-lang: Is there a gem that has a list of rnadom words?
<andrewvos> ruby-lang: I suppose a dictionary file would be alright too, but I'm very lazy
savage- has joined #ruby-lang
dous_ has joined #ruby-lang
tomzx has joined #ruby-lang
<andrewvos> Anyone know an easy way to strip html tags from a string?
<andrewvos> Other than a regex
rippa has joined #ruby-lang
<Tasser> andrewvos, thou shalt not parse html with regex
<andrewvos> Tasser: yeah yeah yeah
<andrewvos> Tasser: I'm not
<andrewvos> I just want to get a wikipedia rndom page, and then mess around with the text content
<seanstickle> Actually, that sounds exactly like you're parsing HTML
<seanstickle> Unless you're including the javascript and title content and all that in the term "text content"
<andrewvos> seanstickle: Yeah good point
<Mon_Ouie> Using http://www.mediawiki.org/wiki/API:Query may make the parsing easier
<andrewvos> Mon_Ouie thanks!
dfr|mac has joined #ruby-lang
gokul has joined #ruby-lang
cruyps has joined #ruby-lang
<andrewvos> Mon_Ouie: Can't get anything better from there I think
<andrewvos> Nokogiri to the rescue!
<Mon_Ouie> Well, you still need a way to strip the HTML (I guess you could iterate over it using a parser and only printing the text); you just get direct access to the content of the page
<shevy> hmmm a bit semi off-topic
<shevy> web_object.background_color = '#ffffee'
<shevy> any idea how to ... uhm... turn this colour darker or lighter without having to know the values?
looopy has joined #ruby-lang
elux has joined #ruby-lang
<shevy> perhaps something like ... web_object.background_color = '#ffffee ++++' for several grades of lighter
<shevy> web_object.background_color = 'pink' is a lot easier to understand :\
gregf has joined #ruby-lang
<yorickpeterse> shevy: 0to255.com
<andrewvos> Why doesn't this work? "dsfsd dsfsdf sdf sdf".scan("\w+")
<andrewvos> Am I being stupid?
vbatts_tab has joined #ruby-lang
<Mon_Ouie> /\w+/
<andrewvos> Mon_Ouie: OH MY GOD
<yorickpeterse> ^
<yorickpeterse> quotes as usual
* andrewvos gives up programming
<shevy> yorickpeterse hmm cool site
<seanstickle> andrewvos: or you could just use Mechanize
<andrewvos> Meh, this works kind of: html.css(".mw-content-ltr p").map { |node| node.text }.join(" ").scan(/\b\w{3,}\b/).sample.downcase
curtism has joined #ruby-lang
_ko1 has joined #ruby-lang
jxie has joined #ruby-lang
Sailias has joined #ruby-lang
v0yager has joined #ruby-lang
MistyM has joined #ruby-lang
xaio has joined #ruby-lang
headius has joined #ruby-lang
dberg has joined #ruby-lang
macmartine has joined #ruby-lang
darkf has joined #ruby-lang
shtirlic has joined #ruby-lang
looopy has joined #ruby-lang
dhruvasagar has joined #ruby-lang
erpuds has joined #ruby-lang
denysonique__ has joined #ruby-lang
bryancp has joined #ruby-lang
kitallisii has joined #ruby-lang
darkf_ has joined #ruby-lang
codefriar has quit ["Linkinus - http://linkinus.com"]
v0yager_ has joined #ruby-lang
Keltia_ has joined #ruby-lang
robotmay_ has joined #ruby-lang
Spooner has joined #ruby-lang
Slackwise_ has joined #ruby-lang
quetzal- has joined #ruby-lang
jbsan_ has joined #ruby-lang
UziMonkey_ has joined #ruby-lang
Gekz_ has joined #ruby-lang
khaase_ has joined #ruby-lang
zvrba_ has joined #ruby-lang
Aphelion has joined #ruby-lang
dous has joined #ruby-lang
gregmore_ has joined #ruby-lang
Harzilein_ has joined #ruby-lang
charper_ has joined #ruby-lang
shachaf_ has joined #ruby-lang
cout_ has joined #ruby-lang
xxi_ has joined #ruby-lang
epitron__ has joined #ruby-lang
zerokarm1left has joined #ruby-lang
lake1 has joined #ruby-lang
robwilli_ has joined #ruby-lang
S2kx has joined #ruby-lang
Utkarsh has joined #ruby-lang
epitron has joined #ruby-lang
lorenzo has joined #ruby-lang
Jade has joined #ruby-lang
kyrylo has joined #ruby-lang
jorgenpt has joined #ruby-lang
yugui_zzz has joined #ruby-lang
cschneid has joined #ruby-lang
epitron has joined #ruby-lang
imajes has joined #ruby-lang
kyrylo has joined #ruby-lang
chrismcgh has joined #ruby-lang
stepnem has joined #ruby-lang
DEac- has joined #ruby-lang
LanceHaig has joined #ruby-lang
tallship has joined #ruby-lang
khaase has joined #ruby-lang
dv310p3r has joined #ruby-lang
alip has joined #ruby-lang
soahccc has joined #ruby-lang
mephux has joined #ruby-lang
sj26 has joined #ruby-lang
jwollert has joined #ruby-lang
dkannan has joined #ruby-lang
Nisstyre has joined #ruby-lang
josh9 has joined #ruby-lang
curtism has joined #ruby-lang
jbwiv has joined #ruby-lang
dominikh has joined #ruby-lang
jammi has joined #ruby-lang
rue has joined #ruby-lang
mitchty has joined #ruby-lang
apeiros_ has joined #ruby-lang
dreinull has joined #ruby-lang
S1kx has joined #ruby-lang
m3nd3s has joined #ruby-lang
mrchrisadams has joined #ruby-lang
denysonique__ has joined #ruby-lang
lsegal has joined #ruby-lang
elux has joined #ruby-lang
simon_weber has joined #ruby-lang
anthony has joined #ruby-lang
publicvoid_ has joined #ruby-lang
tenderlove has joined #ruby-lang
Bwild has joined #ruby-lang
darkf has joined #ruby-lang
Dotan_ has joined #ruby-lang
Luxx_ has joined #ruby-lang
workmad3 has joined #ruby-lang
<manveru> :P
<manveru> andrewvos: the faker gem has random text
<manveru> or you can d/l xml dumps from wikipedia for parsing bliss
<manveru> also that
<manveru> oh, and this: http://ipsum-generator.com/
<manveru> ι ~ % ruby -rfaker -e 'puts Faker::Lorem.paragraphs(10)'
<manveru> and that
<manveru> guess i need a pastebin to list all of the possiblities
dberg has joined #ruby-lang
<MistyM> manveru: There's also http://cupcakeipsum.com/ and http://hipsteripsum.me/ ;)
<shevy> omg
fayimora has joined #ruby-lang
<erikh> there was also a samuel l jackson one
<erikh> http://slipsum.com/#.Tz_z8UzC6Go
slippyd has joined #ruby-lang
<shevy> lol
<shevy> that one is better than hipsters
<shevy> he should hunt the hipsters down and shoot them
<erikh> SLJ is better than pretty much anything
<erikh> right
<erikh> he could do that
<erikh> in a very loud voice
<erikh> ok, time to reinstall, bbiaf
<shevy> famous last words
<shevy> :(
srbaker has joined #ruby-lang
<darix> lorem ipsum isnt exactly a good fake text as the word length and so not really match our languages
futurechimp has joined #ruby-lang
RomyRomy has joined #ruby-lang
virunga has joined #ruby-lang
chimkan_ has joined #ruby-lang
tomzx has joined #ruby-lang
<manveru> well, you could take stephen fry and rot13 it
Keva161 has joined #ruby-lang
<elux> i dont get it..
<elux> why havent they fixed net/http to work with persistent connections?
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
Fretta has joined #ruby-lang
workmad3 has joined #ruby-lang
gregf has joined #ruby-lang
outoftime_ has joined #ruby-lang
<darix> elux: so drbrain could write us http://docs.seattlerb.org/net-http-persistent/?
<elux> darix: yea.. im aware of that gem.. it gets the job done, i just dont see why thats even necessary
<elux> im trying to understand the fundamental problem in net/http that prevents persistent connnections..
<darix> drbrain: any reasons why you didnt push net-http-persistent into ruby itself?
skryking has joined #ruby-lang
cirwin has joined #ruby-lang
tommyblue has joined #ruby-lang
outoftime_ has joined #ruby-lang
nofxx has joined #ruby-lang
<josh9> i have a 1 liner webapp - run Proc.new {|env| [200, {"Content-Type" => "text/html"}, ["Rack using the rackup tool"]]} why do i see 'NoMethodError at /' at the chrome's tab?
<nofxx> Hm.. mechanize floods /tmp ... is there some option I'm missing? gonna write a cron
<whitequark> josh9: works for me
<whitequark> cache?
igotnolegs has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
<apeiros_> urgs
<apeiros_> better :)
rpall has joined #ruby-lang
<josh9> whitequark: maybe it's chrome..
<josh9> whitequark: i can see the text, it's just the chrome tab
<josh9> that show this message
Banistertab has joined #ruby-lang
<josh9> what is so special with #call? what happens when i access my website? is it creating an instance of the object i passed into Thin.run?
<josh9> and running #call ?
seanstickle has joined #ruby-lang
DRCALKIN has joined #ruby-lang
macmartine has joined #ruby-lang
<josh9> i am looking at the initialize method of thin. it accepts the object. not sure what it does with it..
<josh9> @app = arg if arg.respond_to?(:call)
<apeiros_> thin uses rack
Jade has joined #ruby-lang
<apeiros_> rack uses that
<apeiros_> anything that responds to call and returns an array with status code, headers and body is a proper middleware
<josh9> yeah. it looks like thin has an instance var called @app. so my object that i passed to thin is assigned into this variable.
<josh9> i am curious to see what happens when a request comes to thin. i guess it create an instance of @app and calles #call
<apeiros_> I think it just calls .call
<apeiros_> after all, the object you hand it responds to call directly, not its instances.
<josh9> true
<apeiros_> however, you can - of course - create an instance of whatever in that .call method and do whatever you want with it.
enebo_ has joined #ruby-lang
tla has joined #ruby-lang
<josh9> i also notice #start https://github.com/macournoyer/thin/blob/master/lib/thin/server.rb#L142 but not sure who is calling it
pabs_ has joined #ruby-lang
shyouhei_ has joined #ruby-lang
mqt` has joined #ruby-lang
<apeiros_> this is funny: alias :start! :start
hrnt_ has joined #ruby-lang
<apeiros_> syntax/method schizophrenia…
<apeiros_> (alias is syntax, hence no , is needed, yet he uses symbols - which isn't necessary either…)
<apeiros_> I also dislike this: log ">> Thin
<apeiros_> the >> isn't part of the message. it's part of the formatting. it doesn't belong into the message.
* apeiros_ is being a nitpick again
melter has joined #ruby-lang
looopy has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
heftig has joined #ruby-lang
Sailias has joined #ruby-lang
futurechimp has joined #ruby-lang
rushed has quit [#ruby-lang]
mahlon has joined #ruby-lang
Dotan has joined #ruby-lang
havenn has joined #ruby-lang
tbuehlmann has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<dominikh> alias instead of alias_method is barely ever needed as well.
andrewhl has joined #ruby-lang
apeiros_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
apeiros_ has joined #ruby-lang
apeiros_ has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
duckinator has joined #ruby-lang
apeiros_ has joined #ruby-lang
tenderlove has joined #ruby-lang
tjgillies has joined #ruby-lang
shachaf has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
urbanmonk has joined #ruby-lang
dejongge has joined #ruby-lang
<shevy> ur mom is barely ever needed as well!!!
<apeiros_> shevy: behave…
<shevy> I tend to use more aliases ... I'd say around 3:1 alias:alias_method some such
workmad3 has joined #ruby-lang
<shevy> but it can be quite insane. I think ruby-tk uses alias foo_bar foobar for all methods or something like t hat.
BadQuanta has joined #ruby-lang
workmad3 has joined #ruby-lang
headius has joined #ruby-lang
UziMonkey has joined #ruby-lang
UziMonkey has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
ryanf_ has joined #ruby-lang
kyrylo_ has joined #ruby-lang
kyrylo_ has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
Tref has joined #ruby-lang
<josh9> let's assume my stack is nginx -> thin -> sinatra. so what exactly happenes on each request? that's what i understand: nginx pass the request to thin, thin create instance of my sinatra app.
<apeiros_> josh9: raise an exception, check the backtrace
<josh9> also when i first start thin, it loads my sinatra class and libraries to memory.
<apeiros_> or use caller.join("\n") in your response
kith has joined #ruby-lang
<josh9> apeiros_: what's caller.join?
<apeiros_> josh9: ri Kernel#caller
andkerosine has joined #ruby-lang
<apeiros_> also Array#join
<andkerosine> Array#*
<apeiros_> it gives you the current backtrace
* apeiros_ thinks Array#* is inconsistent
<apeiros_> (cf. String#*)
<nark-1> which one is better for post request: http://pastie.org/3410953?
shevy has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
Sailias has joined #ruby-lang
listrophy has joined #ruby-lang
<listrophy> i'm playing around with turnip, but if i have a backtick in my step definition, it won't match. :(
slyphon has joined #ruby-lang
<josh9> apeiros_: thanks, printing caller helpes
<listrophy> and i'm seeing nothing in Turnip::StepDefinition#compile_regexp that would prevent this.
<listrophy> are backticks special characters in regexp or something?