class Statistrano::Deployment::Strategy::Branches::Release
Manages the state of a single release for the manifest
Attributes
config[R]
name[R]
options[R]
Public Class Methods
new(name, config, options={})
click to toggle source
init a release @param name [String] name of the release @param config [Obj] the config object @param options [Hash] :time, :commit, & :link || :repo_url
# File lib/statistrano/deployment/strategy/branches/release.rb, line 17 def initialize name, config, options={} @name = name @config = config @options = Util.symbolize_hash_keys options end
Public Instance Methods
commit()
click to toggle source
# File lib/statistrano/deployment/strategy/branches/release.rb, line 27 def commit @_commit ||= options.fetch(:commit) { Asgit.current_commit } end
href()
click to toggle source
# File lib/statistrano/deployment/strategy/branches/release.rb, line 35 def href "http://#{name}.#{config.base_domain}" end
link()
click to toggle source
# File lib/statistrano/deployment/strategy/branches/release.rb, line 31 def link @_link ||= options.fetch(:link) { (options[:repo_url]) ? "#{options[:repo_url]}/tree/#{commit}" : nil } end
time()
click to toggle source
# File lib/statistrano/deployment/strategy/branches/release.rb, line 23 def time @_time ||= options.fetch(:time) { Time.now.to_i } end
to_hash()
click to toggle source
def get_binding
binding
end
# File lib/statistrano/deployment/strategy/branches/release.rb, line 52 def to_hash hash = { name: name, time: time, commit: commit } hash.merge({ link: link }) if link return hash end
to_json()
click to toggle source
convert the release to a json object @return [String]
# File lib/statistrano/deployment/strategy/branches/release.rb, line 65 def to_json return to_hash.to_json end