Class: RdiffBackupWrapper::Volume

Inherits:
Object
  • Object
show all
Defined in:
lib/rdiff_backup_wrapper/volume.rb

Direct Known Subclasses

LuksLoopVolume

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Volume

Returns a new instance of Volume.



15
16
17
# File 'lib/rdiff_backup_wrapper/volume.rb', line 15

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



13
14
15
# File 'lib/rdiff_backup_wrapper/volume.rb', line 13

def config
  @config
end

Class Method Details

.create(config) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/rdiff_backup_wrapper/volume.rb', line 5

def self.create(config)
  if config['type'] == 'luks-loop'
    LuksLoopVolume.new config
  else
    raise "Unknown volume type '#{config['type']}"
  end
end

Instance Method Details

#check_error(o, e, t) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/rdiff_backup_wrapper/volume.rb', line 19

def check_error(o, e, t)
  return if t.value.exitstatus == 0
  STDERR.puts e.read
  STDERR.puts o.read
  STDERR.puts t
  raise "error"
end