Class: Guard::Reek::Runner::Paths

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

Overview

this class decides which files are run against reek

Instance Method Summary collapse

Constructor Details

#initialize(paths, all) ⇒ Paths

Returns a new instance of Paths.



19
20
21
22
23
# File 'lib/guard/reek/runner.rb', line 19

def initialize(paths, all)
  @all = all
  @paths = paths
  @paths = [] if @paths.include?('.reek')
end

Instance Method Details

#to_aryObject



29
30
31
32
33
34
35
# File 'lib/guard/reek/runner.rb', line 29

def to_ary
  if @paths.empty?
    Array(@all)
  else
    @paths
  end
end

#to_sObject



25
26
27
# File 'lib/guard/reek/runner.rb', line 25

def to_s
  @paths.empty? ? 'all' : @paths.to_s
end