Class: Dotsync::PullAction
- Inherits:
-
BaseAction
- Object
- BaseAction
- Dotsync::PullAction
- Includes:
- MappingsTransfer, OutputSections
- Defined in:
- lib/dotsync/actions/pull_action.rb
Constant Summary
Constants included from MappingsTransfer
MappingsTransfer::DIFFERENCES_LEGEND, MappingsTransfer::MAPPINGS_LEGEND
Constants included from PathUtils
Dotsync::PathUtils::ENV_VARS_COLOR
Instance Attribute Summary
Attributes inherited from BaseAction
Instance Method Summary collapse
Methods included from OutputSections
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
Methods inherited from BaseAction
Constructor Details
This class inherits a constructor from Dotsync::BaseAction
Instance Method Details
#execute(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dotsync/actions/pull_action.rb', line 10 def execute( = {}) output_sections = compute_output_sections() () if output_sections[:options] show_env_vars if output_sections[:env_vars] show_mappings_legend if output_sections[:mappings_legend] show_mappings if output_sections[:mappings] show_differences_legend if has_differences? && output_sections[:differences_legend] show_differences if output_sections[:differences] return unless [:apply] # Confirmation prompt unless --yes flag is provided or no differences if has_differences? && ![:yes] && ![:quiet] return unless confirm_action end if has_differences? if create_backup show_backup purge_old_backups end end transfer_mappings action("Mappings pulled", icon: :done) end |