lhj-tools 0.1.53 → 0.1.54

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: b7b3a7e3757035f3306fd09213009b4558445763b02c74c40b86e7016a7088ef
4
- data.tar.gz: 86c4e51a41826d0eca77d839bdb8735471737b94452a2e82688e4ca537162721
3
+ metadata.gz: ba3c81ae4e0b59daafc45266b2b3fea814b1a15547eb0501b3e2bba19b167240
4
+ data.tar.gz: 5c818f2bffe07c9e3f5ef50544f82ecc4303f2b020099ba0064cf93f12575723
5
5
  SHA512:
6
- metadata.gz: 21efdee7795596ff21d051a36ed81d4a4828482ec35639832c08524eca2e9ca39b66d96b78f10c32b012ae4509744df493deecc01b823c3e1396f1806c03d572
7
- data.tar.gz: a2a0d03aeb156b1a7bc4d12a4590dd45b8e595bb3fe5a8d17681b109140a2a7e34b9bd28aa1dea065e76951b01953a2f4753f842e8aa0974c6034db6b9b55c56
6
+ metadata.gz: a87a98b3150d9763a7e41f153a3af6ef8291e7ae1074c8c12fd6f51fafc4ed36557605bb484d13d2b3ae5e9a58b0ffac69b95af951f15023bc1a90e06ddd78a5
7
+ data.tar.gz: 20d3838363aa11ce08db7e18f5ff5efb24abcb627e2b3ab1b8c15c72bbf0d0555eda8d8a8742ddd892fda9ecbef387904480616173faccc011d57808bfe05ef5
@@ -0,0 +1,66 @@
1
+ require_relative 'log_helper'
2
+ require_relative 'pgyer_shortcut_helper'
3
+
4
+ module Lhj
5
+ # version info
6
+ class AppVersionInfo
7
+ # @param [Symbol] env
8
+ def initialize(env, build_number, work_path)
9
+ @env = env
10
+ @build_number = build_number
11
+ @work_path = work_path
12
+ end
13
+
14
+ # build_app_version (build_app_version_no) (build: build_version)
15
+ def build_info
16
+ "#{build_app_version} (#{build_app_version_no}) (build: #{build_version})"
17
+ end
18
+
19
+ def build_app_version
20
+ # app version '1.0.0'
21
+ vers = []
22
+ Dir.glob("#{@work_path}/*.xcodeproj/*.pbxproj").each do |file|
23
+ File.readlines(file).each do |l|
24
+ if /MARKETING_VERSION.*(\d+\.\d+\.\d+)/ =~ l
25
+ ma = l.match(/(\d+\.\d+\.\d+)/)
26
+ vers << ma[0]
27
+ end
28
+ end
29
+ end
30
+ vers[0]
31
+ end
32
+
33
+ def build_app_version_no
34
+ # xcode build version
35
+ # ${BUILD_NUMBER} of jenkins
36
+ @build_number || '1'
37
+ end
38
+
39
+ def build_version
40
+ # pu gong ying build number
41
+ client = Lhj::PgyerShortcut.new(@env)
42
+ version = 0
43
+ version = client.build_version.to_i if client.build_version
44
+ version += 1
45
+ version.to_s
46
+ end
47
+
48
+ def build_updated
49
+ time = Time.now
50
+ time.strftime('%Y-%m-%d %H:%M:%S')
51
+ end
52
+
53
+ def branch_name
54
+ Dir.chdir(@work_path) do
55
+ Lhj::LogHelper.instance.current_branch(@work_path)
56
+ end
57
+ end
58
+
59
+ def update_log
60
+ Dir.chdir(@work_path) do
61
+ Lhj::Actions.git_log_last_commits(' %an %ar - %s;', 3, :exclude_merges, 'short', false)
62
+ end
63
+ end
64
+
65
+ end
66
+ end
@@ -64,11 +64,11 @@ module Lhj
64
64
  @result = response.body
65
65
  puts @result
66
66
  puts 'upload success'
67
- # if @result['data'] && @result['data']['appUpdateDescription'] && @env == :uat
68
- # str = Lhj::TbHelper.trans_tb(@result['data']['appUpdateDescription'])
69
- # str = Lhj::VikaHelper.trans_vika(str)
70
- # @result['data']['appUpdateDescription'] = str
71
- # end
67
+ if @result['data'] && @result['data']['appUpdateDescription'] && @env == :uat
68
+ str = Lhj::TbHelper.trans_tb(@result['data']['appUpdateDescription'])
69
+ str = Lhj::VikaHelper.trans_vika(str)
70
+ @result['data']['appUpdateDescription'] = str
71
+ end
72
72
  rescue Faraday::TimeoutError
73
73
  puts 'upload fail'
74
74
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.53"
5
+ VERSION = "0.1.54"
6
6
  end
7
7
  end
data/lib/lhj/tools.rb CHANGED
@@ -21,6 +21,7 @@ module Lhj
21
21
  require 'lhj/helper/git_helper'
22
22
  require 'lhj/helper/log_helper'
23
23
  require 'lhj/helper/vika_helper'
24
+ require 'lhj/helper/app_version_info'
24
25
 
25
26
  class Error < StandardError; end
26
27
 
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.53
4
+ version: 0.1.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-11 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -335,6 +335,7 @@ files:
335
335
  - lib/lhj/command/yapi/formatters/template/yapi.erb
336
336
  - lib/lhj/config.rb
337
337
  - lib/lhj/env.rb
338
+ - lib/lhj/helper/app_version_info.rb
338
339
  - lib/lhj/helper/dingtalk_config.rb
339
340
  - lib/lhj/helper/dingtalk_helper.rb
340
341
  - lib/lhj/helper/git_branch_feature_config.rb