lhj-tools 0.1.28 → 0.1.29
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/git_branch_feature_config.rb +23 -0
- data/lib/lhj/helper/log_helper.rb +7 -1
- data/lib/lhj/helper/vika_helper.rb +10 -4
- 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: e3afdfb3713841a23a3cd431741fa3a2add9acefdec7c7adeda320eead551100
|
4
|
+
data.tar.gz: 56366dee80c13449fef8ca7d06958950796cf580decc9344b2e8504dd8c30c73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7a81af5dd316ea322f40edd1b6c40baf8fea27a397383e392ced1ac2d95325c23c66504a83313ff1998ada24d08b85bcb900e080ae7c956e3ab1c6a1e4af07d
|
7
|
+
data.tar.gz: 67ef0b91969fd2d517d0f8ee319e681e61d0da8239d7dc2e6b93a95e39f3914b030a69b455eed66838dc53681e6c8ede3426653c298664c49ff94bd660a82f79
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'yaml'
|
3
|
+
require 'lhj/config'
|
4
|
+
|
5
|
+
module Lhj
|
6
|
+
# Git BranchFeature Config
|
7
|
+
class GitBranchFeatureConfig
|
8
|
+
|
9
|
+
CONFIG_NAME = 'git_branch_feature.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.feature(branch)
|
20
|
+
config[branch] if config
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'lhj/helper/team_member_config'
|
2
|
+
require 'lhj/helper/git_branch_feature_config'
|
2
3
|
|
3
4
|
module Lhj
|
4
5
|
# log helper
|
5
6
|
class LogHelper
|
6
|
-
attr_reader :branch, :env, :log
|
7
|
+
attr_reader :branch, :env, :log, :feature
|
7
8
|
|
8
9
|
def self.instance
|
9
10
|
@instance ||= new
|
@@ -13,6 +14,7 @@ module Lhj
|
|
13
14
|
@branch = fetch_branch
|
14
15
|
@env = fetch_env(env)
|
15
16
|
@log = fetch_log
|
17
|
+
@feature = fetch_feature
|
16
18
|
save_last_commit_hash
|
17
19
|
render_template
|
18
20
|
end
|
@@ -22,6 +24,10 @@ module Lhj
|
|
22
24
|
name.split('/').last
|
23
25
|
end
|
24
26
|
|
27
|
+
def fetch_feature
|
28
|
+
Lhj::GitBranchFeatureConfig.feature(@branch)
|
29
|
+
end
|
30
|
+
|
25
31
|
def fetch_env(env)
|
26
32
|
case env
|
27
33
|
when :release
|
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'lhj/helper/vika_config'
|
2
2
|
require 'json'
|
3
|
+
require 'lhj/config'
|
3
4
|
|
4
5
|
module Lhj
|
5
6
|
# pgyer upload
|
6
7
|
class VikaHelper
|
7
8
|
|
8
|
-
RECORDS_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstmDXBooTe1Wj0QqE/
|
9
|
+
RECORDS_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstmDXBooTe1Wj0QqE/views'.freeze
|
9
10
|
|
10
|
-
def self.
|
11
|
-
url = URI(
|
11
|
+
def self.records
|
12
|
+
url = URI(RECORDS_API_URL)
|
12
13
|
|
13
14
|
https = Net::HTTP.new(url.host, url.port)
|
14
15
|
https.use_ssl = true
|
@@ -17,7 +18,12 @@ module Lhj
|
|
17
18
|
request["Authorization"] = "Bearer usk3cvEicoXG84y32J61BRg"
|
18
19
|
|
19
20
|
response = https.request(request)
|
20
|
-
|
21
|
+
File.write(File.join(Lhj::Config.instance.home_dir, 'vika_all_records.json'), JSON.parse(response.read_body))
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.all_records
|
25
|
+
map = {'v6.2.0' => '月底发版分支'}
|
26
|
+
puts map.to_yaml
|
21
27
|
end
|
22
28
|
end
|
23
29
|
end
|
data/lib/lhj/tools/version.rb
CHANGED
data/lib/lhj/tools.rb
CHANGED
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.29
|
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-
|
11
|
+
date: 2022-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -331,6 +331,7 @@ files:
|
|
331
331
|
- lib/lhj/env.rb
|
332
332
|
- lib/lhj/helper/dingtalk_config.rb
|
333
333
|
- lib/lhj/helper/dingtalk_helper.rb
|
334
|
+
- lib/lhj/helper/git_branch_feature_config.rb
|
334
335
|
- lib/lhj/helper/git_helper.rb
|
335
336
|
- lib/lhj/helper/local_config.rb
|
336
337
|
- lib/lhj/helper/log_helper.rb
|