aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/fetcher/base.rb
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-07-26 15:03:19 +0900
committerHomu <homu@barosl.com>2016-07-26 15:03:19 +0900
commit2b649723dc7730b79df7dee3837afcff949f3d3a (patch)
tree818bfd4e72297d028483c4455600ec27829f4bca /lib/bundler/fetcher/base.rb
parent32fa2f7d49caf4417c76c33a9295a0d5ddb54ca2 (diff)
parent06ab91386db8d493d512bd32b8fad9ca2b4c4b0f (diff)
downloadbundler-2b649723dc7730b79df7dee3837afcff949f3d3a.tar.gz
Auto merge of #4810 - NickLaMuro:fix_git_version_for_apple_git, r=segiddins
Removes OSX/msysgit strings from Bundler::Source::Git::GitProxy#version Overview -------- When running the previous version of `Bundler::Source::Git::GitProxy#version` output through `Gem::Version.create` when the git version is something like $ git --version git version 1.2.3 (Apple Git-22) Ruby blows up with the error: ArgumentError: Malformed version number string 1.2.3 (Apple Git-22) The '(Apple Git-22)' and any additions that are added by `msysgit` (ex: `1.8.3.msysgit.0`) can be safely ignored as they are additions to the git version string for those specific versions, but should still line up with the core git version. This regression was added in https://github.com/bundler/bundler/pull/4717, so this is not in a release of the gem yet, only in `1.13.0.rc1` installation. This prevented: * running tests on OSX or on any OS with a non-core git installation * running `bundle install/update` with any git gem dependencies in the Gemfile on OSX or any OS with a non-core git installation This change simply regexps those version additions out, in addition to removing the `git version`, so only the version number (containing numbers or `.`s) will be parsed by this regexp. Also, another method, `full_version` has been added to allow the `Bundler::Env` to report on the specific version of git being used, which is useful when error reports are submitted. Note about tests ---------------- The tests stub out any shell cmd and mocks a return value, which was easier to test the functionality of the regexp and requiring different git executable versions. I also didn't add integration tests to address the regression caused by #4717, but simply tested that the versions parsed would work when sent through `Gem::Version.create` This does mean I only tested a sample of git version types, so there might be something that I missed. Also, the test for `full_version` working in reports was kinda jank, but it was the best I could do...
Diffstat (limited to 'lib/bundler/fetcher/base.rb')
0 files changed, 0 insertions, 0 deletions