xcodeproj 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/xcodeproj/gem_version.rb +1 -1
- data/lib/xcodeproj/plist_helper.rb +32 -0
- data/lib/xcodeproj/project.rb +0 -32
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa0f6900b32b2e81187155258bd93efaccab24e7
|
4
|
+
data.tar.gz: 5990152c979ec79206161cd2f8ed0bcc47601bc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4409f563332fb076e1c39d6be7fee7cd87086aa05428ffc85c8405f434067a915f4c4cd6f7be1972f1f0ec7006c4be12e328c4d69c332f1fb924facd5f52815f
|
7
|
+
data.tar.gz: d0b4413f8ad34fe2dbad39caf4870a8409f22fec4a6cbcaf5a489785b4bfc2531beb4a4292c029376303720567cef7b9a73f3ac09f14ca9e730597b9e92cb00d
|
@@ -41,6 +41,7 @@ module Xcodeproj
|
|
41
41
|
ruby_hash_write_xcode(hash, path)
|
42
42
|
else
|
43
43
|
CoreFoundation.RubyHashPropertyListWrite(hash, path)
|
44
|
+
fix_encoding(path)
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
@@ -63,6 +64,37 @@ module Xcodeproj
|
|
63
64
|
|
64
65
|
private
|
65
66
|
|
67
|
+
# Simple workaround to escape characters which are outside of ASCII
|
68
|
+
# character-encoding. Relies on the fact that there are no XML characters
|
69
|
+
# which would need to be escaped.
|
70
|
+
#
|
71
|
+
# @note This is necessary because Xcode (4.6 currently) uses the MacRoman
|
72
|
+
# encoding unless the `// !$*UTF8*$!` magic comment is present. It
|
73
|
+
# is not possible to serialize a plist using the NeXTSTEP format
|
74
|
+
# without access to the private classes of Xcode and that comment
|
75
|
+
# is not compatible with the XML format. For the complete
|
76
|
+
# discussion see CocoaPods/CocoaPods#926.
|
77
|
+
#
|
78
|
+
#
|
79
|
+
# @note Sadly this hack is not sufficient for supporting Emoji.
|
80
|
+
#
|
81
|
+
# @param [String, Pathname] The path of the file which needs to be fixed.
|
82
|
+
#
|
83
|
+
# @return [void]
|
84
|
+
#
|
85
|
+
def fix_encoding(filename)
|
86
|
+
output = ''
|
87
|
+
input = File.open(filename, 'rb') { |file| file.read }
|
88
|
+
input.unpack('U*').each do |codepoint|
|
89
|
+
if codepoint > 127 # ASCII is 7-bit, so 0-127 are valid characters
|
90
|
+
output << "&##{codepoint};"
|
91
|
+
else
|
92
|
+
output << codepoint.chr
|
93
|
+
end
|
94
|
+
end
|
95
|
+
File.open(filename, 'wb') { |file| file.write(output) }
|
96
|
+
end
|
97
|
+
|
66
98
|
# @return [Bool] Checks whether there are merge conflicts in the file.
|
67
99
|
#
|
68
100
|
# @param [#to_s] path
|
data/lib/xcodeproj/project.rb
CHANGED
@@ -317,38 +317,6 @@ module Xcodeproj
|
|
317
317
|
FileUtils.mkdir_p(save_path)
|
318
318
|
file = File.join(save_path, 'project.pbxproj')
|
319
319
|
Xcodeproj.write_plist(to_hash, file)
|
320
|
-
fix_encoding(file)
|
321
|
-
end
|
322
|
-
|
323
|
-
# Simple workaround to escape characters which are outside of ASCII
|
324
|
-
# character-encoding. Relies on the fact that there are no XML characters
|
325
|
-
# which would need to be escaped.
|
326
|
-
#
|
327
|
-
# @note This is necessary because Xcode (4.6 currently) uses the MacRoman
|
328
|
-
# encoding unless the `// !$*UTF8*$!` magic comment is present. It
|
329
|
-
# is not possible to serialize a plist using the NeXTSTEP format
|
330
|
-
# without access to the private classes of Xcode and that comment
|
331
|
-
# is not compatible with the XML format. For the complete
|
332
|
-
# discussion see CocoaPods/CocoaPods#926.
|
333
|
-
#
|
334
|
-
#
|
335
|
-
# @note Sadly this hack is not sufficient for supporting Emoji.
|
336
|
-
#
|
337
|
-
# @param [String, Pathname] The path of the file which needs to be fixed.
|
338
|
-
#
|
339
|
-
# @return [void]
|
340
|
-
#
|
341
|
-
def fix_encoding(filename)
|
342
|
-
output = ''
|
343
|
-
input = File.open(filename, 'rb') { |file| file.read }
|
344
|
-
input.unpack('U*').each do |codepoint|
|
345
|
-
if codepoint > 127
|
346
|
-
output << "&##{codepoint};"
|
347
|
-
else
|
348
|
-
output << codepoint.chr
|
349
|
-
end
|
350
|
-
end
|
351
|
-
File.open(filename, 'wb') { |file| file.write(output) }
|
352
320
|
end
|
353
321
|
|
354
322
|
public
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcodeproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|