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