lib/pluginmanager/install.rb
# install_list will be an array of [plugin name, version, options] tuples, version it
# can be nil at this point we know that plugins_arg is not empty and if the
# --version is specified there is only one plugin in plugins_arg
#
install_list will be an array of [plugin name, version, options] tuples, version it
can be nil at this point we know that plugins_arg is not empty and if the
version is specified there is only one plugin in plugins_arg
install_list will be an array of [ plugin name version options ] tuples version it can be nil at this point we know that plugins_arg is not empty and if the version is specified there is only one plugin in plugins_arg
def install_gems_list!(install_list)
    install_list = LogStash::PluginManager.merge_duplicates(install_list)
    puts("Installing" + (install_list.empty? ? "..." : " " + install_list.collect(&:first).join(", ")))
    install_list.each do |plugin, version, options|
      if preserve?
        plugin_gem = gemfile.find(plugin)
        puts("Preserving Gemfile gem options for plugin #{plugin}") if plugin_gem && !plugin_gem.options.empty?
        gemfile.update(plugin, version, options)
      else
        gemfile.overwrite(plugin, version, options)
      end
    end
    gemfile.save
    bundler_options = {:install => true}
    bundler_options[:without] = [] if development?
    bundler_options[:rubygems_source] = gemfile.gemset.sources
    bundler_options[:local] = true if local?
    output = LogStash::Bundler.invoke!(bundler_options)
    puts("Installation successful")
  rescue => exception
    gemfile.restore!
    report_exception("Installation Aborted", exception)
  ensure
    display_bundler_output(output)
  end
def install_gems_list! ( install_list ) install_list = LogStash :: PluginManager . merge_duplicates ( install_list ) puts ( "Installing" + ( install_list . empty? ? "..." : " " + install_list . collect ( & :first ) . join ( ", " ) ) ) install_list . each do | plugin , version , options | if preserve? plugin_gem = gemfile . find ( plugin ) puts ( "Preserving Gemfile gem options for plugin #{plugin}" ) if plugin_gem && ! plugin_gem . options . empty? gemfile . update ( plugin , version , options ) else gemfile . overwrite ( plugin , version , options ) end end gemfile . save bundler_options = { :install => true } bundler_options [ :without ] = [ ] if development? bundler_options [ :rubygems_source ] = gemfile . gemset . sources bundler_options [ :local ] = true if local? output = LogStash :: Bundler . invoke! ( bundler_options ) puts ( "Installation successful" ) rescue => exception gemfile . restore! report_exception ( "Installation Aborted" , exception ) ensure display_bundler_output ( output ) end
install_list will be an array of [plugin name, version, options] tuples, version it
can be nil at this point we know that plugins_arg is not empty and if the
version is specified there is only one plugin in plugins_arg
install_list will be an array of [ plugin name version options ] tuples version it can be nil at this point we know that plugins_arg is not empty and if the version is specified there is only one plugin in plugins_arg
# If something goes wrong during the installation `LogStash::Gemfile` will restore a backup version. # Add plugins/gems to the current gemfile # Sync gemfiles changes to disk to make them available to the `bundler install`'s API
install_list