Class: Guard::Sync
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Sync
constructor
A new instance of Sync.
- #reload ⇒ Object
- #run_all ⇒ Object
- #run_on_additions(paths) ⇒ Object
- #run_on_changes(paths) ⇒ Object
- #run_on_modifications(paths) ⇒ Object
- #run_on_removals(paths) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Sync
Returns a new instance of Sync.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/guard/sync.rb', line 6 def initialize(watchers = [], = {}) super @options = { :all_on_start => false, :archive => true, :compress => true, :verbose => false, :delete => false, :src => '.' }.merge update end |
Instance Method Details
#reload ⇒ Object
26 27 |
# File 'lib/guard/sync.rb', line 26 def reload end |
#run_all ⇒ Object
29 30 31 32 |
# File 'lib/guard/sync.rb', line 29 def run_all UI.info "Guard::Sync is running" if @opts %x{#{@command}} if @opts end |
#run_on_additions(paths) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/guard/sync.rb', line 37 def run_on_additions paths @options[:exclude] = '*' @options[:include] = paths.to_s[1..-2] @options[:delete] = false update run_all end |
#run_on_changes(paths) ⇒ Object
34 35 |
# File 'lib/guard/sync.rb', line 34 def run_on_changes paths end |
#run_on_modifications(paths) ⇒ Object
45 46 |
# File 'lib/guard/sync.rb', line 45 def run_on_modifications paths end |
#run_on_removals(paths) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/guard/sync.rb', line 48 def run_on_removals paths @options[:exclude] = '*' @options[:include] = paths.to_s[1..-2] @options[:delete] = true update run_all end |
#start ⇒ Object
19 20 21 |
# File 'lib/guard/sync.rb', line 19 def start run_all if @options[:all_on_start] end |
#stop ⇒ Object
23 24 |
# File 'lib/guard/sync.rb', line 23 def stop end |