Class: Kaisoku::Commands::WatchCommand
- Inherits:
-
Object
- Object
- Kaisoku::Commands::WatchCommand
- Defined in:
- lib/kaisoku/commands/watch_command.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(paths, options) ⇒ WatchCommand
constructor
A new instance of WatchCommand.
Constructor Details
#initialize(paths, options) ⇒ WatchCommand
Returns a new instance of WatchCommand.
6 7 8 9 10 |
# File 'lib/kaisoku/commands/watch_command.rb', line 6 def initialize(paths, ) @paths = paths @options = @context = RuntimeContext.new() end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kaisoku/commands/watch_command.rb', line 12 def call watcher = watcher_class.new( configuration: @context.configuration, paths: @paths.empty? ? Watcher::DEFAULT_PATHS : @paths, interval: @options[:interval] || 0.2 ) puts "watching #{watcher.paths.join(', ')}" WatchSession.new(watcher: watcher, debounce: 0.05, runner: runner).start end |