Class: BackItUp::Config
- Inherits:
-
Object
- Object
- BackItUp::Config
- 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
-
#dest_filename ⇒ Object
readonly
Returns the value of attribute dest_filename.
-
#dirs ⇒ Object
readonly
Returns the value of attribute dirs.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#ftp_options ⇒ Object
readonly
Returns the value of attribute ftp_options.
Instance Method Summary collapse
- #each_file ⇒ Object
-
#initialize(file_handle) ⇒ Config
constructor
A new instance of Config.
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_filename ⇒ Object (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 |
#dirs ⇒ Object (readonly)
Returns the value of attribute dirs.
92 93 94 |
# File 'lib/back_it_up/config.rb', line 92 def dirs @dirs end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
92 93 94 |
# File 'lib/back_it_up/config.rb', line 92 def files @files end |
#ftp_options ⇒ Object (readonly)
Returns the value of attribute ftp_options.
92 93 94 |
# File 'lib/back_it_up/config.rb', line 92 def end |
Instance Method Details
#each_file ⇒ Object
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 |