Class: Jenkins2API::Command::Plugin

Inherits:
ThorCommand show all
Defined in:
lib/commands/plugin.rb

Overview

Contains all the commands under plugin namespace

Instance Method Summary collapse

Instance Method Details

#install(name, id) ⇒ Object

Install a plugin



27
28
29
# File 'lib/commands/plugin.rb', line 27

def install(name, id)
  client.configuration.plugin_install(name, id)
end

#listObject

List installed plugins



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/commands/plugin.rb', line 10

def list
  puts "Legend:\n  I  Inactive\n  U  Update is available\n"

  client.configuration.plugin_list.each do |plugin|
    flag = ' '
    flag = 'I' unless plugin['active']
    flag = 'U' if plugin['hasUpdate']

    printf(
      " [%s] %s (%s@%s)\n", flag, plugin['longName'],
      plugin['shortName'], plugin['version']
    )
  end
end