Sha256: dad64f8700839f2de3d37554f7fca1f030f3c74f666f210dd8f3de7f7ac8b58b

Contents?: true

Size: 387 Bytes

Versions: 14

Compression:

Stored size: 387 Bytes

Contents

module Manpages
  class GemVersion
    def initialize(gem_spec)
      @gem_spec = gem_spec
    end

    def latest?
      latest_gem.nil? || latest_gem <= @gem_spec.version
    end

  private

    def latest_gem
      all_gem_versions.sort.last
    end

    def all_gem_versions
      Gem::Specification.each.select {|spec| @gem_spec.name == spec.name }.map(&:version)
    end
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/gem_version.rb
manpages-0.6.1 lib/manpages/gem_version.rb
manpages-0.6.0 lib/manpages/gem_version.rb
manpages-0.5.2 lib/manpages/gem_version.rb
manpages-0.5.1 lib/manpages/gem_version.rb
manpages-0.5.0 lib/manpages/gem_version.rb
manpages-0.4.0 lib/manpages/gem_version.rb