lhj-tools 0.1.45 → 0.1.47
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 +1 -0
- data/lib/lhj/helper/pgyer_shortcut_helper.rb +42 -0
- 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: 3a3d83868ea1e59da60c81e44b61120054d3896c805f438a9cc72c3a9e70621b
|
4
|
+
data.tar.gz: e394c3618917bbd9e0e543bd00fefa181c49f91ebd7d08f0cd7e19ef34e2b9f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c70d7668d27d807eecfbd30c99ac00d0c5da06b3d6695b4e200b848eaaa0a5b85d26598afbc65f1cd0299f6de4dbe70ed29c06c97226f6ab5c6911bbcbebd9cc
|
7
|
+
data.tar.gz: 8dc428ed99bc90d6da940fd4bdaa9e130f0e37e4c6ae64e1636612f4651692a671bcfd32ca6660a47788cbb45cdd7f2397c2f7f97d0d214aa521b44841b9fca9
|
@@ -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
|
@@ -83,6 +83,7 @@ module Lhj
|
|
83
83
|
zipped_path = "Life_i_#{rand_key}.zip"
|
84
84
|
zipped_path = "Life_a_#{rand_key}.zip" unless file.end_with?('.ipa')
|
85
85
|
Actions.sh(%(cd "#{folder_path_dir}" && zip -r "#{zipped_path}" "#{folder_path_dir}"/* -x="#{folder_path_dir}"/Code/MacauLife.ipa), log: false)
|
86
|
+
|
86
87
|
# step 2
|
87
88
|
oss_key = "code/#{zipped_path}"
|
88
89
|
oss_file = File.join(folder_path_dir, zipped_path)
|
@@ -0,0 +1,42 @@
|
|
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 build_version
|
35
|
+
body = request_shortcut_body
|
36
|
+
res_json = JSON.parse(body)
|
37
|
+
res = ''
|
38
|
+
res = res_json['data']['buildBuildVersion'] if res_json['code'].to_i.zero?
|
39
|
+
res
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
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.47
|
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-11 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
|