PodfileTool 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/PodfileTool.rb +19 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abf4a59b3266444e330d502c8fabb90015ecc53d
4
- data.tar.gz: 25831d7f8c6ab6167c5b350e67042b39c17f14e3
3
+ metadata.gz: 6e2df3af18b1a742210c4eb011bbbb490422db46
4
+ data.tar.gz: 71c30ac49009a1e367a644c4b76f9a6b0512dad0
5
5
  SHA512:
6
- metadata.gz: 5f3036f2d92398945a1f304b6a0d6fa5a07e8e8d4595ee4fdc43e6afad41e137aa1898aa176fc2507ec2bfa3773b7db1f1c52e27fe116d4d546e7b0f82ae2591
7
- data.tar.gz: 7f18acf1b9dee403b54c1a25c76d838f32b0c5bc07f4140088886458253787525a097150a63e84493445d450f379cc07a65f63c5304fe8b6fd273c2d29db5897
6
+ metadata.gz: fa8bbb8a8bc0bde65741f90a0bdc205a9c8efbdff847e0c9dc46499a7a3579e190bf22c15e6808f244fc58750ccc91bcd733f771eed0833661d26485e4a69ecf
7
+ data.tar.gz: 4fbd5fbfe2377be609b1b1936acf01244bb2163f4e747af25ceb638e188188fff1ed1ef4937b34168a151b8098abfde6b1f21e37c9ca6dc0182b1248718db505
data/lib/PodfileTool.rb CHANGED
@@ -19,9 +19,25 @@ class PodfileTool
19
19
  # Arguments:
20
20
  # path: (path_of_Podfile)
21
21
  def self.outputJson(path)
22
- podfile_hash = Pod::Podfile.from_file(path).to_hash
23
- podfile_json = JSON.pretty_generate(podfile_hash)
24
- puts podfile_json
22
+ if path
23
+ if path.empty?
24
+ puts 'need good Podfile Path!!!'
25
+ else
26
+ if File.exist?(path)
27
+ if File.file?(path)
28
+ podfile_hash = Pod::Podfile.from_file(path).to_hash
29
+ podfile_json = JSON.pretty_generate(podfile_hash)
30
+ podfile_json
31
+ else
32
+ puts 'Podfile Path is not a file!!!'
33
+ end
34
+ else
35
+ puts 'need exist Podfile Path!!!'
36
+ end
37
+ end
38
+ else
39
+ puts 'need Podfile Path!!!'
40
+ end
25
41
  end
26
42
 
27
43
  def self.outputJsonFile(path)
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - dacaiguoguo