yk_command 0.5.3 → 0.5.6

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: a8d1eb70f1aeb80490615d2daf6d23297c3789629d7889d060466cb6c61c4d2a
4
- data.tar.gz: bb5331d9981c1b1f9bcbe2b4b634abfdc07589e92bc3323ec5aa6870c9a74e2a
3
+ metadata.gz: 70d1d7a508e7e09d31ac986c323ad6f310d57ae896f8127c032c69c2b706abb5
4
+ data.tar.gz: 84ab9862a0869edf6651d08a532ac1605695e45e39c55fa016c1c3299618f1a9
5
5
  SHA512:
6
- metadata.gz: bb985042e783621b1cf095559757cda4fc26c669f16862889f897dd31bba59fc400bcaae63db84bbddfb3442d0d9cc54677176515a8e1aeb624482250556d6f5
7
- data.tar.gz: 13d82d18acf28d6b07431850a05d6fe8f66c7317757a28900a8b01aa5d4fff3643dfaa386840ab3b5c6ff7dd4b0d1532ba0c09c8a5769a97649eeb2b7f3ad120
6
+ metadata.gz: a166e1914e2c2ce43dbcb69d5c79095cd54074c5ca1e196c0668ec0c5f6c840ebfbc7efa4010d6ba165588c7f5392230a4a9f5dca03dded5c501477d20aaede2
7
+ data.tar.gz: 26bfdaf1ac131b2384721e3bac97638a37d20e52ee6849b0f358ba82dfb7f6f3f26168e3ab1a07dbf51bac3c082370217b5e13ba7c5b1fd17017a3773ad7cf51
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.6)
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,20 @@ 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
+
13
+ @at_path = config_path
14
+ FileUtils.remove_dir("#{@at_path+'/configruation-files'}", true)
11
15
  hostA = 'yeah'
12
16
  hostB = 'ka'
13
17
  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)
18
+ system("git clone #{config_repo_url} #{@at_path+'/configruation-files'}")
19
+ FileUtils.remove_dir("#{@at_path+'/configruation-files/.git'}", true)
20
+ end
19
21
 
22
+ def read_config(file_name)
23
+ config_file_path = "#{@at_path+'/configruation-files/'+file_name}"
20
24
  File.exist?(config_file_path) ? YAML.load_file(config_file_path) : {}
21
25
  end
22
26
  end
@@ -29,7 +29,7 @@ module YkCommand
29
29
 
30
30
  FileUtils.copy_entry "#{current_class_path.to_s + '/YKProjectTemplate'}", "#{current_class_path.to_s + '/temp'}"
31
31
 
32
- prepare_template(YkConfig.new.read_config at_path,PROJECT_CONFIG_FILE)
32
+ prepare_template(YkConfig.new(at_path).read_config PROJECT_CONFIG_FILE)
33
33
 
34
34
  Pod::TemplateConfigurator.new(pod_name, framework, prefix, author, "#{current_class_path.to_s + '/temp'}").run
35
35
  #move temp folder to destination
@@ -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.6'.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.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Major Tom