Class: Deploy::Version
- Inherits:
-
Object
- Object
- Deploy::Version
- Defined in:
- lib/deploy_version.rb
Instance Attribute Summary collapse
-
#current_version ⇒ Object
Returns the value of attribute current_version.
-
#deployed_by ⇒ Object
Returns the value of attribute deployed_by.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
Instance Method Summary collapse
- #add(key, value) ⇒ Object
- #deployed_time ⇒ Object
- #export ⇒ Object
-
#initialize ⇒ Version
constructor
A new instance of Version.
- #load_from_file ⇒ Object
- #load_from_url ⇒ Object
- #store_to_file(filename) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Version
Returns a new instance of Version.
22 23 24 25 |
# File 'lib/deploy_version.rb', line 22 def initialize @deployed_time = Time.now @custom_values = {} end |
Instance Attribute Details
#current_version ⇒ Object
Returns the value of attribute current_version.
20 21 22 |
# File 'lib/deploy_version.rb', line 20 def current_version @current_version end |
#deployed_by ⇒ Object
Returns the value of attribute deployed_by.
20 21 22 |
# File 'lib/deploy_version.rb', line 20 def deployed_by @deployed_by end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
20 21 22 |
# File 'lib/deploy_version.rb', line 20 def time_zone @time_zone end |
Instance Method Details
#add(key, value) ⇒ Object
50 51 52 |
# File 'lib/deploy_version.rb', line 50 def add key, value @custom_values[key] = value end |
#deployed_time ⇒ Object
46 47 48 |
# File 'lib/deploy_version.rb', line 46 def deployed_time @deployed_time end |
#export ⇒ Object
63 64 65 |
# File 'lib/deploy_version.rb', line 63 def export YAML::dump(to_h) end |
#load_from_file ⇒ Object
31 32 33 |
# File 'lib/deploy_version.rb', line 31 def load_from_file raise Error.not_implemented 'load_from_file' end |
#load_from_url ⇒ Object
27 28 29 |
# File 'lib/deploy_version.rb', line 27 def load_from_url raise Error.not_implemented 'load_from_url' end |
#store_to_file(filename) ⇒ Object
35 36 37 38 39 |
# File 'lib/deploy_version.rb', line 35 def store_to_file(filename) File.open(filename, 'w+') do |file| file.puts export end end |
#to_h ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/deploy_version.rb', line 54 def to_h { :current_version => @current_version, :deployed_by => @deployed_by, :deployed_time => deployed_time, :custom_values => @custom_values } end |