Class: Heirloom::CLI::Tag
- Inherits:
-
Object
- Object
- Heirloom::CLI::Tag
- Includes:
- Shared
- Defined in:
- lib/heirloom/cli/tag.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Tag
constructor
A new instance of Tag.
- #tag ⇒ Object
Methods included from Shared
#ensure_archive_domain_empty, #ensure_archive_exists, #ensure_buckets_available, #ensure_buckets_exist, #ensure_catalog_domain_exists, #ensure_directory_is_writable, #ensure_domain_exists, #ensure_entry_does_not_exist_in_catalog, #ensure_entry_exists_in_catalog, #ensure_metadata_in_upload_region, #ensure_path_is_directory, #ensure_valid_bucket_prefix, #ensure_valid_metadata_region, #ensure_valid_name, #ensure_valid_options, #ensure_valid_region, #ensure_valid_regions, #ensure_valid_secret, #latest_id, #load_config, #read_secret
Constructor Details
#initialize ⇒ Tag
Returns a new instance of Tag.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/heirloom/cli/tag.rb', line 11 def initialize @opts = @logger = HeirloomLogger.new :log_level => @opts[:level] @config = load_config :logger => @logger, :opts => @opts :provided => @opts, :required => [:name, :id, :attribute, :value], :config => @config @config ensure_domain_exists :name => @opts[:name], :config => @config @archive = Archive.new :name => @opts[:name], :id => @opts[:id], :config => @config ensure_archive_exists :archive => @archive, :config => @config end |
Class Method Details
.command_summary ⇒ Object
7 8 9 |
# File 'lib/heirloom/cli/tag.rb', line 7 def self.command_summary 'Tag an Heirloom with an attribute and value' end |
Instance Method Details
#tag ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/heirloom/cli/tag.rb', line 30 def tag unless @archive.exists? @logger.error "Archive does not exist" exit 1 end @archive.update :attribute => @opts[:attribute], :value => @opts[:value] end |