lib/bundler/cli.rb in bundler-1.1.rc vs lib/bundler/cli.rb in bundler-1.1.rc.2
- old
+ new
@@ -152,14 +152,14 @@
"Do not allow the Gemfile.lock to be updated after this install"
method_option "deployment", :type => :boolean, :banner =>
"Install using defaults tuned for deployment environments"
method_option "standalone", :type => :array, :lazy_default => [], :banner =>
"Make a bundle that can work without the Bundler runtime"
- method_option "full-index", :tpye => :boolean, :banner =>
+ method_option "full-index", :type => :boolean, :banner =>
"Use the rubygems modern index instead of the API endpoint"
- method_option "clean", :type => :boolean, :default => true, :banner =>
- "Run bundle clean automatically after clean"
+ method_option "clean", :type => :boolean, :banner =>
+ "Run bundle clean automatically after install"
def install
opts = options.dup
if opts[:without]
opts[:without].map!{|g| g.split(" ") }
opts[:without].flatten!
@@ -209,14 +209,15 @@
Bundler.settings[:shebang] = opts["shebang"] if opts[:shebang]
Bundler.settings[:no_prune] = true if opts["no-prune"]
Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? '1' : nil
Bundler.settings.without = opts[:without]
Bundler.ui.be_quiet! if opts[:quiet]
+ Bundler.settings[:clean] = opts[:clean] if opts[:clean]
Bundler::Fetcher.disable_endpoint = opts["full-index"]
# rubygems plugins sometimes hook into the gem install process
- Gem.load_plugins if Gem.respond_to?(:load_plugins)
+ Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
Installer.install(Bundler.root, Bundler.definition, opts)
Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !options["no-cache"]
if Bundler.settings[:path]
@@ -230,11 +231,11 @@
end
Installer.post_install_messages.to_a.each do |name, msg|
Bundler.ui.confirm "Post-install message from #{name}:\n#{msg}"
end
- clean if opts["clean"] && Bundler.settings[:path]
+ clean if Bundler.settings[:clean] && Bundler.settings[:path]
rescue GemNotFound => e
if opts[:local] && Bundler.app_cache.exist?
Bundler.ui.warn "Some gems seem to be missing from your vendor/cache directory."
end
@@ -251,12 +252,10 @@
possible versions of the gems in the bundle.
D
method_option "source", :type => :array, :banner => "Update a specific source (and all gems associated with it)"
method_option "local", :type => :boolean, :banner =>
"Do not attempt to fetch gems remotely and use the gem cache instead"
- method_option "clean", :type => :boolean, :default => true, :banner =>
- "Run bundle clean automatically after clean"
def update(*gems)
sources = Array(options[:source])
if gems.empty? && sources.empty?
# We're doing a full update
@@ -265,15 +264,15 @@
Bundler.definition(:gems => gems, :sources => sources)
end
opts = {"update" => true, "local" => options[:local]}
# rubygems plugins sometimes hook into the gem install process
- Gem.load_plugins if Gem.respond_to?(:load_plugins)
+ Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
Installer.install Bundler.root, Bundler.definition, opts
Bundler.load.cache if Bundler.root.join("vendor/cache").exist?
- clean if options["clean"] && Bundler.settings[:path]
+ clean if Bundler.settings[:clean] && Bundler.settings[:path]
Bundler.ui.confirm "Your bundle is updated! " +
"Use `bundle show [gemname]` to see where a bundled gem is installed."
end
desc "show [GEM]", "Shows all gems that are part of the bundle, or the path to a given gem"
@@ -413,10 +412,13 @@
exit 126
rescue Errno::ENOENT
Bundler.ui.error "bundler: command not found: #{ARGV.first}"
Bundler.ui.warn "Install missing gem executables with `bundle install`"
exit 127
+ rescue ArgumentError
+ Bundler.ui.error "bundle exec needs a command to run"
+ exit 128
end
end
desc "config NAME [VALUE]", "retrieve or set a configuration value"
long_desc <<-D
@@ -554,10 +556,12 @@
:author => git_user_name.empty? ? "TODO: Write your name" : git_user_name,
:email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email
}
template(File.join("newgem/Gemfile.tt"), File.join(target, "Gemfile"), opts)
template(File.join("newgem/Rakefile.tt"), File.join(target, "Rakefile"), opts)
+ template(File.join("newgem/LICENSE.tt"), File.join(target, "LICENSE"), opts)
+ template(File.join("newgem/README.md.tt"), File.join(target, "README.md"), opts)
template(File.join("newgem/gitignore.tt"), File.join(target, ".gitignore"), opts)
template(File.join("newgem/newgem.gemspec.tt"), File.join(target, "#{name}.gemspec"), opts)
template(File.join("newgem/lib/newgem.rb.tt"), File.join(target, "lib/#{name}.rb"), opts)
template(File.join("newgem/lib/newgem/version.rb.tt"), File.join(target, "lib/#{name}/version.rb"), opts)
if options[:bin]
@@ -577,9 +581,10 @@
def clean
if Bundler.settings[:path] || options[:force]
Bundler.load.clean
else
Bundler.ui.error "Can only use bundle clean when --path is set or --force is set"
+ exit 1
end
end
private