Class: Backup::Splitter
- Inherits:
-
Object
- Object
- Backup::Splitter
- Includes:
- CLI::Helpers
- Defined in:
- lib/backup/splitter.rb
Constant Summary
Constants included from CLI::Helpers
Instance Method Summary collapse
-
#initialize(model, chunk_size) ⇒ Splitter
constructor
A new instance of Splitter.
-
#split_with {|@split_command| ... } ⇒ Object
This is called as part of the procedure used to build the final backup package file(s).
Methods included from CLI::Helpers
#command_name, #raise_if_command_failed!, #run, #utility
Constructor Details
#initialize(model, chunk_size) ⇒ Splitter
Returns a new instance of Splitter.
7 8 9 10 |
# File 'lib/backup/splitter.rb', line 7 def initialize(model, chunk_size) @model = model @chunk_size = chunk_size end |
Instance Method Details
#split_with {|@split_command| ... } ⇒ Object
This is called as part of the procedure used to build the final backup package file(s). It yields it’s portion of the command line for this procedure, which will split the data being piped into it into multiple files, based on the @chunk_size. Once the packaging procedure is complete, it will return and
19 20 21 22 23 |
# File 'lib/backup/splitter.rb', line 19 def split_with before_packaging yield @split_command after_packaging end |