lhj-tools 0.2.82 → 0.2.83

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: e5cb532b2f91d92e8575f55aa8f46251351fe6cf8497732c9436344d41c3f10b
4
- data.tar.gz: 9e90fce95487eb3185ffad60b9840cefa94e4defff4dab3355a809ad524acc45
3
+ metadata.gz: e5d002932699d20e17f85d6c37b38bb6450b3ddbc1cbf7611d8e01fb28035465
4
+ data.tar.gz: 04c53c4bdd4d245538c1e0f347153aa15a20d5a0497248c89acfc9040d550c56
5
5
  SHA512:
6
- metadata.gz: 60613b6d94a186e14a6c06d62e46277658c90804b37d3d62185bc94edba554463ef426de55e687e74338c9617ebaaf09342a7ed21eecb14053ae4068f1d4539a
7
- data.tar.gz: 96297521dbf1c255087ae94accee5f04de60ea533c6bb46c7ca537c0cc7ceee4ea0269c9b6f7df983821cf676006b071e49f044993ee48fb04395383b2934ff1
6
+ metadata.gz: e31cccdb1e468653c14cd2e4fc370a6c445fbb22ed6f1c79c610821f8d04c5c2b7368ea0c2ebcefa0f049fff9c9480515ff303799637881a223076b64fb08443
7
+ data.tar.gz: b72cae20a8095402304f1b3b62edfd042a6b330a7903986c52634671dc17285dedd9c221feaa5e96f66bffde9de7e25ac06023b7373ae77ef926a5561d4f9905
@@ -40,6 +40,7 @@ module Lhj
40
40
  block_lines = []
41
41
  File.open(file, 'r') do |f|
42
42
  multi_comment = false
43
+ strong_key = false
43
44
  available_idx = 0
44
45
  block_idx = 0
45
46
  f.readlines.each_with_index do |line, idx|
@@ -60,10 +61,13 @@ module Lhj
60
61
  # 此行包含^符号,且不是方法声明,且不是主线程方法
61
62
  if (line =~ BLOCK_KEY_BEGIN_REGEX && line !~ /^\s*[+-]/ && line !~ /dispatch_get_main_queue/) || block_idx.positive?
62
63
  line_position = block_idx.zero? ? :start : :process
64
+ strong_key = false if block_idx.zero?
65
+ strong_key = true if line =~ /@strongify/
63
66
  block_idx += 1 if line =~ /\{/
64
67
  block_idx -= 1 if line =~ /\}/
65
68
  line_position = :end if block_idx.zero?
66
- block_lines << { idx: idx, line: line, position: line_position }
69
+ strong_key = false if block_idx.zero?
70
+ block_lines << { idx: idx, line: line, position: line_position, strong: strong_key }
67
71
  end
68
72
  end
69
73
  end
@@ -73,6 +77,7 @@ module Lhj
73
77
  def self.handle_block_notify(file_name, wrapper_lines)
74
78
  arr = wrapper_lines.filter { |l| l[:position] != :start }
75
79
  arr.filter! { |l| l[:position] != :end }
80
+ arr.filter! { |l| !l[:strong] }
76
81
  arr.filter! { |l| l[:line] =~ /\W+self\W+/ || l[:line] =~ /\W+_/ }
77
82
  arr.filter! { |l| l[:line] !~ /\^/ }
78
83
  arr.filter! { |l| l[:line] !~ /__weak/ }
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.82'
4
+ VERSION = '0.2.83'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhj-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.82
4
+ version: 0.2.83
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-22 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj