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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1205a5bdd1c7e5e4db52b49b2c60f57e62334a4630572b4f9c76258ce01aaaa
4
- data.tar.gz: b6750102f1b8989b9316d5bd94e7a93345e999bf9b0c2f414a8c2c0a1a6351b0
3
+ metadata.gz: e3afdfb3713841a23a3cd431741fa3a2add9acefdec7c7adeda320eead551100
4
+ data.tar.gz: 56366dee80c13449fef8ca7d06958950796cf580decc9344b2e8504dd8c30c73
5
5
  SHA512:
6
- metadata.gz: dc99f9def782efb532b5d5e387b4a982ca59bb4e649f2edb45ac029614252a1994bbe1082ffb32ef6077a404bf711475ef3bdcb8f721d695e1cf44cb9391b035
7
- data.tar.gz: aea91cd4ad9d94d570c2f888d6450c5e984e10457379a42910db3c64493e686d4f6ecf6737bd7b12a3957516f478f4992b9fa7414c70db20fe130bf1f138e343
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/records?viewId=viwqN84ID6mJb&fieldKey=id'.freeze
9
+ RECORDS_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstmDXBooTe1Wj0QqE/views'.freeze
9
10
 
10
- def self.all_records
11
- url = URI("https://api.vika.cn/fusion/v1/datasheets/dstmDXBooTe1Wj0QqE/records?viewId=viwqN84ID6mJb&fieldKey=id")
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
- puts response.read_body
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.28"
5
+ VERSION = "0.1.29"
6
6
  end
7
7
  end
data/lib/lhj/tools.rb CHANGED
@@ -12,6 +12,7 @@ module Lhj
12
12
  require 'lhj/ui/ui'
13
13
  require 'lhj/config'
14
14
  require 'lhj/helper/pod_repo_config'
15
+ require 'lhj/helper/git_branch_feature_config'
15
16
  require 'lhj/helper/pgyer_helper'
16
17
  require 'lhj/helper/dingtalk_helper'
17
18
  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.28
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-13 00:00:00.000000000 Z
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