lib/nanoc/cli/commands/watch.rb in nanoc-3.7.5 vs lib/nanoc/cli/commands/watch.rb in nanoc-3.8.0
- old
+ new
@@ -65,12 +65,12 @@
# Rebuild once
rebuilder.call(nil)
# Get directories to watch
- dirs_to_watch = watcher_config[:dirs_to_watch] || %w( content layouts lib )
- files_to_watch = watcher_config[:files_to_watch] || %w( nanoc.yaml config.yaml Rules rules Rules.rb rules.rb )
+ dirs_to_watch = watcher_config.fetch(:dirs_to_watch, %w( content layouts lib ))
+ files_to_watch = watcher_config.fetch(:files_to_watch, %w( 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.directory?(dir) }.compact.join('|'))
# Watch
puts 'Watching for changes…'
@@ -93,10 +93,10 @@
end
end
# Allows sending user notifications in a cross-platform way.
class Notifier
- # A list of commandline tool names that can be used to send notifications
+ # A list of command-line tool names that can be used to send notifications
TOOLS = %w( growlnotify notify-send ) unless defined? TOOLS
# Send a notification. If no notifier is found, no notification will be
# created.
#