Permalink
Browse files

[rbx] Attempt to fix encoding issues.

  • Loading branch information...
1 parent a340ea2 commit 425a5c162196f4fc93bbf6a58cc61f469b119fcc @fabiopelosin fabiopelosin committed Jun 8, 2012
Showing with 9 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +4 −1 lib/cocoapods/podfile.rb
  3. +4 −1 lib/cocoapods/specification.rb
View
@@ -20,3 +20,4 @@ spec/fixtures/mercurial-repo/.hg/*cache
spec/fixtures/vcr
.yardoc
/doc
+.rbx/
View
@@ -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!
@@ -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

0 comments on commit 425a5c1

Please sign in to comment.