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
14 changes: 6 additions & 8 deletions bundler/lib/bundler/source/rubygems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,9 @@ def install(spec, options = {})
message += " with native extensions" if spec.extensions.any?
Bundler.ui.confirm message

installed_spec = nil

Gem.time("Installed #{spec.name} in", 0, true) do
installed_spec = installer.install
end
start_time = Time.now
installed_spec = installer.install
Bundler.ui.confirm "Installed #{spec.name} in: #{format("%.3f", Time.now - start_time)}s"

spec.full_gem_path = installed_spec.full_gem_path
spec.loaded_from = installed_spec.loaded_from
Expand Down Expand Up @@ -483,9 +481,9 @@ def download_gem(spec, download_cache_path, previous_spec = nil)
Bundler.ui.confirm("Fetching #{version_message(spec, previous_spec)}")
gem_remote_fetcher = remote_fetchers.fetch(spec.remote).gem_remote_fetcher

Gem.time("Downloaded #{spec.name} in", 0, true) do
Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher)
end
start_time = Time.now
Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher)
Bundler.ui.confirm "Downloaded #{spec.name} in: #{format("%.3f", Time.now - start_time)}s"
end

# Returns the global cache path of the calling Rubygems::Source object.
Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/bundler/source/rubygems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
end
end

describe "log debug information" do
describe "log timing information" do
it "log the time spent downloading and installing a gem" do
build_repo2 do
build_gem "warning"
Expand All @@ -56,7 +56,7 @@
gem "warning"
G

stdout = install_gemfile(gemfile_content, env: { "DEBUG" => "1" })
stdout = install_gemfile(gemfile_content)

expect(stdout).to match(/Downloaded warning in: \d+\.\d+s/)
expect(stdout).to match(/Installed warning in: \d+\.\d+s/)
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@
end

bundle "update", all: true
expect(out.sub("Removing foo (1.0)\n", "")).to match(/Resolving dependencies\.\.\.\.*\nFetching foo 2\.0 \(was 1\.0\)\nInstalling foo 2\.0 \(was 1\.0\)\nBundle updated/)
expect(out.sub("Removing foo (1.0)\n", "")).to match(/Resolving dependencies\.\.\.\.*\nFetching foo 2\.0 \(was 1\.0\)\nDownloaded foo in:.*\nInstalling foo 2\.0 \(was 1\.0\)\nInstalled foo in:.*\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/runtime/inline_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def confirm(msg, newline = nil)
end
RUBY

expect(out).to eq("CONFIRMED!\nCONFIRMED!")
expect(out).to eq("CONFIRMED!\nCONFIRMED!\nCONFIRMED!\nCONFIRMED!")
end

it "has an option for quiet installation" do
Expand Down