Method: Inspec::Plugin::V2::Installer#update

Defined in:
lib/inspec/plugin/v2/installer.rb

#update(plugin_name, opts = {}) ⇒ Object

Updates a plugin. Most options same as install, but will not handle path installs. If no :version is provided, updates to the latest. If a version is provided, the plugin becomes pinned at that specified version.

Parameters:

  • plugin_name (String)
  • opts (Hash) (defaults to: {})

    The installation options

Options Hash (opts):

  • :gem_file (String)

    Reserved for future use. No effect.

  • :version (String)

    Version constraint for remote gem updates



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/inspec/plugin/v2/installer.rb', line 84

def update(plugin_name, opts = {})
  # TODO: - check plugins.json for validity before trying anything that needs to modify it.
  validate_update_opts(plugin_name, opts)
  opts[:update_mode] = true

  # TODO: Handle installing from a local file
  # TODO: Perform dependency checks to make sure the new solution is valid
  install_from_remote_gems(plugin_name, opts)

  update_plugin_config_file(plugin_name, opts.merge({ action: :update }))
end