Skip to content

Commit

Permalink
[rbx] Attempt to fix encoding issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopelosin committed Jun 8, 2012
1 parent a340ea2 commit 425a5c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ spec/fixtures/mercurial-repo/.hg/*cache
spec/fixtures/vcr
.yardoc
/doc
.rbx/
5 changes: 4 additions & 1 deletion lib/cocoapods/podfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ def empty?

def self.from_file(path)
podfile = Podfile.new do
eval(File.open(path, 'r:utf-8') { |f| f.read }, nil, path.to_s)
# TODO: work around for Rubinius incomplete encoding in 1.9 mode
string = File.open(path, 'r') { |f| f.read }
string.encode!('UTF-8') if string.respond_to?(:encode!)
eval(string, nil, path.to_s)
end
podfile.defined_in_file = path
podfile.validate!
Expand Down
5 changes: 4 additions & 1 deletion lib/cocoapods/specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ module Pod
extend Config::Mixin

def self._eval_podspec(path)
eval(File.open(path, 'r:utf-8') { |f| f.read }, nil, path.to_s)
# TODO: work around for Rubinius incomplete encoding in 1.9 mode
string = File.open(path, 'r') { |f| f.read }
string.encode!('UTF-8') if string.respond_to?(:encode!)
eval(string, nil, path.to_s)
end

class Specification
Expand Down

0 comments on commit 425a5c1

Please sign in to comment.