diff --git a/bundler/lib/bundler/cli.rb b/bundler/lib/bundler/cli.rb index d93feb7b55ce..1fd55814604d 100644 --- a/bundler/lib/bundler/cli.rb +++ b/bundler/lib/bundler/cli.rb @@ -657,6 +657,7 @@ def issue gem cache. Gems installed from a git repository will be issued `git checkout --force`. D + method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile" def pristine(*gems) require_relative "cli/pristine" Bundler.settings.temporary(no_install: false) do diff --git a/bundler/lib/bundler/man/bundle-add.1 b/bundler/lib/bundler/man/bundle-add.1 index 210911dcf446..7e209df4ff3a 100644 --- a/bundler/lib/bundler/man/bundle-add.1 +++ b/bundler/lib/bundler/man/bundle-add.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-ADD" "1" "December 2023" "" +.TH "BUNDLE\-ADD" "1" "January 2024" "" .SH "NAME" \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-binstubs.1 b/bundler/lib/bundler/man/bundle-binstubs.1 index b71347d6e1d9..9c6d8496f19e 100644 --- a/bundler/lib/bundler/man/bundle-binstubs.1 +++ b/bundler/lib/bundler/man/bundle-binstubs.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-BINSTUBS" "1" "December 2023" "" +.TH "BUNDLE\-BINSTUBS" "1" "January 2024" "" .SH "NAME" \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-cache.1 b/bundler/lib/bundler/man/bundle-cache.1 index 5f03c38abe8d..1c67bfc7a984 100644 --- a/bundler/lib/bundler/man/bundle-cache.1 +++ b/bundler/lib/bundler/man/bundle-cache.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-CACHE" "1" "December 2023" "" +.TH "BUNDLE\-CACHE" "1" "January 2024" "" .SH "NAME" \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-check.1 b/bundler/lib/bundler/man/bundle-check.1 index bc24dfe2b279..5889c945d1e1 100644 --- a/bundler/lib/bundler/man/bundle-check.1 +++ b/bundler/lib/bundler/man/bundle-check.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-CHECK" "1" "December 2023" "" +.TH "BUNDLE\-CHECK" "1" "January 2024" "" .SH "NAME" \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-clean.1 b/bundler/lib/bundler/man/bundle-clean.1 index 00787da5f100..0d7d18802137 100644 --- a/bundler/lib/bundler/man/bundle-clean.1 +++ b/bundler/lib/bundler/man/bundle-clean.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-CLEAN" "1" "December 2023" "" +.TH "BUNDLE\-CLEAN" "1" "January 2024" "" .SH "NAME" \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-config.1 b/bundler/lib/bundler/man/bundle-config.1 index 8090e03f7df1..83d813183bdd 100644 --- a/bundler/lib/bundler/man/bundle-config.1 +++ b/bundler/lib/bundler/man/bundle-config.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-CONFIG" "1" "December 2023" "" +.TH "BUNDLE\-CONFIG" "1" "January 2024" "" .SH "NAME" \fBbundle\-config\fR \- Set bundler configuration options .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-console.1 b/bundler/lib/bundler/man/bundle-console.1 index 14e5f55647fe..a37171c6dffc 100644 --- a/bundler/lib/bundler/man/bundle-console.1 +++ b/bundler/lib/bundler/man/bundle-console.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-CONSOLE" "1" "December 2023" "" +.TH "BUNDLE\-CONSOLE" "1" "January 2024" "" .SH "NAME" \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-doctor.1 b/bundler/lib/bundler/man/bundle-doctor.1 index aea8bacdad93..bb6fbc2b4f52 100644 --- a/bundler/lib/bundler/man/bundle-doctor.1 +++ b/bundler/lib/bundler/man/bundle-doctor.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-DOCTOR" "1" "December 2023" "" +.TH "BUNDLE\-DOCTOR" "1" "January 2024" "" .SH "NAME" \fBbundle\-doctor\fR \- Checks the bundle for common problems .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-exec.1 b/bundler/lib/bundler/man/bundle-exec.1 index af622f4423e7..73a54055b6df 100644 --- a/bundler/lib/bundler/man/bundle-exec.1 +++ b/bundler/lib/bundler/man/bundle-exec.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-EXEC" "1" "December 2023" "" +.TH "BUNDLE\-EXEC" "1" "January 2024" "" .SH "NAME" \fBbundle\-exec\fR \- Execute a command in the context of the bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-gem.1 b/bundler/lib/bundler/man/bundle-gem.1 index bc62a883ea2a..89a0f1cc9131 100644 --- a/bundler/lib/bundler/man/bundle-gem.1 +++ b/bundler/lib/bundler/man/bundle-gem.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-GEM" "1" "December 2023" "" +.TH "BUNDLE\-GEM" "1" "January 2024" "" .SH "NAME" \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-help.1 b/bundler/lib/bundler/man/bundle-help.1 index 3e6d7a851ea2..1e937f595a4b 100644 --- a/bundler/lib/bundler/man/bundle-help.1 +++ b/bundler/lib/bundler/man/bundle-help.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-HELP" "1" "December 2023" "" +.TH "BUNDLE\-HELP" "1" "January 2024" "" .SH "NAME" \fBbundle\-help\fR \- Displays detailed help for each subcommand .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-info.1 b/bundler/lib/bundler/man/bundle-info.1 index 43cc7d23b64f..683bd4da64eb 100644 --- a/bundler/lib/bundler/man/bundle-info.1 +++ b/bundler/lib/bundler/man/bundle-info.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-INFO" "1" "December 2023" "" +.TH "BUNDLE\-INFO" "1" "January 2024" "" .SH "NAME" \fBbundle\-info\fR \- Show information for the given gem in your bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-init.1 b/bundler/lib/bundler/man/bundle-init.1 index 9c6f89a6b2ae..99199308cd9f 100644 --- a/bundler/lib/bundler/man/bundle-init.1 +++ b/bundler/lib/bundler/man/bundle-init.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-INIT" "1" "December 2023" "" +.TH "BUNDLE\-INIT" "1" "January 2024" "" .SH "NAME" \fBbundle\-init\fR \- Generates a Gemfile into the current working directory .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-inject.1 b/bundler/lib/bundler/man/bundle-inject.1 index f8c4d4342e0b..0598fa68eb01 100644 --- a/bundler/lib/bundler/man/bundle-inject.1 +++ b/bundler/lib/bundler/man/bundle-inject.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-INJECT" "1" "December 2023" "" +.TH "BUNDLE\-INJECT" "1" "January 2024" "" .SH "NAME" \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-install.1 b/bundler/lib/bundler/man/bundle-install.1 index a23763889b50..af46f4312a08 100644 --- a/bundler/lib/bundler/man/bundle-install.1 +++ b/bundler/lib/bundler/man/bundle-install.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-INSTALL" "1" "December 2023" "" +.TH "BUNDLE\-INSTALL" "1" "January 2024" "" .SH "NAME" \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-list.1 b/bundler/lib/bundler/man/bundle-list.1 index 943f17ab839d..68c4d513a009 100644 --- a/bundler/lib/bundler/man/bundle-list.1 +++ b/bundler/lib/bundler/man/bundle-list.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-LIST" "1" "December 2023" "" +.TH "BUNDLE\-LIST" "1" "January 2024" "" .SH "NAME" \fBbundle\-list\fR \- List all the gems in the bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-lock.1 b/bundler/lib/bundler/man/bundle-lock.1 index 041c2d739ed2..f2102f5ed0e5 100644 --- a/bundler/lib/bundler/man/bundle-lock.1 +++ b/bundler/lib/bundler/man/bundle-lock.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-LOCK" "1" "December 2023" "" +.TH "BUNDLE\-LOCK" "1" "January 2024" "" .SH "NAME" \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-open.1 b/bundler/lib/bundler/man/bundle-open.1 index a349288987ce..04a963d32343 100644 --- a/bundler/lib/bundler/man/bundle-open.1 +++ b/bundler/lib/bundler/man/bundle-open.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-OPEN" "1" "December 2023" "" +.TH "BUNDLE\-OPEN" "1" "January 2024" "" .SH "NAME" \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-outdated.1 b/bundler/lib/bundler/man/bundle-outdated.1 index a501fec83ebd..93b0e99c7bda 100644 --- a/bundler/lib/bundler/man/bundle-outdated.1 +++ b/bundler/lib/bundler/man/bundle-outdated.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-OUTDATED" "1" "December 2023" "" +.TH "BUNDLE\-OUTDATED" "1" "January 2024" "" .SH "NAME" \fBbundle\-outdated\fR \- List installed gems with newer versions available .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-platform.1 b/bundler/lib/bundler/man/bundle-platform.1 index 2ff1938585d0..1c136ea50d3a 100644 --- a/bundler/lib/bundler/man/bundle-platform.1 +++ b/bundler/lib/bundler/man/bundle-platform.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-PLATFORM" "1" "December 2023" "" +.TH "BUNDLE\-PLATFORM" "1" "January 2024" "" .SH "NAME" \fBbundle\-platform\fR \- Displays platform compatibility information .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-plugin.1 b/bundler/lib/bundler/man/bundle-plugin.1 index 09e0d816acef..5e6f058fa43d 100644 --- a/bundler/lib/bundler/man/bundle-plugin.1 +++ b/bundler/lib/bundler/man/bundle-plugin.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-PLUGIN" "1" "December 2023" "" +.TH "BUNDLE\-PLUGIN" "1" "January 2024" "" .SH "NAME" \fBbundle\-plugin\fR \- Manage Bundler plugins .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-pristine.1 b/bundler/lib/bundler/man/bundle-pristine.1 index 60609f4ee802..5c8a6a53481e 100644 --- a/bundler/lib/bundler/man/bundle-pristine.1 +++ b/bundler/lib/bundler/man/bundle-pristine.1 @@ -1,10 +1,10 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-PRISTINE" "1" "December 2023" "" +.TH "BUNDLE\-PRISTINE" "1" "January 2024" "" .SH "NAME" \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition .SH "SYNOPSIS" -\fBbundle pristine\fR +\fBbundle pristine\fR [\-\-gemfile=GEMFILE] .SH "DESCRIPTION" \fBpristine\fR restores the installed gems in the bundle to their pristine condition using the local gem cache from RubyGems\. For git gems, a forced checkout will be performed\. .P @@ -21,3 +21,8 @@ Why use \fBbundle pristine\fR over \fBgem pristine \-\-all\fR? Both commands are very similar\. For context: \fBbundle pristine\fR, without arguments, cleans all gems from the lockfile\. Meanwhile, \fBgem pristine \-\-all\fR cleans all installed gems for that Ruby version\. .P If a developer forgets which gems in their project they might have been debugging, the Rubygems \fBgem pristine [GEMNAME]\fR command may be inconvenient\. One can avoid waiting for \fBgem pristine \-\-all\fR, and instead run \fBbundle pristine\fR\. +.SH "OPTIONS" +.TP +\fB\-\-gemfile=\fR +The location of the Gemfile(5) which Bundler should use\. This defaults to a Gemfile(5) in the current working directory\. In general, Bundler will assume that the location of the Gemfile(5) is also the project's root and will try to find \fBGemfile\.lock\fR and \fBvendor/cache\fR relative to this location\. + diff --git a/bundler/lib/bundler/man/bundle-pristine.1.ronn b/bundler/lib/bundler/man/bundle-pristine.1.ronn index e2d6b6a348f0..f09c8fc4a6f3 100644 --- a/bundler/lib/bundler/man/bundle-pristine.1.ronn +++ b/bundler/lib/bundler/man/bundle-pristine.1.ronn @@ -3,7 +3,7 @@ bundle-pristine(1) -- Restores installed gems to their pristine condition ## SYNOPSIS -`bundle pristine` +`bundle pristine` [--gemfile=GEMFILE] ## DESCRIPTION @@ -32,3 +32,12 @@ Meanwhile, `gem pristine --all` cleans all installed gems for that Ruby version. If a developer forgets which gems in their project they might have been debugging, the Rubygems `gem pristine [GEMNAME]` command may be inconvenient. One can avoid waiting for `gem pristine --all`, and instead run `bundle pristine`. + +## OPTIONS + +* `--gemfile=`: + The location of the Gemfile(5) which Bundler should use. This defaults + to a Gemfile(5) in the current working directory. In general, Bundler + will assume that the location of the Gemfile(5) is also the project's + root and will try to find `Gemfile.lock` and `vendor/cache` relative + to this location. \ No newline at end of file diff --git a/bundler/lib/bundler/man/bundle-remove.1 b/bundler/lib/bundler/man/bundle-remove.1 index 31eae269c88e..5a0cd8ca1dac 100644 --- a/bundler/lib/bundler/man/bundle-remove.1 +++ b/bundler/lib/bundler/man/bundle-remove.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-REMOVE" "1" "December 2023" "" +.TH "BUNDLE\-REMOVE" "1" "January 2024" "" .SH "NAME" \fBbundle\-remove\fR \- Removes gems from the Gemfile .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-show.1 b/bundler/lib/bundler/man/bundle-show.1 index 761629c62579..dec369747c41 100644 --- a/bundler/lib/bundler/man/bundle-show.1 +++ b/bundler/lib/bundler/man/bundle-show.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-SHOW" "1" "December 2023" "" +.TH "BUNDLE\-SHOW" "1" "January 2024" "" .SH "NAME" \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-update.1 b/bundler/lib/bundler/man/bundle-update.1 index 838261df0d92..811b647f7a2e 100644 --- a/bundler/lib/bundler/man/bundle-update.1 +++ b/bundler/lib/bundler/man/bundle-update.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-UPDATE" "1" "December 2023" "" +.TH "BUNDLE\-UPDATE" "1" "January 2024" "" .SH "NAME" \fBbundle\-update\fR \- Update your gems to the latest available versions .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-version.1 b/bundler/lib/bundler/man/bundle-version.1 index d9b0e7c3b183..7236e55cc78d 100644 --- a/bundler/lib/bundler/man/bundle-version.1 +++ b/bundler/lib/bundler/man/bundle-version.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-VERSION" "1" "December 2023" "" +.TH "BUNDLE\-VERSION" "1" "January 2024" "" .SH "NAME" \fBbundle\-version\fR \- Prints Bundler version information .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle-viz.1 b/bundler/lib/bundler/man/bundle-viz.1 index 0e7981ac9ad9..95092050167e 100644 --- a/bundler/lib/bundler/man/bundle-viz.1 +++ b/bundler/lib/bundler/man/bundle-viz.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE\-VIZ" "1" "December 2023" "" +.TH "BUNDLE\-VIZ" "1" "January 2024" "" .SH "NAME" \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/bundle.1 b/bundler/lib/bundler/man/bundle.1 index 2417348be453..7dfeb2b5ee90 100644 --- a/bundler/lib/bundler/man/bundle.1 +++ b/bundler/lib/bundler/man/bundle.1 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "BUNDLE" "1" "December 2023" "" +.TH "BUNDLE" "1" "January 2024" "" .SH "NAME" \fBbundle\fR \- Ruby Dependency Management .SH "SYNOPSIS" diff --git a/bundler/lib/bundler/man/gemfile.5 b/bundler/lib/bundler/man/gemfile.5 index 9f73687c8cca..aeb6f3ab2a79 100644 --- a/bundler/lib/bundler/man/gemfile.5 +++ b/bundler/lib/bundler/man/gemfile.5 @@ -1,6 +1,6 @@ .\" generated with nRonn/v0.11.1 .\" https://github.com/n-ronn/nronn/tree/0.11.1 -.TH "GEMFILE" "5" "December 2023" "" +.TH "GEMFILE" "5" "January 2024" "" .SH "NAME" \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs .SH "SYNOPSIS" diff --git a/bundler/spec/commands/pristine_spec.rb b/bundler/spec/commands/pristine_spec.rb index 1aec37f8501b..8ff3141232a3 100644 --- a/bundler/spec/commands/pristine_spec.rb +++ b/bundler/spec/commands/pristine_spec.rb @@ -203,13 +203,37 @@ end end - context "when BUNDLE_GEMFILE doesn't exist" do - before do + context "when referencing a different gemfile" do + it "shows a meaningful error when BUNDLE_GEMFILE doesn't exist" do bundle "pristine", env: { "BUNDLE_GEMFILE" => "does/not/exist" }, raise_on_error: false + expect(err).to eq("#{bundled_app("does/not/exist")} not found") end - it "shows a meaningful error" do - expect(err).to eq("#{bundled_app("does/not/exist")} not found") + it "works with --gemfile flag" do + create_file "CustomGemfile", <<-G + source "#{file_uri_for(gem_repo2)}" + gem "foo", :git => "#{lib_path("foo")}", :branch => "main" + G + + bundle "install --gemfile CustomGemfile" + + # change weakling so we can confirm it used the right gemfile. + weakling_spec = find_spec("weakling") + weakling_changes_txt = Pathname.new(weakling_spec.full_gem_path).join("lib/changes.txt") + FileUtils.touch(weakling_changes_txt) + expect(weakling_changes_txt).to be_file + + # only foo will be fixed as long as --gemfile is respected. + foo_spec = find_spec("foo") + foo_changed_file = Pathname.new(foo_spec.full_gem_path).join("lib/foo.rb") + diff = "#Pristine spec changes" + File.open(foo_changed_file, "a") {|f| f.puts diff } + expect(File.read(foo_changed_file)).to include(diff) + + bundle "pristine --gemfile CustomGemfile" + + expect(weakling_changes_txt).to be_file # didn't fix weakling + expect(File.read(foo_changed_file)).to_not include(diff) # did fix foo end end