gwtools 0.0.13 → 0.0.14
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/gwtools/generate/swift.rb +5 -6
- data/lib/gwtools/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 578a4b3c9661d4f9abcb537ff04fa85f9fe4539511f6146a86e51395bf0d4594
|
4
|
+
data.tar.gz: 84186267dcd12996e6383d0042fbc73d442a9d9e38e444b01b564ddd2453b331
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffec173635df34cfdb8f2546c49382ddabb461d07ae322bac0aad46855f414462d6bbc3bdbd8fb1574dcb5cd1639745cab3446f522c8f9d6cb918f29a23deab9
|
7
|
+
data.tar.gz: 6ad68012b9573bed42efc66b5a8dea87db70b16af339331dc56cc3d5900f6c7a3f375513995791eb1bdd114fcf045fedaaf86bd2061ad7c791ae39c4567a913d
|
@@ -153,13 +153,12 @@ public extension <%="#{@api_name}"%> {
|
|
153
153
|
target_swift_file = "#{target_path + "/#{pre_name}"}/#{url.split('/').first}.swift"
|
154
154
|
FileUtils.mkdir_p(target_path + "/#{pre_name}") unless File.directory?(target_path + "/#{pre_name}")
|
155
155
|
|
156
|
-
File.open(target_swift_file, "w") do |file|
|
157
|
-
file.write("{}")
|
158
|
-
end
|
159
156
|
# 从 .swift 文件读取 enum
|
160
|
-
|
161
|
-
|
162
|
-
|
157
|
+
json1Hash = {}
|
158
|
+
if File.exist?(target_swift_file)
|
159
|
+
Parser.extract_from(target_swift_file)
|
160
|
+
json1Hash = JSON.parse(Parser.get_clear_enums.to_json)
|
161
|
+
end
|
163
162
|
# 从 url 解析 enum
|
164
163
|
url_enum = Parser.enum_from_url(url)
|
165
164
|
json2Hash = {url_enum.enum_name.to_sym => url_enum}
|
data/lib/gwtools/version.rb
CHANGED