Class: Ops::Revision
- Inherits:
-
Object
- Object
- Ops::Revision
- Defined in:
- lib/ops/revision.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#file_root ⇒ Object
readonly
Returns the value of attribute file_root.
Instance Method Summary collapse
- #headers ⇒ Object
- #info ⇒ Object
-
#initialize(new_headers = {}, opts = Ops.config) ⇒ Revision
constructor
A new instance of Revision.
- #previous_info ⇒ Object
Constructor Details
#initialize(new_headers = {}, opts = Ops.config) ⇒ Revision
Returns a new instance of Revision.
7 8 9 10 11 |
# File 'lib/ops/revision.rb', line 7 def initialize(new_headers = {}, opts = Ops.config) @file_root = opts.file_root.to_s # convert to string in case they pass us a Pathname @environment = opts.environment @headers = new_headers end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
13 14 15 |
# File 'lib/ops/revision.rb', line 13 def environment @environment end |
#file_root ⇒ Object (readonly)
Returns the value of attribute file_root.
5 6 7 |
# File 'lib/ops/revision.rb', line 5 def file_root @file_root end |
Instance Method Details
#headers ⇒ Object
15 16 17 |
# File 'lib/ops/revision.rb', line 15 def headers @headers.select { |k, v| k.match(/^[-A-Z_].*$/) } end |
#info ⇒ Object
19 20 21 |
# File 'lib/ops/revision.rb', line 19 def info @info ||= build_info.merge(deploy_info) end |
#previous_info ⇒ Object
23 24 25 |
# File 'lib/ops/revision.rb', line 23 def previous_info @previous_info ||= previous_build_info.merge(previous_deploy_info) end |