rbinstall.rb: syntax error in gemspec
* tool/rbinstall.rb (load_gemspec): do not hide syntax errors in a gemspec file. check if the result instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3ea72d2589
commit
4df4b48455
@ -743,13 +743,10 @@ def load_gemspec(file)
|
|||||||
file = File.realpath(file)
|
file = File.realpath(file)
|
||||||
code = File.read(file, encoding: "utf-8:-")
|
code = File.read(file, encoding: "utf-8:-")
|
||||||
code.gsub!(/`git.*?`/m, '""')
|
code.gsub!(/`git.*?`/m, '""')
|
||||||
begin
|
spec = eval(code, binding, file)
|
||||||
spec = eval(code, binding, file)
|
unless Gem::Specification === spec
|
||||||
rescue SignalException, SystemExit
|
raise TypeError, "[#{file}] isn't a Gem::Specification (#{spec.class} instead)."
|
||||||
raise
|
|
||||||
rescue SyntaxError, Exception
|
|
||||||
end
|
end
|
||||||
raise("invalid spec in #{file}") unless spec
|
|
||||||
spec.loaded_from = file
|
spec.loaded_from = file
|
||||||
spec
|
spec
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user