Class: CodeHunter::Runner
- Inherits:
-
Object
- Object
- CodeHunter::Runner
- Defined in:
- lib/code_hunter/runner.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv = []) ⇒ Runner
constructor
A new instance of Runner.
- #result ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(argv = []) ⇒ Runner
Returns a new instance of Runner.
9 10 11 |
# File 'lib/code_hunter/runner.rb', line 9 def initialize(argv = []) @options = OptionParser.parse!(argv) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/code_hunter/runner.rb', line 3 def @options end |
Class Method Details
.run(*args) ⇒ Object
5 6 7 |
# File 'lib/code_hunter/runner.rb', line 5 def self.run(*args) new(*args).run end |
Instance Method Details
#result ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/code_hunter/runner.rb', line 17 def result results = services.map(&:run).compact warnings = results.inject([], :+).map {|attributes| Warning.new(attributes) } warnings = warnings.select(&:has_git_metadata?) warnings = warnings.reject(&:ignore?) warnings.map(&:to_hash) end |