lhj-tools 0.2.73 → 0.2.75
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/lhj/helper/ios_api_available_check_helper.rb +8 -5
- data/lib/lhj/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: 5e5b22cf3aed7dd2a1da0fa7815a55275c0118d3ae130bab1ad44afea25f81e2
|
4
|
+
data.tar.gz: b833c76e141e5b0ffa0037aad3f943b3c86d8ee5f6303c183150644b13269ebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3e75769782d140d16ca06b5e0518c9f0a5d8657fb0f88eb012913674734c11026e22c630b951449629e8a3ca94bc0220f1302c599b82a1630acaaaef2bb6940
|
7
|
+
data.tar.gz: d49c7806545e0ab67b843f933663f588ed9f2ab2c14f918487c286844891cb932a827cd373e0fb66a0be8e7548e1e90a5eb97ea46bd5ab32e4b5dcc3b1621a71
|
@@ -5,7 +5,9 @@ module Lhj
|
|
5
5
|
API_AVAILABLE_KEY_BEGIN_REGEX = /@available\(/.freeze
|
6
6
|
|
7
7
|
def self.check(path, type = 'm')
|
8
|
-
all_files = Dir.glob("#{path}/**/*.{#{type}}")
|
8
|
+
all_files = Dir.glob("#{path}/**/*.{#{type}}").reject do |p|
|
9
|
+
p =~ /Pods/
|
10
|
+
end
|
9
11
|
result = {}
|
10
12
|
all_files.each do |f|
|
11
13
|
wrapper_lines = find_available_wrapper(f)
|
@@ -45,7 +47,7 @@ module Lhj
|
|
45
47
|
|
46
48
|
available_idx += 1 if line =~ /\{/
|
47
49
|
available_idx -= 1 if line =~ /\}/
|
48
|
-
lines << { idx: idx
|
50
|
+
lines << { idx: idx }
|
49
51
|
end
|
50
52
|
end
|
51
53
|
lines
|
@@ -69,15 +71,15 @@ module Lhj
|
|
69
71
|
# 2. 找到的行是否已available代码块
|
70
72
|
next if wrapper_lines.length.positive? && wrapper_lines.any? { |w| w[:idx] == idx }
|
71
73
|
|
72
|
-
result << { idx: idx + 1, line: line }
|
74
|
+
result << { idx: idx + 1, line: line.strip }
|
73
75
|
end
|
74
76
|
end
|
75
77
|
result
|
76
78
|
end
|
77
79
|
|
78
80
|
def self.match_white_list_reg(line)
|
79
|
-
regs ||= load_white_api_list
|
80
|
-
regs.any? { |r|
|
81
|
+
@regs ||= load_white_api_list
|
82
|
+
@regs.any? { |r| /#{r}/ =~ line }
|
81
83
|
end
|
82
84
|
|
83
85
|
def self.load_white_api_list
|
@@ -93,6 +95,7 @@ module Lhj
|
|
93
95
|
def self.notify(result)
|
94
96
|
temp = Lhj::ErbTemplateHelper.load('ios_avaliable_api_notify')
|
95
97
|
temp_result = Lhj::ErbTemplateHelper.render(temp, { result: result, branch: git_branch }, '-')
|
98
|
+
puts temp_result
|
96
99
|
Lhj::Dingtalk.post_message_robot(robot_url, 'check code', temp_result)
|
97
100
|
end
|
98
101
|
|
data/lib/lhj/version.rb
CHANGED