Class: Pipefitter::Compressor

Inherits:
Object
  • Object
show all
Defined in:
lib/pipefitter/compressor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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