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
- #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.
23 24 25 |
# File 'lib/deploy_version.rb', line 23 def initialize @deployed_time = Time.now end |
Instance Attribute Details
#current_version ⇒ Object
Returns the value of attribute current_version.
21 22 23 |
# File 'lib/deploy_version.rb', line 21 def current_version @current_version end |
#deployed_by ⇒ Object
Returns the value of attribute deployed_by.
21 22 23 |
# File 'lib/deploy_version.rb', line 21 def deployed_by @deployed_by end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
21 22 23 |
# File 'lib/deploy_version.rb', line 21 def time_zone @time_zone end |
Instance Method Details
#deployed_time ⇒ Object
46 47 48 |
# File 'lib/deploy_version.rb', line 46 def deployed_time @deployed_time end |
#export ⇒ Object
58 59 60 |
# File 'lib/deploy_version.rb', line 58 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 end |
#load_from_url ⇒ Object
27 28 29 |
# File 'lib/deploy_version.rb', line 27 def load_from_url raise Error.not_implemented 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
50 51 52 53 54 55 56 |
# File 'lib/deploy_version.rb', line 50 def to_h { :current_version => @current_version, :deployed_by => @deployed_by, :deployed_time => deployed_time } end |