Class: Docksync::Watch
- Inherits:
-
Object
- Object
- Docksync::Watch
- Defined in:
- lib/docksync/watch.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Watch
constructor
A new instance of Watch.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Watch
5 6 7 |
# File 'lib/docksync/watch.rb', line 5 def initialize() = end |
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/docksync/watch.rb', line 9 def run Dir.chdir([:cwd]) do puts "Watching dir #{@options[:cwd]}" ignore = %w[. .. .git log tmp] files = Dir.glob(['.*','*']) - ignore return false if [:noop] Rsync.new().run FileWatcher.new(files).watch() do |filename, event| Rsync.new(.merge(:skip_install => true)).run end end end |