From efa2319b69de7c32c7b3a170d9d1d38c80a61481 Mon Sep 17 00:00:00 2001 From: Ari Pollak Date: Fri, 30 Jun 2017 15:14:19 -0400 Subject: [PATCH] Match spaces after 'ruby' --- bin/rbenv-bundler-ruby-version | 2 +- test/bundler-ruby-version.bats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/rbenv-bundler-ruby-version b/bin/rbenv-bundler-ruby-version index c42906e..8da7e77 100755 --- a/bin/rbenv-bundler-ruby-version +++ b/bin/rbenv-bundler-ruby-version @@ -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 } diff --git a/test/bundler-ruby-version.bats b/test/bundler-ruby-version.bats index b6d1821..ddd8de3 100644 --- a/test/bundler-ruby-version.bats +++ b/test/bundler-ruby-version.bats @@ -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' }