Sha256: 4b361aa40dcee996d0e2fb1dd77a60fc8efc5378a0b867cf2833be3bff9f3db0

Contents?: true

Size: 449 Bytes

Versions: 3

Compression:

Stored size: 449 Bytes

Contents

require 'bundler/restrict/bundler'
require 'bundler/restrict/gem'

module Bundler
  module Restrict
    class BundlerGems
      include Enumerable

      def initialize(bundler=Bundler.new)
        @bundler = bundler
      end

      def each
        @bundler.list.scan(/\*\s+([[:alnum:]-]+)\s+\(([\d\.]+)\)/).each do |match|
          yield Gem.new(match[0]).version(match[1])
        rescue Gems::NotFound
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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