diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-02-28 16:37:22 -0800 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-02-28 17:10:58 -0800 |
commit | 8cc390caa18e3b536869f0591d529d8ade76fc49 (patch) | |
tree | 2a338d0a499f633c7081a275d18e10777660d4a7 /lib/puppet/util/monkey_patches.rb | |
parent | 24eacb7fe6696a8c049b08ec382c5d1ab114ce67 (diff) | |
download | puppet-8cc390caa18e3b536869f0591d529d8ade76fc49.tar.gz puppet-8cc390caa18e3b536869f0591d529d8ade76fc49.tar.xz puppet-8cc390caa18e3b536869f0591d529d8ade76fc49.zip |
(#5466) Monkey patch Symbol so that you can sort them
It turns out that the ability to sort symbols comes in the preinit
section of application run when we load Facter and hit the code that
adds the <=> method for symbols in lib/facter/util/plist/generator.rb
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/util/monkey_patches.rb')
-rw-r--r-- | lib/puppet/util/monkey_patches.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb index 85854a04c..16384855a 100644 --- a/lib/puppet/util/monkey_patches.rb +++ b/lib/puppet/util/monkey_patches.rb @@ -21,6 +21,9 @@ class Symbol z.emit("!ruby/sym ") to_s.to_zaml(z) end + def <=> (other) + self.to_s <=> other.to_s + end end [Object, Exception, Integer, Struct, Date, Time, Range, Regexp, Hash, Array, Float, String, FalseClass, TrueClass, Symbol, NilClass, Class].each { |cls| |