Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[rbx] Attempt to fix encoding issues.

  • Loading branch information...
commit 425a5c162196f4fc93bbf6a58cc61f469b119fcc 1 parent a340ea2
@fabiopelosin fabiopelosin authored
View
1  .gitignore
@@ -20,3 +20,4 @@ spec/fixtures/mercurial-repo/.hg/*cache
spec/fixtures/vcr
.yardoc
/doc
+.rbx/
View
5 lib/cocoapods/podfile.rb
@@ -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!
View
5 lib/cocoapods/specification.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.