diff --git a/bundler/lib/bundler/source/rubygems.rb b/bundler/lib/bundler/source/rubygems.rb index 2e76becb8491..34934d840a3b 100644 --- a/bundler/lib/bundler/source/rubygems.rb +++ b/bundler/lib/bundler/source/rubygems.rb @@ -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 diff --git a/bundler/spec/commands/binstubs_spec.rb b/bundler/spec/commands/binstubs_spec.rb index 6c3dc7bb2d17..e9d7a66de3ea 100644 --- a/bundler/spec/commands/binstubs_spec.rb +++ b/bundler/spec/commands/binstubs_spec.rb @@ -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 @@ -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 diff --git a/bundler/spec/commands/clean_spec.rb b/bundler/spec/commands/clean_spec.rb index 0b559a87c8fc..e940ad7bf8d7 100644 --- a/bundler/spec/commands/clean_spec.rb +++ b/bundler/spec/commands/clean_spec.rb @@ -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 diff --git a/bundler/spec/commands/console_spec.rb b/bundler/spec/commands/console_spec.rb index a41432b88adb..9fefaa9b93f4 100644 --- a/bundler/spec/commands/console_spec.rb +++ b/bundler/spec/commands/console_spec.rb @@ -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 diff --git a/bundler/spec/commands/exec_spec.rb b/bundler/spec/commands/exec_spec.rb index d59b690d2f4e..312536a540af 100644 --- a/bundler/spec/commands/exec_spec.rb +++ b/bundler/spec/commands/exec_spec.rb @@ -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 @@ -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 diff --git a/bundler/spec/commands/install_spec.rb b/bundler/spec/commands/install_spec.rb index 1e57414377e7..69f2e60e5dff 100644 --- a/bundler/spec/commands/install_spec.rb +++ b/bundler/spec/commands/install_spec.rb @@ -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 @@ -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 @@ -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 diff --git a/bundler/spec/commands/licenses_spec.rb b/bundler/spec/commands/licenses_spec.rb index a20398489041..6a2cbaa65426 100644 --- a/bundler/spec/commands/licenses_spec.rb +++ b/bundler/spec/commands/licenses_spec.rb @@ -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 diff --git a/bundler/spec/commands/open_spec.rb b/bundler/spec/commands/open_spec.rb index 97374f30c3f9..35890de45864 100644 --- a/bundler/spec/commands/open_spec.rb +++ b/bundler/spec/commands/open_spec.rb @@ -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 diff --git a/bundler/spec/commands/outdated_spec.rb b/bundler/spec/commands/outdated_spec.rb index e7edc67e5753..89292adb839c 100644 --- a/bundler/spec/commands/outdated_spec.rb +++ b/bundler/spec/commands/outdated_spec.rb @@ -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 diff --git a/bundler/spec/commands/pristine_spec.rb b/bundler/spec/commands/pristine_spec.rb index 1aec37f8501b..5f1b5036f887 100644 --- a/bundler/spec/commands/pristine_spec.rb +++ b/bundler/spec/commands/pristine_spec.rb @@ -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 diff --git a/bundler/spec/commands/show_spec.rb b/bundler/spec/commands/show_spec.rb index 2b6d4d2d0023..0e283ff19686 100644 --- a/bundler/spec/commands/show_spec.rb +++ b/bundler/spec/commands/show_spec.rb @@ -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 diff --git a/bundler/spec/commands/update_spec.rb b/bundler/spec/commands/update_spec.rb index 8565e27ebf87..cac4e71a47fa 100644 --- a/bundler/spec/commands/update_spec.rb +++ b/bundler/spec/commands/update_spec.rb @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/bundler/spec/install/bundler_spec.rb b/bundler/spec/install/bundler_spec.rb index 19911f1154f3..aa11266009d5 100644 --- a/bundler/spec/install/bundler_spec.rb +++ b/bundler/spec/install/bundler_spec.rb @@ -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 diff --git a/bundler/spec/install/gemfile/gemspec_spec.rb b/bundler/spec/install/gemfile/gemspec_spec.rb index 63778567cfeb..f95ee09e99ea 100644 --- a/bundler/spec/install/gemfile/gemspec_spec.rb +++ b/bundler/spec/install/gemfile/gemspec_spec.rb @@ -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 diff --git a/bundler/spec/install/gemfile/specific_platform_spec.rb b/bundler/spec/install/gemfile/specific_platform_spec.rb index 5f1b034bfc0d..410d1921103b 100644 --- a/bundler/spec/install/gemfile/specific_platform_spec.rb +++ b/bundler/spec/install/gemfile/specific_platform_spec.rb @@ -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 @@ -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)") @@ -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 diff --git a/bundler/spec/install/gems/native_extensions_spec.rb b/bundler/spec/install/gems/native_extensions_spec.rb index 907778a38486..cce8adc8bf0b 100644 --- a/bundler/spec/install/gems/native_extensions_spec.rb +++ b/bundler/spec/install/gems/native_extensions_spec.rb @@ -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") diff --git a/bundler/spec/install/redownload_spec.rb b/bundler/spec/install/redownload_spec.rb index 3a72c356d939..3efe8d70eae3 100644 --- a/bundler/spec/install/redownload_spec.rb +++ b/bundler/spec/install/redownload_spec.rb @@ -16,7 +16,7 @@ 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 @@ -24,7 +24,7 @@ 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 diff --git a/bundler/spec/plugins/install_spec.rb b/bundler/spec/plugins/install_spec.rb index 20c2f1fd2641..2bca53859fbd 100644 --- a/bundler/spec/plugins/install_spec.rb +++ b/bundler/spec/plugins/install_spec.rb @@ -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 @@ -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 @@ -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") @@ -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 @@ -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") diff --git a/bundler/spec/realworld/gemfile_source_header_spec.rb b/bundler/spec/realworld/gemfile_source_header_spec.rb index 45f5d0fd227d..47579566c5aa 100644 --- a/bundler/spec/realworld/gemfile_source_header_spec.rb +++ b/bundler/spec/realworld/gemfile_source_header_spec.rb @@ -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 diff --git a/bundler/spec/realworld/mirror_probe_spec.rb b/bundler/spec/realworld/mirror_probe_spec.rb index fc97f92375d4..6c26aa5e2d27 100644 --- a/bundler/spec/realworld/mirror_probe_spec.rb +++ b/bundler/spec/realworld/mirror_probe_spec.rb @@ -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 @@ -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 diff --git a/bundler/spec/runtime/inline_spec.rb b/bundler/spec/runtime/inline_spec.rb index 50a5258dc748..16325737dbbc 100644 --- a/bundler/spec/runtime/inline_spec.rb +++ b/bundler/spec/runtime/inline_spec.rb @@ -87,7 +87,7 @@ def script(code, options = {}) end RUBY - expect(out).to include("Installing activesupport") + expect(out).to include("Installed activesupport") err_lines = err.split("\n") err_lines.reject! {|line| line =~ /\.rb:\d+: warning: / } expect(err_lines).to be_empty @@ -270,8 +270,8 @@ def confirm(msg, newline = nil) end RUBY - expect(out).to include("Installing activesupport") - expect(out).not_to include("Installing rack") + expect(out).to include("Installed activesupport") + expect(out).not_to include("Installed rack") expect(err).to be_empty end @@ -293,8 +293,8 @@ def confirm(msg, newline = nil) end RUBY - expect(out).to include("Installing activesupport") - expect(out).not_to include("Installing rack") + expect(out).to include("Installed activesupport") + expect(out).not_to include("Installed rack") expect(err).to be_empty end @@ -316,8 +316,8 @@ def confirm(msg, newline = nil) end RUBY - expect(out).to include("Installing activesupport") - expect(out).not_to include("Installing rack") + expect(out).to include("Installed activesupport") + expect(out).not_to include("Installed rack") expect(err).to be_empty end @@ -425,7 +425,7 @@ def confirm(msg, newline = nil) end RUBY - expect(out).to include("Installing rake #{rake_version}") + expect(out).to include("Installed rake #{rake_version}") expect(out).not_to include("was 11.3.0") expect(err).to be_empty end @@ -636,7 +636,7 @@ def confirm(msg, newline = nil) end RUBY - expect(out).to include("Installing timeout 999") + expect(out).to include("Installed timeout 999") end it "does not upcase ENV" do diff --git a/bundler/spec/runtime/setup_spec.rb b/bundler/spec/runtime/setup_spec.rb index 2d78825de46d..31b6dc24cdde 100644 --- a/bundler/spec/runtime/setup_spec.rb +++ b/bundler/spec/runtime/setup_spec.rb @@ -1624,6 +1624,6 @@ def require(path) require 'bundler/setup' RUBY expect(err).to be_empty - expect(out).to include("Installing rack 1.0.0") + expect(out).to include("Installed rack 1.0.0") end end diff --git a/bundler/spec/update/redownload_spec.rb b/bundler/spec/update/redownload_spec.rb index 4a8c711bfa12..00eb6b07abf5 100644 --- a/bundler/spec/update/redownload_spec.rb +++ b/bundler/spec/update/redownload_spec.rb @@ -36,7 +36,7 @@ rack_lib.open("w") {|f| f.write("blah blah blah") } bundle :update, redownload: 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