Class: Capistrano::Patch::Strategy::Base
- Inherits:
-
Deploy::Strategy::Base
- Object
- Deploy::Strategy::Base
- Capistrano::Patch::Strategy::Base
- Defined in:
- lib/capistrano/patch/strategy/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#revision_from ⇒ Object
readonly
Configuration.
-
#revision_to ⇒ Object
readonly
Configuration.
Instance Method Summary collapse
- #apply ⇒ Object
- #check_apply ⇒ Object
- #check_revert ⇒ Object
-
#create ⇒ Object
Actions.
- #deliver ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #mark_apply ⇒ Object
- #mark_revert ⇒ Object
- #patch_directory ⇒ Object
- #patch_file ⇒ Object
- #patch_location ⇒ Object
- #patch_path ⇒ Object
- #revert ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/capistrano/patch/strategy/base.rb', line 8 def initialize(*) super if ENV['PATCH'] ENV['FROM'], ENV['TO'] = File.basename(ENV['PATCH'], '.patch').split('-', 2) end ENV['FROM'] or abort "Please specify FROM revision environment variable" ENV['TO'] or abort "Please specify TO revision environment variable" @revision_from = normalize_revision(ENV['FROM']) @revision_to = normalize_revision(ENV['TO']) end |
Instance Attribute Details
#revision_from ⇒ Object (readonly)
Configuration
26 27 28 |
# File 'lib/capistrano/patch/strategy/base.rb', line 26 def revision_from @revision_from end |
#revision_to ⇒ Object (readonly)
Configuration
26 27 28 |
# File 'lib/capistrano/patch/strategy/base.rb', line 26 def revision_to @revision_to end |
Instance Method Details
#apply ⇒ Object
64 65 66 |
# File 'lib/capistrano/patch/strategy/base.rb', line 64 def apply raise NotImplementedError, "`apply' is not implemented by #{self.class.name}" end |
#check_apply ⇒ Object
56 57 58 |
# File 'lib/capistrano/patch/strategy/base.rb', line 56 def check_apply raise NotImplementedError, "`check_apply' is not implemented by #{self.class.name}" end |
#check_revert ⇒ Object
60 61 62 |
# File 'lib/capistrano/patch/strategy/base.rb', line 60 def check_revert raise NotImplementedError, "`check_revert' is not implemented by #{self.class.name}" end |
#create ⇒ Object
Actions
48 49 50 |
# File 'lib/capistrano/patch/strategy/base.rb', line 48 def create raise NotImplementedError, "`create' is not implemented by #{self.class.name}" end |
#deliver ⇒ Object
52 53 54 |
# File 'lib/capistrano/patch/strategy/base.rb', line 52 def deliver raise NotImplementedError, "`deliver' is not implemented by #{self.class.name}" end |
#mark_apply ⇒ Object
72 73 74 |
# File 'lib/capistrano/patch/strategy/base.rb', line 72 def mark_apply mark(revision_to) end |
#mark_revert ⇒ Object
76 77 78 |
# File 'lib/capistrano/patch/strategy/base.rb', line 76 def mark_revert mark(revision_from) end |
#patch_directory ⇒ Object
32 33 34 |
# File 'lib/capistrano/patch/strategy/base.rb', line 32 def patch_directory raise NotImplementedError, "`patch_directory' is not implemented by #{self.class.name}" end |
#patch_file ⇒ Object
28 29 30 |
# File 'lib/capistrano/patch/strategy/base.rb', line 28 def patch_file @patch_file ||= "#{revision_from}-#{revision_to}.patch" end |
#patch_location ⇒ Object
40 41 42 |
# File 'lib/capistrano/patch/strategy/base.rb', line 40 def patch_location raise NotImplementedError, "`patch_location' is not implemented by #{self.class.name}" end |
#patch_path ⇒ Object
36 37 38 |
# File 'lib/capistrano/patch/strategy/base.rb', line 36 def patch_path File.join patch_directory, patch_file end |
#revert ⇒ Object
68 69 70 |
# File 'lib/capistrano/patch/strategy/base.rb', line 68 def revert raise NotImplementedError, "`revert' is not implemented by #{self.class.name}" end |