Class: RdiffBackupWrapper::Volume
- Inherits:
-
Object
- Object
- RdiffBackupWrapper::Volume
- Defined in:
- lib/rdiff_backup_wrapper/volume.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
- #check_error(o, e, t) ⇒ Object
-
#initialize(config) ⇒ Volume
constructor
A new instance of Volume.
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
#config ⇒ Object (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 |