Class: Capistrano::Patch::Strategy::Git
- Inherits:
-
Base
- Object
- Deploy::Strategy::Base
- Base
- Capistrano::Patch::Strategy::Git
show all
- Defined in:
- lib/capistrano/patch/strategy/git.rb
Instance Attribute Summary
Attributes inherited from Base
#revision_from, #revision_to
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #mark_apply, #mark_revert, #patch_file, #patch_path
Instance Method Details
#apply ⇒ Object
42
43
44
45
46
|
# File 'lib/capistrano/patch/strategy/git.rb', line 42
def apply
command = "cd #{configuration.current_path} && "
command << source.scm('apply', "--binary #{patch_file}")
run(command)
end
|
#check_apply ⇒ Object
30
31
32
33
34
|
# File 'lib/capistrano/patch/strategy/git.rb', line 30
def check_apply
command = "cd #{configuration.current_path} && "
command << source.scm('apply', "--binary --check #{patch_file}")
run(command)
end
|
#check_revert ⇒ Object
36
37
38
39
40
|
# File 'lib/capistrano/patch/strategy/git.rb', line 36
def check_revert
command = "cd #{configuration.current_path} && "
command << source.scm('apply', "-R --binary --check #{patch_file}")
run(command)
end
|
#create ⇒ Object
20
21
22
23
24
|
# File 'lib/capistrano/patch/strategy/git.rb', line 20
def create
command = "env GIT_DIR=#{patch_repository} "
command << source.local.scm('diff-tree', "--binary #{revision_from}..#{revision_to} > #{patch_path}")
system(command)
end
|
#deliver ⇒ Object
26
27
28
|
# File 'lib/capistrano/patch/strategy/git.rb', line 26
def deliver
top.upload patch_path, "#{configuration.current_path}/#{patch_file}"
end
|
#patch_directory ⇒ Object
12
13
14
|
# File 'lib/capistrano/patch/strategy/git.rb', line 12
def patch_directory
configuration.fetch(:patch_directory, '.')
end
|
#patch_location ⇒ Object
16
17
18
|
# File 'lib/capistrano/patch/strategy/git.rb', line 16
def patch_location
patch_path
end
|
#patch_repository ⇒ Object
8
9
10
|
# File 'lib/capistrano/patch/strategy/git.rb', line 8
def patch_repository
configuration.fetch(:patch_repository, '.git')
end
|
#revert ⇒ Object
48
49
50
51
52
|
# File 'lib/capistrano/patch/strategy/git.rb', line 48
def revert
command = "cd #{configuration.current_path} && "
command << source.scm('apply', "-R --binary #{patch_file}")
run(command)
end
|