Class: CollinsShell::Tag

Inherits:
Thor
  • Object
show all
Includes:
ThorHelper, Util
Defined in:
lib/collins_shell/tag.rb

Constant Summary

Constants included from Util

Util::SIZABLE_ATTRIBUTES

Constants included from ThorHelper

CollinsShell::ThorHelper::COLLINS_OPTIONS, CollinsShell::ThorHelper::PAGE_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util

#asset_exec, #asset_get, #call_collins, #finalize_exec, #format_asset_tags, #format_asset_value, #get_selector, #is_array?, #print_find_results, #run_command_in_thread, #say_status, #thread_mgr

Methods included from ThorHelper

#appropriate_answer?, #batch_selector_operation, #collins_config_from_file, #ensure_password, #get_collins_client, #get_collins_config, #get_password, included, #require_valid_collins_config, #require_yes, #say_error, #say_success, #selector_or_tag, #try_config_merge, #use_collins_options, #use_nuke_option, #use_page_options, #use_selector_option, #use_tag_option

Class Method Details



14
15
16
# File 'lib/collins_shell/tag.rb', line 14

def self.banner task, namespace = true, subcommand = false
  "#{basename} #{task.formatted_usage(self, true, subcommand).gsub(':',' ')}"
end

Instance Method Details

#listObject



20
21
22
23
24
25
26
27
28
# File 'lib/collins_shell/tag.rb', line 20

def list
  call_collins get_collins_client, "list" do |client|
    header = [["Name", "Label", "Description"]]
    tags = header + client.get_all_tags.map do |tag|
      [tag.name, tag.label, tag.description]
    end
    print_table tags
  end
end

#values(tag) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/collins_shell/tag.rb', line 32

def values tag
  call_collins get_collins_client, "values" do |client|
    client.get_tag_values(tag).sort.each do |value|
      puts(value)
    end
  end
end