Class: S3Archive::CompressAndUpload
- Inherits:
-
Object
- Object
- S3Archive::CompressAndUpload
- Includes:
- Logging
- Defined in:
- lib/s3archive/compress_and_upload.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ CompressAndUpload
constructor
A new instance of CompressAndUpload.
- #run ⇒ Object
Methods included from Logging
Constructor Details
#initialize(path) ⇒ CompressAndUpload
Returns a new instance of CompressAndUpload.
20 21 22 |
# File 'lib/s3archive/compress_and_upload.rb', line 20 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
19 20 21 |
# File 'lib/s3archive/compress_and_upload.rb', line 19 def path @path end |
Class Method Details
.run(path) ⇒ Object
15 16 17 |
# File 'lib/s3archive/compress_and_upload.rb', line 15 def self.run(path) new(path).run end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/s3archive/compress_and_upload.rb', line 24 def run unless File.exists?(path) logger.error("COULD NOT FIND '#{path}'") return end logger.info("* Processing #{path}") compress! if compress? upload! delete_tempfile! if compress? end |