podsorz 0.0.7 → 0.0.8

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: 5a44111361a02ff1c1a71d7085d25bc8ac4ae3835085913ac796c09a86cda8f9
4
- data.tar.gz: e130cd226bdb7072e8db2ee84ca2fad1a09d0d5cbb6b56a7b23e5ed2c206e190
3
+ metadata.gz: d8deb47506256b4bef4309f5883e777e7062cceea144e70e506fb301fbb3b424
4
+ data.tar.gz: b198d8604d2ea51dae2d735d54a70753e040d1948a485dabc018bea4d7794806
5
5
  SHA512:
6
- metadata.gz: 021efcba84b814774fb105bb019d81053ffbaa727f469ca1c679a55f2ee65a1749ebc4aa15a9c684292899a2ab6930543812b0c825a9ee440b0cc5a2cf2381e3
7
- data.tar.gz: b936d7f1b824146c954767ffd987127ebf09d474e127dae7b9f16e16cf494b959bd1003855c73997d5c5252b11665e25e7bfc2be32175a6b4d62505cc27a589d
6
+ metadata.gz: 68e82ce404af05d8ffbf4368e7b662be5d7072df2b9c2c733685dc2427a6f622b57fa6e08a4c9f32f4313177ab595076297b959dbadea23361559347f0de99f7
7
+ data.tar.gz: 534226be5f8aebb0f2124045fe79ee926652548a8fbea633752759a5acef0ca53529f3e53ca6b8772e7d8303064cd820a55abbaf40b923612a508aed3c8437d8
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- podsorz (0.0.5)
4
+ podsorz (0.0.8)
5
5
  cocoapods
6
6
  cocoapods-packager
7
7
  colorize
data/Podfile ADDED
File without changes
data/PodsOrzConfig.rb ADDED
@@ -0,0 +1,31 @@
1
+ module GitConfig
2
+ #App 当前版本
3
+ APP_RELEASE_VERSION = "2.0.12"
4
+
5
+ #作者姓名xiangqi简写
6
+ BRANCH_AUTHOR_SUFFIX = "xq"
7
+ end
8
+
9
+ #想要开发修改的的Pod
10
+ $FIX_POD_LIST = [
11
+ # "KXModuleOrz",
12
+ # "KXModuleQuestionRepo",
13
+ ]
14
+
15
+
16
+
17
+ #------Binary Static library------#
18
+ #是否全部Pod以二进制静态库加载,false代表以源码显示【打包机】请用源码
19
+ $is_all_binary = false
20
+ #当is_all_binary = false 所有pod即将显示源码时,仍然希望部分Pod二进制静态库加载
21
+ $static_lib_list = [
22
+ # "AFNetworking",
23
+ ]
24
+
25
+ #------Package Action------#
26
+ #当is_all_binary = false 并不是针对所有pod 打binary包,仍然希望部分pod打包成二进制静态库的Pod
27
+ $will_package_list = [
28
+ # "AFNetworking",
29
+ ]
30
+
31
+ #
data/lib/podsorz.rb CHANGED
@@ -8,6 +8,7 @@ require "podsorz/command/publish"
8
8
  require "podsorz/command/sync"
9
9
  require "podsorz/command/binary"
10
10
  require "podsorz/command/install"
11
+ require "podsorz/command/check.rb"
11
12
 
12
13
  require 'gli'
13
14
 
@@ -40,6 +41,7 @@ module PodsOrz
40
41
  install_command()
41
42
  sync_command()
42
43
  binary_command()
44
+ check_command()
43
45
 
44
46
  desc "Show podsorz version"
45
47
  command :version do |version|
@@ -0,0 +1,28 @@
1
+ # require "podsorz/core/PodsOrz/pods_check_merge"
2
+ # require "../../PodsOrz/lib/podsorz/core/PodsOrz/pods_check_merge.rb"
3
+ require "podsorz/core/PodsOrz/pods_check_merge"
4
+
5
+ module PodsOrz
6
+ def self.check_command
7
+ desc "Check Pods not merge"
8
+ command :check do |check|
9
+ check.action do |global_options, options, args|
10
+ dir_path = global_options[:path]
11
+
12
+ is_directory = File.directory?(dir_path)
13
+
14
+ unless is_directory
15
+ Logger.error("Check failure, it is not a directory path: #{dir_path}")
16
+ exit()
17
+ end
18
+
19
+ kx_pods_path = File.expand_path("../kx_pods", dir_path)
20
+ # puts "kx_pods_path #{kx_pods_path}"
21
+ checkManger = PodsOrz::PodsCheckMerge.new()
22
+ checkManger.branchList(kx_pods_path)
23
+
24
+ end
25
+ end
26
+ end
27
+
28
+ end
@@ -82,7 +82,7 @@ module PodsOrz
82
82
  binary_result = File.directory?(@kx_binary_path)
83
83
  unless binary_result
84
84
  Logger.warning("kx_binary directory not exist, generate default 'kx_binary' directory")
85
- Dir.mkdir(@kx_pods_path)
85
+ Dir.mkdir(@kx_binary_path)
86
86
  end
87
87
  end
88
88
  end
@@ -0,0 +1,160 @@
1
+ require 'open3'
2
+ require 'pathname'
3
+ require "podsorz/util/git_operator"
4
+
5
+ module PodsOrz
6
+
7
+ class PodsCheckMerge
8
+
9
+ # def check_Podfile(filePath)
10
+ # # 返回 path 的绝对路径,扩展 ~ 为进程所有者的主目录,~user 为用户的主目录。相对路径是相对于 dir 指定的目录,如果 dir 被省略则相对于当前工作目录
11
+ # tempPath = File.expand_path("Podfile",filePath)
12
+ # result = File::exist?tempPath
13
+ # if result
14
+ # puts("存在-- #{tempPath}")
15
+ # else
16
+ # puts("不存在-- #{tempPath}")
17
+ # end
18
+ # tempPath
19
+ # end
20
+
21
+ def branchList(path)
22
+ list = []
23
+ # IO.popen("cd '#{path}';git branch -r") do |io|
24
+ # io.each do |line|
25
+ # puts("branch -- #{line}")
26
+ # # has_branch = true if line.include? branch_name
27
+ # end
28
+ # end
29
+
30
+ # Open3.popen3("cd '#{File.dirname(__FILE__ )}';git branch -r"){|stdin, stdout, stderr, wait_thr|
31
+ # while line = stdout.gets
32
+ # puts("branch- #{line}")
33
+ # end
34
+ # }
35
+ # @kx_pods_directory = File.expand_path("../kx_pods", File.dirname(__FILE__))
36
+ # puts "里层 #{@kx_pods_directory}"
37
+
38
+ # kx_pods_path /Users/yuyutao/Desktop/rubyGem/kx_pods
39
+ # 里层 /Library/Ruby/Gems/2.6.0/gems/podsorz-0.0.5/lib/podsorz/core/kx_pods
40
+
41
+ # dir = Dir.open("#{@kx_pods_directory}")
42
+ # while name = dir.read
43
+ # p name
44
+ # end
45
+ # dir.close
46
+
47
+ # @kx_pods_directory = "/Users/yuyutao/Desktop/rubyGem/kx_pods"
48
+
49
+ Dir.open("#{path}") do |dir|
50
+ tempAry = ['.','..']
51
+ dirAry = dir.to_a
52
+ ary = dirAry-tempAry
53
+ ary.each do |name|
54
+ dir_path = "#{path}/#{name}"
55
+ is_directory = File.directory?(dir_path)
56
+
57
+ if is_directory
58
+ localBranch("#{dir_path}",name)
59
+ else
60
+ # puts "#{name} 空文件"
61
+ end
62
+ end
63
+
64
+ end
65
+
66
+
67
+ end
68
+
69
+ # git log -n1 --format=format:"%H"
70
+ def localBranch(filePath,fileName)
71
+
72
+ @git_operator = PodsOrz::GitOperator.new()
73
+ has_changes = @git_operator.has_changes(filePath)
74
+ if has_changes
75
+ branch = @git_operator.current_branch(filePath)
76
+ Logger.error("【#{filePath}】 on branch: \"#{branch}\" has unstaged/uncommit changes, please staged and commit local first")
77
+ return
78
+ end
79
+
80
+ is_merge_all = true
81
+ branch = ""
82
+ Open3.popen3("cd '#{filePath}';git branch -l"){|stdin, stdout, stderr, wait_thr|
83
+ if stdout.gets
84
+ while line = stdout.gets
85
+
86
+ if line.include? "master"
87
+ # puts("master分支-#{fileName}")
88
+ elsif line.include? "develop"
89
+ # puts("develop分支-#{fileName}")
90
+ elsif line.include? "release"
91
+ # puts("release分支-#{fileName}")
92
+ else
93
+ # puts("#{fileName} branch- #{line}")
94
+ branch = line.strip
95
+ if branch.include? "*"
96
+ branch.delete!("*",)
97
+ end
98
+ is_merge_all = git_isMerged("#{branch}",filePath)
99
+ end
100
+
101
+ end
102
+
103
+ else
104
+ # puts("未发现本地分支-#{fileName}")
105
+ end
106
+ }
107
+
108
+ # puts("all commit success!") if is_merge_all
109
+ if is_merge_all
110
+
111
+ puts("check result: all commit success! #{filePath}")
112
+ else
113
+ Logger.warning("#{filePath} - #{branch} commit not merge")
114
+ end
115
+
116
+ end
117
+
118
+ def git_isMerged(branch,path)
119
+ merge_destination_branch = "origin/develop"
120
+ merge_source_branch = "#{branch}"
121
+ merge_base = ""
122
+ merge_current_commit = ""
123
+ is_merge_all = true
124
+ cmd = "cd '#{path}';git merge-base #{merge_destination_branch} #{branch}"
125
+ IO.popen(cmd) do |io|
126
+ io.each do |line|
127
+ if line
128
+ merge_base = line
129
+ else
130
+ puts("git merge-base 无hash值 #{path}")
131
+ end
132
+
133
+ end
134
+
135
+ end
136
+ cmd = "git rev-parse #{branch}"
137
+ IO.popen("cd '#{path}';#{cmd}") do |io|
138
+ io.each do |line|
139
+ if line
140
+ merge_current_commit = line
141
+ else
142
+ puts("git rev-parse 无hash值 #{path}")
143
+ end
144
+
145
+ end
146
+
147
+ end
148
+
149
+ if merge_base == merge_current_commit
150
+
151
+ else
152
+ is_merge_all = false
153
+ end
154
+
155
+ is_merge_all
156
+ end
157
+
158
+ end
159
+
160
+ end
@@ -190,9 +190,9 @@ module PodsOrz
190
190
  repo_push_cmd = []
191
191
  repo_push_cmd << "cd #{file_path}"
192
192
  if is_swift
193
- repo_push_cmd << "pod repo push #{@repo_name} #{pod}.podspec --sources=#{@repo_url} --allow-warnings --use-libraries --skip-import-validation --use-modular-headers --swift-version=5.0 --skip-tests --platforms=ios"
193
+ repo_push_cmd << "pod repo push #{@repo_name} #{pod}.podspec --sources=#{@repo_url} --allow-warnings --use-libraries --skip-import-validation --use-modular-headers --swift-version=5.0 --skip-tests"
194
194
  else
195
- repo_push_cmd << "pod repo push #{@repo_name} #{pod}.podspec --sources=#{@repo_url} --allow-warnings --use-libraries --skip-import-validation --skip-tests --platforms=ios"
195
+ repo_push_cmd << "pod repo push #{@repo_name} #{pod}.podspec --sources=#{@repo_url} --allow-warnings --use-libraries --skip-import-validation --skip-tests"
196
196
  end
197
197
 
198
198
 
@@ -0,0 +1,46 @@
1
+ # require File.expand_path('../../lib/yygem/string_calculator', __FILE__)
2
+ require "/Users/yuyutao/Desktop/rubyGem/PodsOrz/lib/podsorz/core/PodsOrz/pods_check_merge.rb"
3
+ require 'rspec'
4
+
5
+ describe PodsCheckMerge do
6
+
7
+ describe ".add" do
8
+ # context "given an empty string" do
9
+ # it "returns zero" do
10
+ # expect(StringCalculator.add("")).to eq(0)
11
+ # end
12
+ # end
13
+
14
+ context "given '4'" do
15
+ it "returns 4" do
16
+ expect(StringCalculator.add("4")).to eql(4)
17
+ end
18
+ end
19
+
20
+ context "given '10'" do
21
+ it "returns 10" do
22
+ expect(StringCalculator.add("10")).to eql(10)
23
+ end
24
+ end
25
+
26
+ context "two numbers" do
27
+ context "given '2,4'" do
28
+ # 输出内容 条件成立则绿色输出 否则红色 FAILED - 1 输出
29
+ it "returns 6" do
30
+ expect(StringCalculator.add("2,4")).to eql(6)
31
+ end
32
+ end
33
+
34
+ context "given '17,100'" do
35
+ StringCalculator.add("17,10")
36
+ it "returns 117" do
37
+ # StringCalculator.add("17,100")
38
+ # eql 与写入期望的值进行对比 RSpec 中 eq、eql、be 有不同差别
39
+ expect(StringCalculator.add("17,100")).to eql(17)
40
+ end
41
+ end
42
+ end
43
+
44
+
45
+ end
46
+ end
@@ -1,3 +1,3 @@
1
1
  module PodsOrz
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podsorz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xiangqi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -77,14 +77,18 @@ extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
79
  - ".gitignore"
80
+ - ".rspec"
80
81
  - Gemfile
81
82
  - Gemfile.lock
82
83
  - LICENSE.txt
84
+ - Podfile
85
+ - PodsOrzConfig.rb
83
86
  - README.md
84
87
  - Rakefile
85
88
  - bin/podsorz
86
89
  - lib/podsorz.rb
87
90
  - lib/podsorz/command/binary.rb
91
+ - lib/podsorz/command/check.rb
88
92
  - lib/podsorz/command/commit.rb
89
93
  - lib/podsorz/command/install.rb
90
94
  - lib/podsorz/command/publish.rb
@@ -100,11 +104,13 @@ files:
100
104
  - lib/podsorz/core/Config/pod_orzconfig_parse.rb
101
105
  - lib/podsorz/core/PodFile/podfile_io.rb
102
106
  - lib/podsorz/core/PodFile/podfile_model.rb
107
+ - lib/podsorz/core/PodsOrz/pods_check_merge.rb
103
108
  - lib/podsorz/core/PodsOrz/pods_detector.rb
104
109
  - lib/podsorz/core/PodsOrz/pods_git_manager.rb
105
110
  - lib/podsorz/core/PodsOrz/pods_git_operator.rb
106
111
  - lib/podsorz/core/PodsOrz/pods_repo.rb
107
112
  - lib/podsorz/core/PodsOrz/pods_version.rb
113
+ - lib/podsorz/core/Specs/check_spec.rb
108
114
  - lib/podsorz/core/Specs/podspec_model.rb
109
115
  - lib/podsorz/util/git_operator.rb
110
116
  - lib/podsorz/util/logger.rb