Sha256: 376befb24a2636268d6170e2a5b11b019b86245143005e461d58c52f4ee9590b

Contents?: true

Size: 394 Bytes

Versions: 3

Compression:

Stored size: 394 Bytes

Contents

require 'gems'
require 'bundler/restrict/gem_version'

module Bundler
  module Restrict
    class Gem
      attr_reader :name

      def initialize(name)
        @name = name
      end

      def version(number)
        versions.find { |ver| ver.number == number }
      end

      def versions
        Gems.versions(@name).map { |info| GemVersion.new(self, info) }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bundler-restrict-0.1.2 lib/bundler/restrict/gem.rb
bundler-restrict-0.1.1 lib/bundler/restrict/gem.rb
bundler-restrict-0.1.0 lib/bundler/restrict/gem.rb