Class: Kolekti::Runner
- Inherits:
-
Object
- Object
- Kolekti::Runner
- Defined in:
- lib/kolekti/runner.rb
Instance Attribute Summary collapse
-
#collectors ⇒ Object
readonly
Returns the value of attribute collectors.
-
#repository_path ⇒ Object
readonly
Returns the value of attribute repository_path.
-
#wanted_metric_configurations ⇒ Object
readonly
Returns the value of attribute wanted_metric_configurations.
Instance Method Summary collapse
- #clean_output ⇒ Object
-
#initialize(repository_path, wanted_metric_configurations, persistence_strategy) ⇒ Runner
constructor
A new instance of Runner.
- #run_wanted_metrics ⇒ Object
Constructor Details
#initialize(repository_path, wanted_metric_configurations, persistence_strategy) ⇒ Runner
Returns a new instance of Runner.
20 21 22 23 24 25 |
# File 'lib/kolekti/runner.rb', line 20 def initialize(repository_path, wanted_metric_configurations, persistence_strategy) @repository_path = repository_path @wanted_metric_configurations = wanted_metric_configurations.map { |m| [m.metric.code, m] }.to_h @persistence_strategy = persistence_strategy @collectors = find_collectors end |
Instance Attribute Details
#collectors ⇒ Object (readonly)
Returns the value of attribute collectors.
18 19 20 |
# File 'lib/kolekti/runner.rb', line 18 def collectors @collectors end |
#repository_path ⇒ Object (readonly)
Returns the value of attribute repository_path.
18 19 20 |
# File 'lib/kolekti/runner.rb', line 18 def repository_path @repository_path end |
#wanted_metric_configurations ⇒ Object (readonly)
Returns the value of attribute wanted_metric_configurations.
18 19 20 |
# File 'lib/kolekti/runner.rb', line 18 def wanted_metric_configurations @wanted_metric_configurations end |
Instance Method Details
#clean_output ⇒ Object
33 34 35 36 37 |
# File 'lib/kolekti/runner.rb', line 33 def clean_output @collectors.each do |collector| collector.clean(@repository_path, @wanted_metric_configurations) end end |
#run_wanted_metrics ⇒ Object
27 28 29 30 31 |
# File 'lib/kolekti/runner.rb', line 27 def run_wanted_metrics @collectors.each do |collector| collector.collect_metrics(@repository_path, @wanted_metric_configurations, @persistence_strategy) end end |