summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-04-27 22:04:34 +0000
committerSamuel Giddins <segiddins@segiddins.me>2017-04-30 18:34:43 -0500
commitf836bcab768df362a21e607d837651ae6ee65b27 (patch)
treef7ce99de3f9219d5b888020747dbf306c941ce31 /lib
parent87f81f3dfe47661ad74738eec15fdb2e0bbe1989 (diff)
downloadbundler-f836bcab768df362a21e607d837651ae6ee65b27.tar.gz
Auto merge of #5612 - bundler:seg-dont-require-thor-actions, r=indirect
[CLI] Avoid loading Thor::Actions when it is not used (cherry picked from commit 8552918f7faefc7f003d8a20979d5223bbd5b8ac)
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli.rb1
-rw-r--r--lib/bundler/cli/gem.rb8
-rw-r--r--lib/bundler/vendored_thor.rb7
3 files changed, 13 insertions, 3 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"