cocoapods-graph 1.0.0 → 1.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/cocoapods-graph.gemspec +1 -1
- data/exe/cocoapods-graph +27 -14
- data/lib/cocoapods_graph/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: e3efceebe8a3046faf8bec4eb90849ada93dad01d072cf0bc0c2fc367c9b584d
|
4
|
+
data.tar.gz: 05cdef5ef7c751165a1f01e3b523a38f642e94c885902d6a1eca4cf61342d9f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67a69893c6e966eab14c1276bd4ae8feca035c20c6d3533a86d8be0f71ddbb053e9149d27c06fdb4f66cea0222fc86bfc66dc29a3bca3fb6b98d2a43caedc53a
|
7
|
+
data.tar.gz: '0825ab124cd0971cb346efb8afb404cfa3b43ca050feb90d6217d170bfa8003ba9ed9b4292fb1070c1bd85f3ff30412ec0f8102597c3b672ec22700bd26a925d'
|
data/cocoapods-graph.gemspec
CHANGED
data/exe/cocoapods-graph
CHANGED
@@ -1,26 +1,36 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Print version immediately if requested
|
4
|
+
if ARGV.include?("-v") || ARGV.include?("--version")
|
5
|
+
require_relative '../lib/cocoapods_graph/version'
|
6
|
+
puts CocoaPodsGraph::VERSION
|
7
|
+
exit
|
8
|
+
end
|
2
9
|
# frozen_string_literal: true
|
3
10
|
|
4
11
|
require 'optparse'
|
5
|
-
|
12
|
+
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
13
|
+
require 'cocoapods_graph'
|
6
14
|
|
7
15
|
module CocoaPodsGraph
|
8
16
|
class CLI
|
9
17
|
VERSION = CocoaPodsGraph::VERSION
|
10
18
|
|
11
19
|
def self.run
|
12
|
-
|
20
|
+
options = {}
|
13
21
|
|
22
|
+
# Print version immediately if requested
|
23
|
+
if ARGV.include?('-v') || ARGV.include?('--version')
|
24
|
+
puts VERSION
|
25
|
+
exit
|
26
|
+
end
|
27
|
+
|
14
28
|
parser = OptionParser.new do |parser|
|
15
29
|
parser.banner = 'Usage: cocoapods-graph [options]'
|
16
30
|
parser.on('-f', '--file FILE', 'Specify Podfile.lock file path') { |f| options[:file] = f }
|
17
31
|
parser.on('--show', 'Print dependencies on console') { options[:show] = true }
|
18
32
|
parser.on('--json', 'Save dependencies to JSON file') { options[:json] = true }
|
19
33
|
parser.on('--html', 'Save dependencies to interactive HTML wheel graph') { options[:html] = true }
|
20
|
-
parser.on('-v', '--version', 'Show version') do
|
21
|
-
puts VERSION
|
22
|
-
exit
|
23
|
-
end
|
24
34
|
parser.on('-h', '--help', 'Show this help message') do
|
25
35
|
puts parser
|
26
36
|
puts "\nExamples:"
|
@@ -48,11 +58,6 @@ module CocoaPodsGraph
|
|
48
58
|
end
|
49
59
|
|
50
60
|
if options[:file] && !options[:file].empty?
|
51
|
-
unless options[:show] || options[:json] || options[:html]
|
52
|
-
puts 'You must select an output option (--show | --json | --html)'
|
53
|
-
exit(1)
|
54
|
-
end
|
55
|
-
|
56
61
|
# Add .lock extension if not present
|
57
62
|
options[:file] += '.lock' unless options[:file].include?('.lock')
|
58
63
|
|
@@ -61,24 +66,32 @@ module CocoaPodsGraph
|
|
61
66
|
exit(1)
|
62
67
|
end
|
63
68
|
|
64
|
-
|
69
|
+
result = CocoaPodsGraph::Generator.parse_lock_file(options[:file])
|
65
70
|
|
71
|
+
any_output = false
|
66
72
|
if options[:show]
|
67
73
|
puts 'Printing dependencies...'
|
68
74
|
result.each(&:print_object)
|
75
|
+
any_output = true
|
69
76
|
end
|
70
77
|
|
71
78
|
if options[:json]
|
72
79
|
puts 'Saving JSON file...'
|
73
80
|
CocoaPodsGraph::Generator.save_json_file(result, options[:file])
|
81
|
+
any_output = true
|
74
82
|
end
|
75
83
|
|
76
84
|
if options[:html]
|
77
85
|
puts 'Saving HTML file...'
|
78
86
|
CocoaPodsGraph::Generator.save_html_wheel_file(result, options[:file])
|
87
|
+
any_output = true
|
79
88
|
end
|
80
89
|
|
81
|
-
|
90
|
+
if any_output
|
91
|
+
else
|
92
|
+
puts 'You must select an output option (--show | --json | --html)'
|
93
|
+
exit(1)
|
94
|
+
end
|
82
95
|
else
|
83
96
|
puts 'Error: Please specify a Podfile.lock file with -f option'
|
84
97
|
exit(1)
|
@@ -87,4 +100,4 @@ module CocoaPodsGraph
|
|
87
100
|
end
|
88
101
|
end
|
89
102
|
|
90
|
-
CocoaPodsGraph::CLI.run
|
103
|
+
CocoaPodsGraph::CLI.run
|