Class: NexusAPI::Tag

Inherits:
Thor
  • Object
show all
Includes:
CLIUtils
Defined in:
lib/nexus_api/cli_commands/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CLIUtils

#if_file_exists?, #print_element, #print_paginating_set, #print_set, #repository_set?, #set, #setup

Instance Attribute Details

#apiObject

Returns the value of attribute api.



3
4
5
# File 'lib/nexus_api/cli_commands/tag.rb', line 3

def api
  @api
end

Instance Method Details

#addObject



11
12
13
14
15
# File 'lib/nexus_api/cli_commands/tag.rb', line 11

def add
  return false unless repository_set?
  setup
  @api.associate_tag(name: options[:name], sha1: options[:sha1], repository: options[:repository])
end

#createObject



19
20
21
22
# File 'lib/nexus_api/cli_commands/tag.rb', line 19

def create
  setup
  @api.create_tag(name: options[:name])
end

#deleteObject



26
27
28
29
# File 'lib/nexus_api/cli_commands/tag.rb', line 26

def delete
  setup
  @api.delete_tag(name: options[:name])
end

#listObject



33
34
35
# File 'lib/nexus_api/cli_commands/tag.rb', line 33

def list
  print_paginating_set(action: :list_tags, params: {}, filter: 'name')
end

#removeObject



41
42
43
44
45
# File 'lib/nexus_api/cli_commands/tag.rb', line 41

def remove
  return false unless repository_set?
  setup
  @api.delete_associated_tag(name: options[:name], sha1: options[:sha1], repository: options[:repository])
end