Class: Crackin::Release
- Inherits:
-
Object
- Object
- Crackin::Release
- Defined in:
- lib/crackin/release.rb
Instance Method Summary collapse
- #finish(options = {}) ⇒ Object
-
#initialize(type) ⇒ Release
constructor
A new instance of Release.
- #rollback(options = {}) ⇒ Object
- #start(options = {}) ⇒ Object
Constructor Details
#initialize(type) ⇒ Release
Returns a new instance of Release.
3 4 5 6 7 8 9 10 11 |
# File 'lib/crackin/release.rb', line 3 def initialize(type) @config = Crackin.config @source = @config.source @current = @source.current_branch @type = type @version = Crackin::VersionFile.new(@config['version']) raise "unknown version type: #{type}" unless @version.respond_to?(type.to_sym) @version.send(type.to_sym) end |
Instance Method Details
#finish(options = {}) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/crackin/release.rb', line 24 def finish(={}) o = { real: true }.merge() run(finish_actions) end |
#rollback(options = {}) ⇒ Object
31 32 33 34 |
# File 'lib/crackin/release.rb', line 31 def rollback(={}) puts "rolling back: #{@version}" undo(start_actions) end |
#start(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/crackin/release.rb', line 13 def start(={}) o = { real: true }.merge() # make sure no pending changes raise "there are pending changes" if o[:real] && @source.pending? puts "release: #{@version}" run(start_actions) end |