class Docksync::Watch
Public Class Methods
new(options)
click to toggle source
# File lib/docksync/watch.rb, line 5 def initialize(options) @options = options end
Public Instance Methods
run()
click to toggle source
# File lib/docksync/watch.rb, line 9 def run Dir.chdir(@options[:cwd]) do puts "Watching dir #{@options[:cwd]}" ignore = %w[. .. .git log tmp] files = Dir.glob(['.*','*']) - ignore return false if @options[:noop] Rsync.new(@options).run FileWatcher.new(files).watch() do |filename, event| Rsync.new(@options.merge(:skip_install => true)).run end end end