lhj-tools 0.1.24 → 0.1.25

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: f8a3955d41955a54ce3ca861519c4333245dacd4c4b14477f73fc7061707c1f3
4
- data.tar.gz: 630fc37529847a893022bd49226e2bd1bd44794f71618458d7e7620d3ad3f265
3
+ metadata.gz: 223ddca466520ca7090669cd355c86c0e62d32d39404ea4cc13f65967f22a541
4
+ data.tar.gz: 26b194fa297f41e60e9f16f4f204644007b3b793cb2a7a3bc625a5b46f7b062b
5
5
  SHA512:
6
- metadata.gz: 0e3c30af417e17bd237c0bc114ed48d8e9fd46e39263085ef1743398e702c510ee9bd5212eaa2e06446a659a33d47089fbdc865dfcf284307538b9b6edb5abc4
7
- data.tar.gz: e0d7853fb9f18c5785fa570c3e23c212f29e5aa935fcf437224f0f9db24c03221e3ff88efa91c8a63eb6eac8057cba5bc4ef4a0d3c798057754482c50a2e6642
6
+ metadata.gz: 0643a43dc5c7c85b533b56245acfd822fe683e50ef763b18790e26199685e4d0d12d456b7c1c5c693ddda7fc9c64823be7a4536e96426feb7bff85117e181336
7
+ data.tar.gz: 4ac4c6329d2e4b654d4ef1f4f7afe613f65fb3068a9f9192f374aa20ea13a01b700a33b71c858565b988e5eea0e4c17c9c05bb23a9d08eab02ac764d67e7af9d
@@ -1,5 +1,6 @@
1
1
  require 'lhj/config'
2
2
  require 'highline'
3
+ require 'lhj/helper/pod_repo_config'
3
4
 
4
5
  module Lhj
5
6
  class Command
@@ -113,9 +114,8 @@ module Lhj
113
114
  end
114
115
 
115
116
  def update_pod_repo
116
- # pod repo push miguatech-aomi_ios-mlspecs *.podspec --sources=miguatech-aomi_ios-mlspecs,aliyun,trunk --allow-warnings --use-libraries --verbose
117
117
  cmd = ['pod repo push']
118
- pod_repo_name = 'miguatech-aomi_ios-mlspecs'
118
+ pod_repo_name = Lhj::PodRepoConfig.pod_repo_name
119
119
  cmd << pod_repo_name
120
120
  cmd << '*.podspec'
121
121
  cmd << "--sources=#{pod_repo_name},aliyun,trunk"
@@ -19,9 +19,11 @@ module Lhj
19
19
  def self.api_key(env = :uat)
20
20
  case env
21
21
  when :release
22
- 'release.....'
22
+ config['release_api_key']
23
23
  when :gray
24
- 'gray.....'
24
+ config['gray_api_key']
25
+ when :uat
26
+ config['uat_api_key']
25
27
  else
26
28
  config['api_key']
27
29
  end
@@ -30,23 +32,18 @@ module Lhj
30
32
  def self.user_key(env = :uat)
31
33
  case env
32
34
  when :release
33
- config['user_key']
35
+ config['release_user_key']
34
36
  when :gray
35
- config['user_key']
37
+ config['gray_user_key']
38
+ when :uat
39
+ config['uat_user_key']
36
40
  else
37
41
  config['user_key']
38
42
  end
39
43
  end
40
44
 
41
45
  def self.password(env = :uat)
42
- case env
43
- when :release
44
- config['password']
45
- when :gray
46
- config['password']
47
- else
48
- config['password']
49
- end
46
+ config['password']
50
47
  end
51
48
  end
52
49
  end
@@ -49,10 +49,11 @@ module Lhj
49
49
  'file' => Faraday::UploadIO.new(file, 'application/octet-stream')
50
50
  }
51
51
  begin
52
- puts 'begin upload'
52
+ puts 'begin upload...'
53
53
  response = http_client.post API_HOST, params
54
54
  @result = response.body
55
55
  puts @result
56
+ puts 'upload success'
56
57
  if @result['data'] && @result['data']['appUpdateDescription']
57
58
  @result['data']['appUpdateDescription'] = Lhj::TbHelper.trans_tb(@result['data']['appUpdateDescription'])
58
59
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ require 'yaml'
3
+ require 'lhj/config'
4
+
5
+ module Lhj
6
+ # pod repo config
7
+ class PodRepoConfig
8
+
9
+ CONFIG_NAME = 'pod_repo_config.yml'
10
+
11
+ def self.config_file
12
+ File.join(Lhj::Config.instance.home_dir, CONFIG_NAME)
13
+ end
14
+
15
+ def self.config
16
+ @yaml ||= YAML.load_file(config_file)
17
+ end
18
+
19
+ def self.pod_repo_name
20
+ config['pod_repo_name']
21
+ end
22
+
23
+ end
24
+ end
@@ -1,4 +1,5 @@
1
1
  require 'lhj/config'
2
+ require_relative 'oss_config'
2
3
 
3
4
  module Lhj
4
5
  class Trans
@@ -18,9 +19,13 @@ module Lhj
18
19
  contents.to_hash
19
20
  end
20
21
 
22
+ def down_load_path
23
+ "http://#{Lhj::OSSConfig.oss_bucket}.#{Lhj::OSSConfig.oss_endpoint}/zh2hant.yml"
24
+ end
25
+
21
26
  def down_load_yaml
22
27
  require 'open-uri'
23
- URI.open('http://aomi-ios-repo.oss-cn-shenzhen.aliyuncs.com/zh2hant.yml') do |i|
28
+ URI.open(down_load_path) do |i|
24
29
  File.open(yaml_file, 'w+') do |f|
25
30
  f.write(i.read)
26
31
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.24"
5
+ VERSION = "0.1.25"
6
6
  end
7
7
  end
data/lib/lhj/tools.rb CHANGED
@@ -6,6 +6,7 @@ module Lhj
6
6
  require 'lhj/env'
7
7
  require 'lhj/ui/ui'
8
8
  require 'lhj/config'
9
+ require 'lhj/helper/pod_repo_config'
9
10
  require 'lhj/helper/pgyer_helper'
10
11
  require 'lhj/helper/dingtalk_helper'
11
12
  require 'lhj/helper/tb_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.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-12 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -336,6 +336,7 @@ files:
336
336
  - lib/lhj/helper/oss_helper.rb
337
337
  - lib/lhj/helper/pgyer_config.rb
338
338
  - lib/lhj/helper/pgyer_helper.rb
339
+ - lib/lhj/helper/pod_repo_config.rb
339
340
  - lib/lhj/helper/tb_config.rb
340
341
  - lib/lhj/helper/tb_helper.rb
341
342
  - lib/lhj/helper/team_member_config.rb