pod-pipeline 0.4.2 → 0.5.0

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: 5e064b08fce2d112de7f132815ddd4bb6aa8f46e77dd08e2668a55ed32457a44
4
- data.tar.gz: ba58fd7869e913eccc0bb462b61ed6506f7618ba83ba15c7a715c7ff422943ba
3
+ metadata.gz: 9bb4ecafe37b498aa5020932ac5cf5102a9dc385b7397c73e67a7a65157339a4
4
+ data.tar.gz: 544ae9a3219ee25016012dad610495a2be353eb74367b34544f12bf661f4e09a
5
5
  SHA512:
6
- metadata.gz: cdd6848d40920cc67c19496eb506badf5a30dd1ae1ba4f70ad7a11cbb9640c5f8c42d7eaa974ccb23dfc89d71a607498f45bdccd2c2cb6b07770b9fcfba43e55
7
- data.tar.gz: c7755c0b4070ba5d3b5cbf49ed32b156a13e8b0616e0fbd651000877c6a2b88c0031ccb0602dc3b5a17523ff71499b50ac66b0d596e390e980766afcc6b10cf2
6
+ metadata.gz: 21454b227d9e8aba69fc1adfa633ab9727ea5d85449b883faaecc02f18a1822503f20a01f93cab4adbb5810363db5e827ecace8d34a03466178ace072dfd8f98
7
+ data.tar.gz: bd6344f371781bfa166021281318cdae775a9b43e0414f31d9938048f5142b492732b571da18a1694071efdd0583b094e8df679c71792d445c7e1c6a8438902f
@@ -0,0 +1,39 @@
1
+ require 'pod-pipeline/util/scanner'
2
+
3
+ module PPL
4
+ class Command
5
+ class Scan < Command
6
+ class All < Scan
7
+ self.summary = '输出 Pod 项目完整信息'
8
+
9
+ self.description = <<-DESC
10
+ 输出 Pod 项目完整信息。
11
+ DESC
12
+
13
+ self.arguments = [
14
+ CLAide::Argument.new('项目根目录(默认使用当前目录)', false),
15
+ ]
16
+ def self.options
17
+ [].concat(super)
18
+ end
19
+
20
+ def initialize(argv)
21
+ @path = argv.arguments!
22
+
23
+ @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first
24
+
25
+ super
26
+ end
27
+
28
+ def run
29
+ PPL::Scanner.new(@projectPath, ["all"]).run
30
+
31
+ puts "Pod: name = #{PPL::Scanner.name}, version = #{PPL::Scanner.version}" if PPL::Scanner.linter
32
+ puts "Git: remote = #{PPL::Scanner.git.remote}, branch = #{PPL::Scanner.git.branches.current.first}" if PPL::Scanner.git
33
+ puts "Workspace: #{PPL::Scanner.workspace.path}" if PPL::Scanner.workspace
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
@@ -0,0 +1,36 @@
1
+ require 'pod-pipeline/util/scanner'
2
+
3
+ module PPL
4
+ class Command
5
+ class Scan < Command
6
+ class Branch < Scan
7
+ self.summary = '输出 Pod Git信息'
8
+
9
+ self.description = <<-DESC
10
+ 输出 Pod Git信息。
11
+ DESC
12
+
13
+ self.arguments = [
14
+ CLAide::Argument.new('项目根目录(默认使用当前目录)', false),
15
+ ]
16
+ def self.options
17
+ [].concat(super)
18
+ end
19
+
20
+ def initialize(argv)
21
+ @path = argv.arguments!
22
+
23
+ @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first
24
+
25
+ super
26
+ end
27
+
28
+ def run
29
+ PPL::Scanner.new(@projectPath, ['branch']).run
30
+
31
+ puts "#{PPL::Scanner.branch}" if PPL::Scanner.branch
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ require 'pod-pipeline/util/scanner'
2
+
3
+ module PPL
4
+ class Command
5
+ class Scan < Command
6
+ class Name < Scan
7
+ self.summary = '输出 Pod 配置信息'
8
+
9
+ self.description = <<-DESC
10
+ 输出 Pod 配置信息。
11
+ DESC
12
+
13
+ self.arguments = [
14
+ CLAide::Argument.new('项目根目录(默认使用当前目录)', false),
15
+ ]
16
+ def self.options
17
+ [].concat(super)
18
+ end
19
+
20
+ def initialize(argv)
21
+ @path = argv.arguments!
22
+
23
+ @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first
24
+
25
+ super
26
+ end
27
+
28
+ def run
29
+ PPL::Scanner.new(@projectPath, ['name']).run
30
+
31
+ puts "#{PPL::Scanner.name}" if PPL::Scanner.name
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ require 'pod-pipeline/util/scanner'
2
+
3
+ module PPL
4
+ class Command
5
+ class Scan < Command
6
+ class Remote < Scan
7
+ self.summary = '输出 Pod Git信息'
8
+
9
+ self.description = <<-DESC
10
+ 输出 Pod Git信息。
11
+ DESC
12
+
13
+ self.arguments = [
14
+ CLAide::Argument.new('项目根目录(默认使用当前目录)', false),
15
+ ]
16
+ def self.options
17
+ [].concat(super)
18
+ end
19
+
20
+ def initialize(argv)
21
+ @path = argv.arguments!
22
+
23
+ @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first
24
+
25
+ super
26
+ end
27
+
28
+ def run
29
+ PPL::Scanner.new(@projectPath, ['remote']).run
30
+
31
+ puts "#{PPL::Scanner.remote}" if PPL::Scanner.remote
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ require 'pod-pipeline/util/scanner'
2
+
3
+ module PPL
4
+ class Command
5
+ class Scan < Command
6
+ class Version < Scan
7
+ self.summary = '输出 Pod 配置信息'
8
+
9
+ self.description = <<-DESC
10
+ 输出 Pod 配置信息。
11
+ DESC
12
+
13
+ self.arguments = [
14
+ CLAide::Argument.new('项目根目录(默认使用当前目录)', false),
15
+ ]
16
+ def self.options
17
+ [].concat(super)
18
+ end
19
+
20
+ def initialize(argv)
21
+ @path = argv.arguments!
22
+
23
+ @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first
24
+
25
+ super
26
+ end
27
+
28
+ def run
29
+ PPL::Scanner.new(@projectPath, ['version']).run
30
+
31
+ puts "#{PPL::Scanner.version}" if PPL::Scanner.version
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ require 'pod-pipeline/util/scanner'
2
+
3
+ module PPL
4
+ class Command
5
+ class Scan < Command
6
+ class Workspace < Scan
7
+ self.summary = '输出 Pod 工作空间'
8
+
9
+ self.description = <<-DESC
10
+ 输出 Pod 工作空间。
11
+ DESC
12
+
13
+ self.arguments = [
14
+ CLAide::Argument.new('项目根目录(默认使用当前目录)', false),
15
+ ]
16
+ def self.options
17
+ [].concat(super)
18
+ end
19
+
20
+ def initialize(argv)
21
+ @path = argv.arguments!
22
+
23
+ @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first
24
+
25
+ super
26
+ end
27
+
28
+ def run
29
+ PPL::Scanner.new(@projectPath, ['workspace']).run
30
+
31
+ puts "#{PPL::Scanner.workspace.path}" if PPL::Scanner.workspace
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,37 +1,23 @@
1
- require 'pod-pipeline/util/scanner'
1
+ require 'pod-pipeline/command/scan/name'
2
+ require 'pod-pipeline/command/scan/version'
3
+ require 'pod-pipeline/command/scan/remote'
4
+ require 'pod-pipeline/command/scan/branch'
5
+ require 'pod-pipeline/command/scan/workspace'
6
+ require 'pod-pipeline/command/scan/all'
2
7
 
3
8
  module PPL
4
9
  class Command
5
10
  class Scan < Command
11
+ self.abstract_command = true
12
+
6
13
  self.summary = '项目扫描'
7
14
  self.description = <<-DESC
8
15
  获取项目的关键参数
9
16
  DESC
10
- self.arguments = [
11
- CLAide::Argument.new('项目根目录(默认使用当前目录)', false),
12
- ]
13
- def self.options
14
- [
15
- ['--channel=pod,git,workspace', '扫描内容。(默认扫描所有内容)']
16
- ].concat(super)
17
- end
18
17
 
19
18
  def initialize(argv)
20
- @path = argv.arguments!
21
- @channels = argv.option('channel', '').split(',')
22
-
23
- @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first
24
-
25
19
  super
26
20
  end
27
-
28
- def run
29
- PPL::Scanner.new(@projectPath, @channels).run
30
-
31
- puts "Pod: #{PPL::Scanner.podspec}" if PPL::Scanner.podspec
32
- puts "Git: remote = #{PPL::Scanner.git.remote}, branch = #{PPL::Scanner.git.branches.current.first}" if PPL::Scanner.git
33
- puts "Workspace: #{PPL::Scanner.workspace.path}" if PPL::Scanner.workspace
34
- end
35
21
  end
36
22
  end
37
23
  end
@@ -8,8 +8,11 @@ require 'pod-pipeline/extension/workspace-ppl.rb'
8
8
  module PPL
9
9
  class Scanner
10
10
  @@linter = nil
11
- @@podspec = nil
11
+ @@name = nil
12
+ @@version = nil
12
13
  @@git = nil
14
+ @@remote = nil
15
+ @@branch = nil
13
16
  @@workspace = nil
14
17
 
15
18
  def initialize(projectPath, channels)
@@ -20,20 +23,29 @@ module PPL
20
23
  def run
21
24
  @channels = ["all"] if @channels.count.zero?
22
25
 
23
- puts "\n[扫描 #{@channels.join(", ")} 内容]"
24
-
25
26
  @channels.each do |channel|
26
27
  case channel
27
28
  when "all"
29
+ puts "\n[扫描 #{@projectPath.split("/").last} 内容]"
28
30
  @@linter = scan_pod @projectPath
29
- @@podspec = @@linter.spec
31
+ @@name = @@linter.spec.name
32
+ @@version = @@linter.spec.version
30
33
  @@git = scan_git @projectPath
34
+ @@remote = @@git.remote
35
+ @@branch = @@git.branches.current.first
31
36
  @@workspace = scan_workspace @projectPath
32
- when "pod"
37
+ when "name"
38
+ @@linter = scan_pod @projectPath
39
+ @@name = @@linter.spec.name
40
+ when "version"
33
41
  @@linter = scan_pod @projectPath
34
- @@podspec = @@linter.spec
35
- when "git"
42
+ @@version = @@linter.spec.version
43
+ when "remote"
44
+ @@git = scan_git @projectPath
45
+ @@remote = @@git.remote
46
+ when "branch"
36
47
  @@git = scan_git @projectPath
48
+ @@branch = @@git.branches.current.first
37
49
  when "workspace"
38
50
  @@workspace = scan_workspace @projectPath
39
51
  else
@@ -48,14 +60,26 @@ module PPL
48
60
  @@linter
49
61
  end
50
62
 
51
- def self.podspec
52
- @@podspec
63
+ def self.name
64
+ @@name
65
+ end
66
+
67
+ def self.version
68
+ @@version
53
69
  end
54
70
 
55
71
  def self.git
56
72
  @@git
57
73
  end
58
74
 
75
+ def self.remote
76
+ @@remote
77
+ end
78
+
79
+ def self.branch
80
+ @@branch
81
+ end
82
+
59
83
  def self.workspace
60
84
  @@workspace
61
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pod-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 郑贤达
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-15 00:00:00.000000000 Z
11
+ date: 2022-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods-core
@@ -118,6 +118,12 @@ files:
118
118
  - lib/pod-pipeline/command/new.rb
119
119
  - lib/pod-pipeline/command/publish.rb
120
120
  - lib/pod-pipeline/command/scan.rb
121
+ - lib/pod-pipeline/command/scan/all.rb
122
+ - lib/pod-pipeline/command/scan/branch.rb
123
+ - lib/pod-pipeline/command/scan/name.rb
124
+ - lib/pod-pipeline/command/scan/remote.rb
125
+ - lib/pod-pipeline/command/scan/version.rb
126
+ - lib/pod-pipeline/command/scan/workspace.rb
121
127
  - lib/pod-pipeline/command/update.rb
122
128
  - lib/pod-pipeline/extension/dir-ppl.rb
123
129
  - lib/pod-pipeline/extension/git-ppl.rb