Class: Backup::Archive::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/backup/archive.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ DSL

Returns a new instance of DSL.



144
145
146
# File 'lib/backup/archive.rb', line 144

def initialize(options)
  @options = options
end

Instance Method Details

#add(path) ⇒ Object



156
157
158
# File 'lib/backup/archive.rb', line 156

def add(path)
  @options[:paths] << path
end

#exclude(path) ⇒ Object



160
161
162
# File 'lib/backup/archive.rb', line 160

def exclude(path)
  @options[:excludes] << path
end

#root(path) ⇒ Object



152
153
154
# File 'lib/backup/archive.rb', line 152

def root(path)
  @options[:root] = path
end

#tar_options(opts) ⇒ Object



164
165
166
# File 'lib/backup/archive.rb', line 164

def tar_options(opts)
  @options[:tar_options] = opts
end

#use_sudo(val = true) ⇒ Object



148
149
150
# File 'lib/backup/archive.rb', line 148

def use_sudo(val = true)
  @options[:sudo] = val
end