diff options
-rw-r--r-- | lib/bundler/cli.rb | 1 | ||||
-rw-r--r-- | lib/bundler/cli/gem.rb | 8 | ||||
-rw-r--r-- | lib/bundler/vendored_thor.rb | 7 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 6 |
5 files changed, 20 insertions, 4 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index ba329b78cb..c55e2a9a56 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -4,7 +4,6 @@ require "bundler/vendored_thor" module Bundler class CLI < Thor - include Thor::Actions AUTO_INSTALL_CMDS = %w(show binstubs outdated exec open console licenses clean).freeze def self.start(*) diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 7fa005289e..0e4b7f742b 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -2,6 +2,11 @@ require "pathname" module Bundler + class CLI + Bundler.require_thor_actions + include Thor::Actions + end + class CLI::Gem TEST_FRAMEWORK_VERSIONS = { "rspec" => "3.0", @@ -13,7 +18,10 @@ module Bundler def initialize(options, gem_name, thor) @options = options @gem_name = resolve_name(gem_name) + @thor = thor + thor.behavior = :invoke + thor.destination_root = nil @name = @gem_name @target = SharedHelpers.pwd.join(gem_name) diff --git a/lib/bundler/vendored_thor.rb b/lib/bundler/vendored_thor.rb index 0d0b45bfba..4a5d0cf6bb 100644 --- a/lib/bundler/vendored_thor.rb +++ b/lib/bundler/vendored_thor.rb @@ -1,4 +1,7 @@ # frozen_string_literal: true -module Bundler; end +module Bundler + def self.require_thor_actions + Kernel.send(:require, "bundler/vendor/thor/lib/thor/actions") + end +end require "bundler/vendor/thor/lib/thor" -require "bundler/vendor/thor/lib/thor/actions" diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 6ce19124f5..a3c3a36419 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -47,7 +47,7 @@ RSpec.describe "bundle gem" do end after do - `rm "#{ENV["GIT_CONFIG"]}"` if File.exist?(ENV["GIT_CONFIG"]) + FileUtils.rm(ENV["GIT_CONFIG"]) if File.exist?(ENV["GIT_CONFIG"]) ENV["GIT_CONFIG"] = @git_config_location end diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 14f973dc97..b19a81e75f 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1163,6 +1163,12 @@ end loaded_specs = Gem.loaded_specs.dup #{exemptions.inspect}.each {|s| loaded_specs.delete(s) } pp loaded_specs + + # not a default gem, but harmful to have loaded + open_uri = $LOADED_FEATURES.grep(/open.uri/) + unless open_uri.empty? + warn "open_uri: \#{open_uri}" + end RUBY it "activates no gems with -rbundler/setup" do |