Sha256: e60abed43517a9c6e9b79d4daaa178aeb2a63739a489691fc7d98cc0092f3ef2

Contents?: true

Size: 699 Bytes

Versions: 12

Compression:

Stored size: 699 Bytes

Contents

# Enumerable for gem name => version hash
module GemVersionCheck
  class Checks
    include Enumerable

    def initialize(gem_names)
      @gem_names = gem_names
    end

    def each(&block)
      members.each(&block)
    end

    def members
      @members ||= begin
        puts "Fetching gemspecs for all listed gems..."
        checks = {}
        @gem_names.each do |gem_name|
          spec = Gem.latest_spec_for(gem_name)
          if spec
            puts " * #{gem_name}: #{spec.version.to_s}"
            checks[gem_name] = spec.version.to_s
          else
            puts " * #{gem_name}: not found (Maybe a typo?)"
          end
        end
        checks
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gem_version_check-0.5.1 lib/gem_version_check/checks.rb
gem_version_check-0.5.0 lib/gem_version_check/checks.rb
gem_version_check-0.5.2 lib/gem_version_check/checks.rb
gem_version_check-0.4.1 lib/gem_version_check/checks.rb
gem_version_check-0.4.0 lib/gem_version_check/checks.rb
gem_version_check-0.3.1 lib/gem_version_check/checks.rb
gem_version_check-0.3.0 lib/gem_version_check/checks.rb
gem_version_check-0.2.1 lib/gem_version_check/checks.rb
gem_version_check-0.2.0 lib/gem_version_check/checks.rb
gem_version_check-0.1.0 lib/gem_version_check/checks.rb
gem_version_check-0.0.10 lib/gem_version_check/checks.rb
gem_version_check-0.0.9 lib/gem_version_check/checks.rb