yk_command 0.5.3 → 0.5.4

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: a8d1eb70f1aeb80490615d2daf6d23297c3789629d7889d060466cb6c61c4d2a
4
- data.tar.gz: bb5331d9981c1b1f9bcbe2b4b634abfdc07589e92bc3323ec5aa6870c9a74e2a
3
+ metadata.gz: b14860e741967bf1e1962b731b5e6410041dcd2f0a7b306e36b617ae08fdac11
4
+ data.tar.gz: 22c4cff5793fe6f6e4c20e25203f92e463a986feaf7a6a5d54542e3199e8bc02
5
5
  SHA512:
6
- metadata.gz: bb985042e783621b1cf095559757cda4fc26c669f16862889f897dd31bba59fc400bcaae63db84bbddfb3442d0d9cc54677176515a8e1aeb624482250556d6f5
7
- data.tar.gz: 13d82d18acf28d6b07431850a05d6fe8f66c7317757a28900a8b01aa5d4fff3643dfaa386840ab3b5c6ff7dd4b0d1532ba0c09c8a5769a97649eeb2b7f3ad120
6
+ metadata.gz: 2d3cf9617030efc50565b6b468997b5812ae6b5701abb92c3094452fab63e0d39fff69faed885b502559c81dea16e69c0747ab017f5ec1d4ff5d579ffdd9cd7f
7
+ data.tar.gz: 02eb89e280b18fdf83f6acde3abc29108a5ee50e712e27bd6467e6c4a98b97d0582fbde87e082305772dff5cef9b137e295fa273b514cae81dc3b87238a64048
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yk_command (0.5.3)
4
+ yk_command (0.5.4)
5
5
  bundler
6
6
  cocoapods
7
7
  cocoapods-core
@@ -24,8 +24,12 @@ module YkCommand
24
24
 
25
25
 
26
26
  def initialize(path)
27
- config = YkConfig.new.read_config path,SERVER_ENV_CONFIG_FILE
28
- @app_server_api = Request.new(config)
27
+ @config = YkConfig.new path
28
+
29
+ server_config = @config.read_config SERVER_ENV_CONFIG_FILE
30
+ @app_server_api = Request.new(server_config)
31
+ @bot_config = @config.read_config BOT_CONFIG_FILE
32
+
29
33
  end
30
34
 
31
35
  def dependency(path = nil)
@@ -125,12 +129,8 @@ module YkCommand
125
129
 
126
130
  def bot_message(path,success_name_list,failed_name_list)
127
131
 
128
- # bot_config_file_path = "#{path}/#{BOT_CONFIG_FILE}"
129
- # bot_config = File.exist?(bot_config_file_path) ? YAML.load_file(bot_config_file_path) : nil
130
-
131
- bot_config = YkConfig.new.read_config path , BOT_CONFIG_FILE
132
- if bot_config
133
- bot = WxBot.new(bot_config)
132
+ if @bot_config
133
+ bot = WxBot.new(@bot_config)
134
134
  bot.send_result_to_group(success_name_list,failed_name_list)
135
135
  bot.send_news_to_group
136
136
  end
@@ -13,8 +13,9 @@ module YkCommand
13
13
  no_commands do
14
14
  def initialize
15
15
  path = __dir__
16
- @gitlab_srvice =YkGitlab.new(YkConfig.new.read_config path,GITLAB_CONFIG_FILE)
17
- @api_service = Request.new(YkConfig.new.read_config path,SERVER_ENV_CONFIG_FILE)
16
+ config = YkConfig.new path
17
+ @gitlab_srvice =YkGitlab.new(config.read_config GITLAB_CONFIG_FILE)
18
+ @api_service = Request.new(config.read_config SERVER_ENV_CONFIG_FILE)
18
19
  end
19
20
 
20
21
  def update_app_data
@@ -7,16 +7,18 @@ module YkCommand
7
7
 
8
8
  include Thor::Actions
9
9
  no_commands do
10
- def read_config(at_path,file_name)
10
+
11
+ def initialize(config_path)
12
+ @at_path = config_path
11
13
  hostA = 'yeah'
12
14
  hostB = 'ka'
13
15
  config_repo_url = "http://gitlab.#{hostA}#{hostB}.com/App/iOS/YKComponents/com-manage-platform-resources/configruation-files.git"
14
- system("git clone #{config_repo_url} #{at_path+'/configruation-files'}")
15
-
16
- config_file_path = "#{at_path}/#{file_name}"
17
- FileUtils.copy_file "#{at_path+'/configruation-files/'+file_name}", config_file_path
18
- FileUtils.remove_dir("#{at_path+'/configruation-files'}", true)
16
+ system("git clone #{config_repo_url} #{@at_path+'/configruation-files'}")
17
+ FileUtils.remove_dir("#{@at_path+'/configruation-files/.git'}", true)
18
+ end
19
19
 
20
+ def read_config(file_name)
21
+ config_file_path = "#{@at_path+'/configruation-files/'+file_name}"
20
22
  File.exist?(config_file_path) ? YAML.load_file(config_file_path) : {}
21
23
  end
22
24
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YkCommand
4
- VERSION = '0.5.3'.freeze
4
+ VERSION = '0.5.4'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yk_command
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Major Tom