lhj-tools 0.1.44 → 0.1.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhj/helper/log_helper.rb +1 -0
- data/lib/lhj/helper/pgyer_config.rb +13 -0
- data/lib/lhj/helper/pgyer_helper.rb +3 -1
- data/lib/lhj/helper/pgyer_shortcut_helper.rb +67 -0
- data/lib/lhj/helper/vika_helper.rb +12 -5
- data/lib/lhj/tools/version.rb +1 -1
- data/lib/lhj/tools.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98c79bee846ee40347cbf2c34c2315574cc66d9f7745e0f9668be75cb2cbe6bb
|
4
|
+
data.tar.gz: e86ccbb315e7d6e8e9b0b07e468bc25fc3efa9fcd688deb0ec903e411de1ba60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f529d7ccc9a3e3999e9cceca6b4b92b779249bffe537807ebf313e5e74c3063231db450a0b88737144a80babd6f69b079d70ce7fe7f4bbc15a3fff5dbbf621
|
7
|
+
data.tar.gz: f32d8f5ec2800d52352aa78e6a729032a62484e8e8306a53f2dd22cd37a4765b41f17588c16ce07d0e8f5402ef8a4ec9f0f3419c83780071b12f838809cc352f
|
@@ -52,6 +52,7 @@ module Lhj
|
|
52
52
|
message = message.gsub('seconds ', '秒')
|
53
53
|
message = message.gsub('minutes ', '分钟')
|
54
54
|
message = message.gsub('hours ', '小时')
|
55
|
+
message = message.gsub('weeks ', '周')
|
55
56
|
message = message.gsub('days ', '天')
|
56
57
|
message = message.gsub('ago ', '前')
|
57
58
|
Lhj::TeamMemberConfig.config.each do |key, value|
|
@@ -42,6 +42,19 @@ module Lhj
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
+
def self.shortcut_url(env = :uat)
|
46
|
+
case env
|
47
|
+
when :release
|
48
|
+
config['release_shortcut_url']
|
49
|
+
when :gray
|
50
|
+
config['gray_shortcut_url']
|
51
|
+
when :uat
|
52
|
+
config['uat_shortcut_url']
|
53
|
+
else
|
54
|
+
config['shortcut_url']
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
45
58
|
def self.password(env = :uat)
|
46
59
|
config['password']
|
47
60
|
end
|
@@ -82,7 +82,9 @@ module Lhj
|
|
82
82
|
rand_key = rand(100) % 3
|
83
83
|
zipped_path = "Life_i_#{rand_key}.zip"
|
84
84
|
zipped_path = "Life_a_#{rand_key}.zip" unless file.end_with?('.ipa')
|
85
|
-
Actions.sh(%(cd "#{folder_path_dir}" && zip -r "#{zipped_path}" "#{folder_path_dir}"/*), log: false)
|
85
|
+
# Actions.sh(%(cd "#{folder_path_dir}" && zip -r "#{zipped_path}" "#{folder_path_dir}"/*), log: false)
|
86
|
+
Actions.sh(%(cd "#{folder_path_dir}" && zip -r "#{zipped_path}" "#{folder_path_dir}"/* -x="#{folder_path_dir}"/Code/MacauLife.ipa), log: false)
|
87
|
+
|
86
88
|
# step 2
|
87
89
|
oss_key = "code/#{zipped_path}"
|
88
90
|
oss_file = File.join(folder_path_dir, zipped_path)
|
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require "uri"
|
4
|
+
require "net/http"
|
5
|
+
require 'lhj/helper/pgyer_config'
|
6
|
+
|
7
|
+
module Lhj
|
8
|
+
# pgyer upload
|
9
|
+
class PgyerShortcut
|
10
|
+
API_SHORTCUT_HOST = 'https://www.pgyer.com/apiv2/app/getByShortcut'
|
11
|
+
|
12
|
+
attr_reader :api_key, :user_key, :password, :shortcut_url
|
13
|
+
|
14
|
+
def initialize(env = :uat)
|
15
|
+
@api_key = Lhj::PgyerConfig.api_key(env)
|
16
|
+
@user_key = Lhj::PgyerConfig.user_key(env)
|
17
|
+
@shortcut_url = Lhj::PgyerConfig.shortcut_url(env)
|
18
|
+
end
|
19
|
+
|
20
|
+
def request_shortcut_body
|
21
|
+
url = URI(API_SHORTCUT_HOST)
|
22
|
+
|
23
|
+
https = Net::HTTP.new(url.host, url.port)
|
24
|
+
https.use_ssl = true
|
25
|
+
|
26
|
+
request = Net::HTTP::Post.new(url)
|
27
|
+
request['Content-Type'] = 'application/x-www-form-urlencoded'
|
28
|
+
request.body = "_api_key=#{@api_key}&buildShortcutUrl=#{@shortcut_url}"
|
29
|
+
|
30
|
+
response = https.request(request)
|
31
|
+
response.read_body
|
32
|
+
end
|
33
|
+
|
34
|
+
def res_body
|
35
|
+
body = request_shortcut_body unless @res_body
|
36
|
+
@res_body ||= JSON.parse(body)
|
37
|
+
end
|
38
|
+
|
39
|
+
def build_version
|
40
|
+
res_json = res_body
|
41
|
+
res = ''
|
42
|
+
res = res_json['data']['buildBuildVersion'] if res_json['code'].to_i.zero?
|
43
|
+
res
|
44
|
+
end
|
45
|
+
|
46
|
+
def build_updated
|
47
|
+
res_json = res_body
|
48
|
+
res = ''
|
49
|
+
res = res_json['data']['buildUpdated'] if res_json['code'].to_i.zero?
|
50
|
+
res
|
51
|
+
end
|
52
|
+
|
53
|
+
def build_app_version
|
54
|
+
res_json = res_body
|
55
|
+
res = ''
|
56
|
+
res = res_json['data']['buildVersion'] if res_json['code'].to_i.zero?
|
57
|
+
res
|
58
|
+
end
|
59
|
+
|
60
|
+
def build_app_version_no
|
61
|
+
res_json = res_body
|
62
|
+
res = ''
|
63
|
+
res = res_json['data']['buildVersionNo'] if res_json['code'].to_i.zero?
|
64
|
+
res
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -16,10 +16,12 @@ module Lhj
|
|
16
16
|
|
17
17
|
QUERY_RECORDS_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstid/records?viewId=viwid'.freeze
|
18
18
|
|
19
|
-
QUERY_RECORDS_FIELD_KEY_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstid/records?viewId=viwid&fieldKey=id&pageSize=
|
19
|
+
QUERY_RECORDS_FIELD_KEY_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstid/records?viewId=viwid&fieldKey=id&pageSize=page_size&pageNum=page_num'.freeze
|
20
20
|
|
21
21
|
RECORD_LINK_URL = 'https://vika.cn/workbench/dstid/viwid/recid'.freeze
|
22
22
|
|
23
|
+
QUERY_RECORDS_PAGE_SIZE = 100
|
24
|
+
|
23
25
|
def self.trans_vika(note)
|
24
26
|
str = note.dup
|
25
27
|
if /#.+#/ =~ str
|
@@ -120,13 +122,17 @@ module Lhj
|
|
120
122
|
|
121
123
|
res['data']['views'].each do |viw|
|
122
124
|
viw_id = viw['id']
|
123
|
-
request_records(dst_id, viw_id)
|
125
|
+
request_records(1, dst_id, viw_id)
|
124
126
|
end
|
125
127
|
end
|
126
128
|
|
127
|
-
def self.request_records(dst_id, viw_id)
|
128
|
-
|
129
|
-
|
129
|
+
def self.request_records(page_num, dst_id, viw_id)
|
130
|
+
url = url_with_kind(:records_key, dst_id, viw_id)
|
131
|
+
url = url.gsub('page_size', QUERY_RECORDS_PAGE_SIZE.to_s)
|
132
|
+
url = url.gsub('page_num', page_num.to_s)
|
133
|
+
response = get_with_url(url)
|
134
|
+
page_size = handle_records_response(dst_id, viw_id, response)
|
135
|
+
request_records(page_num + 1, dst_id, viw_id) if page_size == QUERY_RECORDS_PAGE_SIZE
|
130
136
|
end
|
131
137
|
|
132
138
|
def self.handle_records_response(dst_id, viw_id, res)
|
@@ -146,6 +152,7 @@ module Lhj
|
|
146
152
|
data_source[ds_key] = ds_value
|
147
153
|
end
|
148
154
|
end
|
155
|
+
res['data']['pageSize'].to_i
|
149
156
|
end
|
150
157
|
|
151
158
|
def self.link_url(dst_id, viw_id, rec_id)
|
data/lib/lhj/tools/version.rb
CHANGED
data/lib/lhj/tools.rb
CHANGED
@@ -14,6 +14,7 @@ module Lhj
|
|
14
14
|
require 'lhj/helper/pod_repo_config'
|
15
15
|
require 'lhj/helper/git_branch_feature_config'
|
16
16
|
require 'lhj/helper/pgyer_helper'
|
17
|
+
require 'lhj/helper/pgyer_shortcut_helper'
|
17
18
|
require 'lhj/helper/dingtalk_helper'
|
18
19
|
require 'lhj/helper/tb_helper'
|
19
20
|
require 'lhj/action/sh_helper'
|
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.
|
4
|
+
version: 0.1.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -344,6 +344,7 @@ files:
|
|
344
344
|
- lib/lhj/helper/oss_helper.rb
|
345
345
|
- lib/lhj/helper/pgyer_config.rb
|
346
346
|
- lib/lhj/helper/pgyer_helper.rb
|
347
|
+
- lib/lhj/helper/pgyer_shortcut_helper.rb
|
347
348
|
- lib/lhj/helper/pod_repo_config.rb
|
348
349
|
- lib/lhj/helper/tb_config.rb
|
349
350
|
- lib/lhj/helper/tb_helper.rb
|