Permalink
Browse files

Adding error handling for incorrect Podfile syntax

  • Loading branch information...
1 parent 11edeba commit e269b2c55ca55409442ac2f8d3198512aa559119 @xslim xslim committed Oct 4, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/cocoapods/podfile.rb
View
@@ -177,7 +177,11 @@ def self.from_file(path)
string = File.open(path, 'r:utf-8') { |f| f.read }
# 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"
- eval(string, nil, path.to_s)
+ begin
+ eval(string, nil, path.to_s)
+ rescue Exception => e
+ raise Informative, "Podfile syntax error: #{e.inspect}"
+ end
end
podfile.defined_in_file = path
podfile.validate!

0 comments on commit e269b2c

Please sign in to comment.