Class: Cch::Watcher

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

Class Method Summary collapse

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.



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

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

Class Method Details

.filesObject



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

def self.files
  new.files
end

Instance Method Details

#filesObject



13
14
15
16
17
# File 'lib/cch/watcher.rb', line 13

def files
  files = @commands.flat_map { |command| backtiq_command(command) }.compact.sort.uniq
  Cch.logger.info("watched files='#{files}'")
  files
end