Sha256: 78d7e431fbf77f53ffec213f32bb765d029ef6c3f76da91654f82d9e7406ea3d

Contents?: true

Size: 333 Bytes

Versions: 2

Compression:

Stored size: 333 Bytes

Contents

if !Symbol.instance_methods.include?(:<=>)
  class Symbol
    # Ruby 1.8.7 does not define #<=>, which subsequently breaks Enumerable#sort
    # when sorting an array of symbols.
    #
    # @see https://github.com/puppetlabs/r10k/issues/310
    def <=>(other)
      self.to_s <=> other.to_s if other.is_a?(Symbol)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
r10k-1.5.1 lib/r10k/util/monkey_patches.rb
r10k-1.4.2 lib/r10k/util/monkey_patches.rb