cocoapods-why 1.0.1 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/cocoapods_why.rb +1 -1
- data/lib/pod/command/why.rb +13 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dee070d6c9eeb13c6b272ccbe0bbc47bede1febfddc027930cb6f5427ac4fb75
|
4
|
+
data.tar.gz: e5e0ca8c2852514fb2d3b400a8a819ab6fd53c9fe02171ec49b35635775ec367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b00f5211624dc04127c735c6d4e49ff7b65fd47d827a7b3deac1f19cae9bc20b7bb50e7456485d4a1d737418edefca4a04955bf2b4f2b0eec5aa41aa18ef4f89
|
7
|
+
data.tar.gz: eb81280dbbd5b664a7275db60b5744b2bd97d1935baa21c92fcd45e1d304b1fdf683d5e85dcbee6ecb2b39b8ef4dafd5d174f5d0da59be2489a7a2c622b21852
|
data/README.md
CHANGED
@@ -72,6 +72,15 @@ For local development of this plugin, the simplest approach is to install it int
|
|
72
72
|
|
73
73
|
You can then make changes to the code and they will be executed when using the `why` command from the app's directory.
|
74
74
|
|
75
|
+
# Release Process
|
76
|
+
|
77
|
+
1. Bump version number in cocoapods_why.rb
|
78
|
+
2. Run `bundle update` to update Gemfile.lock
|
79
|
+
3. Make sure tests still pass: `rake spec`
|
80
|
+
4. (Optional) Run Rubocop on all source files
|
81
|
+
5. Build the gem: `gem build cocoapods-why.gemspec`
|
82
|
+
6. Publish the gem: `gem push cocoapods-why-1.0.gem`
|
83
|
+
|
75
84
|
# Copyright
|
76
85
|
|
77
86
|
Copyright 2020 Square, Inc.
|
data/lib/cocoapods_why.rb
CHANGED
data/lib/pod/command/why.rb
CHANGED
@@ -11,12 +11,13 @@ module Pod
|
|
11
11
|
class Command
|
12
12
|
class Why < Command
|
13
13
|
self.summary = 'Shows why one pod depends on another'
|
14
|
-
self.description = 'If both source and target are given, all paths between them are shown. If target is omitted, all
|
14
|
+
self.description = 'If both source and target are given, all paths between them are shown. If target is omitted, all of the source\'s dependencies (direct and transitive) are shown.'
|
15
15
|
|
16
16
|
self.arguments = [CLAide::Argument.new('source', true), CLAide::Argument.new('target', false)]
|
17
17
|
|
18
18
|
def self.options
|
19
19
|
[
|
20
|
+
['--reverse', 'Shows reverse dependencies (what depends on the source instead of what the source depends on). Only valid when target is omitted.'],
|
20
21
|
['--to-yaml=FILE', 'Output the results in YAML format to the given file'],
|
21
22
|
['--to-dot=FILE', 'Output the results in DOT (GraphViz) format to the given file'],
|
22
23
|
['--cache=FILE', 'Load the dependency data from the given YAML file (created previously with the "query" command) instead of from the current CocoaPods instance']
|
@@ -27,6 +28,7 @@ module Pod
|
|
27
28
|
super
|
28
29
|
@source = argv.shift_argument
|
29
30
|
@target = argv.shift_argument
|
31
|
+
@reverse = argv.flag?('reverse')
|
30
32
|
@to_yaml = argv.option('to-yaml')
|
31
33
|
@to_dot = argv.option('to-dot')
|
32
34
|
@cache = argv.option('cache')
|
@@ -42,7 +44,7 @@ module Pod
|
|
42
44
|
all_dependencies = all_dependencies(targets)
|
43
45
|
[@source, @target].compact.each { |pod| help! "Cannot find pod named #{pod}" if all_dependencies[pod].nil? }
|
44
46
|
graph = make_graph(all_dependencies)
|
45
|
-
@target.nil? ?
|
47
|
+
@target.nil? ? find_dependencies(@source, graph, @reverse) : find_all_dependency_paths(@source, @target, graph)
|
46
48
|
end
|
47
49
|
|
48
50
|
private
|
@@ -167,11 +169,16 @@ module Pod
|
|
167
169
|
File.open(@to_dot, 'w') { |file| file.write(all_paths_graph(graph, all_paths).to_dot_graph.to_s) } if @to_dot
|
168
170
|
end
|
169
171
|
|
170
|
-
# Finds and prints all pods that depend on source (directly or transitively).
|
171
|
-
def
|
172
|
-
|
172
|
+
# Finds and prints all pods that source depends on, or all that depend on source (directly or transitively).
|
173
|
+
def find_dependencies(source, graph, reverse)
|
174
|
+
if reverse
|
175
|
+
UI.puts "What depends on #{source}?"
|
176
|
+
graph = graph.reverse
|
177
|
+
else
|
178
|
+
UI.puts "What does #{source} depend on?"
|
179
|
+
end
|
173
180
|
|
174
|
-
tree = graph.
|
181
|
+
tree = graph.bfs_search_tree_from(source)
|
175
182
|
graph = graph.vertices_filtered_by { |v| tree.has_vertex? v }
|
176
183
|
sorted_dependencies = graph.vertices.sort
|
177
184
|
sorted_dependencies.delete(source)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-why
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trevor Harmon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|