Class: Cch::Watcher

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

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Commands::Shell

#backtiq_command, #system_command

Class Attribute Details

.commandsObject

Returns the value of attribute commands.



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

def commands
  @commands
end

Class Method Details

.filesObject



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

def files
  new.files(commands)
end

Instance Method Details

#files(commands) ⇒ Object



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

def files(commands)
  files = commands.flat_map { |command| backtiq_command(command) }.compact.sort.uniq
  Cch.logger.info("watching #{files.size.to_s.color(:yellow)} files=#{files}")
  files
end