lhj-tools 0.1.29 → 0.1.30

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: e3afdfb3713841a23a3cd431741fa3a2add9acefdec7c7adeda320eead551100
4
- data.tar.gz: 56366dee80c13449fef8ca7d06958950796cf580decc9344b2e8504dd8c30c73
3
+ metadata.gz: d687a5f900925541da6435425f42e505ff3d80abcab177e1c5a619082da05b6a
4
+ data.tar.gz: 593fcf17a101528199b43cc9905865e94d185ba687e81f2733623a99c512981c
5
5
  SHA512:
6
- metadata.gz: f7a81af5dd316ea322f40edd1b6c40baf8fea27a397383e392ced1ac2d95325c23c66504a83313ff1998ada24d08b85bcb900e080ae7c956e3ab1c6a1e4af07d
7
- data.tar.gz: 67ef0b91969fd2d517d0f8ee319e681e61d0da8239d7dc2e6b93a95e39f3914b030a69b455eed66838dc53681e6c8ede3426653c298664c49ff94bd660a82f79
6
+ metadata.gz: b4d2b8d1da73e9a0906501f26a419a7f7bde4195d428bd30b2c2e119d2c18882430e69015dacc9e88e1dc1a5c50ae986201cec584213230bc5c298bbe0331423
7
+ data.tar.gz: 1f1d936c41971b3ab3214c8eea90c49cbac6931e8c4b8174a11ae083d09cab9ad4ee0b3c05f718545d9763ffd07bb4b15c67f2c750bfa8a4dd2b8d53c1610ae0
@@ -14,8 +14,11 @@ module Lhj
14
14
  str = note
15
15
  if /#.+#/ =~ note
16
16
  note.scan(/#[^#]+#/) do |m|
17
- res_body = req_with_task(m.match(/\d+/)[0])
18
- if res_body['code'].to_i == 200
17
+ ma = m.match(/\d+/)
18
+ next if !ma || !ma[0] || ma[0].length <= 0
19
+
20
+ res_body = req_with_task(ma[0])
21
+ if res_body && res_body['code'].to_i == 200
19
22
  url_str = "[#{res_body['result'][0]['content']}](https://www.teambition.com/task/#{res_body['result'][0]['taskId']})"
20
23
  str = str.gsub(m, url_str)
21
24
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.29"
5
+ VERSION = "0.1.30"
6
6
  end
7
7
  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.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-14 00:00:00.000000000 Z
11
+ date: 2022-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide