Class: NexusAPI::Script
- Inherits:
-
Thor
- Object
- Thor
- NexusAPI::Script
show all
- Includes:
- CLIUtils
- Defined in:
- lib/nexus_api/cli_commands/script.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
#api ⇒ Object
Returns the value of attribute api.
3
4
5
|
# File 'lib/nexus_api/cli_commands/script.rb', line 3
def api
@api
end
|
Instance Method Details
#delete ⇒ Object
9
10
11
12
|
# File 'lib/nexus_api/cli_commands/script.rb', line 9
def delete
setup
@api.delete_script(name: options[:name])
end
|
#execute ⇒ Object
17
18
19
20
|
# File 'lib/nexus_api/cli_commands/script.rb', line 17
def execute
setup
@api.run_script(name: options[:name])
end
|
#list ⇒ Object
24
25
26
|
# File 'lib/nexus_api/cli_commands/script.rb', line 24
def list
print_set(action: :list_scripts, filter: 'name')
end
|
#upload ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/nexus_api/cli_commands/script.rb', line 30
def upload
setup
options[:repository] = 'scripts'
if_file_exists? do
@api.upload_script(filename: options[:filename])
end
end
|