capistrano_multiconfig_parallel 0.26.0 → 0.27.0

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
  SHA1:
3
- metadata.gz: 4c9443f1342e6cef04998b05550359bda1c1865f
4
- data.tar.gz: b8d384ffc6569933a2e281c0b52fd8bc29b06aae
3
+ metadata.gz: c2bedeebfd42524af07a4fa566e3ce392fc5e4cf
4
+ data.tar.gz: 916e61cd649f9190533cc64d886ce9da8930f03f
5
5
  SHA512:
6
- metadata.gz: 10bb19ccb40fd6601ec3dddddc7493fae7e592f4cfa93cbabf13ab4c003da1d285e1e5cf468c89c99c55eba793d51953eed11168e375431481df238ee67e894c
7
- data.tar.gz: dc3877c7d91879f0931c91f3d57f3b1ff59f1e5c1743dd5c58234d65f5424a4820e5b6d8b17ff7d4321928448cd83d85f32611463f7d5902225f6d4d48df022d
6
+ metadata.gz: 4f47bbdfc7f0f447a0443ff7312875e7d1a4147f22bfbdd36239fb0d79b5ba8efbd465b92d08943fc74db69fd07a1c47f92d235b626b6ea1a7108e76263b63d0
7
+ data.tar.gz: 8bd55994be361d87eef6951ec6e77fdc85c798f6c69e30c64aa61e5e7953128b572e03aedb5bde2a6c4ea00592533828123af81191a31d17e6a6cc5b135f32ba
@@ -52,7 +52,7 @@ module CapistranoMulticonfigParallel
52
52
 
53
53
  def start_task
54
54
  log_to_file("exec worker #{@job_id} starts task")
55
- @client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: subscription_channel)
55
+ @client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: subscription_channel, log_file_path: websocket_config.fetch('log_file_path', nil))
56
56
  end
57
57
 
58
58
  def publish_rake_event(data)
@@ -51,7 +51,7 @@ module CapistranoMulticonfigParallel
51
51
 
52
52
  def initialize_subscription
53
53
  return if defined?(@client) && @client.present?
54
- @client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: @subscription_channel)
54
+ @client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: @subscription_channel, log_file_path: websocket_config.fetch('log_file_path', nil))
55
55
  end
56
56
 
57
57
  def task_name
@@ -27,6 +27,13 @@ default_config:
27
27
  default: 'false'
28
28
  required: false
29
29
 
30
+ - name: 'websocket_server.log_file_path'
31
+ type: 'filename'
32
+ description: >-
33
+ Enables the logging of websocket communication into a different file
34
+ default: './log/multi_cap_websocket.log'
35
+ required: false
36
+
30
37
  - name: 'development_stages'
31
38
  type: 'Array'
32
39
  description: >-
@@ -97,6 +97,8 @@ module CapistranoMulticonfigParallel
97
97
  end
98
98
 
99
99
  def websocket_config
100
+ raise websocket_server_config.inspect
101
+ create_log_file(websocket_server_config.fetch('log_file_path', nil)) if debug_websocket?
100
102
  websocket_server_config.merge('enable_debug' => debug_websocket?, 'use_redis' => false)
101
103
  end
102
104
 
@@ -50,7 +50,7 @@ module CapistranoMulticonfigParallel
50
50
 
51
51
  def find_config_type(type)
52
52
  type = type.to_s
53
- ['boolean'].include?(type) ? type.delete(':').to_sym : type.constantize
53
+ ['boolean', 'filename'].include?(type) ? type.delete(':').to_sym : type.constantize
54
54
  end
55
55
 
56
56
  def find_env_multi_cap_root
@@ -118,9 +118,15 @@ module CapistranoMulticonfigParallel
118
118
  ['deploy_multi_stages']
119
119
  end
120
120
 
121
+ def create_log_file(file_path)
122
+ return if file_path.blank?
123
+ directory = File.dirname(file_path)
124
+ FileUtils.mkdir_p(directory) unless File.directory?(directory)
125
+ FileUtils.touch(file_path) unless File.file?(file_path)
126
+ end
127
+
121
128
  def enable_main_log_file
122
- FileUtils.mkdir_p(log_directory) unless File.directory?(log_directory)
123
- FileUtils.touch(main_log_file) unless File.file?(main_log_file)
129
+ create_log_file(main_log_file)
124
130
  log_file = File.open(main_log_file, 'w')
125
131
  log_file.sync = true
126
132
  end
@@ -7,7 +7,7 @@ module CapistranoMulticonfigParallel
7
7
  # module used for generating the version
8
8
  module VERSION
9
9
  MAJOR = 0
10
- MINOR = 26
10
+ MINOR = 27
11
11
  TINY = 0
12
12
  PRE = nil
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_multiconfig_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada