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