pixab 2.2.0 → 2.2.1
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 +4 -4
- data/lib/gitlab/GitRepoInfo.rb +22 -5
- data/lib/pixab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40bdedbf96ae1aad98cea6889c0cd32dafc9d9d6634ed181ea5d3aad9fc50c53
|
4
|
+
data.tar.gz: f097ad80dcff665eb3f0e6a77f7717fbed41bc7e7503e6819a09e0591e5b43f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74c4e32db81e84edf7d54c6a7bf719290bf458978440435e231113ba1e08eefb6dc659934742f295a1660733887c4adbb24f00f408adc303c22e050a57264d4f
|
7
|
+
data.tar.gz: fec66d4eac0ed930fa2052a3d02d77e8a482b1da15edf8f068e6fdbb5c98f81bf25649b0bdf0d707115fa54b15b69639dd192a3ce3ec7313040a622f59ccf705
|
data/lib/gitlab/GitRepoInfo.rb
CHANGED
@@ -16,9 +16,17 @@ module Pixab
|
|
16
16
|
`git fetch origin`
|
17
17
|
|
18
18
|
@branch = GitUtils.current_branch
|
19
|
+
if @branch.nil?
|
20
|
+
puts "无法获取当前分支".red
|
21
|
+
end
|
22
|
+
|
19
23
|
@target_branch = get_target_branch(@branch)
|
20
|
-
@
|
21
|
-
|
24
|
+
if @target_branch.nil?
|
25
|
+
puts "无法获取目标分支,当前分支:#{@branch}".red
|
26
|
+
end
|
27
|
+
|
28
|
+
@remote_branch = "origin/#{@branch}"
|
29
|
+
@remote_target_branch = "origin/#{@target_branch}"
|
22
30
|
end
|
23
31
|
|
24
32
|
def get_target_branch(branch)
|
@@ -39,13 +47,22 @@ module Pixab
|
|
39
47
|
end
|
40
48
|
|
41
49
|
def get_version(feature_name)
|
50
|
+
# 用 '_' 分割字符串
|
42
51
|
parts = feature_name.split('_')
|
43
|
-
|
44
|
-
|
45
|
-
|
52
|
+
|
53
|
+
# 遍历分割的部分
|
54
|
+
parts.each do |part|
|
55
|
+
# 判断是否为纯数字
|
56
|
+
if part.match?(/^\d+$/)
|
57
|
+
return part
|
58
|
+
# 判断是否为类似 7.5.0 的格式
|
59
|
+
elsif part.match?(/^\d+(\.\d+)*$/)
|
46
60
|
return part
|
47
61
|
end
|
48
62
|
end
|
63
|
+
|
64
|
+
# 如果没有满足条件的字符串,返回 nil
|
65
|
+
nil
|
49
66
|
end
|
50
67
|
|
51
68
|
# 判断远程分支是否代码是否同步到远程目标分支
|
data/lib/pixab/version.rb
CHANGED