Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bundler/lib/bundler/source/rubygems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,15 @@ def install(spec, options = {})

spec.source.checksum_store.register(spec, installer.gem_checksum)

message = "Installing #{version_message(spec, options[:previous_spec])}"
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
installed_spec = installer.install
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)

message = "Installed #{version_message(spec, options[:previous_spec])}"
message += " with native extensions" if spec.extensions.any?
message += format(" in %.3fs", end_time - start_time)
Bundler.ui.confirm message

installed_spec = installer.install

spec.full_gem_path = installed_spec.full_gem_path
spec.loaded_from = installed_spec.loaded_from

Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/commands/binstubs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@

bundle "config set auto_install 1"
bundle "binstubs rack"
expect(out).to include("Installing rack 1.0.0")
expect(out).to include("Installed rack 1.0.0")
expect(the_bundle).to include_gems "rack 1.0.0"
end

Expand All @@ -550,7 +550,7 @@

bundle "config set auto_install 1"
bundle "binstubs rack", env: { "BUNDLE_INSTALL" => "1" }
expect(out).not_to include("Installing rack 1.0.0")
expect(out).not_to include("Installed rack 1.0.0")
end
end
end
2 changes: 1 addition & 1 deletion bundler/spec/commands/clean_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def should_not_have_gems(*gems)

bundle "config set auto_install 1"
bundle :clean
expect(out).to include("Installing weakling 0.0.3")
expect(out).to include("Installed weakling 0.0.3")
should_have_gems "thin-1.0", "rack-1.0.0", "weakling-0.0.3"
should_not_have_gems "foo-1.0"
end
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/console_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def __pry__
input.puts("puts 'hello'")
input.puts("exit")
end
expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")
expect(out).to include("hello")
expect(the_bundle).to include_gems "foo 1.0"
end
Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/commands/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@

bundle "config set auto_install 1"
bundle "exec rackup"
expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")
end

it "performs an automatic bundle install with git gems" do
Expand Down Expand Up @@ -658,7 +658,7 @@
G

bundle "exec fastlane"
expect(out).to include("Installing optparse 999.999.999")
expect(out).to include("Installed optparse 999.999.999")
expect(out).to include("2.192.0")
end

Expand Down
10 changes: 5 additions & 5 deletions bundler/spec/commands/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

bundle "install --verbose"

expect(out).to include("Installing rack 1.0.0")
expect(out).to include("Installed rack 1.0.0")
expect(default_bundle_path("gems/rack-1.0.0")).to exist
expect(the_bundle).to include_gems("rack 1.0.0")
end
Expand Down Expand Up @@ -1265,9 +1265,9 @@ def run
gem "yard", group: :c
G

expect(out).to include("Installing rack")
expect(out).to include("Installing rake")
expect(out).not_to include("Installing yard")
expect(out).to include("Installed rack")
expect(out).to include("Installed rake")
expect(out).not_to include("Installed yard")
end
end

Expand All @@ -1290,7 +1290,7 @@ def run
gem "bar"
G

expect(out).to include("Using foo 1.0.0").and include("Fetching bar 1.0.0").and include("Installing bar 1.0.0")
expect(out).to include("Using foo 1.0.0").and include("Fetching bar 1.0.0").and match(/Installed bar 1.0.0 in \d+\.\d+s/)
expect(last_command).to be_success
end
end
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/licenses_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@

bundle "config set auto_install 1"
bundle :licenses
expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")
end
end
2 changes: 1 addition & 1 deletion bundler/spec/commands/open_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

bundle "config set auto_install 1"
bundle "open rails", env: { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" }
expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")
end

it "opens the editor with a clean env" do
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/outdated_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ def test_group_option(group)

bundle "config set auto_install 1"
bundle :outdated, raise_on_error: false
expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")
end

context "after bundle install --deployment", bundler: "< 3" do
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/pristine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
bundle "pristine foo bar weakling"

expect(err).to include("Cannot pristine bar (1.0). Gem is sourced from local path.")
expect(out).to include("Installing weakling 1.0")
expect(out).to include("Installed weakling 1.0")

expect(weakling_changes_txt).not_to be_file
expect(foo_changes_txt).not_to be_file
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@

bundle "config set auto_install 1"
bundle :show
expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")
end

context "with a valid regexp for gem name" do
Expand Down
14 changes: 7 additions & 7 deletions bundler/spec/commands/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@

bundle "update --conservative --verbose"

expect(out).not_to include("Installing quickbooks-ruby 0.1.9")
expect(out).to include("Installing quickbooks-ruby 1.0.19").and include("Installing oauth2 1.4.10")
expect(out).not_to include("Installed quickbooks-ruby 0.1.9")
expect(out).to include("Installed quickbooks-ruby 1.0.19").and include("Installed oauth2 1.4.10")
end

it "does not downgrade direct dependencies when using gemspec sources" do
Expand Down Expand Up @@ -423,9 +423,9 @@

bundle "update --verbose"

expect(out).not_to include("Installing sneakers 2.12.0")
expect(out).not_to include("Installing rake 12.3.3")
expect(out).to include("Installing sneakers 2.11.0").and include("Installing rake 13.0.6")
expect(out).not_to include("Installed sneakers 2.12.0")
expect(out).not_to include("Installed rake 12.3.3")
expect(out).to include("Installed sneakers 2.11.0").and include("Installed rake 13.0.6")
end

it "does not downgrade indirect dependencies unnecessarily" do
Expand Down Expand Up @@ -826,7 +826,7 @@
end

bundle "update", all: true
expect(out).to include("Installing activesupport 3.0 (was 2.3.5)")
expect(out).to include("Installed activesupport 3.0 (was 2.3.5)")
end

it "only prints `Using` for versions that have changed" do
Expand All @@ -850,7 +850,7 @@

bundle "update", all: true
out.sub!("Removing foo (1.0)\n", "")
expect(out).to match(/Resolving dependencies\.\.\.\.*\nFetching foo 2\.0 \(was 1\.0\)\nInstalling foo 2\.0 \(was 1\.0\)\nBundle updated/)
expect(out).to match(/Resolving dependencies\.\.\.\.*\nFetching foo 2\.0 \(was 1\.0\)\nInstalled foo 2\.0 \(was 1\.0\) in [\d.]+s\nBundle updated/)
end

it "shows error message when Gemfile.lock is not preset and gem is specified" do
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/install/bundler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
gem "rails_pinned_to_old_activesupport"
G

expect(out).to include("Installing activesupport 1.2.3 (was 2.3.2)")
expect(out).to include("Installed activesupport 1.2.3 (was 2.3.2)")
expect(err).to be_empty
end

Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/install/gemfile/gemspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,14 @@ def x64_mingw_checksums(checksums)

it "should install" do
results = bundle "install", artifice: "endpoint"
expect(results).to include("Installing rack 1.0.0")
expect(results).to include("Installed rack 1.0.0")
expect(the_bundle).to include_gems "rack 1.0.0"
end
end

it "should install", :jruby do
results = bundle "install", artifice: "endpoint"
expect(results).to include("Installing rack 1.0.0")
expect(results).to include("Installed rack 1.0.0")
expect(the_bundle).to include_gems "rack 1.0.0"
end

Expand Down
8 changes: 4 additions & 4 deletions bundler/spec/install/gemfile/specific_platform_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@

it "still installs the generic RUBY variant if necessary" do
bundle "install --verbose", artifice: "compact_index", env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }
expect(out).to include("Installing nokogiri 1.3.10")
expect(out).to include("Installed nokogiri 1.3.10")
end

it "still installs the generic RUBY variant if necessary, even in frozen mode" do
bundle "install --verbose", artifice: "compact_index", env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s, "BUNDLE_FROZEN" => "true" }
expect(out).to include("Installing nokogiri 1.3.10")
expect(out).to include("Installed nokogiri 1.3.10")
end
end

Expand Down Expand Up @@ -198,7 +198,7 @@
L

bundle "install --verbose", artifice: "compact_index", env: { "BUNDLER_VERSION" => "2.1.4", "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
expect(out).to include("Installing libv8 8.4.255.0 (universal-darwin)")
expect(out).to include("Installed libv8 8.4.255.0 (universal-darwin)")

bundle "add mini_racer --verbose", artifice: "compact_index", env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
expect(out).to include("Using libv8 8.4.255.0 (universal-darwin)")
Expand Down Expand Up @@ -235,7 +235,7 @@
L

bundle "install --verbose", artifice: "compact_index_precompiled_before", env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }
expect(out).to include("Installing grpc 1.50.0 (universal-darwin)")
expect(out).to include("Installed grpc 1.50.0 (universal-darwin)")
end
end

Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/install/gems/native_extensions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
bundle "config set build.c_extension --with-c_extension=hello"
bundle "install"

expect(out).to include("Installing c_extension 1.0 with native extensions")
expect(out).to match(/Installed c_extension 1.0 with native extensions in \d+\.\d+s/)

run "Bundler.require; puts CExtension.new.its_true"
expect(out).to eq("true")
Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/install/redownload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
rack_lib.open("w") {|f| f.write("blah blah blah") }
bundle :install, flag => true

expect(out).to include "Installing rack 1.0.0"
expect(out).to include "Installed rack 1.0.0"
expect(rack_lib.open(&:read)).to eq("RACK = '1.0.0'\n")
expect(the_bundle).to include_gems "rack 1.0.0"
end

it "works on first bundle install" do
bundle :install, flag => true

expect(out).to include "Installing rack 1.0.0"
expect(out).to include "Installed rack 1.0.0"
expect(the_bundle).to include_gems "rack 1.0.0"
end

Expand Down
16 changes: 8 additions & 8 deletions bundler/spec/plugins/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

it "doesn't install plugin again" do
bundle "plugin install foo --source #{file_uri_for(gem_repo2)}"
expect(out).not_to include("Installing plugin foo")
expect(out).not_to include("Installed plugin foo")
expect(out).not_to include("Installed plugin foo")
end
end
Expand All @@ -72,8 +72,8 @@

bundle "plugin install foo kung-foo --version '1.0' --source #{file_uri_for(gem_repo2)}"

expect(out).to include("Installing foo 1.0")
expect(out).to include("Installing kung-foo 1.0")
expect(out).to include("Installed foo 1.0")
expect(out).to include("Installed kung-foo 1.0")
plugin_should_be_installed("foo", "kung-foo")
end

Expand All @@ -83,10 +83,10 @@
end

bundle "plugin install foo --version 1.0 --source #{file_uri_for(gem_repo2)} --verbose"
expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")

bundle "plugin install foo --source #{file_uri_for(gem_repo2)} --verbose"
expect(out).to include("Installing foo 1.1")
expect(out).to include("Installed foo 1.1")

bundle "plugin install foo --source #{file_uri_for(gem_repo2)} --verbose"
expect(out).to include("Using foo 1.1")
Expand Down Expand Up @@ -146,8 +146,8 @@ def exec(command, args)

bundle "plugin install foo kung-foo --version '1.0' --source #{file_uri_for(gem_repo2)}"

expect(out).to include("Installing foo 1.0")
expect(out).to include("Installing kung-foo 1.0")
expect(out).to include("Installed foo 1.0")
expect(out).to include("Installed kung-foo 1.0")
plugin_should_be_installed("foo", "kung-foo")

build_repo2 do
Expand Down Expand Up @@ -284,7 +284,7 @@ def exec(command, args)

bundle "install"

expect(out).to include("Installing foo 1.0")
expect(out).to include("Installed foo 1.0")

plugin_should_be_installed("foo")

Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/realworld/gemfile_source_header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

bundle :install, artifice: nil

expect(out).to include("Installing weakling")
expect(out).to include("Installed weakling")
expect(out).to include("Bundle complete")
expect(the_bundle).to include_gems "weakling 0.0.3"
end
Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/realworld/mirror_probe_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

bundle :install, artifice: nil

expect(out).to include("Installing weakling")
expect(out).to include("Installed weakling")
expect(out).to include("Bundle complete")
expect(the_bundle).to include_gems "weakling 0.0.3"
end
Expand All @@ -54,7 +54,7 @@

bundle :install, artifice: nil

expect(out).to include("Installing weakling")
expect(out).to include("Installed weakling")
expect(out).to include("Bundle complete")
expect(the_bundle).to include_gems "weakling 0.0.3"
end
Expand Down
Loading