Class: Guard::Foodcritic::Runner
- Inherits:
-
Object
- Object
- Guard::Foodcritic::Runner
- Defined in:
- lib/guard/foodcritic/runner.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #command(paths) ⇒ Object
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run(paths) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Runner
Returns a new instance of Runner.
8 9 10 11 12 |
# File 'lib/guard/foodcritic/runner.rb', line 8 def initialize( = {}) @options = { cli: '--epic-fail any' }.merge() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/guard/foodcritic/runner.rb', line 6 def @options end |
Instance Method Details
#command(paths) ⇒ Object
14 15 16 |
# File 'lib/guard/foodcritic/runner.rb', line 14 def command(paths) ['foodcritic', @options[:cli], paths].flatten(1).join(' ') end |
#run(paths) ⇒ Object
18 19 20 |
# File 'lib/guard/foodcritic/runner.rb', line 18 def run(paths) system command(paths) end |