mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Let fake.rb allow newlines in expanded strings
This commit is contained in:
parent
576bdec03f
commit
2b967cd4b7
1 changed files with 3 additions and 1 deletions
|
@ -10,7 +10,9 @@ end
|
|||
if inc = arg['i']
|
||||
src = inc == '-' ? STDIN.read : File.read(inc)
|
||||
def src.value(name)
|
||||
eval(self[/\bruby_#{name}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#'))
|
||||
eval(self[/\bruby_#{name}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].
|
||||
gsub(/#/, '\\#').
|
||||
gsub(/((?:\G|[^\\])(?:\\\\)*)\n/, '\1'))
|
||||
end
|
||||
arg['versions'] = version = {}
|
||||
File.read(File.join(arg['srcdir'], 'version.c')).
|
||||
|
|
Loading…
Add table
Reference in a new issue