Class: CobraCommander::Change
- Inherits:
-
Object
- Object
- CobraCommander::Change
- Defined in:
- lib/cobra_commander/change.rb
Overview
Calculates and prints affected components & files
Constant Summary collapse
- InvalidSelectionError =
Class.new(StandardError)
Instance Method Summary collapse
-
#initialize(umbrella, results, branch) ⇒ Change
constructor
A new instance of Change.
- #run! ⇒ Object
Constructor Details
#initialize(umbrella, results, branch) ⇒ Change
Returns a new instance of Change.
11 12 13 14 15 16 17 |
# File 'lib/cobra_commander/change.rb', line 11 def initialize(umbrella, results, branch) @root_dir = Dir.chdir(umbrella.path) { `git rev-parse --show-toplevel`.chomp } @results = results @branch = branch @umbrella = umbrella @affected = Affected.new(@umbrella, changes) end |
Instance Method Details
#run! ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cobra_commander/change.rb', line 19 def run! assert_valid_result_choice if selected_result?("json") puts @affected.json_representation else show_full if selected_result?("full") tests_to_run end rescue InvalidSelectionError => e puts e. end |