Class: Dotsync::WatchAction
- Inherits:
-
BaseAction
- Object
- BaseAction
- Dotsync::WatchAction
- Includes:
- MappingsTransfer
- Defined in:
- lib/dotsync/actions/watch_action.rb
Constant Summary
Constants included from MappingsTransfer
MappingsTransfer::DIFFERENCES_LEGEND, MappingsTransfer::MAPPINGS_LEGEND
Constants included from PathUtils
Instance Attribute Summary
Attributes inherited from BaseAction
Instance Method Summary collapse
- #execute(options = {}) ⇒ Object
-
#initialize(config, logger) ⇒ WatchAction
constructor
A new instance of WatchAction.
Methods included from MappingsTransfer
#show_differences, #show_differences_legend, #show_env_vars, #show_mappings, #show_mappings_legend, #transfer_mappings
Methods included from PathUtils
#colorize_env_vars, #expand_env_vars, #extract_env_vars, #path_is_parent_or_same?, #relative_to_absolute, #sanitize_path, #translate_tmp_path
Constructor Details
#initialize(config, logger) ⇒ WatchAction
Returns a new instance of WatchAction.
9 10 11 12 13 |
# File 'lib/dotsync/actions/watch_action.rb', line 9 def initialize(config, logger) super setup_listeners setup_signal_trap end |
Instance Method Details
#execute(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/dotsync/actions/watch_action.rb', line 15 def execute( = {}) show_mappings_legend unless [:quiet] || [:no_legend] || [:no_mappings] show_mappings unless [:quiet] || [:no_mappings] @listeners.each(&:start) logger.action("Listening for changes...") unless [:quiet] logger.action("Press Ctrl+C to exit.") unless [:quiet] sleep end |