From 29aea4206a0b225a9a7448ede7d9ce166e2b71a9 Mon Sep 17 00:00:00 2001 From: Eric Clemmons Date: Tue, 7 Aug 2012 23:08:20 -0500 Subject: [PATCH] Fix currentVersion regex always returning nil The pattern `[^$]+`failed to match any of the string past "Current Version:", while `.+` matches only the characters preceding the version number. --- lib/symfony2/doctrine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symfony2/doctrine.rb b/lib/symfony2/doctrine.rb index 9618bc5..91b3337 100644 --- a/lib/symfony2/doctrine.rb +++ b/lib/symfony2/doctrine.rb @@ -60,7 +60,7 @@ task :migrate, :roles => :app, :except => { :no_release => true } do currentVersion = nil run "cd #{latest_release} && #{php_bin} #{symfony_console} --no-ansi doctrine:migrations:status --env=#{symfony_env_prod}", :once => true do |ch, stream, out| - if stream == :out and out =~ /Current Version:[^$]+\(([\w]+)\)/ + if stream == :out and out =~ /Current Version:.+\(([\w]+)\)/ currentVersion = Regexp.last_match(1) end if stream == :out and out =~ /Current Version:\s*0\s*$/