blazingpair/ruby-conf — pull request #1 by gnovos (2012-08-23 02:35:49+00:00)
Title: This is what happens when you let me write code.  You really only have yourself to blame.

I wanted to be able to print out the config with puts, thus headed in to implement "to_s". The following is what took place:

* ".inspect" walks the tree in alphabetical order, recursively ".inspect"-ing it's children

* Fixed one *huge* bug, as Hash.clone does NOT do a deep copy, so the "inherited" properties were being over written if they were inherited by more than one node.

* Multiple inheritance is now possible using an array, like this: "rectangle :inherits => [shape, square] do ..."

* This is now perfectly legal syntax:

RubyConf.define "AreYouReadyForThis?", :as => :JustWaitForIt do
ok {
this "looks"
pretty :normal
so {
far what is the
big {
deal? I mean
oh
wait a second
wait a goddamn second I said!
what {
the hell are you doing?
how can this be valid ruby?
are you
freaking {
kidding me?
how can this possible?
This is unnatural
this is witchcraft
witchcraft {
I tell you!
Look {
this is too much
You do
too many weird things with software
I want this to
end
I just want to be left alone
just {
stay away from me
ok?
}
}
}
}
}
}
}
}
end

* "to_s" is now implemented. It wil print the above like this:

[AreYouReadyForThis?]

ok:
pretty: normal
so:
big:
deal?: I mean
oh:
wait: a second
what:
are: you
freaking:
This: is unnatural
how: can this possible?
kidding: me?
this: is witchcraft
witchcraft:
I: tell you!
Look:
I: just want to be left alone
You:
I: want this to
too: many weird things with software
just:
ok?:
stay: away from me
this: is too much
how: can this be valid ruby?
the: hell are you doing?
far: what is the
this: looks

and the inspect version looks like this:

[AreYouReadyForThis?] ok: { pretty: :normal, so: { big: { deal?: "I mean", oh: "", wait: "a second", what: { are: "you", freaking: { This: "is unnatural", how: "can this possible?", kidding: "me?", this: "is witchcraft", witchcraft: { I: "tell you!", Look: { I: "just want to be left alone", You: { I: "want this to", too: "many weird things with software" }, just: { ok?: "", stay: "away from me" }, this: "is too much" } } }, how: "can this be valid ruby?", the: "hell are you doing?" } }, far: "what is the" }, this: "looks" }