-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle BUNDLED WITH deletion in windows (#1108)
Windows Gemfile.lock uses `\r\n` instead of `\n` for newlines which can cause issues when matching regex. We are using regex to strip out BUNDLED WITH and were not previously handling windows Gemfile.lock by mistake. There is other code that reads in the major version of BUNDLED WITH and it uses a read mode of `rt` which solves the problem. The solution is to change this other location to also use a read mode of `rt`: ``` irb(main):009:0> !!File.read("./spec/fixtures/windows_lockfile/Gemfile.lock").match(/^BUNDLED WITH$(\r?\n) (?<major>\d+)\.\d+\.\d+/m) => false irb(main):010:0> !!File.read("./spec/fixtures/windows_lockfile/Gemfile.lock", mode: 'rt').match(/^BUNDLED WITH$(\r?\n) (?<major>\d+)\.\d+ \.\d+/m) => true ``` The test now also assert the desired behavior of removing BUNDLED WITH occurs.
- Loading branch information
Showing
4 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters