class Heroku::Command::Plugins

manage plugins to the heroku gem

Public Instance Methods

index() click to toggle source
plugins

list installed plugins

Example:

$ heroku plugins
=== Installed Plugins
heroku-accounts
# File lib/heroku/command/plugins.rb, line 18
def index
  validate_arguments!

  plugins = ::Heroku::Plugin.list

  if plugins.length > 0
    styled_header("Installed Plugins")
    styled_array(plugins)
  else
    display("You have no installed plugins.")
  end
end
install() click to toggle source
plugins:install URL

install a plugin

Example:

$ heroku plugins:install https://github.com/ddollar/heroku-accounts.git
Installing heroku-accounts... done
# File lib/heroku/command/plugins.rb, line 40
def install
  plugin = Heroku::Plugin.new(shift_argument)
  validate_arguments!

  action("Installing #{plugin.name}") do
    if plugin.install
      unless Heroku::Plugin.load_plugin(plugin.name)
        plugin.uninstall
        exit(1)
      end
    else
      error("Could not install #{plugin.name}. Please check the URL and try again.")
    end
  end
end
uninstall() click to toggle source
plugins:uninstall PLUGIN

uninstall a plugin

Example:

$ heroku plugins:uninstall heroku-accounts
Uninstalling heroku-accounts... done
# File lib/heroku/command/plugins.rb, line 65
def uninstall
  plugin = Heroku::Plugin.new(shift_argument)
  validate_arguments!

  action("Uninstalling #{plugin.name}") do
    plugin.uninstall
  end
end
update() click to toggle source
plugins:update [PLUGIN]

updates all plugins or a single plugin by name

Example:

$ heroku plugins:update
Updating heroku-accounts... done

$ heroku plugins:update heroku-accounts
Updating heroku-accounts... done
# File lib/heroku/command/plugins.rb, line 86
def update
  plugins = if plugin = shift_argument
    [plugin]
  else
    ::Heroku::Plugin.list
  end
  validate_arguments!

  plugins.each do |plugin|
    begin
      action("Updating #{plugin}") do
        begin
          Heroku::Plugin.new(plugin).update
        rescue Heroku::Plugin::ErrorUpdatingSymlinkPlugin
          status "skipped symlink"
        end
      end
    rescue SystemExit
      # ignore so that other plugins still update
    end
  end
end