Permalink
Browse files

Allow double quotes around RAILS_GEM_VERSION also. Closes #10443 [Jam…

…es Cox]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8358 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 33e9876 commit 9ccbb1356327f658b3012cf2967e6b03ae0ac1ee @jeremy jeremy committed Dec 10, 2007
Showing with 6 additions and 1 deletion.
  1. +1 −1 railties/environments/boot.rb
  2. +5 −0 railties/test/boot_test.rb
@@ -93,7 +93,7 @@ def load_rubygems
end
def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*'([!~<>=]*\s*[\d.]+)'/
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
end
private
@@ -128,6 +128,11 @@ def test_should_return_nil_if_no_lines_are_passed
assert_equal nil, parse(nil)
end
+ def test_should_accept_either_single_or_double_quotes
+ assert_equal "1.2.3", parse("RAILS_GEM_VERSION = '1.2.3'")
+ assert_equal "1.2.3", parse('RAILS_GEM_VERSION = "1.2.3"')
+ end
+
def test_should_return_nil_if_no_lines_match
assert_equal nil, parse('nothing matches on this line\nor on this line')
end

0 comments on commit 9ccbb13

Please sign in to comment.