<banisterfiend>
Yeah, we do that on demand using a bunch of tricks
<seydar>
k, i just posted to the mailing list. hopefully i was actually subscribed.
<charliesome>
works for core methods too, not bad
<charliesome>
banisterfiend: suggestion: do something sane with mri indentation
<banisterfiend>
charliesome: yeah, for core methods it's easy, we just package the core docs/source, but for arbitrary 3rd party gems we actually have to use a bunch of heuristics to figure out where the C files are stored, scan them, and then extract the source
<banisterfiend>
charliesome: yeah, we should :)
<charliesome>
something as simple as src.gsub("\t", 8 * " ") should do it
sent-hil has quit [Remote host closed the connection]
<xalei>
hi guys, I'm a bit new to ruby, using rvm on linux, and my environment is giving me a little angst... just wondering if anyone has time to answer a few quick questions?
<seydar>
yep
<seydar>
ask away
<crazyhorse18>
manveru: runs really fast :)
mwjcomputing has quit [Ping timeout: 264 seconds]
<crazyhorse18>
manveru: thankyou very much :D
AJAlabs has left #ruby-lang [#ruby-lang]
waffleau has joined #ruby-lang
<crazyhorse18>
xalei: i feel your pain.. i ended up giving up with rvm on my production environment
<crazyhorse18>
also doing a cap environment deploy --dry-run is really good to see what it's actually going to execute
<crazyhorse18>
cd #{app_path} && pwd && #{bundle_cmd} install #{args.join(' ')} << that's pretty much all it ends up doing which is not much
<bougyman>
ah, i'm using chef to deploy
<bougyman>
haven't had an issue with rvm and chef yet.
<crazyhorse18>
bougyman: oh right..
<crazyhorse18>
bougyman: you can use chef instead of capistrano?
<bougyman>
crazyhorse18: chef can certainly deploy, yes.
<bougyman>
we deploy whole stacks with it.
<crazyhorse18>
i pretty much wrote my own deployment scripts.. i.e. i'm not using capistranos inbuilt methods
<crazyhorse18>
what's it like for managing configuration files? i.e. config files that need ruby code to generate them
<bougyman>
i write chef recipes, but leverage all its' knowledge (ohai)
<bougyman>
crazyhorse18: it's like ruby :)
<bougyman>
ruby_block do; ERB stuff; end
<bougyman>
but it has its' own template provider that handles most of those cases.
jtoy has joined #ruby-lang
<crazyhorse18>
ok.. at the moment
<crazyhorse18>
i'm using capistrano to generate nginx configuration files.. upload and version it to the server.. run the nginx test method, then using that to copy the recipe in
enamrik has joined #ruby-lang
<crazyhorse18>
so potentially.. i could get rid of capistrano from all of my apps
<crazyhorse18>
and just use chef?
<bougyman>
you could.
<bougyman>
not recommending that. use the right tool for the job. if cap is working why switch?
<crazyhorse18>
well ok so some issues
<crazyhorse18>
firstly.. my scripts don't set up users
<crazyhorse18>
or private keys
<crazyhorse18>
etc..
jtoy has quit [Quit: jtoy]
<crazyhorse18>
i want to add stuff like tripwire (or that one that's easier than tripwire) to each of the servers
<crazyhorse18>
my scripts don't setup and install nginx or postgresql or anything like.. that still has to be done manually
<crazyhorse18>
could you use it to setup developer machines? i.e. setup ubuntu.. install the full stack, install sublimetext.. etc
Nisstyre has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby-lang
faustman has quit [Ping timeout: 240 seconds]
enamrik has quit [Quit: enamrik]
wallerdev has quit [Quit: wallerdev]
Nisstyre has joined #ruby-lang
enamrik has joined #ruby-lang
wallerdev has joined #ruby-lang
enamrik has quit [Client Quit]
cirenyc has quit [Quit: Leaving...]
toretore has quit [Quit: Leaving]
<crazyhorse18>
if i have begin; SomeCommand.that_is_broken; rescue; end; .. what reasons would cause the error to still bubble up and display on my console output?
<charliesome>
crazyhorse18: rescue by default only handles StandardError and subclasses
<crazyhorse18>
how can i get it to rescue everything
<crazyhorse18>
i've tried
GarethAdams has joined #ruby-lang
<crazyhorse18>
rescue Exception => e
<charliesome>
rescue Exception
<charliesome>
should work
<crazyhorse18>
and it still throws
<charliesome>
what's the error
tsp has joined #ruby-lang
<GarethAdams>
crazyhorse18: does the stack trace from the error include the block where you have the `rescue Exception`?
<crazyhorse18>
ActiveRecord::StatementInvalid
<crazyhorse18>
GarethAdams: no it doesnt
<GarethAdams>
crazyhorse18: you'll need to rescue around one of the lines mentioned in that stack trace
<GarethAdams>
crazyhorse18: I didn't see the start of your problem but it sounds like the error is comeing from somewhere other than where you think it is
<GarethAdams>
*coming
waffleau has quit [Quit: waffleau]
<crazyhorse18>
your right..
<crazyhorse18>
sorry idiot moment
brianpWins has joined #ruby-lang
sent-hil has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
<crazyhorse18>
rspec had wrapped the entire file in a db transaction and in the error block it was throwing it again
wyhaines has joined #ruby-lang
datanoise has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 256 seconds]
<matti>
;]
<tsp>
How do I tell gem server where its docs are?
<tsp>
I have some gems installed in the default /usr/lib/ruby/gems, and others installed in ~/.gems. The ones in /usr/lib have no docs, which is fine, but gem server can't find the docs for the ones in ~/.gems.
datanoise has quit [Ping timeout: 244 seconds]
burgestrand has quit [Read error: Connection reset by peer]
burgestrand1 has joined #ruby-lang
xalei has quit [Remote host closed the connection]
tdy_ has joined #ruby-lang
tdy_ has quit [Client Quit]
vbatts has quit [Ping timeout: 252 seconds]
tdy has quit [Quit: WeeChat 0.3.9.2]
tdy has joined #ruby-lang
xyzodiac has joined #ruby-lang
mercwithamouth has joined #ruby-lang
jbsan has quit [Ping timeout: 250 seconds]
jbsan has joined #ruby-lang
mwjcomputing has quit [Ping timeout: 260 seconds]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
davidbalber|away is now known as davidbalbert
tenderlo_ has joined #ruby-lang
davidbalbert is now known as davidbalber|away
Sambalero has joined #ruby-lang
Sambalero has quit [Remote host closed the connection]
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
tenderlove has quit [Ping timeout: 250 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
coliflor_ has joined #ruby-lang
wyhaines_ has joined #ruby-lang
coliflor has quit [Ping timeout: 245 seconds]
wyhaines has quit [Ping timeout: 252 seconds]
gsav has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]
vbatts has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 244 seconds]
CaptainJet has quit []
xyzodiac has joined #ruby-lang
areil has joined #ruby-lang
tenderlo_ has quit [Remote host closed the connection]
wyhaines_ has quit [Remote host closed the connection]
nerd has quit [Quit: WeeChat 0.3.9.2]
xyzodiac has quit [Quit: Computer has gone to sleep.]
xyzodiac has joined #ruby-lang
mercwithamouth has joined #ruby-lang
kain has quit [Quit: exit]
Nisstyre has quit [Quit: Leaving]
mercwithamouth has quit [Ping timeout: 260 seconds]
Nisstyre has joined #ruby-lang
kain has joined #ruby-lang
seanstickle has quit [Quit: seanstickle]
datanoise has joined #ruby-lang
lcdhoffman has joined #ruby-lang
lcdhoffman has quit [Client Quit]
mwjcomputing has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
intellitech has joined #ruby-lang
Nisstyre has joined #ruby-lang
ddd has joined #ruby-lang
wyhaines has joined #ruby-lang
enamrik has joined #ruby-lang
enamrik has quit [Client Quit]
ryanf_ has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
agarie has joined #ruby-lang
Guest__ has joined #ruby-lang
ananna has joined #ruby-lang
Guest__ has left #ruby-lang [#ruby-lang]
anannie has quit [Ping timeout: 252 seconds]
pvande has joined #ruby-lang
<pvande>
I've been playing with Ripper a bit, and I've stumbled across some difficulties with string parsing.
gsav has quit [Read error: Connection reset by peer]
<pvande>
The problem I'm trying to solve involves valid Ruby from Ripper's parse tree; since the string contents are escaped differently, and the quoting information is abstracted away, I'm at a loss for how best to work with this.
<pvande>
Anyone have any pointers?
<foucist>
pvande: not familiar with it.. btw, were you expecting the last result to be the same as the former result?
<foucist>
i.e. you were expecting => [:program, [[:string_literal, [:string_content, [:@tstring_content, "\"", [1, 1]]]]]] ?
<pvande>
foucist: It's less a question of expecting one thing or another. I could work with either result.
<pvande>
What I can't seem to work with is the literal unquoted source bytes (e.g. '"' vs '\"') without knowing how they were quoted.
<foucist>
pvande: well, ripper seems consistent though
<pvande>
I'd *prefer* not to have to know how they were quoted, in which case I would get just the "interpretted" content.
<pvande>
To be clear: it's not the quotes I care about. What I care about is knowing how to interpret the tstring_content.
mwjcomputing has quit [Ping timeout: 252 seconds]
ryanf_ has quit [Quit: broken pipes |||]
<lsegal>
Ripper.sexp is a very simplistic ast generator convenience method. if you're trying to get details about the original source you'll want to write your own on_* methods
<rking>
pvande: When mapping from a complex input to a complex output, there is almost almost going to be a question of canonicalization.
<rking>
That is, Which is the "true form", to say '"' or to say "\"" ? Neither/both, of course, so if you want to compare two equivalences you first have to decide-on and convert-to some canonical form.
<rking>
pvande: You wouldn't expect to see `puts "foo" if @bar` == `if @bar; puts "foo" end`, would you?
<rking>
Or perhaps a better example would be the 2nd vs `if @bar then puts "foo" end`
<lsegal>
pvande i'd probably use the @tstring_content node's line/char info to find the previous character, which would give you ' or "... at least in the case of simple quote strings.
<pvande>
rking: I'm fine with that, really. But the AST abstracts away the information required for canonicalization -- that's my problem.
<rking>
Nono, it's up to you to map that AST to some single voicing of any given AST
<rking>
It's actually pretty cool that Ripper retains the original, so you don't have to modify user input when round-tripping
<Gues_____>
rking: I feel like I've failed to express myself well.
<Gues_____>
(Also, my IRC client is giving me trouble.)
<Gues_____>
What I'm trying to do is round-trip Ruby code. Without string content canonicalization or retaining the quoting information, you can't round-trip with the AST.
<lsegal>
note that that is not "the" AST. it's *an* AST representation based on a very simplistic ripper API implementation
<lsegal>
if you want a round-trippable AST, you have to add in that extra information to the AST you generate
waffleau_ has quit [Ping timeout: 248 seconds]
<lsegal>
you can figure it out, trstring_content has position information with which you can use to access the opening quote character.. and that should be reliable. but it needs to be done when the AST is built
ruby-lang888 has joined #ruby-lang
<lsegal>
(or you need access to the original source)
<Gues_____>
lsegal: I've not had much luck building a custom AST generator so far, but it sounds like that may be the way I need to go. Thanks
<lsegal>
yea, if you don't want to go that route, just keep access to the original source around and use that with the position indexes on the token nodes
waffleau_ has joined #ruby-lang
ruby-lang888 has quit [Ping timeout: 245 seconds]
<Gues_____>
lsegal: The problem with just using the position indexes comes from multi-character quoting constructs.
<lsegal>
those dont even show up right in the ast anyway
mytrile has quit [Remote host closed the connection]
leopard_me has quit [Quit: Computer has gone to sleep.]
<jammi>
got that exception a moment ago and there's no english explanation available
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
swav has joined #ruby-lang
ebouchut has quit [Quit: This computer has gone to sleep]
<pangel>
Sorry for asking again: when I create a new UDPSocket socket, which port will send on by default (I assume the port specified in socket.send is the destination port)
io_syl has quit [Quit: Computer has gone to sleep.]
seanstickle has quit [Quit: seanstickle]
<manveru>
pangel: did yo utry?
<manveru>
*you
<imperator>
there isn't a default port is there? thought you had to specify it
mercwithamouth has joined #ruby-lang
Weems has joined #ruby-lang
workmad3 has quit [Ping timeout: 240 seconds]
<chris2>
eh wtf
<chris2>
i've been using ruby for over ten years and never noticed:
<chris2>
>> "foo" =~ /fo|foo/; $&
<chris2>
=> "fo"
<manveru>
"foo"[/fo|foo/] :)
<chris2>
i mean: it doesnt use the longest match
ebouchut has joined #ruby-lang
<pangel>
manveru: I don't know how to inspect a socket object to see which it is bound to by default
<pangel>
imperator: well, I can do s = UDPSocket.new, s.send(msg, flags, ip, port) without specifying an outgoing port
<manveru>
chris2: it uses the first one
<chris2>
yes
<chris2>
thats not how regular expressions work, usually
<manveru>
pangel: after .send it's bound at 58341 on the first try, 38862 on second
<manveru>
so i'd say it just chooses a random one
<manveru>
just like tcp
madish has joined #ruby-lang
<manveru>
chris2: ag matches fo
<chris2>
grep -P matches fo too
<manveru>
ack matches fo
<chris2>
tcl matches foo
<chris2>
egrep matches foo
<manveru>
so i guess doing order over length is a perlish thing?
waffleau_ has joined #ruby-lang
waffleau has quit [Read error: Connection reset by peer]
<apeiros_>
fo* isn't the same as fo|foo, though
<manveru>
yeah
<pangel>
manveru: And I guess recvfrom then listens on all ports as well? I don't know much about networking, but is it possible for two sockets to listen to the same port at the same time?
<manveru>
pangel: for udp it's possible, afaik
joevandyk has joined #ruby-lang
<manveru>
then again, i pretty much never use udp, so don't trust me :)
<manveru>
chris2: sed matches foo
<chris2>
all but perly stuff seems to match foo
mytrile has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
mytrile has quit [Ping timeout: 256 seconds]
<pangel>
manveru: thanks :)
gaveen has quit [Ping timeout: 250 seconds]
mercwithamouth has quit [Ping timeout: 252 seconds]
xyzodiac has joined #ruby-lang
knknbk has joined #ruby-lang
PhilCK has quit [Quit: PhilCK]
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
leopard_me has joined #ruby-lang
mytrile has joined #ruby-lang
mars777 has joined #ruby-lang
ddd has quit [Quit: Leaving.]
ddd has joined #ruby-lang
ddd has left #ruby-lang [#ruby-lang]
ddd has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
vlad_starkov has joined #ruby-lang
workmad3 has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 264 seconds]
Mon_Ouie has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
icooba has quit [Quit: Computer has gone to sleep.]
fsvehla has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
mytrile has joined #ruby-lang
ebouchut has quit [Quit: This computer has gone to sleep]
gregmoreno has quit [Remote host closed the connection]
adambeynon has joined #ruby-lang
Carnage\ has quit []
Flocon has joined #ruby-lang
S3kx has quit [Quit: Leaving]
havenn has joined #ruby-lang
unsymbol has quit [Ping timeout: 252 seconds]
unsymbol has joined #ruby-lang
datanoise has quit [Ping timeout: 260 seconds]
havenn has quit [Remote host closed the connection]
ebouchut has joined #ruby-lang
datanoise has joined #ruby-lang
<jkyle>
is there a built in method for merging hashes that merges key values rather than overwrites them? I've created a gist with code examples of what I want: https://gist.github.com/4246405
<apeiros_>
jkyle: Hash#merge takes a block
coliflor has quit [Remote host closed the connection]
coliflor has joined #ruby-lang
<reactormonk>
apeiros_, hmm, how annoying would a private :send be? :>
<banisterfiend>
reactormonk: not that bad
wyhaines has joined #ruby-lang
wyhaines_ has quit [Read error: Connection reset by peer]
<reactormonk>
banisterfiend, require 'evil'?
<reactormonk>
banisterfiend, did you take that up btw?
tenderlove has quit [Remote host closed the connection]
setmeaway2 has quit [Read error: Connection reset by peer]
setmeaway2 has joined #ruby-lang
s1n4 has quit [Quit: leaving]
kith_ has joined #ruby-lang
banisterfiend has quit [Ping timeout: 250 seconds]
banisterfiend has joined #ruby-lang
kith has quit [Ping timeout: 260 seconds]
kith_ is now known as kith
<apeiros_>
jkyle: .0
<apeiros_>
I doubt that works
sheperson has quit [Quit: Leaving]
leopard_me has quit [Quit: Computer has gone to sleep.]
<jkyle>
it works
<jkyle>
or my bit of testing indicates such, what looks broken?
* jkyle
goes to test more
tenderlove has joined #ruby-lang
<jkyle>
it's a recursive loop with the terminator being one or the other hash having a non-hash value as the key
leopard_me has joined #ruby-lang
dankest has joined #ruby-lang
ebouchut has joined #ruby-lang
<havenn>
Is requiring multiple files/gems on one line undesirable? What would the downside be of having a plural #requires that accepts multiple args? E.g.: https://gist.github.com/2339554
joenobody has joined #ruby-lang
<tpope>
havenn: changing require to requires doesn't make grammatical sense, for starters
<havenn>
tpope: This file requires 'x', 'y', 'z'
<tpope>
havenn: This file require 'x'
<havenn>
tpope: mmm
<tpope>
going from one to many has no effect on the verb
<havenn>
tpope: Just a cheap way to mean plural. But I see your point that it is grammatically suspect.
tenderlove has quit [Remote host closed the connection]
setmeaway2 has quit [Read error: No buffer space available]
setmeaway2 has joined #ruby-lang
<tpope>
I think the solution, if anything, would be to just make require take multiple arguments, and make the return value either the AND or the OR of them
<tpope>
nobody's ever going to use that dumb hash anyways
<tpope>
but to answer your larger question
<tpope>
advantages of one require per line include easier scannability, and cleaner diffs
Flocon has quit [Quit: Quitte]
wallerdev has joined #ruby-lang
<rue>
Arguably
<tpope>
cleaner diffs isn't arguable
joenobody has quit [Quit: See ya!]
wyhaines has joined #ruby-lang
wyhaines_ has quit [Read error: Connection reset by peer]
CaptainJet has joined #ruby-lang
<jkyle>
as someone who merges others commits, one per line is far more desirable
<hagabaka>
eh, if the ability of requiring multiple files per call existed, you can use that to produce cleaner changes too
gaveen has quit [Quit: Leaving]
<tpope>
elaborate
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
uebas has joined #ruby-lang
<hagabaka>
if multiple files are loaded for closely related purposes, you can load them in one line
uebas has left #ruby-lang [#ruby-lang]
<reactormonk>
does the ruby parser use \s or \p{Space}?
<jkyle>
from the diff perspective it's a matter of clarity. with one per line, it's obvious. with multiple per line, you must derive by scanning each file and figuring it out.
earthquake has joined #ruby-lang
<reactormonk>
so you can do ugly shit with unicode spaces
rippa has joined #ruby-lang
<tpope>
yeah, I could see an argument for multiple requires per line being cleaner code, but I definitely can't see it supporting cleaner diffs
<hagabaka>
right, but if you apply that standard of "cleaner diffs", which is changes are preferably be done in entire lines, then few things in Ruby promote cleaner diffs
Torrieri has joined #ruby-lang
havenn has quit [Remote host closed the connection]
<hagabaka>
and you would still be able to write the filenames on different lines even if they are arguments to the same method call, like people do with long arrayes and hashes
<tpope>
oh god, that's the worst of both worlds :/
<tpope>
for the record, I don't really oppose the change. require 'a', 'b', 'c' in irb would be nice
<reactormonk>
tpope, go use pry
<tpope>
I do use pry
<tpope>
changing my sentence to use pry would have accomplished nothing
<ggreer>
instead of having the language promote cleaner diffs, wouldn't it be better if the diff tools were smarter when it came to showing changes?
<tpope>
not realistically going to happen
fsvehla has quit [Quit: fsvehla]
<ggreer>
eh, we're getting closer. github already highlights the parts of lines that change
<tpope>
I mean, with ruby, that's a pretty hopeless task
gaveen has quit [Quit: leaving]
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
fsvehla has joined #ruby-lang
<tpope>
I guess the flipside is what's the gain? I sort of buy hagabaka's grouping argument, but blank lines work well for that too
havenn has joined #ruby-lang
seydar has joined #ruby-lang
dankest is now known as dankest|away
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
dankest|away is now known as dankest
gaveen_ has joined #ruby-lang
rippa has quit [Ping timeout: 264 seconds]
gaveen_ has quit [Client Quit]
Ridders has joined #ruby-lang
gaveen has quit [Quit: Leaving]
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
<seydar>
hey coolkids
<seydar>
wait nevermind, wrong channel
<seydar>
my greeting still stands however
seydar has quit [Quit: Changing server]
<injekt>
how nice
Ridders has quit [Quit: Page closed]
havenn has quit [Remote host closed the connection]
seanstickle has joined #ruby-lang
dlackty has quit []
datanoise has quit [Ping timeout: 248 seconds]
fsvehla has quit [Quit: fsvehla]
dankest is now known as dankest|away
s1n4 has joined #ruby-lang
fsvehla has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
fsvehla has quit [Client Quit]
sush24_ has quit [Quit: This computer has gone to sleep]
seanstickle has quit [Quit: seanstickle]
mccraig_ has quit []
mccraig_ has joined #ruby-lang
coliflor has quit [Ping timeout: 245 seconds]
dankest|away is now known as dankest
wallerdev has quit [Quit: wallerdev]
enamrik has joined #ruby-lang
mjio has joined #ruby-lang
srbaker has joined #ruby-lang
workmad3 has joined #ruby-lang
stonerfish has quit [Quit: Leaving.]
Verdi_ has joined #ruby-lang
wallerdev has joined #ruby-lang
datanoise has joined #ruby-lang
dankest is now known as dankest|away
datanoise has quit [Ping timeout: 255 seconds]
gsav has joined #ruby-lang
akahn_ has quit []
strmpnk_ has quit []
strmpnk_ has joined #ruby-lang
mroth has quit []
mroth has joined #ruby-lang
beawesomeinstead has quit []
wyhaines_ has joined #ruby-lang
wyhaines has quit [Read error: Connection reset by peer]
beawesomeinstead has joined #ruby-lang
gaveen has quit [Quit: leaving]
gaveen has joined #ruby-lang
brainspoil has joined #ruby-lang
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
ebouchut has quit [Quit: This computer has gone to sleep]
mercwithamouth has joined #ruby-lang
wycats__ has quit []
wycats__ has joined #ruby-lang
Mon_Ouie has quit [Quit: WeeChat 0.3.9.2]
kyrylo has quit [Quit: WeeChat 0.3.9.1]
mercwithamouth has quit [Ping timeout: 265 seconds]
Paradox has quit [Ping timeout: 252 seconds]
<jkyle>
apeiros_: it works cause merge only iterates over duplicate keys, so you never get a situation where one key lookup returns the default nil and blows away the other entry
Paradox has joined #ruby-lang
<jkyle>
non-dups are automatically merged into the calling hash
brainspoil has quit [Quit: Leaving]
Nisstyre-laptop has quit [Quit: Leaving]
cddr has joined #ruby-lang
cirwin has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
<apeiros_>
jkyle: no, it works by coincidence
wyhaines_ has quit [Read error: Connection reset by peer]
<apeiros_>
jkyle: line 7 returns new
<apeiros_>
that you add it to new_hash doesn't matter
wyhaines has joined #ruby-lang
<apeiros_>
but in your case I think you never have a colliding key other than ones which have a hash as value anyway.