Skip to content

Commit

Permalink
Merge pull request #6924 from rubygems/segiddins/bundle-update-redown…
Browse files Browse the repository at this point in the history
…load

Fix bundle update --redownload
  • Loading branch information
segiddins committed Aug 29, 2023
2 parents e777ffc + 3b058e5 commit c44fe8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions bundler/lib/bundler/cli/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def run
opts = options.dup
opts["update"] = true
opts["local"] = options[:local]
opts["force"] = options[:redownload]

Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]

Expand Down
10 changes: 10 additions & 0 deletions bundler/spec/update/redownload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,15 @@
bundle "update rack --no-color --redownload"
expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end

it "re-installs installed gems" do
rack_lib = default_bundle_path("gems/rack-1.0.0/lib/rack.rb")
rack_lib.open("w") {|f| f.write("blah blah blah") }
bundle :update, :redownload => true

expect(out).to include "Installing 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
end
end

0 comments on commit c44fe8e

Please sign in to comment.