apeiros changed the topic of #ruby-lang to: Ruby 1.9.3-p374: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
havenn has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
<zenspider> andrewvos: when I was running a top 10 most complex projects list puppet was always #1
<zenspider> it IS too much code
<zenspider> anyone have jruby handy?
datanoise has quit [Ping timeout: 246 seconds]
chuenjin has quit [Quit: leaving]
unlikely_monkey has joined #ruby-lang
havenn has quit [Ping timeout: 255 seconds]
chuenjin has joined #ruby-lang
bzalasky has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
methods1 has joined #ruby-lang
methods1 has left #ruby-lang [#ruby-lang]
jonahR has joined #ruby-lang
jnoon has joined #ruby-lang
elico has quit [Quit: Elico]
serhart has left #ruby-lang [#ruby-lang]
sailias has joined #ruby-lang
havenn has joined #ruby-lang
musl has quit [Remote host closed the connection]
kuja has joined #ruby-lang
musl has joined #ruby-lang
datanoise has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
tdy_ has joined #ruby-lang
swav has joined #ruby-lang
datanoise has quit [Read error: Operation timed out]
dustint has joined #ruby-lang
enebo has quit [Quit: enebo]
brianpWins has quit [Quit: brianpWins]
marr has quit [Ping timeout: 245 seconds]
__butch__ has quit [Quit: Leaving.]
sailias has quit [Quit: Leaving.]
waffleau_ has joined #ruby-lang
apeiros_ has joined #ruby-lang
toretore has quit [Quit: Leaving]
apeiros_ has quit [Ping timeout: 248 seconds]
<crankharder> a = [1,2,3] ; l = lambda{|a| a ** 2} ; how do I pass the lambda to something liek Array#map?
<crankharder> so, output would be the same as [1,2,3].map{|a| a**2}
<zenspider> toproc it
<zenspider> a.map(&l) or a.map(l.to_proc)
<zenspider> err... I think you still need the ampersand in the latter to make sure it gets passed as the block
<crankharder> ty
brianpWins has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
dustint has quit [Remote host closed the connection]
havenn has joined #ruby-lang
tdy_ has quit [Quit: WeeChat 0.4.0]
swav has quit [Read error: Connection reset by peer]
swav has joined #ruby-lang
Rakko has joined #ruby-lang
dustint has joined #ruby-lang
waffleau_ has quit [Quit: waffleau_]
havenn has quit [Ping timeout: 245 seconds]
cirenyc has joined #ruby-lang
sandbags has quit [Remote host closed the connection]
io_syl has quit [Read error: Operation timed out]
brianpWins has quit [Quit: brianpWins]
emocakes has quit [Quit: emocakes]
CapnKernul has joined #ruby-lang
io_syl has joined #ruby-lang
Bearproof has joined #ruby-lang
waffleau has joined #ruby-lang
Bearproof has left #ruby-lang [#ruby-lang]
cjs226 has quit []
mjio has quit []
waffleau has quit [Client Quit]
xalei has quit [Remote host closed the connection]
blazes816 has quit [Quit: blazes816]
cjs226 has joined #ruby-lang
CapnKernul has quit [Quit: Leaving...]
spuk has quit [Ping timeout: 245 seconds]
spuk has joined #ruby-lang
itsmeduncan has joined #ruby-lang
sush24 has joined #ruby-lang
mjio has joined #ruby-lang
esad has quit [Quit: Computer has gone to sleep.]
bzalasky has joined #ruby-lang
ryez has joined #ruby-lang
havenn has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
joevandyk has quit [Quit: joevandyk]
bzalasky has quit [Remote host closed the connection]
setmeaway has quit [Quit: Leaving]
sepp2k1 has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
CapnKernul has joined #ruby-lang
jbsan has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Ping timeout: 248 seconds]
jxie has quit [Ping timeout: 248 seconds]
jxie has joined #ruby-lang
lsegal has joined #ruby-lang
vlad_starkov has joined #ruby-lang
kotp has quit [Ping timeout: 248 seconds]
jonahR has quit [Quit: jonahR]
gregmore_ has joined #ruby-lang
Rarrikins has joined #ruby-lang
Rarrikins_x_k_m_ has quit [Ping timeout: 246 seconds]
gregmore_ has quit [Read error: Operation timed out]
dmwuw has quit [Remote host closed the connection]
CapnKernul has quit [Read error: Connection reset by peer]
jstultz_ has quit [Ping timeout: 260 seconds]
karasawa has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
Gary13579 has joined #ruby-lang
kotp has joined #ruby-lang
Gary13579 has left #ruby-lang [#ruby-lang]
rsl has quit [Quit: Computer has gone to sleep.]
itsmeduncan has quit [Quit: itsmeduncan]
Rarrikins has quit [Ping timeout: 256 seconds]
itsmeduncan has joined #ruby-lang
Rarrikins has joined #ruby-lang
Rarrikins_d has joined #ruby-lang
itsmeduncan has quit [Client Quit]
alvaro_o has quit [Quit: Ex-Chat]
itsmeduncan has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
io_syl has quit [Quit: Textual IRC Client: www.textualapp.com]
Rarrikins has quit [Ping timeout: 248 seconds]
itsmeduncan has quit [Client Quit]
Rarrikins_d has quit [Remote host closed the connection]
jonahR has joined #ruby-lang
bzalasky has joined #ruby-lang
glebm has quit [Ping timeout: 244 seconds]
ivanoats has joined #ruby-lang
pcboy_ has quit [Remote host closed the connection]
bryno has quit [Ping timeout: 256 seconds]
pcboy_ has joined #ruby-lang
bryno has joined #ruby-lang
ViPi has quit [Quit: Computer has gone to sleep.]
krz has joined #ruby-lang
xalei has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
srbaker has joined #ruby-lang
CapnKernul has joined #ruby-lang
CapnKernul has quit [Read error: Connection reset by peer]
io_syl has joined #ruby-lang
tomzx_mac has joined #ruby-lang
thufir_ has quit [Quit: Leaving.]
vlad_starkov has quit [Remote host closed the connection]
karasawa has quit [Ping timeout: 256 seconds]
ViPi has joined #ruby-lang
dustint has quit [Ping timeout: 252 seconds]
namidark has quit [Quit: WeeChat 0.3.2]
ivanoats has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
headius has joined #ruby-lang
cirenyc has joined #ruby-lang
cirenyc has quit [Remote host closed the connection]
dwu1 has joined #ruby-lang
havenn has quit [Remote host closed the connection]
karasawa has joined #ruby-lang
havenn has joined #ruby-lang
JohnBat26 has joined #ruby-lang
havenn has quit [Ping timeout: 244 seconds]
karasawa has quit [Ping timeout: 260 seconds]
benolee has joined #ruby-lang
benolee has quit [Client Quit]
CapnKernul has joined #ruby-lang
unlikely_monkey has quit [Remote host closed the connection]
stonerfish has joined #ruby-lang
unlikely_monkey has joined #ruby-lang
CapnKernul has quit [Read error: Connection reset by peer]
levifig has quit [Excess Flood]
levifig has joined #ruby-lang
unlikely_monkey has quit [Remote host closed the connection]
karasawa has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
agile has joined #ruby-lang
vlad_starkov has joined #ruby-lang
lcdhoffman has joined #ruby-lang
lcdhoffman has quit [Client Quit]
__DOGBERT__ has joined #ruby-lang
__DOGBERT__ has quit [Client Quit]
srbaker has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Ping timeout: 256 seconds]
karasawa has quit [Ping timeout: 252 seconds]
waffleau has joined #ruby-lang
CapnKernul has joined #ruby-lang
towski has joined #ruby-lang
gregmoreno has joined #ruby-lang
<freedrull> hmmmm kind of using require_relative everywhere now (aside from requiring installed gems).....any drawbacks???
CapnKernul has quit [Read error: No route to host]
nazty has quit [Read error: Connection reset by peer]
nignaztic has joined #ruby-lang
havenn has joined #ruby-lang
datanoise has joined #ruby-lang
mossplix has joined #ruby-lang
karasawa has joined #ruby-lang
stardiviner has joined #ruby-lang
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
unlikely_monkey has joined #ruby-lang
karasawa has quit [Ping timeout: 272 seconds]
rippa has joined #ruby-lang
havenn has quit [Ping timeout: 256 seconds]
datanoise has quit [Ping timeout: 260 seconds]
mosesaro has quit [Remote host closed the connection]
setmeaway has joined #ruby-lang
karasawa has joined #ruby-lang
Zissler has quit [Ping timeout: 256 seconds]
chuenjin has quit [Ping timeout: 244 seconds]
mercwithamouth has quit [Ping timeout: 252 seconds]
mistym has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 276 seconds]
kurko_ has quit [Quit: Computer has gone to sleep.]
datanoise has joined #ruby-lang
waffleau has left #ruby-lang [#ruby-lang]
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
datanoise has quit [Ping timeout: 248 seconds]
mjio has quit []
bzalasky has quit [Remote host closed the connection]
tomzx_mac has quit [Ping timeout: 248 seconds]
mossplix has quit [Quit: mossplix]
Rakko has quit [Quit: This computer has gone to sleep]
Nisstyre has quit [Ping timeout: 246 seconds]
<ryanf> freedrull: lots of people don't like require_relative because it makes your directory structure rigid
<ryanf> moving a file means rewriting all of its requires in addition to the things that require it
mrsolo has joined #ruby-lang
<ryanf> but in a case where you'd instead be doing like "require File.expand_path(blah blah __FILE__ blah blah"
<ryanf> I don't think there's a downside
datanoise has joined #ruby-lang
mossplix has joined #ruby-lang
psycho_one has joined #ruby-lang
Nisstyre has joined #ruby-lang
tms_ has joined #ruby-lang
retro|cz has quit [Remote host closed the connection]
mrsolo has quit [Quit: Leaving]
retro|cz has joined #ruby-lang
headius has quit [Quit: headius]
ramonmaruko has quit [Ping timeout: 252 seconds]
ramonmaruko has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
dkannan has joined #ruby-lang
datanoise has quit [Ping timeout: 260 seconds]
Rakko has joined #ruby-lang
dhruvasagar has joined #ruby-lang
workmad3 has joined #ruby-lang
zmack has joined #ruby-lang
S1kx has joined #ruby-lang
<mfn> hi
waffleau has joined #ruby-lang
S1kx has quit [Quit: Leaving]
datanoise has joined #ruby-lang
dzhulk has quit [Quit: Leaving.]
andrewhl has quit [Remote host closed the connection]
tonni_ has joined #ruby-lang
chrismcgh has joined #ruby-lang
foca has quit [Ping timeout: 276 seconds]
zz_chrismcg has quit [Ping timeout: 276 seconds]
guilleiguaran has quit [Ping timeout: 276 seconds]
znz_jp has quit [Ping timeout: 276 seconds]
eban has quit [Ping timeout: 276 seconds]
Silex has quit [Ping timeout: 276 seconds]
eban1 has joined #ruby-lang
Silex^^ has joined #ruby-lang
tonni has quit [Ping timeout: 276 seconds]
foca has joined #ruby-lang
znz_jp has joined #ruby-lang
psycho_one has quit [Ping timeout: 240 seconds]
io_syl has quit [Ping timeout: 248 seconds]
datanoise has quit [Ping timeout: 256 seconds]
unlikely_monkey has quit [Remote host closed the connection]
towski has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
dc5ala has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
dhruvasagar has joined #ruby-lang
<Rakko> hi mfn
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
charliesome has joined #ruby-lang
megha has joined #ruby-lang
bzalasky has joined #ruby-lang
ryanf has quit [Quit: leaving]
tenderlove has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
marr has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
dhsmith has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
yorickpeterse has quit [Quit: Who cares about these quit messages?]
tenderlove has joined #ruby-lang
Silex^^ is now known as Silex
tenderlove has quit [Read error: Connection reset by peer]
yorickpeterse has joined #ruby-lang
tenderlove has joined #ruby-lang
bondar has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
LanceHaig has joined #ruby-lang
dr_bob has joined #ruby-lang
bondar has quit [Ping timeout: 256 seconds]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
S1kx has joined #ruby-lang
Sinestro has quit [Quit: Computer has gone to sleep.]
rue|w has joined #ruby-lang
pbjorklund has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
ten1 has quit [Ping timeout: 252 seconds]
Averna has quit [Quit: Leaving.]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
rue|w has quit [Read error: Connection reset by peer]
rue|w has joined #ruby-lang
ryanf has joined #ruby-lang
dzhulk has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 248 seconds]
havenn has joined #ruby-lang
<manveru> i try to keep all my requires in one place, not spread through the whole tree
<manveru> lib/name.rb <- there they belong :)
<manveru> and then require_relative is no harder than require
pbjorklund has quit [Quit: oh no]
<injekt> and if its a gem just use require anyway because ./lib is in the load path
<Spaceghost|cloud> I prefer just adjusting the ruby path.
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
<yorickpeterse> injekt: not when you don't actually package it as a gem
<manveru> i don't trust people to not screw up $RUBYLIB
<manveru> or $LOAD_PATH
<Spaceghost|cloud> I don't trust people ever.
<injekt> yorickpeterse: so.. not a gem them :P
<manveru> i said lib
<Spaceghost|cloud> I still prefer adjusting the load path.
<manveru> not all my libs are gems
<yorickpeterse> injekt: if you make a Gem it doesn't modify $: until you actually create a .gem file and require it. That means that when running tests and such you still have to take care of that
wallerdev has quit [Quit: wallerdev]
<injekt> mine either, and in those i would do things differently, but there's NEVER any reason to mess with the load path
stardiviner has joined #ruby-lang
<manveru> tell that to the people that do :P
<injekt> ruby has an -I switch for a reason
havenn has quit [Ping timeout: 244 seconds]
<Spaceghost|cloud> Why not?
<injekt> ^^
<manveru> see
<Spaceghost|cloud> In code you own and write, what's wrong with adding to the load path?
<yorickpeterse> tbh I don't really mind it that much as long as it doesn't go beyond `$:.unshift(...) unless $:.include?(...)`
<injekt> Spaceghost|cloud: it's almost never necessary so i rarely see the point
<Spaceghost|cloud> Development?
<injekt> back to ruby -I
<manveru> export RUBYLIB=/path/to/your/lib
<Spaceghost|cloud> I guess I can see your point for that.
<injekt> or that but I rarely use RUBYLIB
<manveru> or -I, but that's more cumbersome for rake and the like
<injekt> yeah
<Spaceghost|cloud> I don't really see the major benefits.
<yorickpeterse> Yes, lets require people to export variables when they can really just run `ruby whatever.rb` instead. Either way, it's a preference so there's no real point in iscussing it
<yorickpeterse> * discussing
<injekt> tbh I dont really care, but I want to punch every person EVER for modifying the load path in their executable files
<injekt> when they're gems
<manveru> oldie but i use it almost every day
<Spaceghost|cloud> I don't do it in the executable so much as the typical gemname.rb file.
<Spaceghost|cloud> The one I typically require everything else into.
solars has joined #ruby-lang
<injekt> yeah that's just as pointless :D
<Spaceghost|cloud> takes less work than dealing with your alternatives. :)
<injekt> if it's a gem, the lib path is already in your load path so you're just adding a duplicate
<andrewvos> zenspider: Yeah it is just too enterprisey. Too much code, too little payoff.
<Spaceghost|cloud> It's in development, so it's not really a gem at that point.
<injekt> right, I'm talking about published gems
<Spaceghost|cloud> I don't see the value in not modifying the load path yet. I hear your desire to not do it, but I can't buy into it and join you in your distaste for it without you giving us that information.
zmack has quit [Read error: Connection reset by peer]
zmack has joined #ruby-lang
Rakko has quit [Quit: Bye]
<Spaceghost|cloud> I understand that a gem is in the load path automatically.
dr_bob has quit [Quit: Leaving.]
jxie has quit [Quit: leaving]
<yorickpeterse> Hence I said it's fine when you only add it when it's not already there
<yorickpeterse> Other than that it just feels like one of those "I don't agree with it, thus it's wrong" arguments
<Spaceghost|cloud> yorickpeterse: I understand your point. I'm kinda curious about injekt's, as I've been reading his stuff for a while now and respect his opinion.
<Spaceghost|cloud> Not that I don't respect yours. I'm trying to learn more awesome stuff.
eban1 has quit [Quit: WeeChat 0.3.8]
eban has joined #ruby-lang
<yorickpeterse> Oh I'm not trying to defend myself or anything :)
<Spaceghost|cloud> yorickpeterse: I personally agree with you.
<manveru> well, look at it that way, adding to $LOAD_PATH in your lib adds it to every lib that requires it, and ruby has to make one more file lookup for every require
emocakes has joined #ruby-lang
<yorickpeterse> Correct, but if you do it after loading all your dependencies (= third party gems and such) it doesn't add a lot of overhead
<Spaceghost|cloud> manveru: So you would suggest using relative_require's as a way to mitigate extra require time?
<manveru> using require_relative, you don't have to worry whether it's a gem or not, you don't waste time adjusting $LOAD_PATH, you don't add lookup overhead, you just do what you need to
<Spaceghost|cloud> Even with ruby2's nifty require lookup improvements?
<Spaceghost|cloud> manveru: Requires a lot of time dealing with stupid stuff with the path to the file I want to require though.
<Spaceghost|cloud> After it's done though, I guess that's all the time you invest.
<manveru> you write it once, and you change it if you rename the file, same as normal require
<Spaceghost|cloud> manveru: And if you move things, you have to change everything that uses it, relative to the file's location.
<manveru> and just because ruby becomes faster doesn't mean we can do more pointless stuff :P
<manveru> that's why i say, don't spread your requires all through your codebase
<Spaceghost|cloud> As opposed to modifying the load path, which is a bit of a sed invcation.
<Spaceghost|cloud> manveru: I guess. Yeah.
<Spaceghost|cloud> I wonder, I may go test it in a large app. Add some code in lib/ and do each with benchmarks perhaps.
<manveru> do so :)
<manveru> mind you, i'm an old timer, and it was way worse in 1.8
<manveru> 1.9 sped up requires a bit, 1.9.3 even more
<rue|w> Wait, 1.8 counts as old-timey now?
<Spaceghost|cloud> manveru: I don't think you're wrong. Maybe it's my lack of zen that makes me not want to care that a file I want may be in ../../ or ../../../whatever
<manveru> since nobody uses 1.6 anymore, sure
<manveru> then again, 1.8 has no require_relative
<manveru> so the point is rather silly :)
emocakes has quit [Quit: emocakes]
judofyr has joined #ruby-lang
chuenjin has joined #ruby-lang
<Spaceghost|cloud> manveru: So in development only, I would like to think that the cost isn't high enough to deal with require_relative. Is it cheaper to use require_relative in a gem not in development if it's already going to be in the load path?
<manveru> es
<manveru> *yes
<Spaceghost|cloud> So relative_requires are just inherently cheaper to use rather than load path, that makes sense.
<manveru> because ruby can go directly to the file that needs to be required instead of walking through all the gems and $LOAD_APTH
<manveru> that's why some rails apps have startup times in the minutes :P
<Spaceghost|cloud> sorry got that backwards. require_relative
<Spaceghost|cloud> It's 4am here.
gjaldon has joined #ruby-lang
<manveru> np
<Spaceghost|cloud> manveru: True. That makes sense.
tenderlove has joined #ruby-lang
KM|2 has quit [Read error: Connection reset by peer]
blacktulip has joined #ruby-lang
<manveru> i'm not saying that it's the best thing in every case, it's just what i do
<Spaceghost|cloud> It makes sense though.
waffleau has quit [Read error: Connection reset by peer]
waffleau has joined #ruby-lang
<Spaceghost|cloud> injekt: So, you use require_relative a lot then?
waffleau_ has joined #ruby-lang
waffleau has quit [Read error: Connection reset by peer]
<Spaceghost|cloud> manveru, injekt, yorickpeterse: Thank you. :D
<yorickpeterse> np
<manveru> you're welcome :)
<Spaceghost|cloud> manveru: So the benefits of require_relative would cascade downwards to users of the gem as well, right?
<judofyr> manveru: the reason Rails apps have startup time in the minutes is that RubyGems is totally retarded when it comes it storing specifications :)
<Spaceghost|cloud> Cause if that's true. And I think that's what you said, I think I just bought in.
<manveru> judofyr: ok, that too :P
<Spaceghost|cloud> Man, just bundle exec on anything sometimes takes forever.
<manveru> but in general it would help if people wouldn't require dozends of gems
<Spaceghost|cloud> manveru: The culture in rails is "Look for a gem, then look on the internet, avoid writing anything at all costs, even if it would have taken you less time to write it."
<judofyr> not sure if my little hack still works with the latest Bundler: https://github.com/judofyr/quickgem
<Spaceghost|cloud> Assuming that someone else having written it is any guarantee of it being managed by someone else.
<manveru> i don't think the problem was visible when rubygems was first created... the usual app i worked on had maybe 2-3 dependencies
dr_bob has joined #ruby-lang
<manveru> well, usually you end up maintaining your dependencies at some point :P
<manveru> that's why i like stuff that's been stable for a few years
<Spaceghost|cloud> judofyr: Have you already been shot down by fowlduck on this? :D
<judofyr> Spaceghost|cloud: fowlduck?
<Spaceghost|cloud> judofyr: Nate. rubygems bro.
<manveru> of course, "stable" in the rails world is equal with "dead"...
<Spaceghost|cloud> manveru: Unless you're using jruby!
<Spaceghost|cloud> Then it's "really dead, but I'm sure I can make it work"
<manveru> lol
<manveru> i've tried making soap4r work with jruby once... fun times
<Spaceghost|cloud> judofyr: Nate Sutton.
<manveru> was way quicker writing it in handsoap from scratch :(
<rue|w> judofyr: @fowlduck.
<judofyr> Spaceghost|cloud: I did wrote a message on rubygems-devel, but nobody picked it up: http://rubyforge.org/pipermail/rubygems-developers/2012-September/006988.html
<Spaceghost|cloud> manveru: I just don't even want to hear about. I have enough reasons to make sads without hearing about SOAPy stuf
<Spaceghost|cloud> judofyr: /query fowlduck
<Spaceghost|cloud> Or better yet, I can invite you to a channel.
<Spaceghost|cloud> judofyr: I'd talk to him, but maybe make sure your shit works with latest bundler and rubygems?
adambeynon has joined #ruby-lang
gokul has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
cultureulterior_ has joined #ruby-lang
sush24 has joined #ruby-lang
cultureulterior_ has quit [Ping timeout: 272 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
guilleiguaran has joined #ruby-lang
wizonesolutions has joined #ruby-lang
datanoise has joined #ruby-lang
waffleau_ has quit [Quit: waffleau_]
socialcoder has joined #ruby-lang
kcassidy has joined #ruby-lang
<socialcoder> please see that
<socialcoder> why does one give answer below the threshold number and the other above?
<socialcoder> I was expecting an answer of 128 and 64, and if 64 then not 1024 for second one, but below 1000
<socialcoder> * 128 and not 64
karasawa has quit [Ping timeout: 246 seconds]
<judofyr> socialcoder: in the first example you puts *before* you double it. in the second you puts *after*
<socialcoder> wow, that makes a difference eh?
datanoise has quit [Ping timeout: 272 seconds]
<judofyr> socialcoder: ehm. "x = 1; puts x; x = 2" is different from "x = 1; x = 2; puts x", yes
<judofyr> socialcoder: x in the first example *is* 128
<socialcoder> ok kewl
<judofyr> socialcoder: you just puts the previous x :)
tenderlo_ has joined #ruby-lang
<socialcoder> hmmm
tenderlove has quit [Read error: Connection reset by peer]
<socialcoder> feel silly asking now :)
tbuehlmann has joined #ruby-lang
<judofyr> socialcoder: :)
<socialcoder> thanks though
<socialcoder> is it ok to ignore the for-loop
<socialcoder> It has been confusing me a bit
<socialcoder> and then I just noticed, the second book I am learning from, doesn't mention for loop at all
<socialcoder> no mention anywhere in 600+ pages
<judofyr> socialcoder: for x in y; … end is pretty much always the same as y.each { |x| … }
<judofyr> socialcoder: that's really all there is to it
<socialcoder> yea, I know that, but something screws my brain when I see a for loop example...I guess I will stick to each
<judofyr> stick it each
<judofyr> nobody uses for anyway
<socialcoder> geat
<socialcoder> what is %w stand for?
<judofyr> %w(hello world) is a shortcut for ["hello", "world"]
<judofyr> or, it can also be %w|hello world|
tenderlo_ has quit [Ping timeout: 272 seconds]
<judofyr> or %w[foo bar]
<judofyr> I think the "w" is for "word"
<socialcoder> err...so it replaces bracket, double quote etc?
<judofyr> socialcoder: it creates an array of strings
<socialcoder> ah right
tenderlove has joined #ruby-lang
<socialcoder> judo
<socialcoder> if I am not asking for too much, can you please explain whats happening here
<socialcoder> i know def and end
<socialcoder> but this look a bit complicated
<judofyr> ah, blocks :)
workmad3 has joined #ruby-lang
<socialcoder> usually def name(parametparameter is replaced by something belower)
<socialcoder> here I am not following it
mossplix has quit [Quit: mossplix]
<judofyr> socialcoder: `def foo(&blk); blk; end` captures the block given to the method as an object
<judofyr> (a Proc object in fact)
<judofyr> and then you can call it later
<socialcoder> call as foo?
<judofyr> so in this case, when you call each_vowel, `code_block` would be set to `{ |vowel| puts vowel }`
karasawa has joined #ruby-lang
nXqd has joined #ruby-lang
<judofyr> (or, well, a Proc representing that block to be very specific)
<judofyr> so when the code does "code_block.call(123)" the block is invoked
<socialcoder> hmmm
ruskie has quit [Read error: Connection reset by peer]
tenderlove has quit [Ping timeout: 252 seconds]
<socialcoder> ah trust me, that one makes sense to me
ryanf has quit [Quit: leaving]
<wnd> while we're at it, I've always wondered if there's any real difference between that and this: https://gist.github.com/4593481
<judofyr> socialcoder: ah. good. I made another comment about the blocks: https://gist.github.com/4593447#comment-742596
<judofyr> wnd: nope
waffleau_ has joined #ruby-lang
<judofyr> wnd: or, this doesn't create a Proc object. but other than that, they're exactly the same
<wnd> ok, thanks
<socialcoder> what is wnd?
<socialcoder> oops
<socialcoder> haha
<socialcoder> just to clarify
<socialcoder> each_vowel(&code_block) does the ampersand mean anything?
<socialcoder> or can it be anything there
<judofyr> socialcoder: no. the ampersand is special
<socialcoder> ah, so what is it telling
<judofyr> `def each_vowel(&foo)` means that it accepts a block: each_vowel { … }
<judofyr> if it was `def each_vowel(code_block)`, then `each_vowel { … }` would give you an ArgumentError because it accepts 1 argument, but you gave it none
<judofyr> (blocks are kinda "special arguments" so they're not included in the error messages)
megha has quit [Ping timeout: 252 seconds]
security has joined #ruby-lang
esad has joined #ruby-lang
<judofyr> (e.g. `each_vowel { … } `calls the method with zero arguments and a block argument,)
<judofyr> socialcoder: so your original example just has two "levels" of blocks. you call each_vowel with a block (1), each_vowel calls #each with a block (2), the #each method calls the 2nd block and the 2nd block calls the 1st block which puts the vowel
GarethAdams has joined #ruby-lang
nkr has joined #ruby-lang
S1kx has quit [Quit: Leaving]
GarethAdams has quit [Client Quit]
cba has quit [Remote host closed the connection]
pbjorklund has joined #ruby-lang
<socialcoder> hmm, this is gonna take me sometime to digest :)
<socialcoder> I guess I will workout some examples of my own
<judofyr> yeah
<judofyr> socialcoder: have you done any JavaScript?
esad has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Quit: Lost terminal]
dhruvasagar has joined #ruby-lang
<injekt> Spaceghost|cloud: no I never use require_relative
<injekt> I use require everywhere and dont alter the load path except when running my tests
cba has joined #ruby-lang
dhruvasagar has quit [Client Quit]
dhruvasagar has joined #ruby-lang
ruskie has joined #ruby-lang
<Spaceghost|cloud> interesting.
<Spaceghost|cloud> I prefer require_relative
dwu1 has quit [Quit: Leaving.]
<injekt> i never really liked it and I'm not sure why
gjaldon has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
<socialcoder> Judo, back
<socialcoder> nope, Ruby is my entry into the world of programming
<socialcoder> did a bit of html, css before, but I know they are not related
<socialcoder> why do you ask
<judofyr> socialcoder: oki. JavaScript uses a lot of callbacks, and they are pretty similar to how blocks work in Ruby :)
<injekt> wuddup judofry
tenderlove has quit [Read error: Connection reset by peer]
chekcmate has joined #ruby-lang
<socialcoder> Ah I see
<chekcmate> hello everyone!
<judofyr> inkjet: working on some stuff and helping socialcoder with blocks :)
<socialcoder> I do wish I had that background
rolfb has joined #ruby-lang
tenderlove has joined #ruby-lang
<socialcoder> haha
<injekt> judofyr: :)
dhruvasa1ar has joined #ruby-lang
<judofyr> hello checkmate
<socialcoder> hey checkm8
<injekt> min
<injekt> mon
<injekt> ...
<injekt> moin
dhruvasa1ar has quit [Client Quit]
<chekcmate> hey judofyr hey injekt
dhruvasagar has quit [Quit: Lost terminal]
<judofyr> injekt: you're getting there
<chekcmate> moin moin heh
<socialcoder> so judo, proc, lambda, code block al are same right?
<injekt> judofyr: it's been a long morning
dhruvasagar has joined #ruby-lang
<injekt> :D
xalei has quit [Remote host closed the connection]
<judofyr> injekt: also, working on quickload.js in my spare time now.
<injekt> judofyr: yeah I noticed that, looks interesting
<socialcoder> so judo, proc, lambda, code block al are same right?
<judofyr> socialcoder: well, block is the syntax. this is a block: `{ |args| }`
<judofyr> socialcoder: a proc is an object
<judofyr> representing a block
<judofyr> a lambda is a special kind of proc
<judofyr> a lambda behaves different from a proc when it comes to `return` and such
<Spaceghost|cloud> We
<chekcmate> why won't the second one be triggered?
<judofyr> chekcmate: because only one branch will match
<injekt> chekcmate: case when is like if elseif
<socialcoder> I see
<chekcmate> but but but
<judofyr> chekcmate: also, you can just write `case; when …; when …` and it will check for truthiness for you
<injekt> so you want the second condition above the first
<chekcmate> so t he "longer" conditions have to bee above the smaller ones?
<chekcmate> generally or is this just a trick?
<chekcmate> *the be
havenn has joined #ruby-lang
francisfish has joined #ruby-lang
<injekt> it's programming logic, the first branch has more specific conditions
<injekt> the second branch will always match what the first branch would match, but it's not the other way around
<Mon_Ouie> An alternative would be to have nested cases
<chekcmate> alright, so it was just a false position?
<chekcmate> "just"
<chekcmate> but it's about positioning, right?
<injekt> yeah I would just move the second condition above and it'll work how you expect because it'll match that one first
<chekcmate> ok, because I have some more conditions...
<chekcmate> thanks again, guys!
<judofyr> anytime :)
havenn has quit [Ping timeout: 256 seconds]
b1rkh0ff has joined #ruby-lang
* injekt runs away
Criztian has joined #ruby-lang
<socialcoder> bye Judo
<socialcoder> bye all
socialcoder has quit []
dzhulk has left #ruby-lang [#ruby-lang]
<chekcmate> hmm... I don't really feel safe using that case-when logic, though it seems to work as I expect it to
<injekt> if it works as you expect why wouldn't you feel safe using it?
<chekcmate> I'm not entirely sure about the input it has to process
<chekcmate> but that'll be my problem - I'll mug you guys again when there are problems, heh
<injekt> :)
esad has joined #ruby-lang
<judofyr> injekt: def R(*a); proc { |o| o.send(*a) } end
<judofyr> injekt: much simpler :)
<injekt> but :(
<injekt> good idea on just throwing everything at send though
<judofyr> \o/
cultureulterior_ has joined #ruby-lang
pbjorklund has quit [Quit: oh no]
vesan has quit [Read error: Connection reset by peer]
vesan has joined #ruby-lang
<injekt> i am not ready for work today
security is now known as megha
<injekt> ddfreyne: you might be interested in http://stackoverflow.com/questions/14456875/nanoc-long-compile-time
<judofyr> injekt: maybe someone forgot a "sleep 20" ?
mossplix has joined #ruby-lang
<injekt> :D
<injekt> seems like it
<injekt> who wants to go through this schema and add counter_cache columns to everythign that needs it
<Spaceghost|cloud> injekt: Did you just ask for an intern?
<injekt> it appears so
<injekt> ddfreyne :)
GarethAdams has joined #ruby-lang
GarethAdams has quit [Client Quit]
GarethAdams has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
pbjorklund has joined #ruby-lang
emocakes has joined #ruby-lang
schroedinbug has quit [Ping timeout: 252 seconds]
madish has joined #ruby-lang
pbjorklund has quit [Quit: oh no]
Bearproof has joined #ruby-lang
Bearproof has quit [Client Quit]
pbjorklund has joined #ruby-lang
agnitio has joined #ruby-lang
schroedinbug has joined #ruby-lang
datanoise has joined #ruby-lang
GarethAdams has quit [Quit: Leaving...]
GarethAdams has joined #ruby-lang
datanoise has quit [Ping timeout: 244 seconds]
sepp2k has joined #ruby-lang
rsl has joined #ruby-lang
carloslopes has joined #ruby-lang
rue|w has quit [Read error: Connection reset by peer]
rue_XIW has joined #ruby-lang
krz has quit [Quit: krz]
cjs226 has quit []
Bearproof has joined #ruby-lang
Bearproof has left #ruby-lang [#ruby-lang]
rue_XIW has quit [Read error: Connection reset by peer]
<chekcmate> why nil? :(
rue|w has joined #ruby-lang
<lianj> [//, 1]
<lianj> => "1358852426.379053 open() bla.bla,bla"[/(\d{10}.\d{6})/, 1]
imperator has joined #ruby-lang
rue|w has quit [Read error: Connection reset by peer]
rue|w has joined #ruby-lang
<chekcmate> ahhh shit
<chekcmate> I forgot to tell which match, right?
<chekcmate> lianj: thanks!
<chekcmate> it's still nil ._.
rue|w has quit [Read error: Connection reset by peer]
<injekt> chekcmate: no it's not :)
rue|w has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
<chekcmate> injekt: it's not a regex problem in this case ^^
rue|w has quit [Read error: Connection reset by peer]
rue|w has joined #ruby-lang
esad has quit [Quit: Computer has gone to sleep.]
<injekt> ah
<chekcmate> alright, found the mistake :)
<chekcmate> the input wasn't modified and did not even deliver the timestamp... heh
<chekcmate> injekt: how's your project going anyways?
<injekt> chekcmate: not bad thanks, slow day today
<chekcmate> got a slowpoke in your system?
<injekt> yep
<injekt> me
<chekcmate> hah
<chekcmate> I bet your colleagues would appreciate it, seeing you in a slowpoke costume
<injekt> hah
<Spaceghost|cloud> I'm not a colleague, but I'd still like to see it.
<injekt> cant get going
banisterfiend has joined #ruby-lang
<chekcmate> that's injekt working.
<chekcmate> today ^^
<injekt> :)
<chekcmate> and when injekt is on fire, he transforms into this: http://farm4.static.flickr.com/3360/3231449064_a8507c170c.jpg
<chekcmate> now that'll get you some PR!
<chekcmate> "CEO cosplays for workers"
tms_ has quit [Quit: Konversation terminated!]
GarethAdams has quit [Quit: Leaving...]
<injekt> lol
apeiros_ has joined #ruby-lang
GarethAdams has joined #ruby-lang
havenn has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
postmodern has quit [Quit: Leaving]
iaintshine has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
havenn has quit [Ping timeout: 240 seconds]
rue_XIW has joined #ruby-lang
rue|w has quit [Read error: No route to host]
gokul has quit [Quit: Leaving]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
cjs226 has joined #ruby-lang
tdy has quit [Ping timeout: 244 seconds]
karasawa has quit [Ping timeout: 252 seconds]
karasawa has joined #ruby-lang
_paul0 has quit [Ping timeout: 245 seconds]
gjaldon has joined #ruby-lang
Criztian has quit [Ping timeout: 260 seconds]
kurko_ has joined #ruby-lang
waffleau_ has quit [Quit: waffleau_]
pbjorklund has quit [Quit: oh no]
Criztian has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
_paul0 has joined #ruby-lang
wyhaines has joined #ruby-lang
tockitj has joined #ruby-lang
tockitj has left #ruby-lang [#ruby-lang]
jxie has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
rolfb has quit [Quit: Linkinus - http://linkinus.com]
_tockitj has joined #ruby-lang
<_tockitj> how to concatenate two iterators together ?
<andrewvos> _tockitj: #zip?
<apeiros_> define 'concatenate iterators'
<_tockitj> i have two collections and want to iterate them both in one loop - once all elements of one collection are visited - it should continue to the next
<Mon_Ouie> I don't think there's a method to do it as it is but you could easily define it using Enumerator or your own class (e.g. Enumerator { |y| a.each { |e| y << e }; b.each { |e| y << e } }
<_tockitj> converting them both to arrays and adding them up might consume too much space
gjaldon has quit [Ping timeout: 276 seconds]
<Mon_Ouie> )
<Mon_Ouie> And Enumerator.new*
<apeiros_> that's how I understand it: http://pastie.org/5822158
toretore has joined #ruby-lang
<injekt> no that's nested
<injekt> i dont think he wants that?
<injekt> but who knows
<apeiros_> injekt: um, no? that's not nested
<apeiros_> and his follow-up makes it sound like that's what he wants…
<injekt> oh
<_tockitj> apeiros_, looks good - but there is nothing in core/stdlib about this ?
<injekt> i see now
<apeiros_> _tockitj: don't think so
<injekt> heh
<apeiros_> I'd add Enumerator#+ to return ConcatenatedEnumerator
<apeiros_> and ConcatenatedEnumerator#+ to do a flat +
<lupine> are any? and all? implemented in terms of each ? I guess they must be
<injekt> lupine: all methods on Enumerable just rely on #each
<injekt> well, they dont all use it, but yeah
<lupine> :)
<_tockitj> thanks
dustint has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 244 seconds]
mistym has joined #ruby-lang
gjaldon has joined #ruby-lang
ddd has quit [Ping timeout: 245 seconds]
stardiviner has joined #ruby-lang
yfeldblum has quit [Ping timeout: 245 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
jonahR has joined #ruby-lang
waffleau_ has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
cored has joined #ruby-lang
cored has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
huydx has quit [Quit: huydx]
datanoise has joined #ruby-lang
nXqd_ has joined #ruby-lang
nXqd has quit [Ping timeout: 248 seconds]
mjolk has joined #ruby-lang
datanoise has quit [Ping timeout: 256 seconds]
emocakes has quit [Quit: emocakes]
esad has joined #ruby-lang
esad has quit [Client Quit]
esad has joined #ruby-lang
bantic has joined #ruby-lang
mistym has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
yfeldblum has joined #ruby-lang
mephux has quit [Ping timeout: 272 seconds]
bantic has quit [Quit: bantic]
TvL2386 has joined #ruby-lang
bantic has joined #ruby-lang
savagecroc has joined #ruby-lang
<savagecroc> hey i've got the following regex which matches multiple lines in a file
<savagecroc> bla.match(/^.*(\[.*\])?.*\n((n|v|adj|vt|ad|adv)\..*\n)*/)
<savagecroc> how can i extract all the resulting matches?
<savagecroc> i.e. that match that entire string
<injekt> savagecroc: you want the matched captures?
<savagecroc> nah don't care about the capture grous
<savagecroc> groups*
<savagecroc> like it'll match 700 of those 3 - 9 line blocks of text in the file
<savagecroc> i just want to grab those
<injekt> it'll be in MatchData#[0]
cored has quit [Ping timeout: 272 seconds]
<injekt> ie bla.match(/^.*(\[.*\])?.*\n((n|v|adj|vt|ad|adv)\..*\n)*/)[0]
megha has quit [Quit: WeeChat 0.3.9.2]
emocakes has joined #ruby-lang
<savagecroc> hmmm weird
<savagecroc> "vegetation [vegetation || ved'ten]\nn. , , \n" << seems to be missing half the text in the match
<injekt> or $&
<savagecroc> pretty much i want to split the file into an array
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<injekt> then you probably dont want match
waffleau_ has quit [Quit: waffleau_]
<savagecroc> first file has somethign bla bla [maybe has this]\nadj. something something\nn. something something\nand now wer are onto the next one[etc]
<savagecroc> regex works in sublime
<savagecroc> ahh hmm
<injekt> savagecroc: these are some very strange things to split a file on
<injekt> what kind of file is it?
<savagecroc> sorry github got blocked today
<savagecroc> so can't gist it
<injekt> pastie.org
<savagecroc> also blcoked
<savagecroc> my vpn
<lianj> eval.in ideone.com
<savagecroc> 's not working ever
<injekt> dpaste.com
<injekt> all of these websites are blocked?
<savagecroc> yay
<injekt> mother of god
<savagecroc> so basically i'm splitting by word
<savagecroc> then i need to get rid of all the duplicates
<savagecroc> the regex works fine in sublime.. for matching each word and it's translation
<injekt> im still not sure what you're trying to return
<savagecroc> oh same file
<savagecroc> but without duplicates
<savagecroc> there are duplicate words.. if you look at the english definitions
<injekt> ah
<savagecroc> english word.. some of them are repeated
<savagecroc> if i can split it into an array
<savagecroc> based on a single regex
<savagecroc> i can do the rest
<savagecroc> for somereason .split doesn't seem to work :?
<injekt> I probably wouldn't use regex for this
<savagecroc> hmm some looping thing
<savagecroc> but :( it worked in sublime.. it just didn't work in ruby
<savagecroc> ahh easy
<savagecroc> replace in sublime with a delimeter.. then do it in ruby :D
<savagecroc> ugh
<savagecroc> still doesn't work
<savagecroc> ruby strips half the content out
<savagecroc> oh crap
<savagecroc> the characters :/
karasawa has quit [Ping timeout: 248 seconds]
karasawa has joined #ruby-lang
ddfreyne has quit [Ping timeout: 248 seconds]
shajith has quit [Ping timeout: 260 seconds]
<injekt> again, regex is a bad idea for this :P
<savagecroc> i'm using split('DELIMITER') now
* chekcmate is still at war with regex...
shajith has joined #ruby-lang
ddfreyne has joined #ruby-lang
headius has joined #ruby-lang
<savagecroc> :( ruby is stripping out all my characters
<savagecroc> i thought it would be UTF8 by default
tomzx_mac has joined #ruby-lang
unlikely_monkey has joined #ruby-lang
<savagecroc> yay fixed the chars.. need ## coding: utf-8 at the top
<savagecroc> :O
<savagecroc> lianj
<savagecroc> testing
<lianj> maybe add sort_by too. eg, puts h.map{|k,v| [k, v.uniq.sort_by{|i| i.split(" ").first }].flatten }.join("\n")
<savagecroc> lianj: its almost there
<savagecroc> not quite working but that's so close i can easily finish it off
<savagecroc> thankyou very much
<lianj> whats not working?
<savagecroc> http://dpaste.com/887745/ < it's leaving a pile of definitions at the bottom
neocoin has joined #ruby-lang
<chekcmate> hahaha, some drunk stole a car from a guy who just loaded the trunk; the guy ran to a bulldozer and asked the driver to pursue the thief
<chekcmate> they got him a few hundred meters after
<chekcmate> the drunk just wanted to drive home
<chekcmate> imagine a bulldozer coming after you lol
datanoise has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
havenn has joined #ruby-lang
dhruvasagar has joined #ruby-lang
mistym has quit [Remote host closed the connection]
TvL2386 has quit [Quit: Ex-Chat]
_paul0 has quit [Ping timeout: 272 seconds]
<lianj> savagecroc: right, due to ||= the .last ofcourse was stupid, sorry. there you go: http://eval.in/private/3785da0950f674
_paul0 has joined #ruby-lang
havenn has quit [Ping timeout: 255 seconds]
<savagecroc> works perfectly
<savagecroc> thankyou :)
<savagecroc> haha, i like how i spend ages on it
<savagecroc> and you finish it in 10mins
srbaker has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
sailias has joined #ruby-lang
diegoviola has joined #ruby-lang
<lianj> savagecroc: :P only because ruby is so much fun
<savagecroc> lol. yeah i like ruby
<savagecroc> i'm actually doing this for a friend
<savagecroc> he's teaching a class tomorrow and he's like this file of 2000 words
<savagecroc> has like 300 duplicates
<savagecroc> can you get rid of them
<lianj> no, but you
<tbuehlmann> you meaning him
<lianj> ah hehe :)
<tbuehlmann> :D
savagecroc has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
nXqd_ has quit [Remote host closed the connection]
nkr has quit [Quit: Linkinus - http://linkinus.com]
<andrewvos> Hmm, go to /var/log in chrome
tomzx_mac has quit [Ping timeout: 260 seconds]
<hagabaka> isn't sort_by{|i| i.split(" ").first } the same as sort?
mossplix has quit [Quit: mossplix]
GarethAdams has quit [Quit: Leaving...]
<lupine> not exactly
davidbalber|away is now known as davidbalbert
<lupine> specifically, it results in the block only being called once per element
<lupine> (technical term, schwartzian transform)
<lupine> from the docs: "As of Ruby 1.8, the method Enumerable#sort_by implements a built-in Schwartzian Transform, useful when key computation or comparison is expensive. [...] The current implementation of sort_by generates an array of tuples containing the original collection element and the mapped value. This makes sort_by fairly expensive when the keysets are simple"
<hagabaka> I'm not talking about sort with a block. I mean since the paste is dealing with words, sort_by{|i| i.split(" ").first } should give the same result as simply sort
tdy has joined #ruby-lang
<lupine> if you don't give sort a block, it just uses <=>
<lianj> hagabaka: youre probably right
<lupine> if that happens to be equivalent to your sort_by block then the result will be the same
banisterfiend has quit [Remote host closed the connection]
unlikely_monkey has quit [Remote host closed the connection]
unlikely_monkey has joined #ruby-lang
unlikely_monkey has quit [Remote host closed the connection]
Zissler has joined #ruby-lang
wallerdev has joined #ruby-lang
glebm has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
GarethAdams has joined #ruby-lang
dr_bob has joined #ruby-lang
dkannan has quit [Quit: dkannan]
havenn has joined #ruby-lang
rdw200169 has joined #ruby-lang
<chekcmate> can I make this shorther? roarray << line_edit(line) roarray = roarray.uniq
<chekcmate> roarray.uniq << line_edit(line) is this ok?
<chekcmate> (that can't work, can it? ^.-)
<chekcmate> anyways - pleased to read a shorter way :)
methods has joined #ruby-lang
outoftime has joined #ruby-lang
fra000 has joined #ruby-lang
<apeiros_> roset = Set.new; roset << line_edit(line)
<apeiros_> and dude, don't name your variables after the datastructures you used…
diegoviola has quit [Quit: WeeChat 0.4.0]
<injekt> lol roset
<apeiros_> that was @ chekcmate. set needs `require 'set'` too btw.
<yorickpeterse> sName = 'trololol'
<yorickpeterse> iNumber = 666
<injekt> yay for hungarian notation
<injekt> strName
<apeiros_> injekt: yeah, that's what happens when you use quirky-hungarian notation!
<injekt> apeiros_: :D
<yorickpeterse> silaNumber = '10 '
<yorickpeterse> ok I'm done
diego1 has joined #ruby-lang
<injekt> Box boxBox = new Box
<injekt> am i doing this right
<apeiros_> not enough over the top
<injekt> :/
<injekt> Box boxBox = new BoxBuildingFactory(new Box())
diego1 is now known as diegoviola
<injekt> I dunno why you would hand a new box to the box building factory lol
wallerdev has quit [Quit: wallerdev]
<apeiros_> I think you'd pass it a BoxBuildingFactoryEngineer
mjolk has left #ruby-lang ["Leaving"]
<chekcmate> apeiros_: well, many books teach it like that... like "myarray" and stuff like that
<chekcmate> thanks for your help :)
<injekt> chekcmate: bad bad books, ignore them all
<apeiros_> chekcmate: yeah, it's stupid and the authors should be spanked
<injekt> your variables should be descriptive of what they point towards
<chekcmate> it became a habit more or less
* apeiros_ still has a hard time to tell his coworkers not to name Model associations after the associated model…
<injekt> apeiros_: wat
<chekcmate> don't you have conventions?
<apeiros_> injekt: imagine you'd name created_by, updated_by etc. all 'person', because the associated model is Person…
<injekt> conventions and stupid people dont always mix well
<apeiros_> (that's actually the argument which brought my point home :D)
<injekt> apeiros_: ohh, attributes?
<chekcmate> hah
<apeiros_> injekt: no, associations (activerecord)
<apeiros_> but same ballpark really
<injekt> heh
<apeiros_> "lets name all string attributes .string!"
<apeiros_> Person = Struct.new(:string, :string, :string) (hey, first name, last name etc. are all strings…)
<injekt> some guy I hired not long ago appended the model name to all the attributes
<judofyr> Rails makes it way too easy to name the association the same as the model :(
<injekt> User.user_email
<apeiros_> I mean, we have stuff like: Customer.belongs_to Employee
<apeiros_> I mean, yeah, sure, nice - not.
* chekcmate has to learn Rails soon >-<
<judofyr> `belongs_to :user` vs `belongs_to :author, :class_name => 'User'`
<apeiros_> it does in now way describe *how* that customer belongs to the employee. thus, bad. but rails optimizes that case.
<apeiros_> judofyr: exactly
sush24 has joined #ruby-lang
GarethAdams has quit [Quit: Leaving...]
<injekt> judofyr: yeah I do that a lot though >.<
<injekt> (that is, dont change the associated name)
Bearproof has joined #ruby-lang
<chekcmate> I'll be going... have to buy new shower curtains
Bearproof has left #ruby-lang [#ruby-lang]
hugobastien has joined #ruby-lang
<chekcmate> destroyed the whole construction this morning
<chekcmate> nearly breaking all bones imo...
<chekcmate> fuck showers
<chekcmate> bye guys
chekcmate has quit [Quit: Page closed]
<yorickpeterse> extreme showering
wallerdev has joined #ruby-lang
GarethAdams has joined #ruby-lang
GarethAdams has quit [Changing host]
GarethAdams has joined #ruby-lang
Bearproof has joined #ruby-lang
<apeiros_> he needs to XP in the shower…
wallerdev has quit [Client Quit]
andrewhl has joined #ruby-lang
Bearproof has quit [Client Quit]
methods has left #ruby-lang [#ruby-lang]
rins has joined #ruby-lang
Zissler has quit []
GarethAdams has quit [Client Quit]
francisfish has joined #ruby-lang
breakingthings has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
esad has quit [Quit: Computer has gone to sleep.]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
workmad3 has quit [Ping timeout: 256 seconds]
dr_bob has quit [Quit: Leaving.]
sush24 has quit [Quit: This computer has gone to sleep]
carloslopes has joined #ruby-lang
<imperator> pair showering?
banisterfiend has joined #ruby-lang
Bearproof has joined #ruby-lang
karasawa has quit [Ping timeout: 244 seconds]
Bearproof has left #ruby-lang [#ruby-lang]
karasawa has joined #ruby-lang
nkr has joined #ruby-lang
sush24 has joined #ruby-lang
kogent has quit [Quit: kogent]
glebm has joined #ruby-lang
mwjcomputing has joined #ruby-lang
mistym has quit [Remote host closed the connection]
megha has joined #ruby-lang
davidbalbert is now known as davidbalber|away
megha has quit [Client Quit]
srbaker has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
rue_XIW has quit [Remote host closed the connection]
headius has quit [Quit: headius]
bantic has quit [Ping timeout: 272 seconds]
judofyr has quit [Remote host closed the connection]
zhul_mechanos has joined #ruby-lang
headius has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
esad has joined #ruby-lang
bfreeman has quit [Quit: bfreeman]
bzalasky has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
enebo has joined #ruby-lang
ViPi has quit [Quit: Computer has gone to sleep.]
elux has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
sn0wb1rd has quit [Quit: sn0wb1rd]
blazes816 has joined #ruby-lang
dzhulk has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
bantic has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
_carloslopes has joined #ruby-lang
mephux has joined #ruby-lang
Kuifje has joined #ruby-lang
Kuifje has quit [Changing host]
Kuifje has joined #ruby-lang
carloslopes has quit [Ping timeout: 244 seconds]
gregmore_ has joined #ruby-lang
tonni has joined #ruby-lang
tonni_ has quit [Ping timeout: 256 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
ten1 has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
_carloslopes has quit [Remote host closed the connection]
lun_ has joined #ruby-lang
zmack has quit [Remote host closed the connection]
banisterfiend has joined #ruby-lang
solars has quit [Read error: Operation timed out]
alvaro_o has joined #ruby-lang
rue|w has joined #ruby-lang
bantic has quit [Quit: bantic]
carloslopes has joined #ruby-lang
jonahR has quit [Quit: jonahR]
Bearproof has joined #ruby-lang
kcassidy has left #ruby-lang [#ruby-lang]
Bearproof has quit [Client Quit]
gregmore_ has quit []
gregmoreno has joined #ruby-lang
fra000 has quit [Quit: Leaving]
rue|w has quit [Remote host closed the connection]
agnitio has quit [Quit: Leaving]
rue has quit [Remote host closed the connection]
rue has joined #ruby-lang
__butch__ has joined #ruby-lang
<injekt> D:
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
christina has joined #ruby-lang
karasawa has quit [Ping timeout: 245 seconds]
bluepojo has joined #ruby-lang
__butch__ has quit [Ping timeout: 248 seconds]
stardiviner has joined #ruby-lang
voker57 has quit [Ping timeout: 244 seconds]
<apeiros_> imperator: yupp :D more fun and less dangerous (ok, probably more)
workmad3 has joined #ruby-lang
__butch__ has joined #ruby-lang
zmack has joined #ruby-lang
imperator has quit [Quit: This computer has gone to sleep]
mercwithamouth has joined #ruby-lang
mwjcomputing has quit [Quit: Leaving]
breakingthings has quit []
mistym has joined #ruby-lang
towski has joined #ruby-lang
mrsolo has joined #ruby-lang
mossplix has joined #ruby-lang
jonahR has joined #ruby-lang
bfreeman has joined #ruby-lang
karasawa has joined #ruby-lang
vlad_starkov has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
elux has quit [Quit: Leaving...]
mistym has quit [Remote host closed the connection]
elux has joined #ruby-lang
blahwoop has joined #ruby-lang
cultureulterior_ has quit [Quit: cultureulterior_]
alvaro_o has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 272 seconds]
workmad3 has quit [Ping timeout: 256 seconds]
alvaro_o has joined #ruby-lang
ruby-lang560 has joined #ruby-lang
zmack has quit [Remote host closed the connection]
karasawa has quit [Ping timeout: 245 seconds]
ruby-lang560 has quit [Quit: Page closed]
io_syl has joined #ruby-lang
kogent has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
mossplix has quit [Quit: mossplix]
apeiros_ has joined #ruby-lang
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 256 seconds]
wyhaines has joined #ruby-lang
nik_ has joined #ruby-lang
Uranio has joined #ruby-lang
karasawa has joined #ruby-lang
davidbalber|away is now known as davidbalbert
<Uranio> add need to write (modify) values in a xls document, what would be the best gem?
<Uranio> roo need nokogiri and the compilation fail... :-/
<whitequark> aptitude install libxml2-dev
imperator has joined #ruby-lang
benanne has joined #ruby-lang
<Uranio> yep... and start a very big conlfict that suggest remove libc6
karasawa has quit [Ping timeout: 255 seconds]
<Uranio> whitequark: ^
<whitequark> then your system is seriously screwed up
megha has joined #ruby-lang
<Uranio> whitequark: until now, that the only one problem, is stable
<apeiros_> stable & broken
<apeiros_> nice combination :)
<whitequark> at least things consistently do not work
<whitequark> I know some industries where that is considered desirable in comparison
<whitequark> banking, anyone?
<Uranio> is the first time I have a problem like that
<Uranio> only happen me with that two libs
megha is now known as account
<lianj> when did you last update your system?
<Uranio> lianj: loooooooong time agoo
<Uranio> I'm trying update now
jaimef has quit [Quit: Emacs must have died]
Nisstyre-laptop has quit [Ping timeout: 256 seconds]
jaimef has joined #ruby-lang
<Uranio> libc6-dev : Breaks: cmake (< 2.8.4+dfsg.1-5) but 2.8.2+dfsg.1-0+squeeze1 is to be installed
<Uranio> Breaks: gcc-4.4 (< 4.4.6-4) but 4.4.5-8 is to be installed
<Uranio> :-/
bluepojo has quit [Quit: Leaving.]
<Uranio> solving...
Nisstyre-laptop has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
dankest has joined #ruby-lang
<lianj> "Oh, the simulated horror!"
<Uranio> I wonder if my system will boot again afet this
<Uranio> initscript also are in the hole bunch
<lianj> if not blame debian
<Uranio> :D Setting up libc6 (2.13-37) ...
esad has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Uranio> lianj: yeah.. sorry for the noise
JMcAfreak has joined #ruby-lang
<Uranio> ok... that two are installing now
<Uranio> thanks lianj and whitequark
chris2 has quit [Ping timeout: 276 seconds]
<apeiros_> and people tell me that *nix package managers where heaven…
<apeiros_> *were
<apeiros_> it may be less messy than win's DLL hell, but it's still messy.
<Uranio> apeiros_: I wonder what OS you use...
<apeiros_> osx, and no, the *nix part inherited there isn't any better.
headius has quit [Quit: headius]
<emocakes> apeiros_, macports ftw
<apeiros_> but I do like the self contained .app packages
<Uranio> and spend a lot of money
<apeiros_> emocakes: I use brew. even though it does the idiocy of chown'ing /usr/local (awesome, isn't it?)
<apeiros_> Uranio: so? my time is worth much more than the money I spend.
<apeiros_> not to speak of my sanity :-p
headius has joined #ruby-lang
<Uranio> good point...
<apeiros_> if you want cheap, use paper and pencil ;-)
* Uranio stop talking about OS before start a flame war
workmad3 has joined #ruby-lang
<emocakes> thats why I dont use brw
<emocakes> because it fucks up /usr/local
<emocakes> *brew
breakingthings has joined #ruby-lang
chris2 has joined #ruby-lang
lun_ has quit [Remote host closed the connection]
kogent has quit [Quit: kogent]
Bearproof has joined #ruby-lang
elux has quit [Quit: Leaving...]
Bearproof has left #ruby-lang [#ruby-lang]
kogent has joined #ruby-lang
maxmanders has joined #ruby-lang
lun_ has joined #ruby-lang
rippa has joined #ruby-lang
adamjleonard has joined #ruby-lang
<whitequark> /usr/local/ is supposed to be fucked up
<whitequark> by random tools
<apeiros_> whitequark: but not to be chowned to a single system user…
<ten1> ^
* apeiros_ should stop using … in inappropriate places
<whitequark> apeiros_: if the system is indeed owned by a single user, why not?
<apeiros_> whitequark: if brew knew it was always the case
<apeiros_> but it isn't
<whitequark> oh. I see.
<apeiros_> I'm a fan of user-specific installs. but those should IMO go into ~
<apeiros_> but that said, I'm not a fan of any current OS design
<apeiros_> (not speaking about the visual design, in case that's not clear :) )
<ten1> apeiros_: plan 9 then? :P
towski has quit [Remote host closed the connection]
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby-lang
<apeiros_> ten1: singularity sounded interesting. but I doubt it'll ever evolve into a public product :(
<apeiros_> but I haven't looked much at plan 9
<apeiros_> might well be that it has concepts which I long for
hakunin_ has joined #ruby-lang
<whitequark> plan 9 is "dhh opinionated" imo
lun_ has quit [Remote host closed the connection]
<whitequark> the notion that the single true way to make a code editor is to omit syntax highlighting and use mouse chords immediately puts me off.
<apeiros_> I'm hooked!
* apeiros_ coded without syntax highlighting for a very long period in his life
* chris2 still does
hakunin has quit [Ping timeout: 248 seconds]
<whitequark> meh.
MaddinXx has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
nik_ has quit [Quit: Leaving]
<chris2> and sam doesnt need chords :P
kogent has quit [Quit: kogent]
hugobastien has quit [Remote host closed the connection]
bfleischer has joined #ruby-lang
<apeiros_> whitequark: was a performance issue back then ;-)
rippa has quit [Read error: Connection reset by peer]
<apeiros_> I wrote faster than the editor with highlighting on.
rippa has joined #ruby-lang
lun_ has joined #ruby-lang
<whitequark> apeiros_: oh.
<whitequark> sounds like a PITA.
blazes816 has quit [Quit: blazes816]
<banisterfiend> apeiros_: what langauge was this? qbasic?
<apeiros_> well, that's what you get with 25MHz@16bit ;-)
<apeiros_> banisterfiend: first hypertalk, then perl
<whitequark> apeiros_: 25MHz@16bit can be a lot
xalei has joined #ruby-lang
<whitequark> it also depends on ISA, cache size and memory bandwidth ;)
<apeiros_> 68020, you can probably find all relevant information on WP ;-)
<apeiros_> MacII si
<banisterfiend> wow the graphics in second life has really improved now
<whitequark> don't need to, I know about this chip enough already
<whitequark> heh.
<banisterfiend> it looks pretty amazing
<apeiros_> the graphics card might also have been the culprit, no idea really. I just noticed a lag with highlighting on, and it was annoying enough to disable highlighting :)
<Uranio> sorry... but the compilation still failing :/
<Uranio> could some body help me
<whitequark> apeiros_: there's also an important difference between MHz and MIPS.
<whitequark> apeiros_: eg newer ARMs have 1.25DMIPS/MHz, and your chip IIRC has somewhere around 1/8MIPS/MHz
MaddinXx has quit [Remote host closed the connection]
<whitequark> and that would only be integer performance. for memory access, multiply by at least 1.5
<ten1> and MIPS ain't a great measure either
<apeiros_> whitequark: heh, having had a mac, I've been quite exposed to MHz vs. performance discussion ;-)
kogent has joined #ruby-lang
rippa has quit [Read error: Connection reset by peer]
<whitequark> ten1: with MIPS, you can at least compare CPUs implementing one ISA or similar ISAs
v0lta has joined #ruby-lang
v0lta has quit [Client Quit]
<Uranio> look like it can't find parse.h cause is looking for libxml and is named libxml2 in debian... let me make a link
rippa has joined #ruby-lang
v0lta has joined #ruby-lang
<whitequark> ten1: eg I would argue that DMIPS@MIPS CPU and @ARM CPU are at least somewhat representative of the integer performance.
JohnBat26 has quit [Read error: Operation timed out]
v0lta has quit [Client Quit]
v0lta has joined #ruby-lang
<whitequark> apeiros_: besides, 68020 isn't 16-bit...
<apeiros_> oh, was that already 32bit?
<whitequark> you might want to check WP ;)
<apeiros_> ah, right, the 68000 of "my" MacSE was 16bit
<banisterfiend> apeiros_: what was hypertalk used for?
<ten1> whitequark: I will accept that an argument can be made for specific cases. With different ISAs it's definitely not a useful measure
glebm has quit [Quit: Computer has gone to sleep.]
<apeiros_> banisterfiend: it was part of hypercard. awesome "IDE"
<apeiros_> my first contact at programming, and in some sense at OO
<apeiros_> s/at/with/?
<apeiros_> it died a very sorry dead by neglect through apple :(
<whitequark> "he has contacted programming. he should be isolated immediately"
karasawa has joined #ruby-lang
<ten1> lol, ain't that the truth
<whitequark> ten1: well, the subjects often isolate themselves by the normal course of the disease
<apeiros_> rofl
workmad3 has quit [Ping timeout: 240 seconds]
<ten1> the problem with that disease is that it can spread over the internet
<whitequark> suppose I want to extend Ruby with machine-length integers, i.e. int32
jonahR has quit [Quit: jonahR]
<whitequark> and not only that, but also add weird but useful semantics like saturating or modwrap arithmetics
<ten1> "...and suppose you were a maths geek. But, I repeat myself"
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<whitequark> so that there would be "overflowing" +, "saturating" +, "overflow->exception" +, "modwrap" +
<whitequark> and possibly "non-overflowing but returning a wider data" +
karasawa has quit [Ping timeout: 255 seconds]
<whitequark> how do you think this polymorphism should be handled?
<apeiros_> metadata in the number object?
jonahR has joined #ruby-lang
<apeiros_> e.g. value.carry_over .overflow? etc.
mj_lk has joined #ruby-lang
<whitequark> apeiros_: the problem is that this semantics is naturally related to the operation and not the value itself
<whitequark> i.e. it is perfectly reasonable to do a saturating multiply, but then add the result to accumulator where overflow should result in an error
<whitequark> as far as I understand it
<apeiros_> I'm not so sure of that :)
<apeiros_> that's just how it has been done so far
<apeiros_> but I see what you mean
bluepojo has joined #ruby-lang
<whitequark> apeiros_: well, here, the semantics is dictated by the algorithms commonly used and not elegance or whatever
<apeiros_> have specific methods which return a Int32OpResult struct e.g.?
<apeiros_> (those are quick shots, so there's quite probably a better solution)
<whitequark> i.e. you suggest adding #overflowing_add, #saturating_add, #non_overflowing_add, ...?
<apeiros_> ugly way: have thread locals with those values for the last executed operation
adamjleonard has quit [Quit: Linkinus - http://linkinus.com]
<apeiros_> whitequark: yes, I'm a fan of "say what you mean"
schaerli has joined #ruby-lang
<whitequark> well, I should note that I aim for compilation to native code, so thread locals don't really fit
lun_ has quit [Remote host closed the connection]
<whitequark> once you consider how the compiler could reorder the instructions, etc.
<apeiros_> that's out of my ballpark of knowledge :-/
adambeynon has joined #ruby-lang
<whitequark> apeiros_: that might make perfect sense, since I'm not aware of any better way
<whitequark> C uses pragmas to annotate blocks of code
<whitequark> that is erm... sub-par
<whitequark> in fact the only official standard I've seen is written like there was this one vendor who needed something to be certified, and they sponsored it
<soahccc> Is there a list of special methods I can override? like == + etc
<whitequark> soahccc: every one of them
<banisterfiend> whitequark: do you know much about open source hardware movement?
<whitequark> banisterfiend: kinda
<soahccc> whitequark: But I can't really add something new, can I?
<whitequark> soahccc: oh. no.
<whitequark> I have had a list somewhere.
<banisterfiend> whitequark: do you think it's viable? or do you think it'll all be killed by patent warfare
<whitequark> banisterfiend: OSHW isn't affected by patent warfare. what's worse is that there's nothing to kill
<whitequark> there are some stupid arduino fans who think they did a single pcb and now they know everything
kogent has quit [Quit: kogent]
<banisterfiend> whitequark: well the 'opencores' initiative was threatened with multiple patent lawsuits by mips
<whitequark> and there's also folks who either already understand that you cannot make good hardware like you make good OSS, or will understand it
<whitequark> banisterfiend: meh, who cares. linux was threatened with multiple patent lawsuits by microsoft.
<whitequark> "threatened"
<banisterfiend> whitequark: linux is defended by many big companies and the open invention network though, opencores doesnt really have much afaik
<whitequark> the actual problem with hardware is that it costs awfully lot to produce, and there won't be a helpful pry repl to fix your errors
<whitequark> you won't make a chip for less than $10k, and that'll only get you the most basic tech
solars has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
<banisterfiend> whitequark: haha, yeah, there's a cool quote
<whitequark> and it's not like you will get it right from the first try
<banisterfiend> whitequark: "electrons are cheap, but atoms are expensive"
<banisterfiend> where software === electrons :)
apeiros_ has joined #ruby-lang
lun_ has joined #ruby-lang
<whitequark> there are nice free CPUs which are not patent-encumbered
<whitequark> OR32
<whitequark> or LM32, for that matter
<soahccc> whitequark: I'm actually trying to get a solution for this https://gist.github.com/15dc603b258f79533326
<whitequark> it's GPL IIRC
<whitequark> soahccc: it's parsed as a.<<(b.!())
neocoin has quit [Remote host closed the connection]
<soahccc> whitequark: hmm doesn't work then I suppose
<whitequark> soahccc: well, there's no <<! operator and there couln't be
<whitequark> if we're talking about ruby
Uranio has quit [Quit: while you reading this, a kitty dies]
<blahwoop> whats a good source to practice and write simple ruby apps?
<whitequark> you can usually emulate the behavior you want with some hacks, but note that the code above is confusing to those who know that there's no <<! operator.
<banisterfiend> whitequark: these guys are awesome: http://en.wikipedia.org/wiki/Open_Invention_Network
<banisterfiend> whitequark: they have multi-million dollar patents, and they exist just to safeguard linux from patent trolls
<banisterfiend> they either strike deals with the trolls, or threaten litigation
<soahccc> yeah I know I thought I could just say def <<| which would be a bit more descriptive...
<whitequark> soahccc: this isn't lisp for you to define your own syntax
<banisterfiend> soahccc: google for superators
<soahccc> That seems to work but isn't that pretty, is it? (result ||= []) << "foo"
<banisterfiend> u can do some crazy stuff with that but i've never used them
<whitequark> banisterfiend: also, say goodbye to performance
bfreeman_ has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
bfreeman has quit [Read error: Connection reset by peer]
wyhaines has quit [Read error: No route to host]
xalei has quit [Remote host closed the connection]
wyhaines has joined #ruby-lang
glebm has joined #ruby-lang
workmad3 has joined #ruby-lang
davidbalbert is now known as davidbalber|away
fp- has joined #ruby-lang
<fp-> hey guys… i'm in need of some design advice
<fp-> also willing to pay for it
<fp-> i am using rails, but this is more of a design question
<drbrain> I see only statements
Asher has quit [Ping timeout: 255 seconds]
<fp-> i have 2 types of data (for simplicity's sake)… a domain registration record (containing expiry information, registration date, etc.) and a virtual domain object that is part of a remote API call
ryanv-raptor has joined #ruby-lang
<fp-> if the user goes to their domains page, it combines this information so that one domain (i.e. example.com) shows when it was registered, when it expires, and how much disk space, and bandwidth it has consumed on the server
Nisstyre-laptop has quit [Quit: Leaving]
tenderlove has quit [Remote host closed the connection]
<fp-> so I have one Domain object that is tied to the database and one that is a rest/api client
<fp-> the difficulty is in caching and merging this data on one screen
<fp-> right now I have a Domain object which is just an ActiveModel, with attributes for name, expires_at, registered_at, disk_space_used, bandwidth_used, etc.
<fp-> and in my Client object, I have a method called "domains" which just calls my Registration model and my VirtualDomain API, to populate the Domain collection
<fp-> I make use of memcache caching on the API side so that I'm not polling on every requet.
<apeiros_> oh, drbrain - any reason Gem::Version is now rubygems/version instead of the (IMO more appropriate) older gem/version ?
<drbrain> apeiros_: AFAIK it was always implemented in rubygems/version.rb
<drbrain> if it was once gems/version.rb it was before my time
<fp-> my current approach seems wrong… it's not a real ActiveRecord association
<apeiros_> drbrain: um, no. I have old code which required 'gem/version' and which doesn't work
christina has quit [Quit: christina]
<apeiros_> +anymore
<apeiros_> drbrain: ok, so the switch from gem/version to rubygems/version in that case happened before your time
<fp-> so I got to thinking about refactoring it and thought that it might be better to move my ActiveModel Domain model to an ActiveRecord domain model, where we can use the database to cache the response from each API call to get information about the hosted domain
<drbrain> I think I first got involved in the mid-0.8 versions
<drbrain> fp-: then you have to worry about cache invalidation in the DB, if that's acceptable, ok
<fp-> most of this app is completed, but this area seems a little above my comfort with application design
<fp-> i just feel like my current implementation is messy
<fp-> if you want to add a domain, I'm using a presenter to collect the info from the end user, such as whether or not to register the domain, if they want hosting, etc.
<drbrain> fp-: joining two data sources is often messy. Provided you have a common key, write a method to merge on it.
<apeiros_> drbrain: hm, then it must have happened during your time actually. because I'm pretty sure with rubygems ~1.3 it still worked
ddv has quit [Changing host]
ddv has joined #ruby-lang
<fp-> and then it will either create a Registration record and/or VirtualDomain
<drbrain> apeiros_: rubygems never uninstalled old files, so maybe it worked by accident
christina has joined #ruby-lang
<fp-> drbrain: do you know of any open source stuff I can look at for an example on how to do this properly? 
maxmanders has quit [Quit: Textual IRC Client: www.textualapp.com]
<fp-> or a search term i can possibly use to find more… i haven't had any luck
<drbrain> fp-: "properly" is very dependent upon data sources
<fp-> well even just an example of a similar situation
<drbrain> nothing comes to mind, maybe someone else will have one
<fp-> the geocoder project seemed somewhat similar, in that ActiveRecord long/lat fields would auto-populate from the API if they were absent or stale
<fp-> but it's more efficient for my app to get a complete list of the customer's hosted domains and update a collection vs requesting info from the server on each domain name when it's iterated over
Bearproof has joined #ruby-lang
Bearproof has left #ruby-lang [#ruby-lang]
rippa has quit [Read error: Connection reset by peer]
rippa has joined #ruby-lang
imajes has quit [Excess Flood]
workmad3 has quit [Ping timeout: 276 seconds]
imajes has joined #ruby-lang
chuenjin has quit [Ping timeout: 260 seconds]
robbyoconnor has quit [Read error: Connection reset by peer]
cddr`` has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby-lang
mj_lk has left #ruby-lang [#ruby-lang]
mjolk has joined #ruby-lang
<mjolk> i'm referencing an object inside of a class, i can use the global scope by prefixing the inner object with '::' correct?
kogent has joined #ruby-lang
karasawa has joined #ruby-lang
<yxhuvud> yes
<fp-> this is pretty relevant to my problem
sailias has quit [Quit: Leaving.]
<fp-> there's a comment on the solution: I'd just add that with a large number of subscriptions this would be pretty slow. More efficient is to retrieve all data by a single request to the API. – RocketR Nov 17 '12 at 10:48
<fp-> if I could figure out how to do that (retrieve all data by a single request) cleanly, then i'd be all set
<fp-> maybe a proxy class?
<apeiros_> drbrain: ah, that might be an explanation, yes
nkr has quit [Quit: Linkinus - http://linkinus.com]
karasawa has quit [Ping timeout: 240 seconds]
davidbalber|away is now known as davidbalbert
dankest is now known as dankest|away
pbjorklund has joined #ruby-lang
<mjolk> thanks yxhuvud
Asher has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
io_syl has quit [Quit: Textual IRC Client: www.textualapp.com]
bantic has joined #ruby-lang
mistym is now known as mistym_meeting
cirenyc has joined #ruby-lang
rippa has quit [Ping timeout: 276 seconds]
dankest|away is now known as dankest
b1rkh0ff has quit [Quit: Leaving]
blazes816 has joined #ruby-lang
davidbalbert is now known as davidbalber|away
zmack has joined #ruby-lang
<mjolk> I keep getting the error: 'NameError: uninitialized constant Net::SSH::HostKeyUnknown'. gem list --local shows net-ssh (2.6.3, 2.6.2, 2.2.2) and I have "require 'net/ssh'" in my .rb... I'm calling Net::SSH:: from inside of a class, but I have it prepended with ::, what gives?
christina has quit [Quit: christina]
pbjorklund has quit [Quit: oh no]
fp- has left #ruby-lang [#ruby-lang]
crudson has joined #ruby-lang
maxmanders has joined #ruby-lang
zmack has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
<manveru> you have your own class called Net ?
<blazes816> bust open pry and do Net::SSH.constants or Net::SSH.source_location to try and grasp where you are
<blazes816> and ensure you're hitting what you think you are
<mjolk> manveru: I don't have a local class called net
<mjolk> what's pry ?
<injekt> mjolk: it's a Ruby REPL
<mjolk> nevermind, found it on github (git://github.com/pry/pry.git)
__BigO__ has joined #ruby-lang
<manveru> gem i pry
<manveru> i'd say irb is enough though :)
<banisterfiend> manveru: upgrade yourself
<banisterfiend> :D
<bougyman> for srs.
<bougyman> pry is quite nice.
<banisterfiend> bougyman: r u on the most recent release?
<banisterfiend> (0.9.11)
<banisterfiend> that has pimped out tab completion and a few other cute things
<injekt> :)
__BigO__ has quit [Remote host closed the connection]
<manveru> i still don't know what pry is good for, it acts like irb, so why use it instead?
<banisterfiend> and an updated slop gem for extra cool :)
<banisterfiend> manveru: show-source MyClass
<banisterfiend> manveru: it'll pull the source of your class and show it to you prettily syntax highlighted in a pager
<andrewvos> manveru:Why uses themes in your terminal?
<manveru> themes?
<banisterfiend> manveru: further, u can edit MyClass#my_method it'll drop u in the editor at the file/line you can modify the code, quit, it'll auto-reload it
__BigO__ has joined #ruby-lang
<banisterfiend> manveru: also, pry isn't just an irb replacemtn, it's a debugger replacment, u can call it in the middle of a running process, explore your runtime state, pull source on methods, classes, edit method, save them
christina has joined #ruby-lang
mistym_meeting is now known as mistym
<manveru> ok... can i turn off those colors?
<banisterfiend> yeah
<banisterfiend> Pry.color = false
<manveru> ah, now it's at least readable :)
<banisterfiend> manveru: or you can change themes: https://github.com/kyrylo/pry-theme
<manveru> i think i just need to get around fixing those urxvt colors
<manveru> they are really unreadable
<banisterfiend> manveru: my favorite thing is: show-source MyClass -a the '-a' will attempt to show u the source for every monkeypatch of the class
<banisterfiend> (*attempt* :)
<injekt> heh
carloslopes has quit [Remote host closed the connection]
<whitequark> banisterfiend: I've implemented several features of pry in my ruby dialect/impl
<whitequark> (it doesn't make sense to run pry as-is or any subset of it there)
<banisterfiend> whitequark: so you keep the source around ?
<whitequark> banisterfiend: the source of what?
<banisterfiend> methods/classes (im just guessing)
<mjolk> ugh pry
<whitequark> banisterfiend: oh. no. first, this is the part which I didn't get to implement yet
<mjolk> ugh ruby packaging
<mjolk> this is all besides the pint
solars has quit [Ping timeout: 248 seconds]
<mjolk> *point
<whitequark> banisterfiend: second, when I will, I'll just follow the way gdb and friends work
<whitequark> ie fetch the source directly from the filesystem
<manveru> banisterfiend: i might just add it to my gemset defaults
<injekt> ugh gemsets
<banisterfiend> manveru: cool
karasawa has joined #ruby-lang
yfeldblum has joined #ruby-lang
<banisterfiend> whitequark: your implementation is closed source right?
chris2_ has joined #ruby-lang
<manveru> banisterfiend: so how do you differentiate between commands and methods or vars?
karasawa has quit [Ping timeout: 276 seconds]
ryanf has joined #ruby-lang
<banisterfiend> manveru: commands get precedence, but in case of conflict you have a few options: 1. prepend a space (commands only execute if they're hard against the margin) 2. you can define a e.g Pry.config.command_prefix = "%", that will force all commands to only execute if they have a symbol like % before them
<manveru> great, thanks
<banisterfiend> manveru: but generally command names are chosen so that they wont conflict (they often have hyphens, like show-source)
<manveru> yeah, wish empty tab-complete would show them :)
<manveru> but not sure if that even triggers the readline completion
<banisterfiend> manveru: our 'help' system is pretty good, u can type 'help show' and it'll show all commands that start with show, etc, or u can pass a command group name along, and it'll show you all commands that belong to that group
<banisterfiend> 'help' by itself just shows everything
<banisterfiend> manveru: show-source also works on commands, btw. So if yur'e curious how commands are implemented you can do something like: show-source edit for example
<injekt> funny i didn't even know that
chuenjin has joined #ruby-lang
<banisterfiend> injekt: yeah i just added that in the last release
<injekt> banisterfiend: neat
<banisterfiend> show-source should be able to work on almost anything, methods, classes, modules, objects, commands, the only thing i didnt add support for is files, and im tempted to do that too
<banisterfiend> to add symmetry to 'edit' comamnd which can edit everything, including files
<injekt> makes sense, maybe only if the extension is included (knowing they definitely dont want anything BUT the file)
<manveru> well, it can't find Date.today :)
<manveru> but it does find Time.now
<banisterfiend> manveru: yeah, tha'ts a problem with our YARD database, i can never get it to scrape all source from stdlib/core for some reason
<banisterfiend> it always leaves things out
<manveru> yeah, not blaming you, i didn't expect it to find Time.now either
runeb has joined #ruby-lang
chris2 has quit [Quit: und wech...]
<banisterfiend> manveru: but (i assume u have pry-doc and the debugger gems installed) try this: $ Debugger#add_breakpoint
chris2_ is now known as chris2
imajes has quit [Excess Flood]
<banisterfiend> it guesses where the *.c files are stored for C extensions, and tries to extract the source
<banisterfiend> ond emand
<banisterfiend> demand*
imajes has joined #ruby-lang
<banisterfiend> use ? for reading docs, and $ for reading source
<banisterfiend> ? Debugger#add_breakpoint / $ Debugger#add_breakpoint
<injekt> I pipe 'git' and 'rake' commands through to system so when I open a terminal in pry I never have to leave it
thone has joined #ruby-lang
dzhulk has left #ruby-lang [#ruby-lang]
dankest has quit [Quit: Leaving...]
<manveru> yeah, i use debugger maybe twice a year
<banisterfiend> manveru: if u want to execute arbitrary shell commands prefix a '.'
<banisterfiend> .ls
<banisterfiend> .cd
<manveru> you said that already
<banisterfiend> did i?
<banisterfiend> i dont think so
<manveru> hm
<manveru> maybe i was just reading it in the help
gix has quit [Ping timeout: 256 seconds]
<banisterfiend> manveru: i mean things like bash, ".ls" in pry is equivalent to system("ls")
<banisterfiend> bbl
bfleischer has quit [Quit: bfleischer]
thone_ has quit [Ping timeout: 245 seconds]
maxmanders has quit [Quit: Textual IRC Client: www.textualapp.com]
Bearproof has joined #ruby-lang
Bearproof has left #ruby-lang [#ruby-lang]
gix has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
__BigO__ has quit [Remote host closed the connection]
__BigO__ has joined #ruby-lang
pythonsnake has quit [Ping timeout: 272 seconds]
schaerli has quit [Remote host closed the connection]
mjio has joined #ruby-lang
pythonsnake has joined #ruby-lang
cjs226 has quit []
wyhaines has quit [Read error: Connection reset by peer]
wyhaines has joined #ruby-lang
wudofyr_ has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
wudofyr_ has joined #ruby-lang
ViPi has joined #ruby-lang
ViPi has quit [Max SendQ exceeded]
ViPi has joined #ruby-lang
sush24 has quit [Ping timeout: 252 seconds]
sailias has joined #ruby-lang
sush24 has joined #ruby-lang
irichlau2 has joined #ruby-lang
crudson has quit [Ping timeout: 248 seconds]
blahwoop has quit [Ping timeout: 248 seconds]
crudson has joined #ruby-lang
irichlau2 has quit [Ping timeout: 252 seconds]
MaddinXx_ has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 245 seconds]
carloslopes has joined #ruby-lang
tdy has quit [Read error: Operation timed out]
mercwithamouth has joined #ruby-lang
dustint has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
MaddinXx_ has quit [Ping timeout: 252 seconds]
breakingthings has quit []
carloslopes has quit [Read error: No route to host]
tdy has joined #ruby-lang
davidbalber|away is now known as davidbalbert
kogent has quit [Quit: kogent]
mjio has quit []
kogent has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
runeb has quit [Remote host closed the connection]
dankest has joined #ruby-lang
tdy has quit [Ping timeout: 245 seconds]
jonahR has quit [Quit: jonahR]
mjio has joined #ruby-lang
bzalasky_ has joined #ruby-lang
tdy has joined #ruby-lang
jonahR has joined #ruby-lang
Sinestro has joined #ruby-lang
jonahR has quit [Client Quit]
_paul0 has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
emocakes has quit [Quit: emocakes]
Criztian has quit [Remote host closed the connection]
paul0 has joined #ruby-lang
<paul0> great, ruby 2.0.0 compiles in Haiku :)
christina has left #ruby-lang [#ruby-lang]
rins has quit [Ping timeout: 248 seconds]
blahwoop has joined #ruby-lang
carloslopes has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 240 seconds]
mercwithamouth has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
musl has quit [Quit: installworld]
mjolk is now known as mjolk_afk
cjs226 has joined #ruby-lang
karasawa has joined #ruby-lang
andrewhl has quit [Remote host closed the connection]
carloslopes has quit [Read error: No route to host]
_carloslopes has joined #ruby-lang
<sandbags> I'm using binding.remote_pry and finding that 'next' or 'stop' drops me into the pry-remote.rb file and then exits
<freedrull> do people still use jeweler :|
<freedrull> ok, *should* people still use jeweler?
<sandbags> rather than taking me to the next line in the method/frame
<drbrain> freedrull: hoe > *
<sandbags> anyone else seen this?
<banisterfiend> sandbags: join #pry
<sandbags> banisterfiend: thx
karasawa has quit [Ping timeout: 276 seconds]
apeiros_ has quit [Remote host closed the connection]
marr has quit [Ping timeout: 252 seconds]
bzalasky_ has quit [Remote host closed the connection]
_carloslopes has quit [Ping timeout: 256 seconds]
ryanv-raptor has quit [Quit: Leaving.]
Kuifje has quit [Ping timeout: 260 seconds]
__BigO__ has quit [Remote host closed the connection]
mwjcomputing has joined #ruby-lang
v0lta has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
datanoise has quit [Ping timeout: 248 seconds]
zhul_mechanos has quit [Quit: zhul_mechanos]
mistym_ has joined #ruby-lang
kogent has quit [Quit: kogent]
spuk has joined #ruby-lang
postmodern has joined #ruby-lang
Bearproof has joined #ruby-lang
Bearproof has left #ruby-lang [#ruby-lang]