Commit e269b2c5 authored by Taras Kalapun's avatar Taras Kalapun

Adding error handling for incorrect Podfile syntax

parent 11edebab
...@@ -177,7 +177,11 @@ module Pod ...@@ -177,7 +177,11 @@ module Pod
string = File.open(path, 'r:utf-8') { |f| f.read } string = File.open(path, 'r:utf-8') { |f| f.read }
# TODO: work around for Rubinius incomplete encoding in 1.9 mode # TODO: work around for Rubinius incomplete encoding in 1.9 mode
string.encode!('UTF-8') if string.respond_to?(:encoding) && string.encoding.name != "UTF-8" string.encode!('UTF-8') if string.respond_to?(:encoding) && string.encoding.name != "UTF-8"
begin
eval(string, nil, path.to_s) eval(string, nil, path.to_s)
rescue Exception => e
raise Informative, "Podfile syntax error: #{e.inspect}"
end
end end
podfile.defined_in_file = path podfile.defined_in_file = path
podfile.validate! podfile.validate!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment