Class: RemoteTable::Package
- Inherits:
-
Object
- Object
- RemoteTable::Package
- Defined in:
- lib/remote_table/package.rb
Instance Attribute Summary collapse
-
#compression ⇒ Object
Returns the value of attribute compression.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#packing ⇒ Object
Returns the value of attribute packing.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #add_hints!(hash) ⇒ Object
-
#initialize(bus) ⇒ Package
constructor
A new instance of Package.
- #stage(path) ⇒ Object
Constructor Details
#initialize(bus) ⇒ Package
Returns a new instance of Package.
5 6 7 8 9 10 11 |
# File 'lib/remote_table/package.rb', line 5 def initialize(bus) @url = bus[:url] or raise "need url" @compression = bus[:compression] || compression_from_basename @packing = bus[:packing] || packing_from_basename_and_compression @filename = bus[:filename] || filename_from_basename_and_compression_and_packing add_hints!(bus) end |
Instance Attribute Details
#compression ⇒ Object
Returns the value of attribute compression.
3 4 5 |
# File 'lib/remote_table/package.rb', line 3 def compression @compression end |
#filename ⇒ Object
Returns the value of attribute filename.
3 4 5 |
# File 'lib/remote_table/package.rb', line 3 def filename @filename end |
#packing ⇒ Object
Returns the value of attribute packing.
3 4 5 |
# File 'lib/remote_table/package.rb', line 3 def packing @packing end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/remote_table/package.rb', line 3 def url @url end |
Instance Method Details
#add_hints!(hash) ⇒ Object
13 14 15 |
# File 'lib/remote_table/package.rb', line 13 def add_hints!(hash) hash[:filename] = filename unless hash.has_key?(:filename) end |
#stage(path) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/remote_table/package.rb', line 17 def stage(path) decompress(path) unpack(path) identify(path) file_path(path) end |