Class: Heirloom::CLI::Catalog

Inherits:
Object
  • Object
show all
Includes:
Shared
Defined in:
lib/heirloom/cli/catalog.rb

Instance Method Summary collapse

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_name, #ensure_valid_options, #ensure_valid_region, #ensure_valid_regions, #ensure_valid_secret, #latest_id, #load_config, #read_secret

Constructor Details

#initializeCatalog

Returns a new instance of Catalog.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/heirloom/cli/catalog.rb', line 7

def initialize
  @opts = read_options
  @logger = HeirloomLogger.new :log_level => @opts[:level]
  @config = load_config :logger => @logger,
                        :opts   => @opts

  ensure_valid_options :provided => @opts,
                       :required => [],
                       :config   => @config
  ensure_valid_region :region => @opts[:metadata_region],
                      :config => @config
  @catalog = Heirloom::Catalog.new :config  => @config
  ensure_catalog_domain_exists :config  => @config,
                               :catalog => @catalog
end

Instance Method Details

#allObject



23
24
25
26
27
28
29
30
31
# File 'lib/heirloom/cli/catalog.rb', line 23

def all
  if @opts[:json]
    jj catalog_with_heirloom_prefix_removed
  else
    formatter = Heirloom::CLI::Formatter::Catalog.new 
    puts formatter.format :catalog => catalog_with_heirloom_prefix_removed,
                          :name    => @opts[:name]
  end
end