Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<andrewvos> You all wrong
<zenspider> no you
<andrewvos> no you
<zenspider> graph 2.5.0 released
ilyam has joined #ruby-lang
erpuds has joined #ruby-lang
<schlecht> Wasn't zenspider meant to write a book?
<andrewvos> I certainly hope not ;)
<andrewvos> hehe just playing
wmoxam has joined #ruby-lang
mark_locklear has joined #ruby-lang
<zenspider> schlecht: I had a contract with addison weseley back in 2001... but I doubt that's what you're referring to
<zenspider> schlecht: did you have something else in mind?
<schlecht> It was from some time back, I don't remember who the publisher was.
<schlecht> Bbiaw.
<injekt> hmmm
asdfreqw has joined #ruby-lang
uglybandersnatch has joined #ruby-lang
ttilley has joined #ruby-lang
<uglybandersnatch> hi all. wondering if you can help with some serious segfaulting i am getting when trying to install gems and use ruby-debug. here is some example output: http://pastie.org/3377465
<uglybandersnatch> i am using rvm and have tried moving between ruby-1.9.2-p180, ruby-1.9.2-p290, ruby-1.9.3-p0 and ruby-head and i get the same problems on all of them.
MistyM has joined #ruby-lang
<zenspider> haha
<zenspider> it's callcc from yard
<zenspider> uglybandersnatch: remove yard
<uglybandersnatch> ok i'll try that
<Tasser> achievement: parse a website with a CSV parser
srbartle_ has joined #ruby-lang
<uglybandersnatch> zenspider: that worked to fix the first error, but i still can't use ruby-debug without it segfaulting. here is what happens when it hits a debugger statement within my rails app: http://pastie.org/3377535
<zenspider> uglybandersnatch: suck. sorry... I don't use ruby-debug. I debug via tests.
<drbrain> uglybandersnatch: how did you build ruby?
<zenspider> I also don't really use rvm... you might want to take that out of the equation tho
<drbrain> with llvm-gcc?
Luxx_ has joined #ruby-lang
<drbrain> ah, rvm? that should use real-gcc, not llvm-gcc
<uglybandersnatch> i built it --with-gcc=clang, as it wouldn't compile otherwise. i am on mac
<drbrain> uglybandersnatch: just to check, what does ruby -rrbconfig -e 'p RbConfig::CONFIG["CC"]' say?
<uglybandersnatch> "gcc"
<drbrain> that's probably why you're crashing
<userbard> uglybandersnatch: Do you need the documentation? Seems the gem installed.
<drbrain> does gcc -v say: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
<uglybandersnatch> drbrain: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
<drbrain> if you built --with-gcc=clang and it worked, you should see "clang" instead of "gcc"
<drbrain> uglybandersnatch: you'll need to rebuild without using llvm-gcc ("gcc")
<uglybandersnatch> drbrain: yeah, sorry that might have just been when i tried it with ruby-head
S2kx has joined #ruby-lang
<uglybandersnatch> drbrain: ok thanks. my gcc might have been replaced by xcode 4.
tomzx has joined #ruby-lang
chimkan_ has joined #ruby-lang
dubellz has joined #ruby-lang
<drbrain> uglybandersnatch: if you installed Xcode 4 or 4.1 you'll have gcc-4.2
vesan has joined #ruby-lang
<drbrain> /usr/bin/gcc-4.2
phazenine has joined #ruby-lang
<phazenine> anyone know what characters are not used as often with php and objective c? like ruby rarely uses ;
<zenspider> ∞
<rue> ≠
Stalkr_ has joined #ruby-lang
<phazenine> mmm how bout a character that is on the keyboard =P
<MistyM>
<zenspider> those are both on my keyboard
<zenspider> ¡™£¢∞§¶•ª
<MistyM> I can totally see a conditional statement based on ¡value!
<drbrain> how about —
<zenspider> maybe the question could be improved
<MistyM> - is used in ObjC.
<MistyM> Oh, wrong dash width. :b
<rue> drbrain: I've been using def n–uh
djcercone has joined #ruby-lang
<MistyM> uglybandersnatch: In OS X, `gcc` has been a symlink to smth for ages now. It used to point to gcc-4.2, now it points to llvm-gcc-4.2.
<phazenine> okay, how bout this, i am being tasked to parse php and objective-c code, but the managers want to be able to load it up into excel, for html i am using the "]" as the delimiter
djcercone has quit [#ruby-lang]
<phazenine> any suggestions?
<drbrain> phazenine: CGI.htmlescape
<drbrain> wait, excel? can't you just set the data type?
<drbrain> wait, excel? I don't think I want to know what you're doing
<phazenine> lol
<rue> Ooh, lag
<rue> O wait, just ffmpeg at 380% CPU :/
Heimidal has joined #ruby-lang
erpuds has joined #ruby-lang
kurko_ has joined #ruby-lang
yadav has joined #ruby-lang
gix has joined #ruby-lang
jtoy has joined #ruby-lang
Stalkr_ has joined #ruby-lang
_bryanp has joined #ruby-lang
macmartine has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
igotnolegs has joined #ruby-lang
andkerosine has joined #ruby-lang
neoesque has joined #ruby-lang
waazzuup has joined #ruby-lang
postmodern_ has joined #ruby-lang
Tref has joined #ruby-lang
<Tref> guys need some ruby regex help
<Tref> I don't even know how i would search for something like this
<Tref> content_type.scan(/boundary="(.*?)"/).to_s
<Tref> content_type = multipart/parallel; boundary=534546696C65426F756E647279; charset=utf-8
<Tref> unfortunately that scan method is not returning anything
<Tref> this is using ruby 1.9.3-p0
Oloryn_lt1 has joined #ruby-lang
<lianj> Tref: "multipart/parallel; boundary=534546696C65426F756E647279; charset=utf-8"[/boundary=(\S+);/,1]
<Tref> regex is so cryptic to me, i don't get it :)
AndChat| has joined #ruby-lang
<Tref> lianj: you are the man
<Tref> I mean I don't know you personally, but in this situation you are the man to me; no homo
<Tref> that was the LAST piece to my puzzle
takaokouji has joined #ruby-lang
wmoxam_ has joined #ruby-lang
MistyM has joined #ruby-lang
Stalkr_ has joined #ruby-lang
gnufied has joined #ruby-lang
wmoxam has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
jasiek has joined #ruby-lang
denysonique__ has joined #ruby-lang
tla_ has joined #ruby-lang
gentz has joined #ruby-lang
wmoxam has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
wmoxam_ has joined #ruby-lang
gouthamvel has joined #ruby-lang
<gouthamvel> [ActiveModel Help] https://gist.github.com/1823066 I have uninitialized constant TagNote::Tag error when trying to access TagNote.new.tag. How can I resolve this?
cloud-brownies has joined #ruby-lang
wmoxam has joined #ruby-lang
postmodern has joined #ruby-lang
elephants has joined #ruby-lang
<drbrain> gouthamvel: Try #ror
<theconartist> (in combination with not modifying the color of your text)
<drbrain> oh wow, LimeChat saved me from that evil?
<drbrain> AWESOME
<gouthamvel> hey thanks guys
wmoxam has joined #ruby-lang
headius has joined #ruby-lang
wallerdev has joined #ruby-lang
<wallerdev> drbrain: nice work on the mechanize release
<drbrain> wallerdev: is there a :P in there somewhere?
<wallerdev> nah i love mechanize
<wallerdev> also i screw up releases in my software all the time
<drbrain> ah, good, since I messed up the first one
<wallerdev> :)
<drbrain> it's ok, you can make one (only one) joke at my expense :)
MistyM has joined #ruby-lang
<wallerdev> have you always been a maintainer of it?
<wallerdev> i know when i first started using it i used it with hpricot which seems to have kinda died with _why
<drbrain> no, knu and I are the third set
<wallerdev> cool
dfr|mac has joined #ruby-lang
<wallerdev> i was going to port mechanize to .NET at one point but ended up just giving up on .NET and moving to ruby instead
<wallerdev> haha
<srbaker> good move
dv310p3r has joined #ruby-lang
<wallerdev> but now I'm back to doing .NET as my day job -_-
looopy has joined #ruby-lang
<drbrain> once upon a time I used mechanize + Win32OLE (to IE and Outlook) + vim to automate the un-automatable
<drbrain> actually, maybe not mechanize
<wallerdev> sounds like a mess
<wallerdev> haha
<drbrain> it was a mess
<drbrain> but it saved me time waiting on the slowest website ever
<wallerdev> i <3 automation
rivaler has joined #ruby-lang
<drbrain> four servers couldn't return requests faster than once every five to ten seconds
<wallerdev> haha
<drbrain> and the daily average load was under one request per second
<wallerdev> were they powered by microsoft access databases
<drbrain> but that's what you get from an all-microsoft shop
gouthamvel has quit [#ruby-lang]
<wallerdev> anyone have experience with CMS systems with ruby/rails?
<wallerdev> I'm probably gonna go with refinerycms
<cloud-brownies> CMS? rails g scaffold ?
<wallerdev> well i need rich text editors for editing everything
<wallerdev> and the ability for users to add pages and things like that
<wallerdev> upload images and files and the usual stuff
twittard has joined #ruby-lang
wyhaines has joined #ruby-lang
<wallerdev> locomotive looks interesting
HW42_ has joined #ruby-lang
tdubz has joined #ruby-lang
andkerosine has quit [#ruby-lang]
sideshownz has joined #ruby-lang
macmartine has joined #ruby-lang
rippa has joined #ruby-lang
chimkan_ has joined #ruby-lang
krz has joined #ruby-lang
savage- has joined #ruby-lang
<jtoy> do you guys test out end to end of your system even if its crossing multiple apps/dameons/etc ?
gokul has joined #ruby-lang
<wallerdev> isnt that the customer's job?
<jtoy> haha, partially
bojicas has joined #ruby-lang
<jtoy> some parts that should happen don't seem to always happen
<jtoy> its becoming a huge pain to train everything
<jtoy> trce
<drbrain> jtoy: at work we have a complete QA environment with everyone's QA code in it
<drbrain> so it's end-to-end across multiple services
<drbrain> so both dedicated QA people and regular users find bugs
<jtoy> drbrain: do you guys write "integration" tests for the environment?
<jtoy> or mostly QA people find the bugs?
<drbrain> for a single app, yes, a few
Aaaarg has joined #ruby-lang
<drbrain> (depending upon the app)
<drbrain> NewRelic finds most of the bugs
<drbrain> due to our volume (50,000+ RPM) it's difficult for QA to find anything but bugs that should have been caught by proper unit tests
<drbrain> so it's usually weird user queries that find bugs
<jtoy> probably my app is more complex then need be, but I want to test out someone hitting the web app, job gets sent, job processor processes it, data shows up in the db, then shows up in our index engine, I'm contemplating writing tests , but doesn't sound like a good solution
<drbrain> QA usually finds bugs that pass between services
andrewhl has joined #ruby-lang
<drbrain> jtoy: with that many parts I would use instrumentation to discover bugs
<jtoy> yeah, seems like it might be easier, although hard to automate humans
<drbrain> NewRelic etc.
<jtoy> drbrain: yeah, I do have new relic, but just for performance measurement
<drbrain> with so many moving parts a test is not necessarily going to tell you "here is the bug" like a unit test would
<jtoy> drbrain: you use rpm for bugs too? most of our stuff is not a web app
<drbrain> jtoy: NewRelic can track web, background job, Solr, etc.
<drbrain> jtoy: they've got the exception reports so we scan those for top errors
<drbrain> then go fix the bug
<jtoy> drbrain: cool, ill have to see if it integrates well with event machine
<drbrain> you can add custom reporting
<drbrain> we've got a separate set of metrics through LWES
<drbrain> which is a multicast log stream
<jtoy> cool, never heard of LWES
<drbrain> we don't leverage it well enough
<drbrain> it's got structured logging
<drbrain> so we can log things like "my service made 5 sub requests and here were each of the request URIs, response codes and response times"
kp666 has joined #ruby-lang
dkannan has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
kp666 has joined #ruby-lang
gnufied has joined #ruby-lang
kitallis has joined #ruby-lang
Axsuul has joined #ruby-lang
MistyM has joined #ruby-lang
ilyam has joined #ruby-lang
comboy has joined #ruby-lang
tommyblue has joined #ruby-lang
jasiek has joined #ruby-lang
aef has joined #ruby-lang
valeri_ufo has joined #ruby-lang
sinuc has joined #ruby-lang
sinuc has joined #ruby-lang
vereteran has joined #ruby-lang
a3li has joined #ruby-lang
tasiu has joined #ruby-lang
khaase has joined #ruby-lang
darix has joined #ruby-lang
darix has joined #ruby-lang
abuiles has joined #ruby-lang
[dmp] has joined #ruby-lang
[dmp] has joined #ruby-lang
timbleck has joined #ruby-lang
soahccc has joined #ruby-lang
jMCg has joined #ruby-lang
jwollert has joined #ruby-lang
cloud-brownies has joined #ruby-lang
_rane has joined #ruby-lang
ryanf has joined #ruby-lang
sideshownz has joined #ruby-lang
necromancer has joined #ruby-lang
meise has joined #ruby-lang
senthil has joined #ruby-lang
charper has joined #ruby-lang
mccraig has joined #ruby-lang
Muz has joined #ruby-lang
simon_weber has joined #ruby-lang
cldwalker has joined #ruby-lang
akahn has joined #ruby-lang
chimkan has joined #ruby-lang
pvh has joined #ruby-lang
ramonmaruko has joined #ruby-lang
macmartine has joined #ruby-lang
ramonmaruko has joined #ruby-lang
lake1 has joined #ruby-lang
lake has joined #ruby-lang
JohnBat26 has joined #ruby-lang
mrb_bk has joined #ruby-lang
denysonique__ has joined #ruby-lang
jxie has joined #ruby-lang
JohnBat26 has joined #ruby-lang
topaz has joined #ruby-lang
nemesit has joined #ruby-lang
<erikh> hmm
<erikh> anyone mind doing a short code review of what I already have? it's incomplete, I'm mostly just wondering if I can get some feedback on what I have
davpoind has joined #ruby-lang
lake has joined #ruby-lang
ramonmaruko has joined #ruby-lang
yxhuvud has joined #ruby-lang
thone_ has joined #ruby-lang
<cloud-brownies> erikh: sure, will do what i can
<erikh> it's a 0mq messaging and event servicing system at this point -- I have more planned for it but I'm still building out messaging components.
<erikh> I really need some people with a brain for concurrency to look at it and provide useful feedback on structure.
TheInkyVoid has joined #ruby-lang
<erikh> it's not particularly big but there are a lot of parts.
<erikh> anyhow -- if you have any comments, that would be awesome.
<cloud-brownies> i do not have a brain for concurrency
<cloud-brownies> but i do have a brain!
ryez has joined #ruby-lang
<erikh> heh
ramonmaruko has joined #ruby-lang
fragmachine has joined #ruby-lang
ramonmaruko has joined #ruby-lang
savage- has joined #ruby-lang
h4y4shi has joined #ruby-lang
yango has joined #ruby-lang
<senthil> what's that concept called when you define a constant to something and use the constant to refer to that something?
<burgestrand> using constants?
<senthil> symbolic constants i think is what I was looking for
Harzilein has joined #ruby-lang
<burgestrand> that’s a new one
* burgestrand googles
<senthil> i just looked it up in C prog lang book
patant has joined #ruby-lang
dc5ala has joined #ruby-lang
<burgestrand> Symbolic constants in C look closer to what we call symbols
<burgestrand> Would have to read a bit more but that’s my initial conclusion
<senthil> you might be right, i'm jus learning c
<drbrain> erikh: what's up with concurrency?
<burgestrand> senthil: alright, looks like it can be just about any kind of value that you define with the preprocessor in C, as far as Ruby goes I don’t think you’ll find a true similarity
Slackwise_ has joined #ruby-lang
<senthil> burgestrand: i was just looking to see if there was a fancy name for doing that
<drbrain> Symbol is probably the closest thing
<drbrain> Symbols are also like C enums in a way
Xzyx987X has joined #ruby-lang
Asher1 has joined #ruby-lang
Asher has joined #ruby-lang
erpuds has joined #ruby-lang
csherin has joined #ruby-lang
postmodern has joined #ruby-lang
<erikh> drbrain: do you want to review some code?
<drbrain> erikh: tomorrow
<erikh> np
<erikh> and thanks!
Slackwise__ has joined #ruby-lang
Asher1 has joined #ruby-lang
Xzyx987X_ has joined #ruby-lang
davpoind_ has joined #ruby-lang
masterkorp has joined #ruby-lang
<h4y4shi> Can you use opengl with ruby?
<cloud-brownies> inside a ruby script, how do i execute another file of ruby code?
<cloud-brownies> dumb question, i know, but honestly not sure what i should google
<drbrain> cloud-brownies: require 'other_file'
<cloud-brownies> ah and then it just gets executed right there?
<drbrain> cloud-brownies: you might need to add . to your load path, so ruby -I.
<cloud-brownies> i guess that makes sense
<drbrain> yes, but only if you've never required it before
<drbrain> if you want to execute it multiple times, turn it into a class
<cloud-brownies> ah yea how do i set the, err... current directory?
<drbrain> use ruby -I to point to files in other directories
<cloud-brownies> drbrain: it's a rake task
<drbrain> ruby -I/path/of/other/files/ some_file.rb
<cloud-brownies> and i want to run some code in another file (and the other code is not a rake task)
<cloud-brownies> no no, rake brownies:awesome:task
<drbrain> can you paste an example?
<cloud-brownies> uh, sure
<drbrain> so I can give you the right answer
<cloud-brownies> drbrain: http://pastie.org/3379139
<drbrain> so you want to run ^^ from your Rakefile?
<drbrain> oh, I should read it, hold on
<cloud-brownies> within the rake task db:dev:prepare i want to call another file full of ruby code
<drbrain> cloud-brownies: does `ruby ../something/something/../dummy_data.rb` generate the data you want in your DB?
<cloud-brownies> yes drbrain
<cloud-brownies> and the code is at the "root level" (?) of that file
<drbrain> then I think this should work
<cloud-brownies> well, so i'm asking how i set the path to that file properly
<drbrain> we call it "top level"
<cloud-brownies> i.e. which "path" do rake tasks run in?
<cloud-brownies> what is the pwd from the perspective of the running task? to put it another way
<drbrain> the easy way is require_relative 'relative/path/to/dummy_data'
<drbrain> that will be relative to the file the db:dev:prepare task is defined in
<drbrain> the pwd can be anything, depending on what tasks prior to this one do
twittard has joined #ruby-lang
<h4y4shi> Is there a module in Ruby?
<drbrain> for the first task invoked, IIRC, rake changes pwd to the directory of the Rakefile
<drbrain> but it doesn't keep it there
<drbrain> h4y4shi: for OpenGL? there's ruby-opengl, but it doesn't work in modern ruby, so use my repository
Slackwise_ has joined #ruby-lang
<cloud-brownies> drbrain: it worked! thanks!
<drbrain> cloud-brownies: great!
<h4y4shi> I mean. For example. There is def command, class command, and do commands. Is there a command called module?
Xzyx987X has joined #ruby-lang
<drbrain> h4y4shi: yes
<drbrain> a Class is a type of Module
<h4y4shi> is it available in the basic ruby or do I have to install something?
<drbrain> it's available in basic ruby
<h4y4shi> thanks =D
<drbrain> h4y4shi: you may wish to follow a ruby tutorial
<drbrain> perhaps this one
<drbrain> corundum: learn to program?
<corundum> A good Ruby tutorial for newbies to programming: http://pine.fm/LearnToProgram/. NOTE: For linux installation section (in Chapter 0), the filename presented is just a example.
<drbrain> h4y4shi: ^^
Axsuul has joined #ruby-lang
<drbrain> bed time
<h4y4shi> good
<h4y4shi> night
<h4y4shi> I will follow you on github
nemesit has joined #ruby-lang
solars has joined #ruby-lang
zmack has joined #ruby-lang
frangiz has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
cyri_ has joined #ruby-lang
<fragmachine> is there a way to output a jpeg file from ruby?
<fragmachine> for example if I have a bunch of text can I turn it into an image?
<theconartist> where are you having trouble
<fragmachine> I don;t know where to start
<theconartist> look for a program or library that does that, then you can figure out how to interface with it in ruby
<fragmachine> yea there are a bunch of gems but they all seem to be for doing things with exsisting images. I found a 'convert' command for my man, but it's broken for some reason
daglees has joined #ruby-lang
<fragmachine> *mac
schlecht has joined #ruby-lang
<theconartist> something like that is what you will be looking for i assume
<fragmachine> thanks, that looks good. Now I just have to figure out how to use it!
Dreamer3 has joined #ruby-lang
<yorickpeterse> Morning kids
<h4y4shi> I tried googling :: ruby. I want to find out what :: does. I found nothing on google. Could someone tell me what it is called?
<erikh> double-colon?
<h4y4shi> is it an operator?
<erikh> :: separates namespaces
<erikh> not exactly
<erikh> it's more like syntax
<rippa> it's kind of like .
<erikh> e.g., Foo::Bar::Baz is read "Baz, in the Bar namespace which is in the Foo namespace"
roadkith has joined #ruby-lang
roadkith has joined #ruby-lang
<rippa> Object.Integer gives you method
<rippa> but Object::Integer gives you constant
burgestrand has joined #ruby-lang
<erikh> actually that's not true
<erikh> the () determines method calls
<rippa> but Object.Integer still gives you method
<yorickpeterse> Ugh, I hate it when people do things like Foo::bar()
<erikh> yeah.
<yorickpeterse> Instead of Foo.bar()
<erikh> but it is what it is
* manveru hands erikh an invitation to anonymous tautologists
<erikh> hey now
<manveru> :)
<manveru> i don't mind ::(), it's just "it is what it is" that i can't stand
<erikh> yes yes
<erikh> What I meant but that, is it's not going away, etc, and it's arguably an artifact of a previous design
<erikh> similar to perlvars
robotmay has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
AlHafoudh has joined #ruby-lang
Natch| has joined #ruby-lang
heftig has joined #ruby-lang
shevy2 has joined #ruby-lang
srbartlett has joined #ruby-lang
futurechimp has joined #ruby-lang
kitallis has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
davpoind has joined #ruby-lang
mqt has joined #ruby-lang
<whitequark> I am a president of tautology club because I'm a president of tautology clug
<whitequark> *club
kitallis has joined #ruby-lang
tla_ has joined #ruby-lang
kleech has joined #ruby-lang
jaisoares has joined #ruby-lang
jaisoares has quit [#ruby-lang]
kitallis has joined #ruby-lang
justinmcp has joined #ruby-lang
<erikh> the first rule of tautology club is to talk about tautology club
adambeynon has joined #ruby-lang
kitallis has joined #ruby-lang
mqt has joined #ruby-lang
spectra has joined #ruby-lang
robotmay has joined #ruby-lang
<whitequark> wrong
<whitequark> the first rule of tautology club is the first rule of tautology club
roha has joined #ruby-lang
<rippa> that's recursion club
hachiya has joined #ruby-lang
jaska has joined #ruby-lang
jhchabran has joined #ruby-lang
jsaak has joined #ruby-lang
knu has joined #ruby-lang
gianlucadv has joined #ruby-lang
virunga has joined #ruby-lang
tbuehlmann has joined #ruby-lang
QaDeS has joined #ruby-lang
kurko_ has joined #ruby-lang
JohnBat26 has joined #ruby-lang
<whitequark> the first rule of recursion club is to apply the first rule of recursion club
<whitequark> rippa: ^
<rippa> and second rule is cut out by compiler
<rippa> because it is never executed
<whitequark> the second rule is to execute anyone who asks about it
tekin_ has joined #ruby-lang
kurko_ has joined #ruby-lang
tbuehlmann has joined #ruby-lang
virunga has joined #ruby-lang
gianlucadv has joined #ruby-lang
knu has joined #ruby-lang
jsaak has joined #ruby-lang
jaska has joined #ruby-lang
hachiya has joined #ruby-lang
spectra has joined #ruby-lang
mqt has joined #ruby-lang
justinmcp has joined #ruby-lang
tla_ has joined #ruby-lang
davpoind has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
futurechimp has joined #ruby-lang
shevy has joined #ruby-lang
heftig has joined #ruby-lang
Natch| has joined #ruby-lang
burgestrand has joined #ruby-lang
Dreamer3 has joined #ruby-lang
daglees has joined #ruby-lang
cyri_ has joined #ruby-lang
frangiz has joined #ruby-lang
zmack has joined #ruby-lang
solars has joined #ruby-lang
Xzyx987X has joined #ruby-lang
masterkorp has joined #ruby-lang
Asher has joined #ruby-lang
csherin has joined #ruby-lang
dc5ala has joined #ruby-lang
patant has joined #ruby-lang
yango has joined #ruby-lang
savage- has joined #ruby-lang
ramonmaruko has joined #ruby-lang
thone_ has joined #ruby-lang
yxhuvud has joined #ruby-lang
topaz has joined #ruby-lang
jxie has joined #ruby-lang
denysonique__ has joined #ruby-lang
mrb_bk has joined #ruby-lang
pvh has joined #ruby-lang
simon_weber has joined #ruby-lang
meise has joined #ruby-lang
soahccc has joined #ruby-lang
timbleck has joined #ruby-lang
darix has joined #ruby-lang
khaase has joined #ruby-lang
tasiu has joined #ruby-lang
a3li has joined #ruby-lang
vereteran has joined #ruby-lang
sinuc has joined #ruby-lang
valeri_ufo has joined #ruby-lang
aef has joined #ruby-lang
jasiek has joined #ruby-lang
tommyblue has joined #ruby-lang
comboy has joined #ruby-lang
kp666 has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
Aaaarg has joined #ruby-lang
tdubz has joined #ruby-lang
wyhaines has joined #ruby-lang
takaokouji has joined #ruby-lang
gix has joined #ruby-lang
vesan has joined #ruby-lang
S2kx has joined #ruby-lang
Indian has joined #ruby-lang
srbaker has joined #ruby-lang
gregf has joined #ruby-lang
JoL1hAHN has joined #ruby-lang
lsegal has joined #ruby-lang
y3llow has joined #ruby-lang
s0ber has joined #ruby-lang
woody2shoes has joined #ruby-lang
CoverSlide has joined #ruby-lang
optikalmouse has joined #ruby-lang
jarib has joined #ruby-lang
oddmunds has joined #ruby-lang
ihme-TTilus has joined #ruby-lang
deryl has joined #ruby-lang
SubSpawn has joined #ruby-lang
setmeaway2 has joined #ruby-lang
matti has joined #ruby-lang
frem has joined #ruby-lang
uniqanomaly_ has joined #ruby-lang
mitchty has joined #ruby-lang
KillerFox has joined #ruby-lang
felipe has joined #ruby-lang
erikh has joined #ruby-lang
fatprog has joined #ruby-lang
nwonknu has joined #ruby-lang
znz_v has joined #ruby-lang
Foxmaste1 has joined #ruby-lang
RegEchse has joined #ruby-lang
matled has joined #ruby-lang
ruskie has joined #ruby-lang
seich_ has joined #ruby-lang
babinho has joined #ruby-lang
schroedinbug2 has joined #ruby-lang
robgough has joined #ruby-lang
werwolf has joined #ruby-lang
Arsen7 has joined #ruby-lang
queequeg1_ has joined #ruby-lang
imajes has joined #ruby-lang
Y_Ichiro has joined #ruby-lang
FiXato has joined #ruby-lang
sora_h has joined #ruby-lang
Bwild has joined #ruby-lang
kain has joined #ruby-lang
kalleth has joined #ruby-lang
fvollero has joined #ruby-lang
Caius has joined #ruby-lang
t0h has joined #ruby-lang
ChloeD has joined #ruby-lang
fireglow has joined #ruby-lang
stepnem has joined #ruby-lang
yorickpeterse has joined #ruby-lang
vbatts has joined #ruby-lang
threedaymonk has joined #ruby-lang
spuk has joined #ruby-lang
hackeron has joined #ruby-lang
tpope_ has joined #ruby-lang
ammar has joined #ruby-lang
jmcphers has joined #ruby-lang
manveru has joined #ruby-lang
andman_ has joined #ruby-lang
logankoe1ter has joined #ruby-lang
flori has joined #ruby-lang
hugsy_ has joined #ruby-lang
nick_h has joined #ruby-lang
listrophy has joined #ruby-lang
turboladen has joined #ruby-lang
bryno has joined #ruby-lang
ReinH has joined #ruby-lang
gregmoreno has joined #ruby-lang
ioga_wrk has joined #ruby-lang
levifig has joined #ruby-lang
pcboy_ has joined #ruby-lang
znz_jp has joined #ruby-lang
anthony has joined #ruby-lang
duckinator has joined #ruby-lang
Aengus has joined #ruby-lang
dabradley has joined #ruby-lang
Tick-Tock has joined #ruby-lang
DefV has joined #ruby-lang
jmeeuwen has joined #ruby-lang
dRbiG has joined #ruby-lang
muzone has joined #ruby-lang
nebbie has joined #ruby-lang
dreinull has joined #ruby-lang
countskm has joined #ruby-lang
melter has joined #ruby-lang
FastJack has joined #ruby-lang
mephux has joined #ruby-lang
josh9 has joined #ruby-lang
kith has joined #ruby-lang
Mchl has joined #ruby-lang
any-key has joined #ruby-lang
crankharder has joined #ruby-lang
major_majors has joined #ruby-lang
corundum has joined #ruby-lang
at5l has joined #ruby-lang
jstemmer has joined #ruby-lang
Weems has joined #ruby-lang
tallship has joined #ruby-lang
dhoss has joined #ruby-lang
bnagy has joined #ruby-lang
wasnotrice has joined #ruby-lang
Zolrath has joined #ruby-lang
tomb has joined #ruby-lang
retro|cz has joined #ruby-lang
hexo has joined #ruby-lang
drbrain has joined #ruby-lang
ahs3- has joined #ruby-lang
lele|w has joined #ruby-lang
Nisstyre has joined #ruby-lang
unsymbol has joined #ruby-lang
Cope has joined #ruby-lang
neko_gata_s_away has joined #ruby-lang
injekt has joined #ruby-lang
skryking has joined #ruby-lang
_br_ has joined #ruby-lang
dominikh has joined #ruby-lang
eban has joined #ruby-lang
ddfreyne has joined #ruby-lang
Stereokitsune has joined #ruby-lang
bougyman has joined #ruby-lang
shajith has joined #ruby-lang
indeterminate has joined #ruby-lang
scyrmion_ has joined #ruby-lang
deryldoucette has joined #ruby-lang
piglop has joined #ruby-lang
rtl has joined #ruby-lang
lantins has joined #ruby-lang
yugui_zzz has joined #ruby-lang
shaman42 has joined #ruby-lang
Boohbah has joined #ruby-lang
ahf has joined #ruby-lang
jordan` has joined #ruby-lang
cynosure has joined #ruby-lang
lele has joined #ruby-lang
dvorak has joined #ruby-lang
blowmage has joined #ruby-lang
hrnt has joined #ruby-lang
kke has joined #ruby-lang
dbussink has joined #ruby-lang
ged has joined #ruby-lang
pabs has joined #ruby-lang
lianj has joined #ruby-lang
Kero has joined #ruby-lang
tdmackey has joined #ruby-lang
mtkd has joined #ruby-lang
Kuukunen has joined #ruby-lang
tty234 has joined #ruby-lang
alip has joined #ruby-lang
neurodamage has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Tasser has joined #ruby-lang
jorgenpt has joined #ruby-lang
rue has joined #ruby-lang
theoros has joined #ruby-lang
ozzloy has joined #ruby-lang
ixx has joined #ruby-lang
corsican_ has joined #ruby-lang
hibariya_ has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
jammi has joined #ruby-lang
lzhz_ has joined #ruby-lang
SpitfireWP has joined #ruby-lang
_ko1 has joined #ruby-lang
perryh has joined #ruby-lang
majnun has joined #ruby-lang
znouza has joined #ruby-lang
lupine_85 has joined #ruby-lang
stic02 has joined #ruby-lang
cola_zero has joined #ruby-lang
ohsix has joined #ruby-lang
Utkarsh has joined #ruby-lang
fahadsadah has joined #ruby-lang
TheMoonMaster has joined #ruby-lang
cout has joined #ruby-lang
Keltia has joined #ruby-lang
shachaf has joined #ruby-lang
joschi has joined #ruby-lang
basicxman has joined #ruby-lang
kvs has joined #ruby-lang
chris2 has joined #ruby-lang
cschneid has joined #ruby-lang
chrismcg has joined #ruby-lang
tris has joined #ruby-lang
epitron has joined #ruby-lang
jalljo has joined #ruby-lang
epitron_ has joined #ruby-lang
theconartist has joined #ruby-lang
aef has joined #ruby-lang
mitchty has joined #ruby-lang
necromancer has joined #ruby-lang
y3llow has joined #ruby-lang
simon_weber has joined #ruby-lang
NARKOZ has joined #ruby-lang
roha has joined #ruby-lang
Bwild has joined #ruby-lang
jobicoppola has joined #ruby-lang
mrb_bk has joined #ruby-lang
roadkith_ has joined #ruby-lang
Stalkr_ has joined #ruby-lang
niklasb has joined #ruby-lang
takaokouji has joined #ruby-lang
sinuc has joined #ruby-lang
sinuc has joined #ruby-lang
aef has joined #ruby-lang
darix has joined #ruby-lang
darix has joined #ruby-lang
masterkorp has joined #ruby-lang
Muz has joined #ruby-lang
comboy has joined #ruby-lang
roadkith has joined #ruby-lang
jwollert has joined #ruby-lang
mrb_bk has joined #ruby-lang
valeri_ufo has joined #ruby-lang
tommyblue has joined #ruby-lang
darix has joined #ruby-lang
darix has joined #ruby-lang
a3li has joined #ruby-lang
khaase has joined #ruby-lang
tasiu has joined #ruby-lang
jMCg has joined #ruby-lang
soahccc has joined #ruby-lang
GarethAdams has joined #ruby-lang
meise has joined #ruby-lang
<GarethAdams> Hi!
_rane has joined #ruby-lang
timbleck has joined #ruby-lang
<GarethAdams> RUBY_VERSION has the current *version* of ruby being run, is there anywhere that tells me where the interpreter is that's being used?
<masterkorp> a
vereteran has joined #ruby-lang
chris2 has joined #ruby-lang
[dmp] has joined #ruby-lang
[dmp] has joined #ruby-lang
vesan has joined #ruby-lang
simon_weber has joined #ruby-lang
akahn has joined #ruby-lang
necromancer has joined #ruby-lang
jasiek has joined #ruby-lang
<darix> GarethAdams: you mean like rbx vs jruby vs mri... ?
<darix> lunch time later
pvh has joined #ruby-lang
abuiles has joined #ruby-lang
<yorickpeterse> GarethAdams: If you mean the path then you can get it as following: `which ruby`
mccraig has joined #ruby-lang
denysonique__ has joined #ruby-lang
<kitallis> f
<ddfreyne> GarethAdams: RUBY_ENGINE if it is defined
cyri_ has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
ryez has joined #ruby-lang
jxie has joined #ruby-lang
takaokouji has joined #ruby-lang
hugsy_ has quit ["Connection reset by beer"]
andrewhl has joined #ruby-lang
jxie has joined #ruby-lang
<shevy> yay ... just finished a grand ruby script that .... generates a .sh script ... :P
<roadkith> lol
<whitequark> ... which generates a ruby script
<whitequark> ad infinitum
mytrile has joined #ruby-lang
kaiwren has joined #ruby-lang
<oddmunds> it's quines all the way down
tomzx has joined #ruby-lang
looopy has joined #ruby-lang
malev has joined #ruby-lang
savage- has joined #ruby-lang
RomyRomy has joined #ruby-lang
empity has joined #ruby-lang
codewrangler has joined #ruby-lang
yalue has joined #ruby-lang
jtoy has joined #ruby-lang
<GarethAdams> yorickpeterse: d'oh, too obvious. Thanks
<GarethAdams> yorickpeterse: although, does that only apply if the interpreter is available via `ruby ...`
<GarethAdams> yorickpeterse: how about if it's been called with an explicit path to ruby, or if the executable is called ruby19 or something stupid?
<yorickpeterse> I'm not sure if there's some Ruby variable that holds the full path to the executable
heftig has joined #ruby-lang
<manveru> yorickpeterse: there is
<manveru> ι ~ % ruby -rrake -e 'p FileUtils::RUBY'
<manveru> "/home/manveru/.rvm/rubies/ruby-1.9.3-p0/bin/ruby"
<yorickpeterse> Aha
mdel has joined #ruby-lang
<manveru> dir, ruby, ext = RbConfig::CONFIG.values_at('bindir', 'ruby_install_name', 'EXEEXT'); File.join(dir, ruby + ext).sub(/.*\s.*/m, '"\&"')
MistyM_ has joined #ruby-lang
<manveru> that's how it's implemented :)
takaokouji has joined #ruby-lang
takaokou_ has joined #ruby-lang
headius has joined #ruby-lang
gnufied1 has joined #ruby-lang
malev has joined #ruby-lang
bglusman has joined #ruby-lang
sj26 has joined #ruby-lang
skryking has joined #ruby-lang
Harzilein has joined #ruby-lang
virunga has joined #ruby-lang
banderson623 has joined #ruby-lang
yfeldblum has joined #ruby-lang
chimkan has joined #ruby-lang
robbrit has joined #ruby-lang
wyhaines has joined #ruby-lang
wmoxam has joined #ruby-lang
dv310p3r has joined #ruby-lang
thisirs has joined #ruby-lang
hackeron has joined #ruby-lang
<NARKOZ> which one is better: http://pastie.org/3380964?
<GarethAdams> manveru: why is it implemented in *rake*?
<roadkith> probably depends on whether you'Re gonna mix in the module in several classes
<roadkith> i'd think - but then i'm a noob
gianlucadv has joined #ruby-lang
hackeron has joined #ruby-lang
rivaler has joined #ruby-lang
sternicus has joined #ruby-lang
<Tasser> manveru, wtf. wasn't there ARGV[0] or something like that?
<manveru> you mean $0
<manveru> and no, that's not gonna help you
<Tasser> likely
<manveru> ι ~ % printf '#!/usr/bin/env ruby\np $0' > foo; chmod +x foo; ./foo
<manveru> "./foo"
<manveru> ι ~ % printf '#!/usr/bin/env ruby\nrequire "rake"; p FileUtils::RUBY' >| foo; chmod +x foo; ./foo
<manveru> "/home/manveru/.rvm/rubies/ruby-1.9.3-p0/bin/ruby"
<tobiasvl> manveru: i like your prompt
<tobiasvl> oh lort what's happening
Austin__ has joined #ruby-lang
toretore has joined #ruby-lang
slyphon|away has joined #ruby-lang
comboy has joined #ruby-lang
elux has joined #ruby-lang
jasiek has joined #ruby-lang
aef has joined #ruby-lang
valeri_ufo has joined #ruby-lang
jwollert has joined #ruby-lang
tommyblue has joined #ruby-lang
a3li has joined #ruby-lang
darix has joined #ruby-lang
darix has joined #ruby-lang
khaase has joined #ruby-lang
simon_weber has joined #ruby-lang
pvh has joined #ruby-lang
sinuc has joined #ruby-lang
tasiu has joined #ruby-lang
meise has joined #ruby-lang
timbleck has joined #ruby-lang
denysonique__ has joined #ruby-lang
soahccc has joined #ruby-lang
[dmp] has joined #ruby-lang
[dmp] has joined #ruby-lang
Muz has joined #ruby-lang
jMCg has joined #ruby-lang
tekin has joined #ruby-lang
<shevy> dumdedum
<shevy> NARKOZ the second is easier.
<shevy> I think the first has the advantage that you can remove the module at a later time again
<shevy> but it's a bit too verbose for my taste
<shevy> I'd wish there would be a way to easily denote how much core classes can be modified. and how to easily revert to how they were before the modification happened
<whitequark> traits
slimfit has joined #ruby-lang
andrewhl has joined #ruby-lang
mccraig has joined #ruby-lang
masterkorp has joined #ruby-lang
_bryanp has joined #ruby-lang
mrb_bk has joined #ruby-lang
akahn has joined #ruby-lang
abuiles has joined #ruby-lang
vereteran has joined #ruby-lang
wyhaines has joined #ruby-lang
rippa has joined #ruby-lang
SkramX has joined #ruby-lang
enebo has joined #ruby-lang
Spooner has joined #ruby-lang
fayimora has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
tbuehlmann has joined #ruby-lang
roha has joined #ruby-lang
Indian has joined #ruby-lang
mark_locklear has joined #ruby-lang
mark_ has joined #ruby-lang
outoftime has joined #ruby-lang
Silex has joined #ruby-lang
<rue> Abilities
<andrewvos> Powers
<injekt> bleghhh
<andrewvos> Combo BREAKER
<shevy> lol
darkf has joined #ruby-lang
<andrewvos> rofl
chendo_ has joined #ruby-lang
sinuc has joined #ruby-lang
sinuc has joined #ruby-lang
<optikalmouse> do you *need* the return in a ruby method?
<optikalmouse> isn't the value of the last evaluated statement in the method returned?
<andrewvos> no
zvrba has joined #ruby-lang
<andrewvos> yes
erpuds has joined #ruby-lang
DEac- has joined #ruby-lang
<optikalmouse> wow
<optikalmouse> so some idiot programmer was placing returns all over the code.
y3llow_ has joined #ruby-lang
<andrewvos> optikalmouse: It could have been you :)
<optikalmouse> andrewvos: I haven't had a coffee yet so <insert insult here> and I'm the newb who JUST started at this new job sooo it would be impossible for me to have done that ;)
<andrewvos> hehehe
whitequark has joined #ruby-lang
stderr- has joined #ruby-lang
zzak has joined #ruby-lang
deadbea7 has joined #ruby-lang
maxx- has joined #ruby-lang
href has joined #ruby-lang
xsdg has joined #ruby-lang
adgar has joined #ruby-lang
mksm has joined #ruby-lang
Eising has joined #ruby-lang
raggi has joined #ruby-lang
flebel has joined #ruby-lang
cyndis has joined #ruby-lang
tobiasvl has joined #ruby-lang
yibe has joined #ruby-lang
yellow5 has joined #ruby-lang
shyouhei has joined #ruby-lang
robbrit has joined #ruby-lang
banderson623 has joined #ruby-lang
banderson623 has joined #ruby-lang
dju has joined #ruby-lang
slimfit has joined #ruby-lang
macmartine has joined #ruby-lang
<shevy> hmm
<shevy> can you show parts of the code optikalmouse
headius has joined #ruby-lang
Sailias has joined #ruby-lang
Spooner has joined #ruby-lang
havenn has joined #ruby-lang
roha has joined #ruby-lang
meise has joined #ruby-lang
<andrewvos> haha
Heimidal has joined #ruby-lang
Harzilein has joined #ruby-lang
meise has joined #ruby-lang
_rane has joined #ruby-lang
darkf has joined #ruby-lang
amerine has joined #ruby-lang
indstry has joined #ruby-lang
lake has joined #ruby-lang
scampbell has joined #ruby-lang
<shevy> :(
<shevy> I wanted to see the multiple returns!
NARKOZ has joined #ruby-lang
niklasb has joined #ruby-lang
anjen has joined #ruby-lang
abuiles has joined #ruby-lang
malev_ has joined #ruby-lang
wmoxam has joined #ruby-lang
wwalker has joined #ruby-lang
lordofthedance has joined #ruby-lang
<wwalker> I can't change it, but my employer does design docs in MS Office Word. Has anyone else suffering this pain found a way to import rdoc into a word doc?
<Tasser> is there an append mode for files?
<outoftime> Tasser: 'a'
<Tasser> thanks
necromancer has joined #ruby-lang
<shevy> yeah or 'a+'
<outoftime> depends on whether you did a good job or a *really* good job.
<necromancer> does anyone here use Airbrake for a non-Rails app? i'm getting a LoadError even when i add gem 'i18n' to my Gemfile, and it's throwing the error in my .gemspec where i'm not even declaring airbrake as a dependency...
malev has joined #ruby-lang
fvollero has joined #ruby-lang
<whitequark> necromancer: I do
<whitequark> but it just works
daglees has joined #ruby-lang
daglees has joined #ruby-lang
slyphon has joined #ruby-lang
<necromancer> whitequark: ugh
<necromancer> this ONLY happens on the production sevrer
<necromancer> what the fuc
SkramX has joined #ruby-lang
butchanton has joined #ruby-lang
rayners has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<optikalmouse> does ruby not come with a debugging tool?
havenn has joined #ruby-lang
<shevy> ruby_debug
<shevy> but I never used it
<shevy> you can set "breakpoints" and do other fancy stuff with it
<shevy> like kill sheep and such
Cope has joined #ruby-lang
<whitequark> necromancer: bundle exec ?
solars has joined #ruby-lang
havenn has joined #ruby-lang
<optikalmouse> ruby-debug is a gem
<optikalmouse> but there's ruby_debug?
<optikalmouse> wtf :S
<Spooner> optikalmouse: pry can be useful as a debugger too (not sure if the full debugging support is released yet).
<Spooner> And I can't find a ruby_debug; only ruby-debug.
<kain> pry is awesome but I still haven't found a way, if any, to step in code
<kain> just breakpoint and go from there
<Spooner> I know Banistergalaxy was talking about implementing that, but it was recent. I only really use it as an irb replacement though, so I am not sure.
<Spooner> kain: pry_debug definitely looks like it steps.?
<kain> Spooner, not sure how then
publicvoid_ has joined #ruby-lang
butchanton has joined #ruby-lang
waazzuup has joined #ruby-lang
fvollero has quit [#ruby-lang]
chendo__ has joined #ruby-lang
<manveru> optikalmouse: require 'debug'
lordofthedance has joined #ruby-lang
adambeynon_ has joined #ruby-lang
<manveru> optikalmouse: it's in stdlib
andkerosine has joined #ruby-lang
tekin_ has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
jhchabran has joined #ruby-lang
gentz has joined #ruby-lang
aef has joined #ruby-lang
<andkerosine> How would I go about modularizing that?
<andkerosine> I can't just set the functions in a module and #include or #extend because I have to pass different parameters...
Skif has joined #ruby-lang
outoftime has joined #ruby-lang
NARKOZ has joined #ruby-lang
raggi has joined #ruby-lang
zigidias has joined #ruby-lang
CodeBlock has joined #ruby-lang
Cherrum has joined #ruby-lang
QaDeS has joined #ruby-lang
CodeBlock has joined #ruby-lang
gianlucadv has joined #ruby-lang
tgall__ has joined #ruby-lang
BadQuanta has joined #ruby-lang
andkerosine has joined #ruby-lang
headius has joined #ruby-lang
heftig has joined #ruby-lang
mitchty has joined #ruby-lang
outoftime has joined #ruby-lang
slyphon has joined #ruby-lang
yibe has joined #ruby-lang
EvilJStoker has joined #ruby-lang
vereteran has joined #ruby-lang
toretore has joined #ruby-lang
conceal_rs has joined #ruby-lang
theconartist has joined #ruby-lang
epitron_ has joined #ruby-lang
jalljo has joined #ruby-lang
epitron has joined #ruby-lang
tris has joined #ruby-lang
zz_chrismcg has joined #ruby-lang
cschneid has joined #ruby-lang
basicxman has joined #ruby-lang
joschi has joined #ruby-lang
shachaf has joined #ruby-lang
Keltia has joined #ruby-lang
cout has joined #ruby-lang
TheMoonMaster has joined #ruby-lang
fahadsadah has joined #ruby-lang
Utkarsh has joined #ruby-lang
ohsix has joined #ruby-lang
cola_zero has joined #ruby-lang
stic02 has joined #ruby-lang
lupine_85 has joined #ruby-lang
znouza has joined #ruby-lang
majnun has joined #ruby-lang
perryh has joined #ruby-lang
_ko1 has joined #ruby-lang
SpitfireWP has joined #ruby-lang
lzhz_ has joined #ruby-lang
jammi has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
hibariya_ has joined #ruby-lang
ixx has joined #ruby-lang
ozzloy has joined #ruby-lang
theoros has joined #ruby-lang
rue has joined #ruby-lang
jorgenpt has joined #ruby-lang
Tasser has joined #ruby-lang
dhruvasagar has joined #ruby-lang
neurodamage has joined #ruby-lang
alip has joined #ruby-lang
tty234 has joined #ruby-lang
Kuukunen has joined #ruby-lang
mtkd has joined #ruby-lang
tdmackey has joined #ruby-lang
Kero has joined #ruby-lang
lianj has joined #ruby-lang
pabs has joined #ruby-lang
ged has joined #ruby-lang
dbussink has joined #ruby-lang
kke has joined #ruby-lang
hrnt has joined #ruby-lang
blowmage has joined #ruby-lang
dvorak has joined #ruby-lang
lele has joined #ruby-lang
cynosure has joined #ruby-lang
jordan` has joined #ruby-lang
ahf has joined #ruby-lang
Boohbah has joined #ruby-lang
shaman42 has joined #ruby-lang
yugui_zzz has joined #ruby-lang
lantins has joined #ruby-lang
rtl has joined #ruby-lang
piglop has joined #ruby-lang
deryldoucette has joined #ruby-lang
scyrmion_ has joined #ruby-lang
indeterminate has joined #ruby-lang
shajith has joined #ruby-lang
bougyman has joined #ruby-lang
Stereokitsune has joined #ruby-lang
ddfreyne has joined #ruby-lang
eban has joined #ruby-lang
dominikh has joined #ruby-lang
_br_ has joined #ruby-lang
injekt has joined #ruby-lang
neko_gata_s has joined #ruby-lang
unsymbol has joined #ruby-lang
Nisstyre has joined #ruby-lang
lele|w has joined #ruby-lang
ahs3- has joined #ruby-lang
drbrain has joined #ruby-lang
hexo has joined #ruby-lang
retro|cz has joined #ruby-lang
tomb has joined #ruby-lang
Zolrath has joined #ruby-lang
wasnotrice has joined #ruby-lang
bnagy has joined #ruby-lang
dhoss has joined #ruby-lang
tallship has joined #ruby-lang
Weems has joined #ruby-lang
jstemmer has joined #ruby-lang
at5l has joined #ruby-lang
corundum has joined #ruby-lang
major_majors has joined #ruby-lang
crankharder has joined #ruby-lang
any-key has joined #ruby-lang
Mchl has joined #ruby-lang
kith has joined #ruby-lang
josh9 has joined #ruby-lang
mephux has joined #ruby-lang
FastJack has joined #ruby-lang
melter has joined #ruby-lang
countskm has joined #ruby-lang
dreinull has joined #ruby-lang
nebbie has joined #ruby-lang
muzone has joined #ruby-lang
dRbiG has joined #ruby-lang
jmeeuwen has joined #ruby-lang
DefV has joined #ruby-lang
Tick-Tock has joined #ruby-lang
dabradley has joined #ruby-lang
Aengus has joined #ruby-lang
duckinator has joined #ruby-lang
anthony has joined #ruby-lang
znz_jp has joined #ruby-lang
pcboy_ has joined #ruby-lang
levifig has joined #ruby-lang
ioga_wrk has joined #ruby-lang
gregmoreno has joined #ruby-lang
ReinH has joined #ruby-lang
bryno has joined #ruby-lang
turboladen has joined #ruby-lang
listrophy has joined #ruby-lang
nick_h has joined #ruby-lang
flori has joined #ruby-lang
logankoe1ter has joined #ruby-lang
andman_ has joined #ruby-lang
manveru has joined #ruby-lang
jmcphers has joined #ruby-lang
ammar has joined #ruby-lang
tpope_ has joined #ruby-lang
spuk has joined #ruby-lang
threedaymonk has joined #ruby-lang
vbatts has joined #ruby-lang
yorickpeterse has joined #ruby-lang
stepnem has joined #ruby-lang
fireglow has joined #ruby-lang
ChloeD has joined #ruby-lang
t0h has joined #ruby-lang
Caius has joined #ruby-lang
kalleth has joined #ruby-lang
kain has joined #ruby-lang
s0ra_h has joined #ruby-lang
FiXato has joined #ruby-lang
Y_Ichiro has joined #ruby-lang
imajes has joined #ruby-lang
queequeg1_ has joined #ruby-lang
Arsen7 has joined #ruby-lang
werwolf has joined #ruby-lang
robgough has joined #ruby-lang
schroedinbug2 has joined #ruby-lang
babinho has joined #ruby-lang
seich_ has joined #ruby-lang
ruskie has joined #ruby-lang
matled has joined #ruby-lang
RegEchse has joined #ruby-lang
Foxmaste1 has joined #ruby-lang
znz_v has joined #ruby-lang
nwonknu has joined #ruby-lang
fatprog has joined #ruby-lang
erikh has joined #ruby-lang
felipe has joined #ruby-lang
KillerFox has joined #ruby-lang
uniqanomaly_ has joined #ruby-lang
frem has joined #ruby-lang
matti has joined #ruby-lang
setmeaway has joined #ruby-lang
SubSpawn has joined #ruby-lang
deryl has joined #ruby-lang
ihme-TTilus has joined #ruby-lang
oddmunds has joined #ruby-lang
jarib has joined #ruby-lang
optikalmouse has joined #ruby-lang
CoverSlide has joined #ruby-lang
woody2shoes has joined #ruby-lang
s0ber has joined #ruby-lang
JoL1hAHN has joined #ruby-lang
gregf has joined #ruby-lang
srbaker has joined #ruby-lang
S2kx has joined #ruby-lang
gix has joined #ruby-lang
tdubz has joined #ruby-lang
Aaaarg has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
kp666 has joined #ruby-lang
topaz has joined #ruby-lang
yxhuvud has joined #ruby-lang
thone_ has joined #ruby-lang
ramonmaruko has joined #ruby-lang
yango has joined #ruby-lang
patant has joined #ruby-lang
Asher has joined #ruby-lang
Xzyx987X has joined #ruby-lang
frangiz has joined #ruby-lang
burgestrand has joined #ruby-lang
Natch| has joined #ruby-lang
shevy has joined #ruby-lang
futurechimp has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
tla_ has joined #ruby-lang
mqt has joined #ruby-lang
spectra has joined #ruby-lang
hachiya has joined #ruby-lang
jaska has joined #ruby-lang
jsaak has joined #ruby-lang
knu has joined #ruby-lang
kurko_ has joined #ruby-lang
chris2 has joined #ruby-lang
vesan has joined #ruby-lang
jxie has joined #ruby-lang
empity has joined #ruby-lang
mdel has joined #ruby-lang
bglusman has joined #ruby-lang
skryking has joined #ruby-lang
dv310p3r has joined #ruby-lang
hackeron has joined #ruby-lang
rivaler has joined #ruby-lang
sternicus has joined #ruby-lang
Austin__ has joined #ruby-lang
comboy has joined #ruby-lang
jasiek has joined #ruby-lang
valeri_ufo has joined #ruby-lang
jwollert has joined #ruby-lang
a3li has joined #ruby-lang
darix has joined #ruby-lang
khaase has joined #ruby-lang
simon_weber has joined #ruby-lang
pvh has joined #ruby-lang
tasiu has joined #ruby-lang
timbleck has joined #ruby-lang
denysonique__ has joined #ruby-lang
soahccc has joined #ruby-lang
[dmp] has joined #ruby-lang
Muz has joined #ruby-lang
andrewhl has joined #ruby-lang
mccraig has joined #ruby-lang
masterkorp has joined #ruby-lang
_bryanp has joined #ruby-lang
mrb_bk has joined #ruby-lang
akahn has joined #ruby-lang
wyhaines has joined #ruby-lang
rippa has joined #ruby-lang
enebo has joined #ruby-lang
mark_locklear has joined #ruby-lang
Silex has joined #ruby-lang
sinuc has joined #ruby-lang
zvrba has joined #ruby-lang
erpuds has joined #ruby-lang
DEac- has joined #ruby-lang
y3llow has joined #ruby-lang
whitequark has joined #ruby-lang
stderr- has joined #ruby-lang
deadbea7 has joined #ruby-lang
xsdg has joined #ruby-lang
adgar has joined #ruby-lang
Eising has joined #ruby-lang
flebel has joined #ruby-lang
tobiasvl has joined #ruby-lang
yellow5 has joined #ruby-lang
shyouhei has joined #ruby-lang
robbrit has joined #ruby-lang
banderson623 has joined #ruby-lang
Harzilein has joined #ruby-lang
meise has joined #ruby-lang
_rane has joined #ruby-lang
darkf has joined #ruby-lang
indstry has joined #ruby-lang
lake has joined #ruby-lang
scampbell has joined #ruby-lang
abuiles has joined #ruby-lang
wmoxam has joined #ruby-lang
wwalker has joined #ruby-lang
necromancer has joined #ruby-lang
malev has joined #ruby-lang
SkramX has joined #ruby-lang
kyrylo has joined #ruby-lang
solars has joined #ruby-lang
publicvoid_ has joined #ruby-lang
waazzuup has joined #ruby-lang
chendo__ has joined #ruby-lang
lordofthedance has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
looopy has joined #ruby-lang
anjen has joined #ruby-lang
Guest49791 has joined #ruby-lang
voker57_ has joined #ruby-lang
csherin has joined #ruby-lang
Heimidal_ has joined #ruby-lang
fayimora has joined #ruby-lang
sj26 has joined #ruby-lang
dju has joined #ruby-lang
H2H has joined #ruby-lang
samuelkadolph has joined #ruby-lang
nacengineer1 has joined #ruby-lang
nofxx has joined #ruby-lang
Defusal has joined #ruby-lang
tommyblue has joined #ruby-lang
lucas__ has joined #ruby-lang
slaytanic has joined #ruby-lang
jMCg_ has joined #ruby-lang
zigidias has joined #ruby-lang
raggi has joined #ruby-lang
NARKOZ has joined #ruby-lang
Skif has joined #ruby-lang
aef has joined #ruby-lang
gentz has joined #ruby-lang
jhchabran has joined #ruby-lang
Cope has joined #ruby-lang
rayners has joined #ruby-lang
Sailias has joined #ruby-lang
macmartine has joined #ruby-lang
slimfit has joined #ruby-lang
cyndis has joined #ruby-lang
Guest30053 has joined #ruby-lang
href has joined #ruby-lang
maxx- has joined #ruby-lang
zzak has joined #ruby-lang
elux has joined #ruby-lang
chimkan has joined #ruby-lang
yfeldblum has joined #ruby-lang
codewrangler has joined #ruby-lang
nemesit has joined #ruby-lang
Slackwise_ has joined #ruby-lang
twittard has joined #ruby-lang
Gekz has joined #ruby-lang
rushed has joined #ruby-lang
Karmaon has joined #ruby-lang
jbsan has joined #ruby-lang
alindeman has joined #ruby-lang
jaimef has joined #ruby-lang
mahlon_ has joined #ruby-lang
freedrul1 has joined #ruby-lang
thorncp has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
anekos_ has joined #ruby-lang
dagobah has joined #ruby-lang
jayne has joined #ruby-lang
yeltzooo has joined #ruby-lang
segy has joined #ruby-lang
ironcamel has joined #ruby-lang
ange has joined #ruby-lang
rhizmoe has joined #ruby-lang
robbyrus1ell has joined #ruby-lang
_bat has joined #ruby-lang
jbwiv has joined #ruby-lang
wilkie has joined #ruby-lang
singpolyma has joined #ruby-lang
Telmo has joined #ruby-lang
mortice has joined #ruby-lang
andrewvos has joined #ruby-lang
devn has joined #ruby-lang
VGoff has joined #ruby-lang
bca has joined #ruby-lang
prsimp has joined #ruby-lang
bryanl has joined #ruby-lang
mitchty has joined #ruby-lang
jmeeuwen_ has joined #ruby-lang
lianj_ has joined #ruby-lang
kke_ has joined #ruby-lang
matti_ has joined #ruby-lang
lightcap has joined #ruby-lang
darix- has joined #ruby-lang
darix- has joined #ruby-lang
<shevy> hmm no idea indstry
Xzyx987X_ has joined #ruby-lang
<indstry> *sign*
<drbrain> indstry: don't you use Set-Cookie to send the cookie?
<drbrain> oh, that's coming back
<indstry> drbrain: no clue, new to ruby, and unfortunatly i need to use CGI for this task
Bwild has joined #ruby-lang
archibald has joined #ruby-lang
meise_ has joined #ruby-lang
<drbrain> indstry: look at ri CGI.out
<drbrain> it's got an example that shows how to do it
<andkerosine> Is it possible to cause a method to behave differently if it's the first part of a chain?
nebbie`` has joined #ruby-lang
headius has joined #ruby-lang
wwalker has joined #ruby-lang
shyouhei has joined #ruby-lang
wyhaines has joined #ruby-lang
mqt has joined #ruby-lang
ramonmaruko has joined #ruby-lang
crankharder has joined #ruby-lang
injekt has joined #ruby-lang
bougyman has joined #ruby-lang
pabs has joined #ruby-lang
ged has joined #ruby-lang
dbussink has joined #ruby-lang
hrnt has joined #ruby-lang
blowmage has joined #ruby-lang
dvorak has joined #ruby-lang
fayimora_ has joined #ruby-lang
<drbrain> … don't puts inside the CGI block and don't create a header in the CGI block
<drbrain> andkerosine: yes, but I don't recommend it
archibald has quit ["Leaving"]
<andkerosine> Hm...
mitchty has joined #ruby-lang
<andkerosine> Well, client.r('subreddit') grabs its about.json data by default, but it can then be chained to grab posts and comments.
savage- has joined #ruby-lang
<andkerosine> Right now, client.r('x').posts makes two requests.
Aengus- has joined #ruby-lang
<andkerosine> I'd like to avoid that if the user doesn't intend to get any about data.
<indstry> drbrain: thanks i'll check that out. Im stuck using a godaddy shared server for this particular client. pita
uniqanomaly__ has joined #ruby-lang
<andkerosine> I guess just have about be a separate method, huh?
<shevy> hmmm what is more commonly used:
<shevy> .slice(0,2) vs [0,2]
<drbrain> andkerosine: sure
<drbrain> shevy: I use the latter
Heimidal has joined #ruby-lang
<shevy> yeah, same here, I grew fond of it. I am looking at some one liners though, like: display the last two lines of a file
<shevy> ruby -e 'puts STDIN.readlines.reverse!.slice(0,2).reverse!' < file.txt
<shevy> of course this also works:
<shevy> ruby -e 'puts STDIN.readlines.reverse![0,2].reverse!' < file.txt
<manveru> oO
<drbrain> indstry: try this: http://paste.segment7.net/qu.html
muzone has joined #ruby-lang
<andkerosine> Could reverse!.slice(0,2).reverse! not be replaced with [-3..-1]?
<shevy> hmm
andrewhl has joined #ruby-lang
<shevy> indeed
<andkerosine> Magic.
<manveru> tail -2 file.txt
<shevy> non ruby!!!
<manveru> neither is your < file.txt
<shevy> that's just data
<manveru> that's your shell
<shevy> my shell is written in ruby!!!!!!!!Infinity!!!!
<manveru> if you have a shell, you have tail
<shevy> of course
<shevy> written in ruby too :)
<andkerosine> If you have a tail, you have a coccyx.
* shevy cuddles manveru
<shevy> a what?
<shevy> is that like a bird?
<outoftime> andkerosine: don't you have either one or the other?
<andkerosine> That's a cloaca.
<shevy> lol
Axsuul has joined #ruby-lang
<drbrain> shevy: ARGF
<andkerosine> drbrain: Right you are.
simon_weber has joined #ruby-lang
<drbrain> ARGF is much better than ruby foo.rb < some_file.txt
pvh has joined #ruby-lang
simon_weber has joined #ruby-lang
twittard has joined #ruby-lang
at5l has joined #ruby-lang
<manveru> still sucks performancewise
conceal_rs has joined #ruby-lang
<manveru> but it wouldn't be as much fun and consice to write it performant
<manveru> and everybody has SSDs and gigs of ram nowadays anyway
jstemmer has joined #ruby-lang
<indstry> drbrain: Hey that worked! thanks
lake has joined #ruby-lang
mrsolo has joined #ruby-lang
divoxx has joined #ruby-lang
<andkerosine> Optimal approach to selectively defining methods depending on which class included the module?
<manveru> don't :)
LanceHaig has joined #ruby-lang
<andkerosine> Well, I'd like all my actions to go in one module. It smacks of overkill to define PostActions, CommentActions, SubredditActions, etc.
<andkerosine> A simple if seems like it'd suffice, but is that generally frowned upon?
<outoftime> andkerosine: encapsulate the concept that varies
scampbell has joined #ruby-lang
<outoftime> andkerosine: or in ruby, sometimes replace "encapsulate" with "write a mixin for" or something : )
<drbrain> andkerosine: or superclass
Carnage\ has joined #ruby-lang
<drbrain> if you're doing it right, there should only be a few lines
matti has joined #ruby-lang
havenn has joined #ruby-lang
<outoftime> andkerosine: I'm wondering why, if you want different behavior for each class, you don't just... write the different behaviors in each class?
<andkerosine> Because they share so many common methods.
<andkerosine> I absolutely hate seeing almost identical code.
Sailias has joined #ruby-lang
<outoftime> andkerosine: right, so extract/encapsulate the concept that varies. write a method in each class that does the part that's different, and then call that method from the mixin
kurko_ has joined #ruby-lang
KimT has joined #ruby-lang
<outoftime> andkerosine: an example would be the Enumerable mixin -- every class that inherits it has its own implementation of #each, and then Enumerable takes care of all the common functionality from there.
<andkerosine> Mm-hmm. That is essentially what I'm doing.
<drbrain> outoftime: andkerosine: in this case, a superclass would be a better fit than a module
<outoftime> no arguments there, i'm only half aware of the actual use case : )
arkidmitra has joined #ruby-lang
amerine has joined #ruby-lang
<arkidmitra> Anyone
<outoftime> arkidmitra: nope, no one.
Danzer has joined #ruby-lang
symm- has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
banderson623 has joined #ruby-lang
<Danzer> someone could review my code? http://pastie.org/3382716 thx.
<drbrain> Danzer: why do you require 'rubygems'?
<Danzer> because my second code on ruby =.=
<drbrain> Danzer: also, use File.open with a block
<shevy> Danzer you should check your indent levels
sinuc has joined #ruby-lang
<drbrain> Danzer: if you're using ruby 1.9 you don't need to require 'rubygems'
<shevy> if you have trouble checking the indent, you can always change from do/end to use {}
<drbrain> File.open(STORE_WHERE, 'w+') do |f| … end
<drbrain> no need for f.close
<drbrain> Danzer: when you run this, what happens?
<shevy> In the code you did there, "f = File.open(STORE_WHERE, 'w+')", you do not use "do" nor "{" but the next line you indented as if you would have used either, you see that?
lalarou has joined #ruby-lang
<Danzer> hmm
sideshownz has joined #ruby-lang
<Danzer> if i run, return a null txt.
<drbrain> Danzer: are you sure?
<lianj> File.open('foo', 'wb'){|f| f.print ["Mike","Robert","Teddy"].zip([42,55,99]).map{|i| "<avatar> %s, %d </avatar>" % i }.join("\n") }
<drbrain> I get an error
<shevy> lianj always has to pack things into one line :(
<drbrain> Danzer: … what is printed on the console after running it?
<lianj> shevy: hehe
<drbrain> shevy: for IRC, sure
erics has joined #ruby-lang
Skif_home has joined #ruby-lang
dejongge has joined #ruby-lang
Jake232 has joined #ruby-lang
lalarou has quit [#ruby-lang]
CoverSlide has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
ilyam has joined #ruby-lang
qpingu has joined #ruby-lang
tomzx has joined #ruby-lang
macmartine has joined #ruby-lang
Carnage\ has joined #ruby-lang
havenn has joined #ruby-lang
cyri_ has joined #ruby-lang
niklasb has joined #ruby-lang
<jbwiv> what's the appropriate way to eval a file into the current scope? so, for example, read a file on erb, have that file be executed, and then be able to inspect the top level vars from its scope after completion?
<jbwiv> that should be irb, not erb
<rippa> eval it
<robbrit> jbwiv: require?
<rippa> eval(File.read('file.rb'))
<rippa> robbrit: he needs locals
<jbwiv> rippa, I tried that, but it seems top-level vars are inspectable
<robbrit> ah damn
<jbwiv> that way
<rippa> are not inspectable?
<jbwiv> rippa: do not remain in scope
<rippa> hmm
<jbwiv> for example, my file does "tables = {}"
<jbwiv> outside of any blocks
<rippa> try supplying current binding
phazenine has joined #ruby-lang
<jbwiv> but after eval, I get an undefined local variable error when referencing tables
<rippa> binding.eval(etc
<jbwiv> rippa, yes...tried that as well
<rippa> I seem to remember it helped somehow
<rippa> oh well
Indian has joined #ruby-lang
<jbwiv> I know I've made this work in the past...just have to remember how
brianpWins has joined #ruby-lang
<burgestrand> jbwiv: I believe it’ll work differently in 1.8.7 vs 1.9
fayimora_ has joined #ruby-lang
<burgestrand> jbwiv: they changed something related to bindings and local variables between those versions, don’t remember exactly what
<jbwiv> burgestrand, this is 1.9. I'll bet when I tried it in the past it was 1.8
voker57_ has joined #ruby-lang
<phazenine> can someone explain why this is selecting everything \p{^Han}|\p{^Katakana}|\p{^Hiragana} as compared to it not selecting one language with this: \p{^Han}|\p{Katakana}|\p{Hiragana}
nark-1 has joined #ruby-lang
<manveru> phazenine: everything of what?
<phazenine> i'm using rubular and using this as an example: ひらがな or ヒラガナ end start 士通
<phazenine> if you use \p{^Han} it selects everything except Han
<phazenine> but the moment you do \p{^Han}|\p{^Hirgana} everything gets selected
<phazenine> i know i'm most likely doing something wrong, but I'd like to know what it is
<rippa> かたかな
<wwalker> phazenine: yes. because everything is either "not Han" or "not Hiragana"
<TTilus> phazenine: well, ain't everyting either not hiragana or not han?
erpuds has joined #ruby-lang
<andkerosine> Curly braces in a Regexp?
freedrul1 has quit [#ruby-lang]
<wwalker> phazenine: more simply: /[^A]/ selects everything except A, /[^B]/ selects everything except B , so /[^A]|[^B]/ by definition selects anything
<burgestrand> andrewhl: yes, unicode character classes you specify with \p{character class}
<burgestrand> … .
<andkerosine> Ah, good stuff.
<burgestrand> andrewhl: not you, sorry, go away.
<andrewhl> lol
<burgestrand> andkerosine: :)
<andkerosine> Odd that you had him in your clipboard?
<andrewhl> tab completion
<burgestrand> andkerosine: not clipboard, just sloppy tab completion
<andkerosine> Second guess.
<andkerosine> Also, TIL.
<phazenine> wwalker: why is that?
<andkerosine> ?!
<andkerosine> Everything in the world is either "not a dog" or "not a cat".
<wwalker> because C matches [^A] and matches [^B]. B matches [^A]
<wwalker> phazenine: maybe you are not understanding clearly that "|" means OR
sideshownz has joined #ruby-lang
<wwalker> phazenine: can you tell me anything that is not " (not hiragan) OR (not han) "
<wwalker> hiragana
<andkerosine> Cinnabons, for they are not of this world.
<phazenine> i understand that | is OR, i just thought if you did /[^A]|[^B]/ it would pull C if the string was "ABABAACABAB"
<phazenine> but i understand tho
<rippa> that should be
<rippa> [^AB]
fayimora has joined #ruby-lang
curtism has joined #ruby-lang
<jbwiv> burgestrand, rippa: according to "Programming Ruby 1.9", "Local variables assigned within an eval are available after the eval only if they were defined at the outer scope before the eval executed. In this way, eval has the same scoping rules as blocks."
<jbwiv> so definitely different in 1.9, and unfortunate/fortunate at the same time :-/
<rippa> define all possible variable names beforehand
<burgestrand> jbwiv: I’m wondering if you can walk around this using local_variables and defining a hash before eval.
<burgestrand> Might have an idea. Back in a minute.
<andkerosine> That does seem like it'd work.
dv310p3r has joined #ruby-lang
<rippa> ( ゚∀゚)アハハ八八ノヽノヽノヽノ \ / \/ \
<jbwiv> burgestrand, ok, cool
<outoftime> amazing that the local variables aren't retained even when a binding is explicitly passed
ilyam has joined #ruby-lang
<burgestrand> Yeah, works, cool!
<Guest49791> so is there no way to do [^AB] with \p{stuff}?
<burgestrand> jbwiv: http://pastie.org/3383121
<burgestrand> Should probably clean that up a bit, but that works.
_bryanp has joined #ruby-lang
<rippa> Guest49791: have you tried [^\p{stuff}\p{stuff2}]?
<burgestrand> Actually, could even simplify it a big bit.
<Guest49791> oh, it works
hagabaka has joined #ruby-lang
<rippa> principle of "try what seems natural and likely in works"
<rippa> *it
<hagabaka> I thought since \p{} was like a character class it couldn't be inside a character class again
<rippa> ruby regex engine supports nested classes
<rippa> even something like
<rippa> [^a[bc[ef]]]
<burgestrand> jbwiv: http://pastie.org/3383145
<hagabaka> cool
<jbwiv> burgestrand, very cool. thanks!
<andkerosine> Pastie is really slow to apply syntax highlighting...
<burgestrand> jbwiv: I think so too :d
LanceHaig has joined #ruby-lang
<jbwiv> burgestrand, what specifically does this do? "eval <<-SOURCE, nil, __FILE__, __LINE__"? I understand heredocs, but what's with the extra args?
<burgestrand> jbwiv: the second argument is the binding it’s to be run in, but as for __FILE__ and __LINE__ they are magical in that they evaluate to the file and line they’re written in; if an error occurs in the eval’d code it will have the correct file and line in the backtrace
<burgestrand> or, at least a more helpful line and file in the backtrace
Skif has joined #ruby-lang
erics has joined #ruby-lang
lsegal has joined #ruby-lang
<jbwiv> burgestrand, ah, ok. thanks very much. wonder why they didn't build something like eval! in...or even evileval! :-)
<outoftime> andkerosine: hastebin.com
<andkerosine> Solarized is gross.
<outoftime> andkerosine: well that settles that.
<andkerosine> I think Gist is beautiful.
<outoftime> Gist is really good at what it's designed for, which is not to replicate the functionality of pastebin/pastie/hastebin.
<andkerosine> The... immediacy?
<outoftime> transience, more like it. Gist is good for things that are meant to be permanent -- shared and collaborated upon.
<outoftime> in my humble opinion, of course.
<outoftime> it's not good for dropping a random stacktrace or code snippet that you need to exist on the internet for the next 45 seconds
<andkerosine> Mm, fair enough. But it can still pretty much double as a throwaway.
<burgestrand> jbwiv: also, in addition, they also set the __FILE__ if used within the evaled code :)
<outoftime> it's pretty slow for that.
<andkerosine> Slow... HTTP-wise?
<andkerosine> Or just getting the code in there?
Jake232 has joined #ruby-lang
<outoftime> yeah, like, response times are slow compared to purpose-built paste bins.
postmodern has joined #ruby-lang
<outoftime> and it keeps track of your gist history as a user, which is great for the lasting-collaborating use case, but annoying for the paste-and-forget use case.
<andkerosine> Another fair point, but proper tools largely do away with that.
<andkerosine> I use a SublimeText2 plugin, so I just highlight the gist, Ctrl-Alt-G, and then there's a link in my clipboard. ^_^
<andkerosine> Not doing it from "the Web" means it always comes out anonymous, which I very much prefer.
<outoftime> that does take care of that problem.
benanne has joined #ruby-lang
<andkerosine> Bad practice to use #index in place of #include? when they're synonymous for my purposes?
jimc| has joined #ruby-lang
<outoftime> andkerosine: it is asking a question you don't need to know the answer to...
Heimidal has joined #ruby-lang
petercooper has joined #ruby-lang
<outoftime> andkerosine: also, e.g. Set#index has no meaning, whereas Set#include? does. so you're more polymorphism-friendly if you're asking the question you need answered.
srbaker has joined #ruby-lang
futurechimp has joined #ruby-lang
jmeeuwen has joined #ruby-lang
jimc| has joined #ruby-lang
jimc| has quit [#ruby-lang]
<jbwiv> this "@belongs_to = @has_one = @has_many = {}" sets those three instance vars to all point at the same hash. Is there a clean shortcut syntax to instantiate a set of variable to the same type of object, but different instances?
roha has joined #ruby-lang
<andkerosine> Hash.new?
Austin__ has joined #ruby-lang
Austin__ has quit [#ruby-lang]
<andkerosine> Nah, you'll have to iterate, I'm afraid.
<andkerosine> Or do it in parallel, which is sometimes ugly, but no so much when the right side is just {}, {}, {}.
<jbwiv> andkerosine, heh.... a=b=c={},{},{} sets them all to point to an array of three hashes
<jbwiv> sheesh, nm
<jbwiv> a,b,c={},{},{}
<andkerosine> Cha. : )
<jbwiv> ;)
<andkerosine> ; P
<jbwiv> thx
jbwiv has quit ["Ex-Chat"]
<andkerosine> Sure thing.
jbwiv has joined #ruby-lang
savage- has joined #ruby-lang
<hagabaka> (a,b,c) = Array.new(3) {{}}
<andkerosine> Yuck.
havenn has joined #ruby-lang
<matled> I have a chain of methods called on a collection (map, reject, map, sort_by). I'm not sure what is more readable, either using a variable and calling map!, reject!, map!, sort_by on it or just calling one method after the other with the blocks in between
<andkerosine> Chain them, but with each chain method on its own line, starting with the dot.
<hagabaka> why do you need to map twice, plus sorb_by?
<hagabaka> *sort_by
dustacio has joined #ruby-lang
<matled> hagabaka: well, I call .entries on a pathname object, first I map them to strings with force_encoding "binary", then reject %w(. ..), then map them to the objects I actually want to have, and finally sort them the way I want them
chimkan_ has joined #ruby-lang
<matled> I didn't know that the dot may be at the start of the line
<hagabaka> couldn't you convert them to strings inside reject block?
<matled> I thought ruby would end the statement if a new line occured and wouldn't allow a method call
<matled> hagabaka: reject does not map the objects
<matled> hagabaka: so I'd have to do the .to_s.force_encoding twice
<hagabaka> you can do anything you want in the reject block
<matled> hagabaka: I know, but the return value of the reject block is a subset of the original collection
<matled> I cannot replace the objects as I can do with #map
<hagabaka> instead of objects.map {convert...}.reject, object {bad stuff}, objects.reject {convert, bad converted_stuff}
<andkerosine> rvm --default use 1.8.7 is not being remembered...
<matled> hagabaka: but I want to have the converted objects later on
eggman2001 has joined #ruby-lang
<hagabaka> ok then, but I just thought it was unlikely that you would need to go through such a convoluted process
CoverSlide has joined #ruby-lang
<hagabaka> what are you actually trying to do if you don't mind answering?
robbrit has quit [#ruby-lang]
<matled> it's a method to return all directories/files within a given directory recursively
<eggman2001> hello, if my nokogiri::xml::element has the html <option value="20">foo</option>, does anyone know how I can pull out the "20"?
<hagabaka> like Dir['**
<hagabaka> ']?
<matled> one problem is that ruby 1.9 encoding is really annoying. the strings returned by #entries may be flagged as UTF-8 but filenames just may be in any encoding, so I have to use force_encoding all the time
<hagabaka> **/*
<manveru> matled: that depends on the locale
andkerosine has quit [#ruby-lang]
malev_ has joined #ruby-lang
<matled> irb(main):007:0> path.entries.map { |e| path + e }
<matled> ArgumentError: invalid byte sequence in UTF-8
<matled> this is what annoys me
<matled> as this is not intended to be used as a library I could just do Encoding.default_external = "binary", but I hesitated from doing that as it feels a bit unclean
slimfit has joined #ruby-lang
<matled> it is just so hard to get it right if you're working with the filesystem, environment or the arguments
ilyam has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine> Is it still important to support <1.9?
<matled> no
<andkerosine> Really?
<matled> yes
<andkerosine> Excellent.
<matled> oh, you just joined, I thought your question was related to my question :)
<matled> I'd say it depends on what your target audience is
<andkerosine> It's a wrapper for the reddit API.
<andkerosine> It's pretty standard stuff, but I hate :x =>, when x: is an option.
<erikh> uh
<erikh> let's put it this way
<erikh> most of the big boy libraries still support 1.8
<andkerosine> Fair enough.
srbartlett has joined #ruby-lang
<sternicus> C noob here. Attempting to implement a join method for Enumerable. http://bugs.ruby-lang.org/issues/5970
<sternicus> I'd like to support joining nested Enumerables.
<sternicus> How can I determine if a value is Enumerable?
<andkerosine> respond_to?(each)
<drbrain> Enumerable === obj
<sternicus> sorry, to clarify… in C
srbaker has joined #ruby-lang
<sternicus> perhaps I should bug the folks in ruby-core
<manveru> sternicus: i highly suspect there is at least one such check in the MRI code
<sternicus> thanks manveru I've been digging, but it's not obvious to me
<manveru> otherwise you can ask in #rubinius, they know the CAPI like their kitchen sink
<sternicus> good idea, thanks
chimkan_ has joined #ruby-lang
<andkerosine> If I'm building a class from Struct, where do instance variables go?
<yorickpeterse> What do you mean with "where do they go"?
<andkerosine> Well, they normally get initialized in #initialize, but redefining it breaks Struct.
Heimidal_ has joined #ruby-lang
nofxx has joined #ruby-lang
<burgestrand> andkerosine: calling super in your initialize method ought to work.
<andkerosine> Gah! Duh... Thank you.
<andkerosine> Or... not? : /
<andkerosine> wrong number of arguments (18 for 0)
<burgestrand> I find it a bit odd to use a struct and then define initialize yourself though.
<burgestrand> Hah, wow.
<andkerosine> As do I.
<andkerosine> But... where else to set instance variables?
<burgestrand> andkerosine: you need to remember, your initialize method needs to take any number of arguments.
patant_ has joined #ruby-lang
<andkerosine> initialize(*a); super(a)
<andkerosine> Results in all 18 arguments getting mushed into the first Struct attribute.
<burgestrand> andkerosine: super(*a); but you don’t need to give explicit arguments to super, here:
<burgestrand> … just making sure the code runs before I paste it :)
<andkerosine> Much obliged.
<burgestrand> But anyhow, you can write write your initailize method like this: initialize(*); super; end
<burgestrand> As long as you don’t give any parentheses or parameters to super, it’ll pass the same arguments as was given to your method.
<burgestrand> andkerosine: http://codepad.org/DZuxDpWE
<andkerosine> Mm-hmm, that worked.
<andkerosine> Thanks very much.
<andkerosine> I really ought to have been able to put that together. : /
<andkerosine> I guess inheriting from Struct is so magical that my judgment got a bit clouded.
KimT has joined #ruby-lang
joast has joined #ruby-lang
Skif has joined #ruby-lang
Stalkr_ has joined #ruby-lang
lordofthedance has joined #ruby-lang
Heimidal has joined #ruby-lang
divoxx has joined #ruby-lang
<necromancer> anybody ever get this? /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- airbrake (LoadError)
<necromancer> it happens on my production server but not development server
<necromancer> using AIrbrake without rails
<drbrain> necromancer: did you install airbrake on your server?
<necromancer> drbrain: yes, it's in my Gemfile
<necromancer> which has been executed using `bundle install`
erpuds has joined #ruby-lang
<necromancer> " Installing airbrake (3.0.9)"
<shevy> hmm is there an "international" symbol for the action "view source" of a webpage? Right now I just display that text... wonder if an icon would be better
Taranis has joined #ruby-lang
<drbrain> necromancer: sounds like a bundler problem then, try #bundler?
HW42 has joined #ruby-lang
<drbrain> necromancer: if `gem list` shows airbrake and `gem which airbrake` shows an airbrake.rb and `ruby -rairbrake -e0` works, you can confirm it's a bundler issue
<drbrain> also, be sure that `gem env` matches /usr/local/rvm/rubies/ruby-1.9.3-p0
schlecht has joined #ruby-lang
zenspider has joined #ruby-lang
<zenspider> what'd I miss?
h4y4shi has joined #ruby-lang
schlecht has joined #ruby-lang
<drbrain> nothing
Nisstyre has joined #ruby-lang
<zenspider> heh
<andkerosine> shevy: Why not Zoidberg?
<andkerosine> necromancer: Is your production environment 1.8?
SuperTaz_work has joined #ruby-lang
<shevy> andkerosine Zoidberg?
<andkerosine> Sorry, disregard.
<andkerosine> Um... an HTML tag or two usually get the message across pretty well.
KimT has quit [#ruby-lang]
<necromancer> drbrain: it is a bundler issue. i am installing with --deployment now
<necromancer> seems to have fixed it...
Austin__ has joined #ruby-lang
darkf has joined #ruby-lang
<erikh> you might need 'bundle exec'
AudreyJean has joined #ruby-lang
patant_ has quit [#ruby-lang]
Austin__ has quit [#ruby-lang]
<andkerosine> "... and nitrate of potassium nitrate."
<drbrain> andkerosine: sounds explosive
roha has joined #ruby-lang
<shevy> andkerosine hmm perhaps I'll use an icon of Zoidberg
<erikh> we have a project called zoidberg
<erikh> I'm hoping to release it soon
slimfit has joined #ruby-lang
<andkerosine> What's it do?
<frem> What's it do? Why not Zoidberg?
<andkerosine> I bet it's a testing framework. ; )
WillMarshall has joined #ruby-lang
<erikh> no, heh
<erikh> it's nothing spectacular
njp has joined #ruby-lang
<njp> Folks,
<njp> Can anyone suggest how to make a change to a gem
<njp> and then reinstall it?
<njp> I've got the gem, and unpacked it
<njp> but I'm not having much luck getting it re-installed into the ruby installation
<njp> ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
<njp> gem --version 1.8.16
<njp> centos 6
<njp> non-standard install path for ruby and the gems
<njp> Gem in question is eventmachine 0.12.10
<njp> very old, but we are not able to change at this point
<njp> I've tried 'rake gem'
<njp> and got some unhelpful errors about rdoc
<njp> Also tried the git checkout of eventmachine-0.12.10
<njp> same thing
<njp> So, what I need is the recipe that gem developers use to try out their gems from local source code
<njp> Ideas?
<andkerosine> Locate the gem on your computer, modify the files, cd to the folder containing the gemspec and run `gem build x.gemspec`.
gregf has joined #ruby-lang
<andkerosine> Followed by `gem install x`, of course.
<njp> Tried that... Didn't _seem_ to work
<njp> couldn't see any .o output in the /ext dir
<andkerosine> You may need to `git commit` the changes?
<njp> I want to keep the changes local
<andkerosine> That does keep them local.
<njp> until I've tested it
<andkerosine> `push` is permanence.
<injekt> you need to compile it if it's an extension
<njp> Right. It is a C extension.
bglusman has joined #ruby-lang
<injekt> ruby extconf.rb then make probably
<drbrain> the C extension gets compiled at install time
<njp> Ahh.
<njp> So I tried the install, and got this:
<njp> gem install eventmachine.gemspec ERROR: Could not find a valid gem 'eventmachine.gemspec' (>= 0) in any repository
<njp> ERROR: Possible alternatives: eventmachine-websocket, eventmachine-vnc, eventmachine-redis, eventmachine, event_machine_flush
<injekt> lol
<injekt> gem build eventmachine-version.gemspec
<injekt> gem install eventmachine-version.gem
<injekt> er less -version on the gemspec one
<njp> Can you paste an example command line for that?
<injekt> i just did
<njp> So I tried a bunch of combinations:
<njp> Your command line, just cut and paste:
<njp> [nick@localhost eventmachine]$ gem build eventmachine-version.gemspec ERROR: Gemspec file not found: eventmachine-version.gemspec
<injekt> dude c'mon
<njp> With the version added:
<njp> gem build eventmachine-0.12.10.gem ERROR: While executing gem ... (ArgumentError) invalid byte sequence in UTF-8
<njp> gem build eventmachine-0.12.10.gemspec ERROR: Gemspec file not found: eventmachine-0.12.10.gemspec
<injekt> right
<injekt> there is an eventmachine.gemspec, true?
<drbrain> gem unpack eventmachine; gem unpack --spec eventmachine
<njp> Yes, there is.
<injekt> so
<injekt> gem build eventmachine.gemspec
<drbrain> mv eventmachine-0.12.10.gemspec eventmachine-0.12.10
<drbrain> cd eventmachine-0.12.10
<injekt> drbrain: that doesn't exist
<drbrain> edit the gem
<injekt> oh
<injekt> he did that?
<injekt> wtf
<drbrain> injekt: gem unpack --spec
<injekt> drbrain: ahh makes sense
<drbrain> injekt: I have no idea, but this ^^ is how you get to the right place
<injekt> heh
<injekt> it's all in the guides
<injekt> but apparently njp hasn't looked for them
<drbrain> --spec might not be
<njp> You know, it may be in the guides, but it sure isn't easy to find
<njp> and yes, I am an experienced user.
<injekt> drbrain: gem help unpack has --spec
<njp> but I appreciate the help anyway
<drbrain> not every gem has a .gemspec file and not every gemspec file is usable to build a gem without a full development environment
<drbrain> (which is another reason why packaging from a gemspec is a lame idea)
<drbrain> I would eval them with $SAFE=4 if I could ☹
<njp> So, I did the unpack <gem name> -spec and all I got was the gemspec file
<drbrain> njp: yup
<drbrain> move it into the place you unpacked the gem
<drbrain> where lib/ and ext/ and whatnot are
<drbrain> then you can `gem build`
<njp> A plain unpack seems to do that already
<drbrain> njp: yup
<drbrain> `gem unpack` gives you the contents of the gem
<drbrain> `gem unpack --spec` gives you the metadata of the gem
bglusman has joined #ruby-lang
<drbrain> you can recombine the two through `gem build` to create the gem again
<lianj> i wonder what change your are up to in the eventmachine gem
<njp> Unfortunately this process just seems to get me back to where I started from
<njp> gem build eventmachine.gemspec Successfully built RubyGem Name: eventmachine Version: 0.12.10 File: eventmachine-0.12.10.gem
<njp> gem install eventmachine.gemspec ERROR: Could not find a valid gem 'eventmachine.gemspec' (>= 0) in any repository ERROR: Possible alternatives: eventmachine-websocket, eventmachine-vnc, eventmachine-redis, eventmachine, event_machine_flush
<lianj> gem install eventmachine-0.12.10.gem
<drbrain> njp: you can't install a gemspec
<lianj> gems, how do they work
<njp> Ahhh, got it.
<njp> Thanks
<drbrain> njp: please, look at your output
AlHafoudh has joined #ruby-lang
<njp> That output doesn't say "you need to install the versioned .gem file" to me
<njp> Maybe if you've been through this process enough you recognize it, but it's not terribly obvious.
<njp> But, I do genuinely appreciate the help
<drbrain> njp: .gemspec and .gem are two different types of files
<lianj> what did you change? (curious)
<drbrain> njp: also, `gem install` by default tries local files matching the name then remote files
<njp> lianj: I'm working on a fix for a bug that we're seeing in a complicated TCP-based system.
<njp> I don't have enough time to go into it in detail, but we were seeing some unusual TCP behaviour with a root cause in close_on_exec for socket file descriptors
kurko_ has joined #ruby-lang
<lianj> i would suggest doing it locally first, without reinstalling all the time
<lianj> preferably in the git repo of eventmachine
<njp> That's certainly what I'd like to do.
twittard_ has joined #ruby-lang
<njp> What's the right way of doing that?
<erikh> njp: is there a rakefile in the repo?
Spooner has joined #ruby-lang
<njp> Yeah.
<erikh> rake -T
<erikh> is there a 'gem' or 'install_gem' target?
<erikh> or something similar
<njp> there's a 'gem' target
<erikh> ok -- you can probably use that to build your gem
<erikh> so, like so: rake gem && gem install pkg/eventmachine-blabla.gem
<erikh> it's not *great* but it's probably simpler than what you're doing.
<erikh> also there's #eventmachine, which has some of the brightest hackers ruby has to offer in it
<njp> Yeah, I did try this, in a git checkout
H2H has joined #ruby-lang
<njp> and got stuff like this:
<njp> rake gem --trace rake aborted! no such file to load -- lib/em/version /home/nick/Work/ruby/install/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /home/nick/Work/ruby/install/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /home/nick/Work/ruby/gem_src/eventmachine.git_checkout/Rakefile:123:in `block in <top (required)>'
<erikh> interesting
<erikh> let me check out the repo
yfeldblum has joined #ruby-lang
burgestrand has joined #ruby-lang
slimfit has joined #ruby-lang
<erikh> are you running against a specific tag?
<erikh> I can look there.
<lianj> git checkout -f v0.12.10 prolly
<erikh> don't make assumptions
<lianj> hehe
pabloh has joined #ruby-lang
<andkerosine> There's probably no non-hackish way to prepend a sleep to the beginning of every method in a module, huh?
<erikh> njp: anyhow I have to bail; that's probably your best bet or check the EM list or irc channel where you can get some insights. ta
<lianj> erikh: v0.12.10 gets me the no lib/em/version file found issue
<erikh> wait for him to come back with an answer
<erikh> just presuming doesn't solve anything for anyone
<erikh> anyhow I really have to go
<njp> Guys - it's v0.12.10
<njp> I've got to go too
<njp> Thanks for all your help. Much appreciated
<lianj> yea, your output showed that were dealing with that version
<lianj> njp: did you try the latest though?
Sailias has joined #ruby-lang
<Stalkr_> Hey all
<schlecht> Hello hacker Stalkr_ 
<Stalkr_> So... I have a question for my fellow Rubyists
magicbeef has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
flexd has joined #ruby-lang
havenn has joined #ruby-lang
butchanton has joined #ruby-lang
lordofthedance has joined #ruby-lang
sinuc has joined #ruby-lang
sinuc has joined #ruby-lang
wyhaines has joined #ruby-lang
shevy has joined #ruby-lang
chimkan_ has joined #ruby-lang
ryez has joined #ruby-lang
chimkan_ has joined #ruby-lang
ilyam has joined #ruby-lang
<injekt> basicxman: ping