Class: Ra10ke::Diff::Task
- Inherits:
-
Object
- Object
- Ra10ke::Diff::Task
- Defined in:
- lib/ra10ke/diff.rb
Instance Attribute Summary collapse
-
#puppetfile ⇒ Object
readonly
Returns the value of attribute puppetfile.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
-
#initialize ⇒ Task
constructor
A new instance of Task.
- #run(branch_a:, branch_b:) ⇒ Object
Constructor Details
#initialize ⇒ Task
Returns a new instance of Task.
11 12 13 14 |
# File 'lib/ra10ke/diff.rb', line 11 def initialize @repo = Git.open('.') @original_branch = repo.current_branch end |
Instance Attribute Details
#puppetfile ⇒ Object (readonly)
Returns the value of attribute puppetfile.
9 10 11 |
# File 'lib/ra10ke/diff.rb', line 9 def puppetfile @puppetfile end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
9 10 11 |
# File 'lib/ra10ke/diff.rb', line 9 def repo @repo end |
Instance Method Details
#run(branch_a:, branch_b:) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ra10ke/diff.rb', line 16 def run(branch_a:, branch_b:) validate_clean_repo validate_branches(branch_a, branch_b) modules_a = load_modules(branch_a) modules_b = load_modules(branch_b) differences = calculate_differences(modules_a, modules_b) print_differences(differences) ensure restore_original_branch end |