Skip to content

Commit

Permalink
Rename --deploy to --deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Aug 4, 2010
1 parent c18bfd3 commit 7dd31f0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion lib/bundler.rb
Expand Up @@ -60,7 +60,7 @@ class InvalidSpecSet < StandardError; end

class << self
attr_writer :ui, :bundle_path
attr_accessor :deploy
attr_accessor :deployment

def configure
@configured ||= begin
Expand Down
20 changes: 10 additions & 10 deletions lib/bundler/cli.rb
Expand Up @@ -112,22 +112,22 @@ def check
"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 "deploy", :type => :boolean, :banner =>
method_option "deployment", :type => :boolean, :banner =>
"Install using defaults tuned for deployment environments"
method_option "production", :type => :boolean, :banner =>
"Deprecated, please use --deploy instead"
"Deprecated, please use --deployment instead"
def install(path = nil)
opts = options.dup
opts[:without] ||= []
opts[:without].map! { |g| g.to_sym }

if opts[:production]
opts[:deploy] = true
opts[:deployment] = 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."
"the final release of Bundler 1.0. Please use --deployment instead."
end

if (path || opts[:path] || opts[:deploy]) && opts[:system]
if (path || opts[:path] || opts[:deployment]) && 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
Expand All @@ -149,12 +149,12 @@ def install(path = nil)
exit 1
end

if opts[:deploy]
Bundler.deploy = true
if opts[:deployment]
Bundler.deployment = true

unless Bundler.default_lockfile.exist?
raise ProductionError, "The --deploy flag requires a Gemfile.lock. Please make sure " \
"you have checked your Gemfile.lock into version control " \
raise ProductionError, "The --deployment flag requires a Gemfile.lock. Please make " \
"sure you have checked your Gemfile.lock into version control " \
"before deploying."
end

Expand All @@ -166,7 +166,7 @@ def install(path = nil)
# 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 opts[:system]
Bundler.settings[:path] = "vendor/bundle" if opts[:deploy]
Bundler.settings[:path] = "vendor/bundle" if opts[:deployment]
Bundler.settings[:path] = path if path
Bundler.settings[:path] = opts[:path] if opts[:path]
Bundler.settings[:bin] = opts["binstubs"] if opts[:binstubs]
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/definition.rb
Expand Up @@ -68,7 +68,7 @@ def initialize(lockfile, dependencies, sources, unlock)
@new_platform = !@platforms.include?(current_platform)
@platforms |= [current_platform]

ensure_equivalent_gemfile_and_lockfile if Bundler.deploy
ensure_equivalent_gemfile_and_lockfile if Bundler.deployment

converge_sources
converge_dependencies
Expand Down
18 changes: 9 additions & 9 deletions spec/install/deploy_spec.rb
@@ -1,6 +1,6 @@
require "spec_helper"

describe "install with --deploy" do
describe "install with --deployment" do
before do
gemfile <<-G
source "file://#{gem_repo1}"
Expand All @@ -9,8 +9,8 @@
end

it "fails without a lockfile" do
bundle "install --deploy"
out.should include("The --deploy flag requires a Gemfile.lock")
bundle "install --deployment"
out.should include("The --deployment flag requires a Gemfile.lock")
end

describe "with an existing lockfile" do
Expand All @@ -19,7 +19,7 @@
end

it "works if you didn't change anything" do
bundle "install --deploy", :exit_status => true
bundle "install --deployment", :exit_status => true
exitstatus.should == 0
end

Expand All @@ -30,7 +30,7 @@
gem "rack-obama"
G

bundle "install --deploy"
bundle "install --deployment"
out.should include("You have modified your Gemfile")
out.should include("You have added to the Gemfile")
out.should include("* rack-obama")
Expand All @@ -44,7 +44,7 @@
gem "activesupport"
G

bundle "install --deploy"
bundle "install --deployment"
out.should include("You have modified your Gemfile")
out.should include("You have added to the Gemfile:\n* activesupport\n\n")
out.should include("You have deleted from the Gemfile:\n* rack")
Expand All @@ -57,7 +57,7 @@
gem "rack", :git => "git://hubz.com"
G

bundle "install --deploy"
bundle "install --deployment"
out.should include("You have modified your Gemfile")
out.should include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
out.should_not include("You have changed in the Gemfile")
Expand All @@ -76,7 +76,7 @@
gem "rack"
G

bundle "install --deploy"
bundle "install --deployment"
out.should include("You have modified your Gemfile")
out.should include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)")
out.should_not include("You have added to the Gemfile")
Expand All @@ -99,7 +99,7 @@
gem "foo", :git => "#{lib_path("rack")}"
G

bundle "install --deploy"
bundle "install --deployment"
out.should include("You have modified your Gemfile")
out.should include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`")
out.should_not include("You have added to the Gemfile")
Expand Down
2 changes: 1 addition & 1 deletion spec/install/gems/packed_spec.rb
Expand Up @@ -28,7 +28,7 @@
simulate_new_machine
FileUtils.rm_rf gem_repo2

bundle "install --deploy"
bundle "install --deployment"
should_be_installed "rack 1.0.0"
end

Expand Down
4 changes: 2 additions & 2 deletions spec/install/gems/simple_case_spec.rb
Expand Up @@ -457,9 +457,9 @@ def set_bundle_path(type, location)
G
end

it "behaves like bundle install vendor/bundle with --deploy" do
it "behaves like bundle install vendor/bundle with --deployment" do
bundle "install"
bundle "install --deploy"
bundle "install --deployment"
out.should include("Your bundle was installed to `vendor/bundle`")
should_be_installed "rack 1.0.0"
bundled_app("vendor/bundle").should exist
Expand Down

0 comments on commit 7dd31f0

Please sign in to comment.