Sha256: 8ce463bc395c583244fa865c096d5c1b47c9554e1f5ff78194916ce4edc09fd9

Contents?: true

Size: 522 Bytes

Versions: 5

Compression:

Stored size: 522 Bytes

Contents

module Appraisal
  # An ordered hash implementation for Ruby 1.8.7 compatibility. This is not
  # a complete implementation, but it covers Appraisal's specific needs.
  class OrderedHash < ::Hash
    # Hashes are ordered in Ruby 1.9.
    if RUBY_VERSION < '1.9'
      def initialize(*args, &block)
        super
        @keys = []
      end

      def []=(key, value)
        @keys << key unless has_key?(key)
        super
      end

      def values
        @keys.collect { |key| self[key] }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/appraisal-2.2.0/lib/appraisal/ordered_hash.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/appraisal-2.2.0/lib/appraisal/ordered_hash.rb
appraisal-2.2.0 lib/appraisal/ordered_hash.rb
appraisal-2.1.0 lib/appraisal/ordered_hash.rb
appraisal-2.0.2 lib/appraisal/ordered_hash.rb