Class: BackItUp::Config

Inherits:
Object
  • Object
show all
Includes:
ScriptDSL
Defined in:
lib/back_it_up/config.rb

Constant Summary

Constants included from ScriptDSL

ScriptDSL::INVALID_FTP_ARG_MSG

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ScriptDSL

#backup, #destination_file, #file, #ftp

Constructor Details

#initialize(file_handle) ⇒ Config

Returns a new instance of Config.



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/back_it_up/config.rb', line 94

def initialize(file_handle)
  @files = []      
  @dirs = []    
  
  file_content = ""

  while l = file_handle.gets do 
    file_content << l
  end
  
  eval(file_content)
end

Instance Attribute Details

#dest_filenameObject (readonly)

Returns the value of attribute dest_filename.



92
93
94
# File 'lib/back_it_up/config.rb', line 92

def dest_filename
  @dest_filename
end

#dirsObject (readonly)

Returns the value of attribute dirs.



92
93
94
# File 'lib/back_it_up/config.rb', line 92

def dirs
  @dirs
end

#filesObject (readonly)

Returns the value of attribute files.



92
93
94
# File 'lib/back_it_up/config.rb', line 92

def files
  @files
end

#ftp_optionsObject (readonly)

Returns the value of attribute ftp_options.



92
93
94
# File 'lib/back_it_up/config.rb', line 92

def ftp_options
  @ftp_options
end

Instance Method Details

#each_fileObject



107
108
109
# File 'lib/back_it_up/config.rb', line 107

def each_file 
  FileList.new(@files, @dirs).files.each {|filename| yield filename }
end