Class: Marionetta::DirectorySync

Inherits:
Object
  • Object
show all
Includes:
Commandable
Defined in:
lib/marionetta/directory_sync.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ DirectorySync

Returns a new instance of DirectorySync.



11
12
13
# File 'lib/marionetta/directory_sync.rb', line 11

def initialize(server)
  @server = server
end

Class Method Details

.sync(server, from, to, options = {}) ⇒ Object



7
8
9
# File 'lib/marionetta/directory_sync.rb', line 7

def self.sync(server, from, to, options = {})
  new(server).sync(from, to, options)
end

Instance Method Details

#sync(from, to, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/marionetta/directory_sync.rb', line 15

def sync(from, to, options = {})
  create_dir(to)

  if options.has_key?(:exclude)
    excludes = options[:exclude]
  else
    excludes = []
  end

  sync_dir(from, to, excludes)
end