Class: Pipefitter::Compressor
- Inherits:
-
Object
- Object
- Pipefitter::Compressor
- Defined in:
- lib/pipefitter/compressor.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
Instance Method Summary collapse
- #compress(filename = nil) ⇒ Object
-
#initialize(base_path, target_path = nil) ⇒ Compressor
constructor
A new instance of Compressor.
Constructor Details
#initialize(base_path, target_path = nil) ⇒ Compressor
Returns a new instance of Compressor.
5 6 7 |
# File 'lib/pipefitter/compressor.rb', line 5 def initialize(base_path, target_path = nil) @base_path = base_path end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
3 4 5 |
# File 'lib/pipefitter/compressor.rb', line 3 def base_path @base_path end |
Instance Method Details
#compress(filename = nil) ⇒ Object
9 10 11 |
# File 'lib/pipefitter/compressor.rb', line 9 def compress(filename = nil) `cd #{base_path}/public && tar -czf #{target(filename)} #{source}` end |