Class: Tara::Archiver
- Inherits:
-
Object
- Object
- Tara::Archiver
- Defined in:
- lib/tara/archiver.rb
Overview
Jara compatible Archiver class that makes it easy to release artiftacts using Tara and Jara.
Instance Method Summary collapse
-
#content_type ⇒ String
Content type used by this archiver.
-
#create(options = {}) ⇒ String
Create a new archive.
-
#extension ⇒ String
Extension used by this archiver.
-
#initialize(config = {}) ⇒ Archiver
constructor
Create a new instance of ‘Archiver` with the specified configuration.
-
#metadata ⇒ Hash
Metadata that the published artifact will be tagged with.
Constructor Details
#initialize(config = {}) ⇒ Archiver
Create a new instance of ‘Archiver` with the specified configuration.
The ‘Archiver` class supports the same configuration as Tara::Archive#initialize does, with the addition of a `:metadata` option.
45 46 47 48 |
# File 'lib/tara/archiver.rb', line 45 def initialize(config={}) @config = config @config[:metadata] ||= {} end |
Instance Method Details
#content_type ⇒ String
Content type used by this archiver
70 71 72 |
# File 'lib/tara/archiver.rb', line 70 def content_type 'application/x-gzip' end |
#create(options = {}) ⇒ String
Create a new archive
54 55 56 |
# File 'lib/tara/archiver.rb', line 54 def create(={}) Archive.create(@config.merge()) end |
#extension ⇒ String
Extension used by this archiver
62 63 64 |
# File 'lib/tara/archiver.rb', line 62 def extension 'tgz' end |
#metadata ⇒ Hash
Metadata that the published artifact will be tagged with.
78 79 80 |
# File 'lib/tara/archiver.rb', line 78 def @config[:metadata] end |