Class: Compressors::Gzip
- Defined in:
- lib/capistrano-db-tasks/compressors/gzip.rb
Class Method Summary collapse
Class Method Details
.compress(from, to = nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/capistrano-db-tasks/compressors/gzip.rb', line 8 def compress(from, to = nil) from = from == :stdin ? "-" : from to = case to when '-' "-c --stdout" when nil "" else "-c --stdout > #{to}" end "gzip #{from} #{to}" end |
.decompress(from, to = nil) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/capistrano-db-tasks/compressors/gzip.rb', line 22 def decompress(from, to = nil) from = from == :stdin ? "-" : from to = case to when :stdout "-c --stdout" when nil "" else "-c --stdout > #{to}" end "gzip -d #{from} #{to}" end |
.file_extension ⇒ Object
4 5 6 |
# File 'lib/capistrano-db-tasks/compressors/gzip.rb', line 4 def file_extension "gz" end |