Sha256: 41fb89d344955cb498040eeeb99b81d9fb397bc98d8c0e0c7ba970bc5a8fb8c6

Contents?: true

Size: 625 Bytes

Versions: 2

Compression:

Stored size: 625 Bytes

Contents

#--
# (c) Copyright 2007-2008 Sun Microsystems, Inc.
# See the file LICENSES.txt included with the distribution for
# software license details.
#++

module Warbler
  # A set of gems. This only exists to allow expected operations
  # to be used to add gems, and for backwards compatibility.
  # It would be easier to just use a hash.
  class Gems < Hash
    ANY_VERSION = nil
    
    def initialize(gems = nil)
      if gems.is_a?(Hash)
        self.merge!(gems)
      elsif gems.is_a?(Array)
        gems.each {|gem| self << gem }
      end
    end
    
    def <<(gem)
      self[gem] ||= ANY_VERSION
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
warbler-0.9.10 lib/warbler/gems.rb
warbler-0.9.9 lib/warbler/gems.rb