jmpod 0.2.5 → 0.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6459c9d7ddb429cda4c2d449c79f80e46151649a2863c6951a7b8e4c6d97dd73
4
- data.tar.gz: c41b842e850b3df388afdd81cd63f8a6b37c0258ba0bf5abe79d96749390a8a4
3
+ metadata.gz: c149657a53dfafa8b7c34a75c5d34177fe46a0bd57a3fb332fca4c3545f9fea1
4
+ data.tar.gz: 7de2b6c3c55ca864195c7e19911a87eef1c9e257cd1e31e1321287f6f1f4c64d
5
5
  SHA512:
6
- metadata.gz: 9a4ae079a3999310e502397af86968e9738b2f32fa0e0bf714745b41d4025bac88581a632e5665eaae2bd1a9bd4e8cf4f9e2340b90ad733501bb6737d2c72ec8
7
- data.tar.gz: dcf57dbb0dd9ab6ce55ae1b4550b028b9cb222fde327ca7ec9d2f444bcd9928e6145cea0f092b8e11b489ec9250646646be9fc32e47c738da0209dd997985095
6
+ metadata.gz: a3af982b6113eff69162ee2600cc260a4ad53c731abc43e615c6d485dce1c0014e4afdc9c61a186739bfba6360d5e3e7a50633d7ce90c70940f8360e1ee2c08a
7
+ data.tar.gz: 67ab8567a230448d97e07002ae129ce9404a3f2330407d254c4ff1c1facc4a1987a715e8b3484e5a9a0515135901e4fef20e240179102693b3ef61d39aa7f512
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jmpod (0.2.5)
4
+ jmpod (0.2.6)
5
5
  claide (>= 1.0.2, < 2.0)
6
6
  cocoapods (>= 1.8.4)
7
7
  colored2 (~> 3.1)
@@ -3,80 +3,28 @@ require 'pathname'
3
3
  require 'tmpdir'
4
4
 
5
5
  module Jmpod
6
- class Analyze
7
- def podfile_dependencies(podfile)
8
- res = []
9
- podfile.root_target_definitions.each do |td|
10
- children_definitions = td.recursive_children
11
- children_definitions.each do |cd|
12
- dependencies_hash_array = cd.send(:get_hash_value, 'dependencies')
13
- next if dependencies_hash_array.nil? || dependencies_hash_array.count.zero?
14
-
15
- dependencies_hash_array.each do |item|
16
- next if item.class.name != 'Hash'
17
-
18
- item.each do |name, _|
19
- res.push name
20
- end
21
- end
22
- end
23
- end
24
- res
25
- end
26
-
27
- def analyze_with_podfile(_podfile_dir_path, podfile, lockfile = nil)
28
- if _podfile_dir_path
29
- sandbox = Dir.mktmpdir
30
- else
31
- sandbox = Dir.pwd + '/Pods'
6
+ class Command
7
+ class Analyze < Command
8
+ self.summary = '分析podfile完整依赖链'
9
+ self.description = <<-DESC
10
+ 分析podfile完整依赖链,并输出json文件.
11
+ DESC
12
+
13
+ def initialize(argv)
14
+ super
32
15
  end
33
- p 'sandbox === '
34
- pp sandbox
35
- an = Pod::Installer::Analyzer.new(Pod::Sandbox.new(sandbox), podfile)
36
- pp an
37
- # analyzer = Pod::Installer::Analyzer.new(
38
- # Pod::Sandbox.new(sandbox),
39
- # podfile,
40
- # lockfile
41
- # )
42
-
43
- # specifications = analyzer.analyze.specifications.map(&:root).uniq
44
16
 
45
- # new_map = generate_pods_data(specifications)
46
- # p "new_map === "
47
- # pp new_map
48
- # new_map
49
- end
50
-
51
- def generate_pods_data(specs)
52
- pods_and_deps_merged = specs.reduce({}) do |result, spec|
53
- name = spec.to_s
54
- result[name] ||= []
55
- result[name].concat(spec.all_dependencies.map(&:to_s))
56
- result
17
+ def self.options
18
+ [
19
+ ].concat(super)
57
20
  end
58
21
 
59
- pod_and_deps = pods_and_deps_merged.map do |name, deps|
60
- deps.empty? ? name : { name => YAMLHelper.sorted_array(deps.uniq) }
22
+ def validate!
23
+ super
61
24
  end
62
- YAMLHelper.sorted_array(pod_and_deps)
63
- end
64
25
 
65
- def self.find_dependencies(name, map, res, dependencies_map, root_name)
66
- return unless map[name]
67
-
68
- map[name].each do |k|
69
- find_dependencies(k.name, map, res, dependencies_map, root_name)
70
- dependency = dependencies_map[k.name.split('/')[0]]
71
- res.push dependency.name if dependency && dependency.name != root_name
26
+ def run
72
27
  end
73
- res
74
28
  end
75
-
76
- def self.subspecs_with_name(spec, subspecs_short_names)
77
- subspecs_short_names.map do |name|
78
- spec.subspecs.find { |ss| ss.name.include? name }
79
- end
80
- end
81
29
  end
82
30
  end
data/lib/jmpod/command.rb CHANGED
@@ -17,7 +17,7 @@ module Jmpod
17
17
  require 'jmpod/command/create'
18
18
  require 'jmpod/command/init'
19
19
  require 'jmpod/command/config'
20
- require 'jmpod/command/dependency'
20
+ require 'jmpod/command/analyze'
21
21
 
22
22
  self.abstract_command = true
23
23
  self.command = 'jmpod'
data/lib/jmpod/version.rb CHANGED
@@ -2,5 +2,5 @@ module Jmpod
2
2
  # freeze 冻结对象,将对象变成一个常量
3
3
  # unless 右边的代码块成立,才会运行左边的代码块
4
4
  # defined? 是用来判断本地变量是否存在,也可用来判断是否存在方法
5
- VERSION = "0.2.5".freeze unless defined? Jmpod::VERSION
5
+ VERSION = "0.2.6".freeze unless defined? Jmpod::VERSION
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmpod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - jieming
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -127,7 +127,6 @@ files:
127
127
  - lib/jmpod/command/create/oc.rb
128
128
  - lib/jmpod/command/create/swift.rb
129
129
  - lib/jmpod/command/create/third.rb
130
- - lib/jmpod/command/dependency.rb
131
130
  - lib/jmpod/command/init.rb
132
131
  - lib/jmpod/command/init/ci.rb
133
132
  - lib/jmpod/command/init/unit.rb
@@ -1,33 +0,0 @@
1
- require 'pp'
2
- require 'tmpdir'
3
- require 'jmpod/command/analyze'
4
-
5
- module Pod
6
- class Command
7
- class Dependency < Command
8
- self.summary = '分析podfile完整依赖链'
9
- self.description = <<-DESC
10
- 分析podfile完整依赖链,并输出json文件.
11
- DESC
12
-
13
- def initialize(argv)
14
- super
15
- end
16
-
17
- def self.options
18
- [
19
- ].concat(super)
20
- end
21
-
22
- def validate!
23
- super
24
- verify_podfile_exists!
25
- end
26
-
27
- def run
28
- analyze_result = Jmpod::Analyzer.analyze_with_podfile(nil, config.podfile)
29
- pp analyze_result
30
- end
31
- end
32
- end
33
- end