Class: BackItUp::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ScriptDSL

#backup, #destination_file, #file

Constructor Details

#initialize(file_handle) ⇒ Config

Returns a new instance of Config.



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/back_it_up/config.rb', line 82

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.



80
81
82
# File 'lib/back_it_up/config.rb', line 80

def dest_filename
  @dest_filename
end

#dirsObject (readonly)

Returns the value of attribute dirs.



80
81
82
# File 'lib/back_it_up/config.rb', line 80

def dirs
  @dirs
end

#filesObject (readonly)

Returns the value of attribute files.



80
81
82
# File 'lib/back_it_up/config.rb', line 80

def files
  @files
end

Instance Method Details

#each_fileObject



95
96
97
# File 'lib/back_it_up/config.rb', line 95

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