Sha256: 3e27a0793ceeec4900a05691700417f7d19d946d351ee4d30b1b99c956b9f161
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
require_relative '../dirwatch' module Dirwatch class Executor def run args options = Options.from_args(args) send "run_#{options.action}", options nil end private def run_exit options; end def run_watch options require_relative 'watcher' watcher = Watcher.new options watcher.start begin watcher.wait_for_stop rescue Interrupt raise ensure stop_watcher watcher end end def stop_watcher watcher watcher.stop end def run_init options require_relative 'templates' hash = options.to_h if hash.delete :list Templates.list hash else Templates.create hash end end end class Console < Executor def run args status = catch :exit do super end exit status if status rescue Dirwatch::UserFriendlyError => e $stderr.puts e.user_friendly_message exit 1 end private def stop_watcher watcher puts 'shutting down...' super end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dirwatch-0.0.2 | lib/dirwatch/executors.rb |