lib/nanoc/cli/commands/watch.rb in nanoc-3.6.6 vs lib/nanoc/cli/commands/watch.rb in nanoc-3.6.7
- old
+ new
@@ -1,9 +1,10 @@
# encoding: utf-8
usage 'watch [options]'
summary 'start the watcher'
+be_hidden
description <<-EOS
Start the watcher. When a change is detected, the site will be recompiled.
EOS
module Nanoc::CLI::Commands
@@ -69,11 +70,11 @@
# Get directories to watch
dirs_to_watch = watcher_config[:dirs_to_watch] || [ 'content', 'layouts', 'lib' ]
files_to_watch = watcher_config[:files_to_watch] || [ 'nanoc.yaml', 'config.yaml', 'Rules', 'rules', 'Rules.rb', 'rules.rb' ]
files_to_watch = Regexp.new(files_to_watch.map { |name| Regexp.quote(name) + '$' }.join('|'))
- ignore_dir = Regexp.new(Dir.glob('*').map { |dir| dir if File.dir?(dir) }.compact.join('|'))
+ ignore_dir = Regexp.new(Dir.glob('*').map { |dir| dir if File.directory?(dir) }.compact.join('|'))
# Watch
puts "Watching for changes…"
callback = Proc.new do |modified, added, removed|
@@ -167,10 +168,10 @@
def notify_send(message)
system('notify-send', message)
end
def on_windows?
- !!(RUBY_PLATFORM =~ /(mingw|bccwin|wince|mswin32)/i)
+ Nanoc.on_windows?
end
end
end