Sha256: c75411b32bf4bbade8970ff4708fb4bcdc91efc8c77f955033d29b0762a9318c

Contents?: true

Size: 731 Bytes

Versions: 16

Compression:

Stored size: 731 Bytes

Contents

module Negroku::Versionable
  module ClassMethods
    attr_accessor :latest, :capfile_version, :updated, :capfile_updated

    def check_version
      require 'gems'

      self.latest = Gems.versions("negroku").first["number"]
      self.updated = is_latest?(version, self.latest)
    end

    def check_capfile_version
      self.capfile_updated = is_latest?(capfile_version, version)
    end

    private

    def is_latest?(current_version, latest_version)
      require 'semantic'

      latest_version = Semantic::Version.new latest_version
      current_version = Semantic::Version.new current_version

      latest_version <= current_version
    end
  end

  def self.included klass
    klass.extend ClassMethods
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
negroku-2.8.6 lib/negroku/versionable.rb
negroku-2.8.5 lib/negroku/versionable.rb
negroku-2.8.4 lib/negroku/versionable.rb
negroku-2.8.3 lib/negroku/versionable.rb
negroku-2.8.2 lib/negroku/versionable.rb
negroku-2.8.1 lib/negroku/versionable.rb
negroku-2.8.0 lib/negroku/versionable.rb
negroku-2.7.1 lib/negroku/versionable.rb
negroku-2.7.0 lib/negroku/versionable.rb
negroku-2.6.0 lib/negroku/versionable.rb
negroku-2.5.5 lib/negroku/versionable.rb
negroku-2.5.4 lib/negroku/versionable.rb
negroku-2.5.3 lib/negroku/versionable.rb
negroku-2.5.2 lib/negroku/versionable.rb
negroku-2.5.1 lib/negroku/versionable.rb
negroku-2.5.0 lib/negroku/versionable.rb