Skip to content

Commit

Permalink
Match spaces after 'ruby'
Browse files Browse the repository at this point in the history
  • Loading branch information
aripollak committed Jun 30, 2017
1 parent 8a33d27 commit efa2319
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/rbenv-bundler-ruby-version
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ version_from_gemfile() {
-e 's/engine:/:engine =>/' -e 's/engine_version:/:engine_version =>/' \
-e "s/.*:engine *=> *['\"]\([^'\"]*\).*:engine_version *=> *['\"]\([^'\"]*\).*/\1-\2/" \
-e "s/.*:engine_version *=> *['\"]\([^'\"]*\).*:engine *=> *['\"]\([^'\"]*\).*/\2-\1/" \
-e "s/ *ruby ['\"]\([^'\"]*\).*/\1/" |
-e "s/ *ruby *['\"]\([^'\"]*\).*/\1/" |
head -1
}

Expand Down
2 changes: 1 addition & 1 deletion test/bundler-ruby-version.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ load test_helper
@test 'Recognize simple ruby version in single quotes with leading spaces' {
mkdir -p "$EXAMPLE_APP_DIR"
cd "$EXAMPLE_APP_DIR"
echo " ruby '1.2.3'" > "$EXAMPLE_APP_DIR/Gemfile"
echo " ruby '1.2.3'" > "$EXAMPLE_APP_DIR/Gemfile"
run rbenv bundler-ruby-version
assert_success '1.2.3'
}
Expand Down

0 comments on commit efa2319

Please sign in to comment.