Class: Siba::Source::Files::Init

Inherits:
Object
  • Object
show all
Includes:
LoggerPlug
Defined in:
lib/siba/plugins/source/files/init.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LoggerPlug

close, create, logger, #logger, opened?

Constructor Details

#initialize(options) ⇒ Init

Returns a new instance of Init.



11
12
13
14
15
16
# File 'lib/siba/plugins/source/files/init.rb', line 11

def initialize(options)
  files_to_include = Siba::SibaCheck.options_string_array options, "include"
  ignore = Siba::SibaCheck.options_string_array options, "ignore", true
  include_subdirs = Siba::SibaCheck.options_bool options, "include_subdirs", true, true
  @files = Siba::Source::Files::Files.new files_to_include, ignore, include_subdirs
end

Instance Attribute Details

#filesObject

Returns the value of attribute files.



9
10
11
# File 'lib/siba/plugins/source/files/init.rb', line 9

def files
  @files
end

Instance Method Details

#backup(dest_dir) ⇒ Object

Collect sources and put them into dest_dir No return value is expected



20
21
22
23
# File 'lib/siba/plugins/source/files/init.rb', line 20

def backup(dest_dir)
  logger.info "Collecting files"
  @files.backup dest_dir
end

#restore(from_dir) ⇒ Object

Restore source files and dirs from_dir No return value is expected



27
28
29
30
# File 'lib/siba/plugins/source/files/init.rb', line 27

def restore(from_dir)
  logger.info "Restoring files"
  @files.restore from_dir
end