summaryrefslogtreecommitdiff
path: root/lib/bundler/cli.rb
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-08-03 12:06:41 -0700
committerAndre Arko <andre@arko.net>2010-08-03 12:06:41 -0700
commit56e10034e64fd0b388a59c7d30b9088e0bc5fac4 (patch)
treebf742f0e75135f86f71ef04e4faf9d8d238f5fd1 /lib/bundler/cli.rb
parenta9e8b091324f90aa768f3a39e56e701e6a42bd28 (diff)
downloadbundler-56e10034e64fd0b388a59c7d30b9088e0bc5fac4.tar.gz
Deprecate --production for --deploy
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r--lib/bundler/cli.rb32
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index f094986f68..b2a2abbd19 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -109,20 +109,28 @@ module Bundler
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
method_option "system", :type => :boolean, :banner =>
"Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
- method_option "production", :type => :boolean, :banner =>
+ method_option "deploy", :type => :boolean, :banner =>
"Install using defaults tuned for deployment environments"
+ method_option "production", :type => :boolean, :banner =>
+ "Deprecated, please use --deploy instead"
def install(path = nil)
opts = options.dup
opts[:without] ||= []
opts[:without].map! { |g| g.to_sym }
- if (path || options[:path] || options[:production]) && options[:system]
+ if opts[:production]
+ opts[:deploy] = true
+ Bundler.ui.warn "The --production option is deprecated, and will be removed in " \
+ "the final release of Bundler 1.0. Please use --deploy instead."
+ end
+
+ if (path || opts[:path] || opts[:deploy]) && opts[:system]
Bundler.ui.error "You have specified both a path to install your gems to, \n" \
"as well as --system. Please choose."
exit 1
end
- if path && options[:path]
+ if path && opts[:path]
Bundler.ui.error "You have specified a path via `bundle install #{path}` as well as\n" \
"by `bundle install --path #{options[:path]}`. These options are\n" \
"equivalent, so please use one or the other."
@@ -138,26 +146,26 @@ module Bundler
exit 1
end
- if opts[:production]
- Bundler.production = true
+ if opts[:deploy]
+ Bundler.deploy = true
unless Bundler.default_lockfile.exist?
- raise ProductionError, "The --production flag requires a Gemfile.lock. Please\n" \
- "make sure you have checked your Gemfile.lock into version\n" \
- "control before deploying."
+ raise ProductionError, "The --deploy flag requires a Gemfile.lock. Please make sure " \
+ "you have checked your Gemfile.lock into version control " \
+ "before deploying."
end
if Bundler.root.join("vendor/cache").exist?
- opts["local"] = true
+ opts[:local] = true
end
end
# Can't use Bundler.settings for this because settings needs gemfile.dirname
ENV['BUNDLE_GEMFILE'] = File.expand_path(opts[:gemfile]) if opts[:gemfile]
- Bundler.settings[:path] = nil if options[:system]
- Bundler.settings[:path] = "vendor/bundle" if options[:production]
+ Bundler.settings[:path] = nil if opts[:system]
+ Bundler.settings[:path] = "vendor/bundle" if opts[:deploy]
Bundler.settings[:path] = path if path
- Bundler.settings[:path] = options[:path] if options[:path]
+ Bundler.settings[:path] = opts[:path] if opts[:path]
Bundler.settings[:bin] = opts["binstubs"] if opts[:binstubs]
Bundler.settings[:disable_shared_gems] = '1' if Bundler.settings[:path]
Bundler.settings.without = opts[:without]