Module: Eternity::Patch::Common
Instance Attribute Summary collapse
-
#current_commit ⇒ Object
readonly
Returns the value of attribute current_commit.
-
#target_commit ⇒ Object
readonly
Returns the value of attribute target_commit.
Instance Method Summary collapse
- #base_commit ⇒ Object
- #base_history ⇒ Object
- #current_history ⇒ Object
- #delta ⇒ Object
- #initialize(current_commit, target_commit) ⇒ Object
- #remaining_history ⇒ Object
- #target_history ⇒ Object
Instance Attribute Details
#current_commit ⇒ Object (readonly)
Returns the value of attribute current_commit.
14 15 16 |
# File 'lib/eternity/patch.rb', line 14 def current_commit @current_commit end |
#target_commit ⇒ Object (readonly)
Returns the value of attribute target_commit.
14 15 16 |
# File 'lib/eternity/patch.rb', line 14 def target_commit @target_commit end |
Instance Method Details
#base_commit ⇒ Object
21 22 23 |
# File 'lib/eternity/patch.rb', line 21 def base_commit @base_commit ||= Commit.base_of current_commit, target_commit end |
#base_history ⇒ Object
29 30 31 |
# File 'lib/eternity/patch.rb', line 29 def base_history @base_history ||= [base_commit] + base_commit.history end |
#current_history ⇒ Object
33 34 35 |
# File 'lib/eternity/patch.rb', line 33 def current_history @current_history ||= [current_commit] + current_commit.history - base_history end |
#delta ⇒ Object
25 26 27 |
# File 'lib/eternity/patch.rb', line 25 def delta @delta ||= TransparentProxy.new { calculate_delta } end |
#initialize(current_commit, target_commit) ⇒ Object
16 17 18 19 |
# File 'lib/eternity/patch.rb', line 16 def initialize(current_commit, target_commit) @current_commit = current_commit @target_commit = target_commit end |
#remaining_history ⇒ Object
41 42 43 |
# File 'lib/eternity/patch.rb', line 41 def remaining_history @remaining_history ||= current_history - target_history end |
#target_history ⇒ Object
37 38 39 |
# File 'lib/eternity/patch.rb', line 37 def target_history @target_history ||= [target_commit] + target_commit.history - base_history end |