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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c3cff85c9714857f4d2291c3abb3478cabc3564c31398ec078a8a681b3b2786
4
- data.tar.gz: 1a87098be80cc339392007248aecd0f8b2dd92259e2e978217ab512c6157275e
3
+ metadata.gz: dee070d6c9eeb13c6b272ccbe0bbc47bede1febfddc027930cb6f5427ac4fb75
4
+ data.tar.gz: e5e0ca8c2852514fb2d3b400a8a819ab6fd53c9fe02171ec49b35635775ec367
5
5
  SHA512:
6
- metadata.gz: ee8d9a9bb28c0e180a124d22ae99cdc37c25983c284ae003bb4e57834306999f05c172c145852283361a9fdf3f746dc3a54c52f07cc6bb2d5da6d52b02e3533c
7
- data.tar.gz: c173fc047350aa91f209eb90b3a239ac81ee9950af471a4054f910d1b570edfc20fd2193f5b78e0870b20aee11017d96be0ea7f4525a6a5110cfafdbc5326149
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CocoaPodsWhy
4
- VERSION = '1.0.1'
4
+ VERSION = '1.1'
5
5
  end
@@ -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 pods that depend on the source (directly or transitively) are shown.'
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? ? find_reverse_dependencies(@source, graph) : find_all_dependency_paths(@source, @target, graph)
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 find_reverse_dependencies(source, graph)
172
- UI.puts "What depends on #{source}?"
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.reverse.bfs_search_tree_from(source)
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.0.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-10 00:00:00.000000000 Z
11
+ date: 2020-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler