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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f290f1dcacdb4ffd6a22237a2bcf16e2e859a722855c8ca63a508d36bc9004d
4
- data.tar.gz: 0cfa5b7a21ca263afab94639ecb90703f01baa9c15db786d6c92c62dcac0ad05
3
+ metadata.gz: 5e5b22cf3aed7dd2a1da0fa7815a55275c0118d3ae130bab1ad44afea25f81e2
4
+ data.tar.gz: b833c76e141e5b0ffa0037aad3f943b3c86d8ee5f6303c183150644b13269ebc
5
5
  SHA512:
6
- metadata.gz: 7a83825633df792ce139161b02f3b882c900ae140a84f517736de5480902766721b177b314154b4ef3fa8e4323f9aad6681d7585b650b605a9593e1684b2f844
7
- data.tar.gz: 7d9436fcc3141dbcc19212c676783bf79e5e457d9f18e029eb791103faf9c7eb8afd6ee744d93cab52cc47c294e1836b2860d3813e0f6ac72524c70780037f8f
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, line: line }
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| line =~ /#{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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lhj
4
- VERSION = '0.2.73'
4
+ VERSION = '0.2.75'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhj-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.73
4
+ version: 0.2.75
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian