ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
kain has joined #ruby-lang
anildigital_work has joined #ruby-lang
mistym has quit [Remote host closed the connection]
swarley has joined #ruby-lang
sgonyea has quit [Quit: sgonyea]
sgonyea has joined #ruby-lang
kain has quit [Ping timeout: 245 seconds]
akahn has joined #ruby-lang
twittard has joined #ruby-lang
sgonyea has quit [Ping timeout: 245 seconds]
twittard is now known as sgonyea
chimkan_ has quit [Quit: chimkan_]
cored has quit [Ping timeout: 248 seconds]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
mccraig has joined #ruby-lang
<erikh> ged, drbrain: getting an error installing latest pg -- referencing a new output formatter 'fivefish'
<andrewvos> ERIKH
<erikh> I imagine this is a new-to-rdoc thing
<erikh> given both of your involvement there
<erikh> andrewvos: hi
iamlacroix has quit [Remote host closed the connection]
<andrewvos> Hangover?
<erikh> oh, worse than that.. i'll spare you the details.
<andrewvos> Your drunk tweets were quite civilised.
<erikh> haha, I was debating deleting them.
<drbrain> erikh: I think ged has been working on a five fish, maybe he added it to the rdoc_options
<erikh> ah, but the runtime dependency isn't there
<ged> erikh: Does it error and fail to install/build docs, or just warn about the formatter?
<erikh> it errors out (actually kills my chef run)
<erikh> trying it with --no-ri --no-rdoc now, we'll see if that fixes it
<erikh> if so, chances are it just needs a runtime dep
justinmcp has joined #ruby-lang
<ged> Well, it should depend on a certain formatter. I set that option thinking that rdoc would ignore a formatter it didn't have.
<ged> Which is what it's done on my machine when I tested it.
<erikh> yeah, it appears that rdoc fails, which causes the gem install to fail
<erikh> well, this is ubuntu stock rdoc/ruby too
<erikh> so, older stuff.
<drbrain> yeah
<erikh> yeah.. --no-ri --no-rdoc fixed it
headius has joined #ruby-lang
<erikh> which is something I can deal with here, but figured you should know anyhow.
sgonyea has quit [Quit: sgonyea]
havenn has joined #ruby-lang
<ged> What version of rdoc?
<ged> And what version of Ruby?
<erikh> sec, let me find out.
<erikh> ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
<erikh> RDoc V1.0.1 - 20041108
<erikh> oh, oh wow
<erikh> ubuntu
<erikh> jesus.
<erikh> that's 12.04 LTS, too.
<drbrain> yeah
kain has joined #ruby-lang
Madis has quit [Quit: ChatZilla 0.9.89 [Firefox 11.0/20120313180949]]
<ged> Ah, still crappy, but that explains it.
datanoise has quit [Ping timeout: 260 seconds]
<ged> Maybe I add a dependency on RDoc 3.12...
rwilcox has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
drbrain has quit [Ping timeout: 260 seconds]
<zenspider> minitest 4.0.0 released! woo...
kain has quit [Ping timeout: 246 seconds]
drbrain has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
<Spaceghostc2c> zenspider: Is it cool?
chimkan_ has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
<zenspider> so cool
headius has quit [Quit: headius]
<diegoviola> zenspider: does it work with rbx?
ryanlecompte has quit [Remote host closed the connection]
<zenspider> diegoviola: I dunno... did you try?
<diegoviola> zenspider: not yet
<diegoviola> i will try
sent-hil has quit [Remote host closed the connection]
Carnage\ has joined #ruby-lang
kain has joined #ruby-lang
<zenspider> what's code completion? never heard of it.
<andrewvos> C-n C-p
<andrewvos> I think stardiviner means Intellisense?
havenn has quit [Remote host closed the connection]
<zenspider> what's intellisense? never heard of it.
<stardiviner> andrewvos: yes, vim omni is not intellisense
<zenspider> also, nonsensical
<andrewvos> zenspider: It's in Visual Studio.
seoaqua has joined #ruby-lang
<andrewvos> zenspider: If a variable is of a certain type, when you type the variable name and press . Visual Studio will list the methods/properties you can call.
<stardiviner> andrewvos: like REPL, and like in bpython or ipython. maybe they implement way is different
<zenspider> andrewvos: what's a type?
<zenspider> everything is an object
undersc0re97 has joined #ruby-lang
undersc0re97 has quit [Changing host]
undersc0re97 has joined #ruby-lang
<zenspider> I have code completion at 5PM every day
<erikh> heh
<erikh> stardiviner: if you want intellisense like completion, look at rubymine
headius has joined #ruby-lang
<zenspider> and realize that it is pretty much useless with a fully dynamic language like ruby.
<erikh> but be forewarned that a lot of... yep, was getting to that
<stardiviner> erikh: thanks
<zenspider> hee
<erikh> well, C# gets close in spots.
<erikh> it has some pretty nifty ways to do dynamic stuff in a static system
kain has quit [Ping timeout: 260 seconds]
<erikh> rubymine's probably your best bet, though, if that's what really concerns you
<erikh> vim has pretty good completion if you have your ducks in a row, I even get rdoc when I mouse over certain calls
<erikh> and with supertab.vim, it works on the tab key like intellisense does
<erikh> but getting vim completion to deal with a multi-ruby environment like rvm/rbenv/rbfu is probably not feasible
m3nd3s has quit [Ping timeout: 245 seconds]
postmodern has joined #ruby-lang
<stardiviner> erikh: supertab.vim ? ok
Carnage\ has quit []
<erikh> yeah, it's on the vim scripts site.
<erikh> note that supertab will try to complete anything.. it's not ruby specific.
seanstickle has joined #ruby-lang
nXqd has quit [Ping timeout: 255 seconds]
datanoise has joined #ruby-lang
qpingu has quit [Quit: Leaving.]
<andrewvos> supertab.vim FTW
seoaqua has quit [Ping timeout: 245 seconds]
kain has joined #ruby-lang
seoaqua has joined #ruby-lang
chimkan_ has quit [Quit: chimkan_]
chendo__ has quit [Ping timeout: 245 seconds]
chendo_ has quit [Ping timeout: 255 seconds]
chendo_ has joined #ruby-lang
chendo__ has joined #ruby-lang
seoaqua has quit [Ping timeout: 240 seconds]
bastilian has joined #ruby-lang
kain has quit [Ping timeout: 256 seconds]
seanstickle has quit [Quit: seanstickle]
BMF has quit [Remote host closed the connection]
Nisstyre-laptop has quit [Remote host closed the connection]
seoaqua has joined #ruby-lang
alvaro_o has quit [Quit: Ex-Chat]
Nisstyre-laptop has joined #ruby-lang
jtoy has joined #ruby-lang
richardjortega has quit [Quit: richardjortega]
robie1373 has joined #ruby-lang
gllmpn has joined #ruby-lang
chendo_ has quit [Ping timeout: 246 seconds]
pygmael has joined #ruby-lang
chendo__ has quit [Ping timeout: 245 seconds]
kain has joined #ruby-lang
havenn has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo__ has joined #ruby-lang
havenn has quit [Ping timeout: 256 seconds]
lsegal has joined #ruby-lang
runeb has quit [Remote host closed the connection]
kain has quit [Ping timeout: 256 seconds]
YayMe has joined #ruby-lang
VegetableSpoon has quit [Quit: Leaving]
YayMe has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
YayMe has joined #ruby-lang
twintail has joined #ruby-lang
twintail1 has joined #ruby-lang
twintail2 has joined #ruby-lang
twintail3 has joined #ruby-lang
nertzy2 has quit [Ping timeout: 246 seconds]
twintail has quit [Ping timeout: 246 seconds]
towski has quit [Remote host closed the connection]
twintail1 has quit [Ping timeout: 244 seconds]
twintail2 has quit [Ping timeout: 246 seconds]
<postmodern> just got this: ERROR: RDoc documentation generator not installed: cannot load such file -- rdoc/rdoc
<postmodern> rdoc is definitely installed
jperry2_ has quit [Quit: jperry2_]
<swarley> postmodern, is it in your path?
seoaqua has quit [Quit: 离开]
<postmodern> swarley, gem list shows 3.12
<swarley> ruby -e"require 'rdoc/rdoc'" ?
<postmodern> swarley, this happens when i run `rake install` which shells out to `gem install pkg/...`
kain has joined #ruby-lang
bastilian has quit [Quit: Leaving...]
<postmodern> think bundler is somehow effecting sub-commands
kain has quit [Ping timeout: 260 seconds]
justin_ has joined #ruby-lang
agarie has joined #ruby-lang
twintail has joined #ruby-lang
coryf has quit [Remote host closed the connection]
ianblenke1 has joined #ruby-lang
justin_ has quit [Quit: Leaving]
twintail3 has quit [Ping timeout: 248 seconds]
justinseiter_ has joined #ruby-lang
dhruvasagar has joined #ruby-lang
wyhaines has joined #ruby-lang
cjs226 has quit []
Bing has joined #ruby-lang
cjs226 has joined #ruby-lang
cndiv has joined #ruby-lang
Bing has quit []
facest has joined #ruby-lang
kain has joined #ruby-lang
faces has quit [Ping timeout: 256 seconds]
twintail1 has joined #ruby-lang
twintail has quit [Ping timeout: 244 seconds]
twintail2 has joined #ruby-lang
<justinseiter> anyone try out http://pragmaticstudio.com/ruby as a ruby intro?
twintail1 has quit [Ping timeout: 256 seconds]
deryl has joined #ruby-lang
ricardovaleriano has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
mistym has quit [Ping timeout: 248 seconds]
dhruvasagar has quit [Ping timeout: 244 seconds]
dhruvasagar has joined #ruby-lang
YayMe has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
chendo_ has quit [Ping timeout: 255 seconds]
chendo__ has quit [Ping timeout: 255 seconds]
chendo_ has joined #ruby-lang
chendo__ has joined #ruby-lang
jtoy has quit [Quit: jtoy]
tRAS has joined #ruby-lang
swarley has quit [Ping timeout: 244 seconds]
cndiv has quit []
cndiv has joined #ruby-lang
rking has quit [Read error: Connection reset by peer]
dous_ has quit [Remote host closed the connection]
xyzodiac has quit [Quit: Computer has gone to sleep.]
twintail2 has quit [Quit: Leaving.]
gaveen has joined #ruby-lang
rhizmoe has joined #ruby-lang
stiang has joined #ruby-lang
<rhizmoe> hi all. what's a good explanation of yield?
justinseiter has quit [Remote host closed the connection]
justinseiter_ has quit [Remote host closed the connection]
sent-hil has joined #ruby-lang
cjs226 has quit [Ping timeout: 246 seconds]
ljsdfc has joined #ruby-lang
havenn has joined #ruby-lang
<agarie> it calls the given block, the arguments passed to yield are passed to the block
sent-hil has quit [Remote host closed the connection]
<rhizmoe> in a case like yield self ...what constitutes the block?
JohnBat26 has joined #ruby-lang
<agarie> it'll be the object itself
jackhammer2022 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
nariyal has joined #ruby-lang
<rhizmoe> i don't understand
snuxoll_ has quit [Quit: ZNC - http://znc.in]
agarie has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 246 seconds]
ricardovaleriano has quit [Remote host closed the connection]
rking has joined #ruby-lang
nariyal has quit [Ping timeout: 246 seconds]
tRAS has quit [Quit: Mother, did it need to be so high?]
<rhizmoe> hm, not sure of the use of that :)
areil has joined #ruby-lang
outoftime has quit [Ping timeout: 248 seconds]
<erikh> deprecated 3.0.1 released
sush24 has joined #ruby-lang
datanoise has joined #ruby-lang
rikkus has quit [Ping timeout: 246 seconds]
rikkus has joined #ruby-lang
CrazyHorse18 has joined #ruby-lang
tRAS has joined #ruby-lang
spo12 has joined #ruby-lang
CrazyHorse181 has joined #ruby-lang
CrazyHorse18 has quit [Ping timeout: 255 seconds]
rking has quit [Remote host closed the connection]
rking has joined #ruby-lang
datanoise has quit [Ping timeout: 245 seconds]
chendo__ has quit [Ping timeout: 255 seconds]
chendo_ has quit [Ping timeout: 255 seconds]
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby-lang
dous has joined #ruby-lang
dous has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo__ has joined #ruby-lang
dous_ has joined #ruby-lang
dous_ has joined #ruby-lang
dous_ has quit [Changing host]
icooba has quit [Ping timeout: 260 seconds]
agarie has joined #ruby-lang
a3li has quit [Ping timeout: 255 seconds]
a3li has joined #ruby-lang
icooba has joined #ruby-lang
dous has quit [Ping timeout: 244 seconds]
sush24 has quit [Ping timeout: 246 seconds]
nariyal has joined #ruby-lang
dc5ala has joined #ruby-lang
ryanf has joined #ruby-lang
sush24 has joined #ruby-lang
stepnem has joined #ruby-lang
cndiv has quit []
sush24 has quit [Read error: Connection reset by peer]
sush24 has joined #ruby-lang
diegoviola has quit [Ping timeout: 246 seconds]
anannie has joined #ruby-lang
ttilley has quit [Quit: ttilley]
CrazyHorse181 has quit [Quit: Leaving.]
tenderlove has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
justinmcp has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
chendo__ has quit [Changing host]
chendo__ has joined #ruby-lang
nariyal has quit [Ping timeout: 256 seconds]
havenn has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
solars has quit [Ping timeout: 240 seconds]
tenderlove has quit [Ping timeout: 245 seconds]
gmg85 has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 240 seconds]
anannie has quit [Remote host closed the connection]
gllmpn has quit [Remote host closed the connection]
seoaqua has joined #ruby-lang
gllmpn has joined #ruby-lang
gllmpn has quit [Remote host closed the connection]
Axsuul has quit [Remote host closed the connection]
<zenspider> rhizmoe: when you do ary.find do |x| ... end -- the 'do ... end' is the block. yield executes the block and passes in whatever args it has... in this case, it'd go into x
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<zenspider> in the case of Array.find, it'd look something like: def find; self.each do |o| return o if yield o; end
<zenspider> which in turn shows another block that is also yielding...tho is that case, from C
<zenspider> upgrading server... bbl
tenderlove has joined #ruby-lang
zenspider has quit [Quit: Terminated with extreme prejudice - dircproxy 1.1.0]
tenderlove has quit [Ping timeout: 260 seconds]
tonni_ has quit [Remote host closed the connection]
sepp2k has joined #ruby-lang
chendo__ has quit [Ping timeout: 255 seconds]
dmwuw has quit [Remote host closed the connection]
chendo__ has joined #ruby-lang
postmodern has quit [Ping timeout: 245 seconds]
anannie has joined #ruby-lang
<seoaqua> i've solved a rare problem when many users share the same linux pc and need to install gems into a shared path. just delete the "user_install" option in /etc/gemrc
postmodern has joined #ruby-lang
soonerguy9782 has joined #ruby-lang
soonerguy9782 has quit [Remote host closed the connection]
rcassidy has quit [Ping timeout: 245 seconds]
sush24 has joined #ruby-lang
CrazyHorse18 has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
CrazyHorse181 has joined #ruby-lang
CrazyHorse18 has quit [Ping timeout: 260 seconds]
<manveru> or use --no-user-install :)
sush24 has quit [Read error: Connection reset by peer]
<yxhuvud> well, that would have to be used every time a gem is installed while gemrc can fix it once and for all.
tenderlove has joined #ruby-lang
tenderlove has quit [Ping timeout: 256 seconds]
stiang has quit [Quit: stiang]
sent-hil has joined #ruby-lang
stiang has joined #ruby-lang
<gmg85> Is the intended use for ruby modules the grouping of classes?
<gmg85> like namespaces in php/cpp
<gmg85> or packages in java?
<heftig> that's one of their uses
<heftig> (both modules and classes act as namespaces)
<heftig> the other one is mixins
<gmg85> how would a class act as a namespace?If it contained other classes in it?
<heftig> yes, or modules.
<heftig> well, constants, to be exact
<heftig> class A; B = 3; end
<heftig> A::B
<gmg85> a mixin is when you use a module in a class?
solars has joined #ruby-lang
goshakkk has joined #ruby-lang
postmodern has quit [Ping timeout: 260 seconds]
vlad_starkov has joined #ruby-lang
ryanf has quit [Ping timeout: 260 seconds]
Carnage\ has joined #ruby-lang
gmg85 has quit [Ping timeout: 245 seconds]
seoaqua has quit [Ping timeout: 248 seconds]
benanne has joined #ruby-lang
nariyal has joined #ruby-lang
msch has joined #ruby-lang
postmodern has joined #ruby-lang
stiang has quit [Quit: stiang]
tRAS has quit [Quit: Mother, did it need to be so high?]
cantonic_ has joined #ruby-lang
zenspider has joined #ruby-lang
cantonic has quit [Ping timeout: 245 seconds]
cantonic_ is now known as cantonic
<zenspider> rawr
SkyEye has joined #ruby-lang
SkyEye has joined #ruby-lang
stiang has joined #ruby-lang
gaveen has quit [Ping timeout: 260 seconds]
Axsuul has joined #ruby-lang
tenderlove has joined #ruby-lang
Madis_ has joined #ruby-lang
yaroslav has joined #ruby-lang
tenderlove has quit [Ping timeout: 248 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
adambeynon has joined #ruby-lang
bastilian has joined #ruby-lang
CrazyHorse181 has quit [Quit: Leaving.]
A124 has joined #ruby-lang
nariyal has quit [Ping timeout: 252 seconds]
VegetableSpoon has joined #ruby-lang
nariyal has joined #ruby-lang
agarie has quit [Remote host closed the connection]
stiang has quit [Quit: stiang]
tbuehlmann has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]
ryanf has joined #ruby-lang
adambeynon has quit [Quit: Computer has gone to sleep.]
CrazyHorse18 has joined #ruby-lang
ryanf has quit [Ping timeout: 240 seconds]
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
CrazyHorse181 has joined #ruby-lang
CrazyHorse18 has quit [Ping timeout: 255 seconds]
jbsan has quit [Quit: jbsan]
tenderlove has joined #ruby-lang
jbsan has joined #ruby-lang
tenderlove has quit [Ping timeout: 245 seconds]
workmad3 has joined #ruby-lang
CrazyHorse181 has quit [Quit: Leaving.]
dous_ has quit [Remote host closed the connection]
CrazyHorse18 has joined #ruby-lang
CrazyHorse181 has joined #ruby-lang
CrazyHorse18 has quit [Ping timeout: 255 seconds]
adambeynon has joined #ruby-lang
hackeron has quit [Remote host closed the connection]
bastilian has quit [Quit: Leaving...]
bastilian has joined #ruby-lang
dous has joined #ruby-lang
dous has quit [Changing host]
dous has joined #ruby-lang
areil has quit [Remote host closed the connection]
<Harzilein> hmm
SkyEye is now known as gaveen
<Harzilein> is there a nice rubyish way to repeatedly accumulate elements of an enumerable based on their contents, then start over? say, aggregating continued lines to lines (of course this is just an example)
workmad3 has quit [Read error: Operation timed out]
CrazyHorse181 has left #ruby-lang [#ruby-lang]
CrazyHorse18 has joined #ruby-lang
<CrazyHorse18> hey
<CrazyHorse18> example?
adambeynon has quit [Quit: Computer has gone to sleep.]
<CrazyHorse18> array.join('')
milestone has joined #ruby-lang
<CrazyHorse18> hash.map {|k,v| whateveryouwanttoextract }.join()
<heftig> Harzilein: maybe you want slice_before ?
<Harzilein> CrazyHorse18: that would be horrible memory-intensive i think
<Harzilein> i'll write some boring code that shows the concept i'm after, wait
<CrazyHorse18> Harzilein: memory intensive my arse :)
<CrazyHorse18> haha
<CrazyHorse18> unless your doing million of lines
<CrazyHorse18> it should be fine
<milestone> hi all, i am having problems parsing and mangling an xml file. https://gist.github.com/3803794 is my script, and instead of copying each child_element from the <profile name="full-ha"> he moves it to my new Element ...
<milestone> i am a ruby newbie
ianblenke2 has joined #ruby-lang
Jork1 has joined #ruby-lang
tenderlove has joined #ruby-lang
ianblenke1 has quit [Ping timeout: 255 seconds]
rolfb has joined #ruby-lang
tenderlove has quit [Ping timeout: 260 seconds]
sush24 has joined #ruby-lang
<Harzilein> CrazyHorse18, heftig: i think i want each_with_object
<Harzilein> hmm
<Harzilein> oh, wait, that returns the memo
<Harzilein> *sigh*
tbuehlmann has quit [Remote host closed the connection]
nyuszika7h has joined #ruby-lang
sush24 has quit [Client Quit]
sush24 has joined #ruby-lang
tbuehlmann has joined #ruby-lang
sush24 has quit [Client Quit]
sush24 has joined #ruby-lang
<heftig> Harzilein: still didn't post that sample :p
sush24 has quit [Client Quit]
<Harzilein> heftig: i'm still writing it, it is slightly more complicated than continued lines
<Harzilein> how do i modify the last element of an array?
benanne has quit [Quit: kbai]
benanne has joined #ruby-lang
<heftig> a[-1] = 4
<heftig> Harzilein: maybe just give us a testcase
<heftig> i.e. what you put in and what should come out
gmci has joined #ruby-lang
lcdhoffman has joined #ruby-lang
lcdhoffman has quit [Client Quit]
<Harzilein> heftig: this is what i'm doing now. i guess each_with_object is not all that bad here: http://paste.debian.net/194261
nyuszika7h has left #ruby-lang ["leaving"]
yaroslav has quit [Quit: yaroslav]
runeb has joined #ruby-lang
<heftig> um
<heftig> lots of garbage in that hash
runeb has quit [Remote host closed the connection]
<heftig> Harzilein: that code doesn't work well at all here
runeb has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
<Harzilein> oh, i forgot to print it at the end, i was using it with irb -r ./rfc5759.rb
<Harzilein> uhm,
<Harzilein> i meant
CrazyHorse18 has quit [Quit: Leaving.]
<Harzilein> with irb -r ./rfc5797.rb
<Harzilein> hp@tt-24:~$ irb -r ./rfc5797.rb
<Harzilein> irb(main):001:0> @result.last
<Harzilein> => {:cmd=>"-N/A- ", :whatevs=>" ", :desc=>"TVFS ", :f1=>" ", :f2=>"Trivial Virtual File Store ", :ref=>" "}
<heftig> Harzilein: yeah, lots of garbage
<Harzilein> heftig: that's not what it's about here
<Harzilein> again, i was wondering if something already exists where i can just plug in a function that does the accumulation and a function that decides if accumulation continues. maybe also something that supports special handling of the last line
<heftig> hm
m3nd3s has joined #ruby-lang
xyzodiac has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
gaveen has quit [Remote host closed the connection]
<heftig> Harzilein: @table.lines.slice_before(/\A\S/).map { |lines| lines.inject([""]*6) { |m,line| m.zip(line.split('|').map(&:strip)).map { |s| s.join(" ") } } }
<heftig> transforms that table into a two-dimensional array
<heftig> @table.lines.slice_before(/\A\S/).map { |lines| lines.inject([""]*6) { |m,line| m.zip(line.split('|').map(&:strip)).map { |s| s.join(" ").strip } }
<heftig> whoops, forgot a strip
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
workmad3 has joined #ruby-lang
<heftig> here's a variant without zip and inject:
<heftig> @table.lines.slice_before(/\A\S/).map { |lines| fields=[]; lines.each { |line| line.split('|').each_with_index { |x,i| fields[i] ||= []; fields[i] << x.strip } }; fields.map { |x| x.join(" ").strip } }
CrazyHorse18 has joined #ruby-lang
sush24 has joined #ruby-lang
CrazyHorse181 has joined #ruby-lang
CrazyHorse18 has quit [Ping timeout: 255 seconds]
tenderlove has joined #ruby-lang
<Harzilein> heftig: thanks
dous has quit [Remote host closed the connection]
<heftig> Harzilein: http://sprunge.us/ZidA?rb
<heftig> Harzilein: should be the simplest variant of this, i think
Jork1 has quit [Quit: Jork1]
<heftig> @result = @table.lines.slice_before(/\A\S/).map { |lines| lines.map { |line| line.split('|').map(&:strip) }.transpose.map { |fieldlines| fieldlines.join(" ").strip } }
<heftig> you can still compress it into a oneliner
tenderlove has quit [Ping timeout: 260 seconds]
<heftig> slice_before slices the lines into chunks for each command, each line is converted into a field array, then the lines belonging to each field are joined
milestone has quit [Quit: milestone]
twintail has joined #ruby-lang
milestone has joined #ruby-lang
nariyal has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
jperry2_ has joined #ruby-lang
milestone has quit [Client Quit]
jperry2_ has quit [Client Quit]
rolfb has quit [Quit: Linkinus - http://linkinus.com]
twintail has quit [Quit: Leaving.]
Jork1 has joined #ruby-lang
vlad_starkov has joined #ruby-lang
milestone has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 245 seconds]
milestone has quit [Client Quit]
vlad_starkov has joined #ruby-lang
kirin` has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
jperry2_ has joined #ruby-lang
jperry2_ has quit [Client Quit]
Jork1 has quit [Quit: Jork1]
Jork1 has joined #ruby-lang
jperry2_ has joined #ruby-lang
jperry2_ has quit [Client Quit]
tenderlove has joined #ruby-lang
anannie has quit [Remote host closed the connection]
ricardovaleriano has joined #ruby-lang
postmodern has quit [Quit: Leaving]
tenderlove has quit [Ping timeout: 260 seconds]
JohnBat26 has quit [Ping timeout: 248 seconds]
runeb has quit [Remote host closed the connection]
jxie_ has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie_ has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
jxie has joined #ruby-lang
outoftime has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
deryl has quit [Quit: Leaving.]
outoftime has quit [Read error: Connection reset by peer]
jtoy has joined #ruby-lang
BMF has joined #ruby-lang
yats has joined #ruby-lang
Fiel has joined #ruby-lang
swarley has joined #ruby-lang
jxie has quit [Quit: leaving]
jtoy has quit [Ping timeout: 246 seconds]
VegetableSpoon has quit [Ping timeout: 246 seconds]
runeb has joined #ruby-lang
outoftime has joined #ruby-lang
swarley has quit [Ping timeout: 245 seconds]
anannie has joined #ruby-lang
runeb has quit [Ping timeout: 246 seconds]
VegetableSpoon has joined #ruby-lang
outoftime has quit [Read error: Connection reset by peer]
jamjam has joined #ruby-lang
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby-lang
kirin` has quit [Quit: leaving]
kirin` has joined #ruby-lang
kingcrawler has joined #ruby-lang
hakunin has quit [Ping timeout: 246 seconds]
stiang has joined #ruby-lang
cored has quit [Ping timeout: 245 seconds]
undersc0re97 has quit [Ping timeout: 256 seconds]
runeb has joined #ruby-lang
runeb has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
outoftime has joined #ruby-lang
kirin` has quit [Quit: leaving]
tenderlove has quit [Ping timeout: 255 seconds]
kirin` has joined #ruby-lang
lcdhoffman has joined #ruby-lang
headius has quit [Quit: headius]
jperry2_ has joined #ruby-lang
VegetableSpoon has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
outoftime has quit [Read error: Connection reset by peer]
headius has joined #ruby-lang
cjs226 has joined #ruby-lang
workmad3 has quit [Ping timeout: 255 seconds]
tRAS has joined #ruby-lang
jperry2_ has quit [Quit: jperry2_]
datanoise has joined #ruby-lang
jtoy has joined #ruby-lang
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby-lang
cirenyc has joined #ruby-lang
jtoy has quit [Ping timeout: 260 seconds]
headius has quit [Quit: headius]
outoftime has joined #ruby-lang
jtoy has joined #ruby-lang
stiang has quit [Quit: stiang]
outoftime has quit [Read error: Connection reset by peer]
dc5ala has quit [Quit: Ex-Chat]
soonerguy9782 has joined #ruby-lang
datanoise has quit [Quit: leaving]
BMF has left #ruby-lang [#ruby-lang]
datanoise has joined #ruby-lang
soonerguy9782 has quit [Client Quit]
datanoise has quit [Client Quit]
datanoise has joined #ruby-lang
stiang has joined #ruby-lang
hackeron has joined #ruby-lang
rubarlion has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
sailias has joined #ruby-lang
outoftime has joined #ruby-lang
rubarlion has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
nathanstitt has joined #ruby-lang
rubarlion has joined #ruby-lang
outoftime has quit [Read error: Connection reset by peer]
Alt-255 has joined #ruby-lang
BMF has joined #ruby-lang
melter has joined #ruby-lang
macmartine has joined #ruby-lang
sailias has quit [Quit: Leaving.]
jtoy has quit [Quit: jtoy]
gsav has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
tbuehlmann has joined #ruby-lang
jtoy has joined #ruby-lang
rubarlion has joined #ruby-lang
outoftime has joined #ruby-lang
headius has joined #ruby-lang
jtoy has quit [Quit: jtoy]
CrazyHorse181 has quit [Ping timeout: 256 seconds]
wallerdev has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
outoftime has quit [Ping timeout: 245 seconds]
pbjorklund has quit [Ping timeout: 255 seconds]
lcdhoffman has joined #ruby-lang
Fiel has left #ruby-lang [#ruby-lang]
jtoy has joined #ruby-lang
BMF has left #ruby-lang [#ruby-lang]
BMF has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
Nisstyre-laptop has quit [Quit: Leaving]
rubarlion has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
rubarlion has joined #ruby-lang
ricardovaleriano has quit [Remote host closed the connection]
ricardovaleriano has joined #ruby-lang
ricardovaleriano has quit [Remote host closed the connection]
ricardovaleriano has joined #ruby-lang
tenderlove has joined #ruby-lang
brianpWins has joined #ruby-lang
RegEchse has joined #ruby-lang
BMF has quit [Remote host closed the connection]
rubarlion has quit [Read error: Connection reset by peer]
tenderlove has quit [Ping timeout: 255 seconds]
rubarlion has joined #ruby-lang
d-best has quit [Quit: Reconnecting]
d-snp has joined #ruby-lang
brahmana has joined #ruby-lang
headius has quit [Quit: headius]
rubarlion has quit [Read error: Connection reset by peer]
rubarlion has joined #ruby-lang
stiang has quit [Quit: stiang]
rubarlion has quit [Read error: Connection reset by peer]
A124 has quit [Quit: Leaving.]
_7894 has quit [Quit: Odcházím]
rubarlion has joined #ruby-lang
Alt-255 has quit [Ping timeout: 246 seconds]
mixtli_ has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
rubarlion has joined #ruby-lang
mixtli_ has quit [Ping timeout: 256 seconds]
ricardovaleriano has quit [Remote host closed the connection]
sepp2k1 has joined #ruby-lang
ricardovaleriano has joined #ruby-lang
mixtli has joined #ruby-lang
sepp2k has quit [Ping timeout: 246 seconds]
<brahmana> Hi all
<brahmana> Is it a good idea to try and use throw-catch instead of a return value and an if-else to check for the return value?
mixtli___ has joined #ruby-lang
mixtli has quit [Read error: Connection reset by peer]
mixtli___ is now known as mixtli
<brahmana> I initially thought of using exceptions, but it might a little too heavy for the use case.
<brahmana> Throw-catch on the other hand is a lot lighter.
<brahmana> But the problem is catching multiple symbols. Any idea on how to go about it?
jtoy has quit [Quit: jtoy]
ricardovaleriano has quit [Ping timeout: 255 seconds]
<Mon_Ouie> You didn't paste any code, but if you can simply use the return value to say what to do, that's most likely what you should do
lsegal has joined #ruby-lang
<brahmana> Yeah. I was actually writing some pseudocode in the pastebin when it occured to me that I can't use throw-catch
<brahmana> Even if I were to do something like catch(:one, :two, :three) I would still need to check which symbol I caught
rubarlion has quit [Ping timeout: 260 seconds]
lonelydimple has joined #ruby-lang
<Mon_Ouie> You can stored_symbol = catch(:error) and use throw :error, :argument
<Mon_Ouie> But it's most likely using throw/catch is a bad idea
workmad3 has joined #ruby-lang
datanoise has quit [Ping timeout: 244 seconds]
<brahmana> And I believe raising exceptions is also not a good idea either, right?
<Mon_Ouie> Exceptions, as their name implies, are for exceptional events — such as IO errors — not things that are supposed to happen
datanoise has joined #ruby-lang
<brahmana> right.. will stick to return value and if-else
<brahmana> Although out of curiosity, how did you say I can achieve something like this http://pastie.org/4864247 with throw-catch ?
<lianj> brahmana: "rails StandardError"
crackity_jones has joined #ruby-lang
yats has quit [Ping timeout: 248 seconds]
<brahmana> lianj: I am sorry, I don't quite follow that.
diegoviola has joined #ruby-lang
Jork1 has quit [Quit: Jork1]
lonelydimple has quit [Ping timeout: 255 seconds]
Jork1 has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
jxie has joined #ruby-lang
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
yats has joined #ruby-lang
ryanf has joined #ruby-lang
milestone has joined #ruby-lang
JuanMiguel has joined #ruby-lang
JuanMiguel has left #ruby-lang [#ruby-lang]
rubarlion has joined #ruby-lang
nathanstitt has quit [Quit: nathanstitt]
micaeked has joined #ruby-lang
tenderlove has joined #ruby-lang
crackity_jones has quit [Quit: Computer has gone to sleep.]
stiang has joined #ruby-lang
tenderlove has quit [Ping timeout: 256 seconds]
rubarlion has quit [Read error: Connection reset by peer]
milestone has quit [Quit: milestone]
rubarlion has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
Asher has quit [Remote host closed the connection]
rubarlion has joined #ruby-lang
crackity_jones has joined #ruby-lang
workmad3 has quit [Ping timeout: 260 seconds]
BMF has joined #ruby-lang
Asher has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
crackity_jones has quit [Quit: Computer has gone to sleep.]
YayMe has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
alex_k has joined #ruby-lang
crackity_jones has joined #ruby-lang
havenn has joined #ruby-lang
xyzodiac has joined #ruby-lang
seoaqua has joined #ruby-lang
brianpWins has quit [Ping timeout: 256 seconds]
<burgestrand> brahmana: he was just nitpicking about the raise call, not providing any input.
rubarlion has quit [Read error: Connection reset by peer]
rubarlion has joined #ruby-lang
ananna has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
davidboy has joined #ruby-lang
brahmana has quit [Quit: Page closed]
anannie has quit [Ping timeout: 246 seconds]
enebo has joined #ruby-lang
xyzodiac has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
BMF has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 248 seconds]
wallerdev has quit [Quit: wallerdev]
BMF has joined #ruby-lang
justinseiter has joined #ruby-lang
milestone has joined #ruby-lang
chimkan has joined #ruby-lang
rubarlion has quit [Read error: Connection reset by peer]
znowi has quit []
rubarlion has joined #ruby-lang
datanoise has quit [Ping timeout: 252 seconds]
rubarlion has quit [Client Quit]
burgestrand has quit [Ping timeout: 245 seconds]
seoaqua has quit [Ping timeout: 240 seconds]
wallerdev has joined #ruby-lang
Kuukunen- has quit [Quit: leaving]
Kuukunen has joined #ruby-lang
tenderlove has joined #ruby-lang
yats has quit [Ping timeout: 256 seconds]
alex_k has quit [Quit: Lost terminal]
corecode has joined #ruby-lang
<corecode> hi
<corecode> any idea why bundler keeps installing an older version of a gem?
<bougyman> because bundler sucks
<micaeked> corecode: try "bundle update"
tenderlove has quit [Ping timeout: 240 seconds]
chimkan has quit [Remote host closed the connection]
<corecode> yea, bundle update shows a newer version
<corecode> but it doesn't change Gemfile.lock
<micaeked> corecode: try removing Gemfile.lock
chimkan_ has joined #ruby-lang
<corecode> hm
<corecode> it doesn't even show the updated version
<micaeked> corecode: post the line from the Gemfile
<corecode> gem 'pygments.rb', '~> 0.2.12'
<micaeked> corecode: try getting rid of the version
<corecode> pygments.rb (0.3.1, 0.2.13)
<corecode> so... 0.3.1 is not ~> 0.2.12?
<micaeked> corecode: no, just get rid of the version entirely if you want it to use the latest
<micaeked> corecode: gem 'pygments.rb'
<corecode> weird
<corecode> that works
<corecode> but why?
<micaeked> corecode: info on version specifiers: http://docs.rubygems.org/read/chapter/16#page74
tRAS has quit [Quit: Mother, did it need to be so high?]
lcdhoffman has quit [Quit: lcdhoffman]
cmaxw_ has joined #ruby-lang
bastilian has quit [Read error: Connection reset by peer]
bastilian has joined #ruby-lang
bastilian has quit [Client Quit]
datanoise has joined #ruby-lang
cmaxw has quit [Ping timeout: 265 seconds]
cmaxw_ has quit [Ping timeout: 256 seconds]
tRAS has joined #ruby-lang
outoftime has joined #ruby-lang
cirenyc has quit [Ping timeout: 246 seconds]
outoftime has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 256 seconds]
brianpWins has joined #ruby-lang
workmad3 has joined #ruby-lang
BMF has quit [Remote host closed the connection]
cmaxw has joined #ruby-lang
lcdhoffman has joined #ruby-lang
sepp2k1 has quit [Remote host closed the connection]
stiang has quit [Quit: stiang]
rue|w has joined #ruby-lang
crudson has left #ruby-lang [#ruby-lang]
datanoise has joined #ruby-lang
tenderlove has joined #ruby-lang
rue|w has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 246 seconds]
YayMe has quit [Ping timeout: 246 seconds]
Carnage\ has quit []
xyzodiac has quit [Quit: Computer has gone to sleep.]
tRAS has quit [Quit: Mother, did it need to be so high?]
crackity_jones has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
gmg85 has joined #ruby-lang
xyzodiac has joined #ruby-lang
<gmg85> was there a change to the case statement syntax from ruby 1.8.x to ruby 1.9.x?
<workmad3> not afaik
<ddfreyne> I think the : after the when (and the then in if statements) is no longer accepted
canton7 has quit [Ping timeout: 244 seconds]
<workmad3> ddfreyne: the 'then' is still fine
<gmg85> ddfreyne: let me try that
<workmad3> I never used : in case statements in ruby though, but yes it seems that is a change :)
<gmg85> it works!
<gmg85> i removed the when
<gmg85> i removed the : i mean :)
<workmad3> :)
Hakon has joined #ruby-lang
gmg85 has quit [Ping timeout: 252 seconds]
havenn has joined #ruby-lang
diegoviola has quit [Quit: Reconnecting]
diegoviola has joined #ruby-lang
ryanf has joined #ruby-lang
mastersrp has joined #ruby-lang
<mastersrp> Hello! I've got a question that might seem silly. Say I have a variable "var", whose value is the name of a module. In that module resides a function (let's call it main, just for simplicity). I want to call that function, but I can't predict the module name. How would I do this?
brianpWins has quit [Ping timeout: 245 seconds]
undersc0re97 has joined #ruby-lang
undersc0re97 has quit [Changing host]
undersc0re97 has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
ryanf_ has joined #ruby-lang
jtoy has joined #ruby-lang
jtoy has quit [Client Quit]
VegetableSpoon has quit [Ping timeout: 248 seconds]
Jork1 has quit [Quit: Jork1]
m3nd3s has quit [Remote host closed the connection]
tbuehlmann has quit [Remote host closed the connection]
<havenn> mastersrp: If you have a local variable referencing the module, call the method directly on the local variable.
<havenn> mastersrp: If that is what you mean by "can't predict the module name"?
lcdhoffman has quit [Quit: lcdhoffman]
rue|w has joined #ruby-lang
havenn has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
rue|w has quit [Ping timeout: 245 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-rc2)]
<mastersrp> Hello! I've got a question that might seem silly. Say I have a variable "var", whose value is the name of a module. In that module resides a function (let's call it main, just for simplicity). I want to call that function, but I can't predict the module name. How would I do this? The variable does NOT reference the module, only it's name in the form of a string.
<mastersrp> The module resides in an external file, which is then required.
goshakkk has quit [Quit: Computer has gone to sleep.]
mistym has quit [Remote host closed the connection]
havenn has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
thone_ has joined #ruby-lang
kain has quit [Ping timeout: 260 seconds]
thone has quit [Ping timeout: 240 seconds]
RegEchse has joined #ruby-lang
justinseiter has quit [Ping timeout: 240 seconds]
<andrewvos> mastersrp: Did you by any chance lose connection for a bit?
cmaxw has quit [Quit: cmaxw]
snorkdude has joined #ruby-lang
justinseiter has joined #ruby-lang
datanoise has joined #ruby-lang
kain has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
datanoise has quit [Ping timeout: 248 seconds]
chimkan_ has quit [Quit: chimkan_]
<rue> mastersrp: Use a policy or convention.
datanoise has joined #ruby-lang
kain has quit [Ping timeout: 256 seconds]
jamjam has quit [Ping timeout: 245 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-rc2)]
datanoise has quit [Ping timeout: 246 seconds]
macmartine has joined #ruby-lang
agarie has joined #ruby-lang
Criztian has joined #ruby-lang
ananna has quit [Remote host closed the connection]
milestone has quit [Quit: milestone]
Jork1 has joined #ruby-lang
solars has quit [Ping timeout: 255 seconds]
<Harzilein> heftig: thanks for that one too
<matti> ;]
slicekick has joined #ruby-lang
kain has joined #ruby-lang
<zzak> hi matti
snorkdude has quit [Ping timeout: 246 seconds]
<matti> Hi zzak
<matti> zzak: Guess long this will take:
<matti> krzysztof@samsung:~$ time ruby -rrubygems -e 'require "fizzbuzz" ; p FB.new(1, 1_000_000_000_000).each {|i| p [i, i.class] }' > fizzbuzz.log
<matti> ;d
cantonic has quit [Quit: cantonic]
<matti> Whops.
<matti> I may run out of space on HDD before this will finish.
<matti> krzysztof@samsung:~$ wc -l fizzbuzz.log
<matti> 15873942 fizzbuzz.log
cantonic has joined #ruby-lang
ryanf_ has quit [Quit: leaving]
kain has quit [Ping timeout: 246 seconds]
slicekick has quit [Remote host closed the connection]
snorkdude has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
justinseiter has quit [Ping timeout: 255 seconds]
<zzak> nice
macmartine has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
ricardovaleriano has joined #ruby-lang
mixtli has quit [Quit: mixtli]
RegEchse has joined #ruby-lang
havenn has joined #ruby-lang
cantonic has quit [Quit: cantonic]
kain has joined #ruby-lang
mistym has quit [Ping timeout: 260 seconds]
kain has quit [Ping timeout: 255 seconds]
ivanoats has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
Madis_ has quit [Quit: ChatZilla 0.9.89 [Firefox 11.0/20120313180949]]
Alexp has joined #ruby-lang
mastersrp has quit [Ping timeout: 246 seconds]
Alexp is now known as Guest84598