Class: Guard::Foodcritic::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/foodcritic/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = {})
  @options = {
    cli: '--epic-fail any'
  }.merge(options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/guard/foodcritic/runner.rb', line 6

def options
  @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