Sha256: 8009d7dd937c09825cf054ac961efcc22d8079dd5fb3679dc968f2758aea44ed

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

module Pessimize
  class Gem
    attr_reader :name, :version, :options
    attr_writer :version

    def initialize(*args)
      @name = args.shift
      while arg = args.shift
        if arg.is_a? Hash
          @options = arg
        else
          @version = arg
        end
      end
    end

    def to_code
      s = ""
      s << %Q{gem "#{name}"}
      s << %Q{, "#{version}"} if version
      s << %Q{, #{options.inspect}} if options
      s
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pessimize-0.1.0 lib/pessimize/gem.rb
pessimize-0.0.3 lib/pessimize/gem.rb
pessimize-0.0.2 lib/pessimize/gem.rb