Class: Cch::Watcher

Inherits:
Object
  • Object
show all
Includes:
Commands::Shell
Defined in:
lib/cch/watcher.rb

Instance Method Summary collapse

Methods included from Commands::Shell

#backtiq_command, #system_command

Constructor Details

#initialize(commands = nil) ⇒ Watcher

Returns a new instance of Watcher


5
6
7
# File 'lib/cch/watcher.rb', line 5

def initialize(commands = nil)
  @commands = commands || Setup.watcher_commands
end

Instance Method Details

#filesObject


9
10
11
12
13
# File 'lib/cch/watcher.rb', line 9

def files
  files = @commands.flat_map { |command| backtiq_command(command) }.compact.sort.uniq
  puts "=> watched files='#{files}'" if Setup.debug
  files
end