diff options
author | Carl Lerche <carllerche@mac.com> | 2009-07-30 10:47:25 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-07-30 10:59:25 -0700 |
commit | f0b92c5b273006f6b05586eda54984b5f2b85e41 (patch) | |
tree | 71f3019d2596c42b0a145aab7222168b27748a48 | |
parent | 8adf4717606cd5b64fe5baf25a8e45ad1a194804 (diff) | |
download | bundler-f0b92c5b273006f6b05586eda54984b5f2b85e41.tar.gz |
Only require the bundler with rubygems when running a bundler command
-rw-r--r-- | lib/bundler/commands/bundle_command.rb | 4 | ||||
-rw-r--r-- | lib/bundler/commands/exec_command.rb | 4 | ||||
-rw-r--r-- | lib/bundler/manifest_file.rb | 2 | ||||
-rw-r--r-- | lib/rubygems_plugin.rb | 1 |
4 files changed, 7 insertions, 4 deletions
diff --git a/lib/bundler/commands/bundle_command.rb b/lib/bundler/commands/bundle_command.rb index cbfd9cf99e..a1f9590f75 100644 --- a/lib/bundler/commands/bundle_command.rb +++ b/lib/bundler/commands/bundle_command.rb @@ -4,7 +4,7 @@ class Gem::Commands::BundleCommand < Gem::Command super('bundle', 'Create a gem bundle based on your Gemfile', {:manifest => nil, :update => false}) add_option('-m', '--manifest MANIFEST', "Specify the path to the manifest file") do |manifest, options| - options[:manifest] = Pathname.new(manifest) + options[:manifest] = manifest end add_option('-u', '--update', "Force a remote check for newer gems") do @@ -23,6 +23,8 @@ Bundle stuff end def execute + # Prevent the bundler from getting required unless it is actually being used + require 'bundler' Bundler::CLI.run(:bundle, options) end diff --git a/lib/bundler/commands/exec_command.rb b/lib/bundler/commands/exec_command.rb index 7d4ced6e3e..228aa60619 100644 --- a/lib/bundler/commands/exec_command.rb +++ b/lib/bundler/commands/exec_command.rb @@ -4,7 +4,7 @@ class Gem::Commands::ExecCommand < Gem::Command super('exec', 'Run a command in context of a gem bundle', {:manifest => nil}) add_option('-m', '--manifest MANIFEST', "Specify the path to the manifest file") do |manifest, options| - options[:manifest] = Pathname.new(manifest) + options[:manifest] = manifest end end @@ -23,6 +23,8 @@ class Gem::Commands::ExecCommand < Gem::Command end def execute + # Prevent the bundler from getting required unless it is actually being used + require 'bundler' Bundler::CLI.run(:exec, options) end diff --git a/lib/bundler/manifest_file.rb b/lib/bundler/manifest_file.rb index 0af486ecf5..c766bca85a 100644 --- a/lib/bundler/manifest_file.rb +++ b/lib/bundler/manifest_file.rb @@ -57,7 +57,7 @@ module Bundler end def filename - @filename ||= find_manifest_file + Pathname.new(@filename ||= find_manifest_file) end def find_manifest_file diff --git a/lib/rubygems_plugin.rb b/lib/rubygems_plugin.rb index 09aa2b8512..f493bcb691 100644 --- a/lib/rubygems_plugin.rb +++ b/lib/rubygems_plugin.rb @@ -1,5 +1,4 @@ require 'rubygems/command_manager' -require 'bundler' require 'bundler/commands/bundle_command' require 'bundler/commands/exec_command' |