Class: Stowaway::Runner

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

Instance Method Summary collapse

Constructor Details

#initialize(options, locator, sweeper) ⇒ Runner

Returns a new instance of Runner.



8
9
10
11
12
# File 'lib/stowaway/runner.rb', line 8

def initialize(options, locator, sweeper)
  @options = options
  @locator = locator
  @sweeper = sweeper
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/stowaway/runner.rb', line 14

def run
  path = @options.path
  print "\nLocating files ... "
  assets = @locator.find_all(path)
  print "#{assets.length} files located"
  blank_lines
  Dir.chdir(@options.path)
  puts "sweeping: #{Dir.pwd}"
  respond @sweeper.sweep(path, assets)
end