PodfileTool 0.0.1 → 0.0.2
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/PodfileTool.rb +24 -2
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abf4a59b3266444e330d502c8fabb90015ecc53d
|
4
|
+
data.tar.gz: 25831d7f8c6ab6167c5b350e67042b39c17f14e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f3036f2d92398945a1f304b6a0d6fa5a07e8e8d4595ee4fdc43e6afad41e137aa1898aa176fc2507ec2bfa3773b7db1f1c52e27fe116d4d546e7b0f82ae2591
|
7
|
+
data.tar.gz: 7f18acf1b9dee403b54c1a25c76d838f32b0c5bc07f4140088886458253787525a097150a63e84493445d450f379cc07a65f63c5304fe8b6fd273c2d29db5897
|
data/lib/PodfileTool.rb
CHANGED
@@ -3,13 +3,35 @@ require 'json'
|
|
3
3
|
require 'cocoapods-core'
|
4
4
|
|
5
5
|
class PodfileTool
|
6
|
+
# parse Cocoapods Podfile to json
|
7
|
+
#
|
8
|
+
# Example:
|
9
|
+
# >> PodfileTool.outputJson("/path_of_Podfile")
|
10
|
+
# => {json}
|
11
|
+
#
|
12
|
+
# Arguments:
|
13
|
+
# path: (path_of_Podfile)
|
14
|
+
# output to file name Podfile.json
|
15
|
+
# Example2:
|
16
|
+
# >> PodfileTool.outputJsonFile("/path_of_Podfile")
|
17
|
+
# => {json}
|
18
|
+
#
|
19
|
+
# Arguments:
|
20
|
+
# path: (path_of_Podfile)
|
6
21
|
def self.outputJson(path)
|
7
22
|
podfile_hash = Pod::Podfile.from_file(path).to_hash
|
8
23
|
podfile_json = JSON.pretty_generate(podfile_hash)
|
9
24
|
puts podfile_json
|
10
25
|
end
|
11
26
|
|
12
|
-
def self.
|
13
|
-
|
27
|
+
def self.outputJsonFile(path)
|
28
|
+
podfile_hash = Pod::Podfile.from_file(path).to_hash
|
29
|
+
podfile_json = JSON.pretty_generate(podfile_hash)
|
30
|
+
aFile = File.new(Dir.pwd+"/Podfile.json", "w")
|
31
|
+
if aFile
|
32
|
+
aFile.syswrite(podfile_json)
|
33
|
+
else
|
34
|
+
puts "Unable to open file!"
|
35
|
+
end
|
14
36
|
end
|
15
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: PodfileTool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dacaiguoguo
|
@@ -42,4 +42,3 @@ signing_key:
|
|
42
42
|
specification_version: 4
|
43
43
|
summary: PodfileTool!
|
44
44
|
test_files: []
|
45
|
-
has_rdoc:
|