diff --git a/plugins/commands/gem/command.rb b/plugins/commands/gem/command.rb deleted file mode 100644 index b3c35828e..000000000 --- a/plugins/commands/gem/command.rb +++ /dev/null @@ -1,39 +0,0 @@ -require "rubygems" -require "rubygems/gem_runner" - -require "vagrant/util/safe_puts" - -module VagrantPlugins - module CommandGem - class Command < Vagrant.plugin("2", :command) - include Vagrant::Util::SafePuts - - def execute - # Bundler sets up its own custom gem load paths such that our - # own gems are never loaded. Therefore, give an error if a user - # tries to install gems while within a Bundler-managed environment. - if defined?(Bundler) - require 'bundler/shared_helpers' - if Bundler::SharedHelpers.in_bundle? - raise Vagrant::Errors::GemCommandInBundler - end - end - - # If the user needs some help, we add our own little message at the - # top so that they're aware of what `vagrant gem` is doing, really. - if @argv.empty? || @argv.include?("-h") || @argv.include?("--help") - @env.ui.info(I18n.t("vagrant.commands.gem.help_preamble"), - :prefix => false) - safe_puts - end - - # We just proxy the arguments onto a real RubyGems command - # but change `GEM_HOME` so that the gems are installed into - # our own private gem folder. - ENV["GEM_HOME"] = @env.gems_path.to_s - ::Gem.clear_paths - ::Gem::GemRunner.new.run(@argv.dup) - end - end - end -end diff --git a/plugins/commands/gem/plugin.rb b/plugins/commands/gem/plugin.rb deleted file mode 100644 index b2635785d..000000000 --- a/plugins/commands/gem/plugin.rb +++ /dev/null @@ -1,18 +0,0 @@ -require "vagrant" - -module VagrantPlugins - module CommandGem - class Plugin < Vagrant.plugin("2") - name "gem command" - description <<-DESC - Provides an interface to RubyGems that can be used to install - RubyGems into the Vagrant environment. - DESC - - command("gem") do - require File.expand_path("../command", __FILE__) - Command - end - end - end -end