Class: Dotsync::HookRunner
- Inherits:
-
Object
- Object
- Dotsync::HookRunner
- Includes:
- PathUtils
- Defined in:
- lib/dotsync/utils/hook_runner.rb
Constant Summary
Constants included from PathUtils
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(mapping:, changed_files:, logger:) ⇒ HookRunner
constructor
A new instance of HookRunner.
- #preview ⇒ Object
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(mapping:, changed_files:, logger:) ⇒ HookRunner
Returns a new instance of HookRunner.
10 11 12 13 14 |
# File 'lib/dotsync/utils/hook_runner.rb', line 10 def initialize(mapping:, changed_files:, logger:) @mapping = mapping @changed_files = changed_files @logger = logger end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 |
# File 'lib/dotsync/utils/hook_runner.rb', line 16 def execute @mapping.hooks.map do |command| = (command) run_command() end end |
#preview ⇒ Object
23 24 25 |
# File 'lib/dotsync/utils/hook_runner.rb', line 23 def preview @mapping.hooks.map { |command| (command) } end |