class AtlassianAppVersions::AbstractVersion

A plugin or app version

Attributes

version[RW]

Public Class Methods

new(versionName, parent) click to toggle source
# File lib/atlassian_app_versions.rb, line 288
def initialize(versionName, parent) 
    @version = versionName
    @parent = parent
end

Public Instance Methods

<=>(other_version) click to toggle source
# File lib/atlassian_app_versions.rb, line 309
def <=>(other_version)
    # Confluence has a version with underscores (3.0.0_01) which Gem::Version doesn't like, so strip it
    v1 = @version.gsub('_', '.')
    v2 = other_version.to_s.gsub('_', '.')
    begin
        Gem::Version.new(v1) <=> Gem::Version.new(v2)
    rescue ArgumentError => e
        $stderr.puts e.message
    end

end
inspect() click to toggle source
# File lib/atlassian_app_versions.rb, line 301
def inspect
    "#<#{self.class.name}:#{self.object_id} #{to_s}>"
end
keys() click to toggle source
# File lib/atlassian_app_versions.rb, line 321
def keys
    versionJSON.keys
end
method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/atlassian_app_versions.rb, line 325
def method_missing(name, *args, &block)
    if versionJSON and versionJSON.keys.member? name.to_s then
        versionJSON[name.to_s]
    else
        super
    end
end
releaseDate() click to toggle source
# File lib/atlassian_app_versions.rb, line 297
def releaseDate
    DateTime.strptime(versionJSON["releaseDate"], '%Y-%m-%dT%H:%M:%S.%L%z') if versionJSON
end
respond_to_missing?(name, include_private = false) click to toggle source
Calls superclass method
# File lib/atlassian_app_versions.rb, line 333
def respond_to_missing?(name, include_private = false)
    keys.member? name.to_s || super
end
to_s() click to toggle source
# File lib/atlassian_app_versions.rb, line 305
def to_s
    @version
end
versionJSON() click to toggle source
# File lib/atlassian_app_versions.rb, line 293
def versionJSON
    @parent.versionsJSON.find { |v| v["version"] == @version }
end