capistrano_sentinel 0.0.8 → 0.0.9

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: ffc62cfd3cdec15cda790fc77c083bfece90a09b
4
- data.tar.gz: b945394ca3009dbb7994d5e60e504c442d1bc893
3
+ metadata.gz: cb4ca0ce5ab4b0150d14a46992263d9c53da5614
4
+ data.tar.gz: 6ea5e82079b69f1edb4064fd02cd5ce02c14ce61
5
5
  SHA512:
6
- metadata.gz: 79493dd401dfd62987ca5f02e8c67e03b7347f673f756bf300890b4c2350f2dea13d1eeedc4f6d2d9dda0563381b96c9c8fa445c80c7a0a21935bea3a8bd7f6e
7
- data.tar.gz: cd7acde38ad0f194c3efc35d542ea7bea48cbe839d2ef040b5471c7ba45b0c3212633aeceb4f22361ee8dda839605846b03bb2627766fb28c11660338e0f206d
6
+ metadata.gz: 406203038d54b2c42b02a01c74bce08b58add529a24258b01292bf172d79b64206289df08f362af6f63212b93c37a2c927f8c5c3217766a40a85333600c43426
7
+ data.tar.gz: d6e17b230487451d05de6c48ca8ea26d4ba7e38c929eece3b23bcd27e84363698e3521bb1dc5625c533447ddefb8098f7aec4b94af22af950921c49643641269
@@ -104,7 +104,6 @@ module CapistranoSentinel
104
104
  return if !message_is_about_a_task?(message)
105
105
  log_to_file("RakeWorker #{@job_id} #{task_name} task_approval : #{message.inspect}")
106
106
  if @job_id.to_s == message['job_id'].to_s && message['task'].to_s == task_name.to_s && message['approved'] == 'yes'
107
- show_warning "#{self.inspect} got #{message} and approved"
108
107
  @task_approved = true
109
108
  else
110
109
  show_warning "#{self.inspect} got unknown task_approval #{message} #{task_data}"
@@ -16,10 +16,6 @@ module CapistranoSentinel
16
16
  nil
17
17
  end
18
18
 
19
- def show_warning(message)
20
- warn message
21
- end
22
-
23
19
 
24
20
  def msg_for_stdin?(message)
25
21
  message['action'] == 'stdin'
@@ -3,6 +3,10 @@ module CapistranoSentinel
3
3
  module Logging
4
4
  module_function
5
5
 
6
+ def logging_enabled?
7
+ ENV["WEBSOCKET_LOGGING"].to_s == 'true'
8
+ end
9
+
6
10
  def logger
7
11
  @logger ||= ::Logger.new(ENV["LOG_FILE"] || '/dev/null')
8
12
  end
@@ -20,7 +24,6 @@ module CapistranoSentinel
20
24
  def log_output_error(error, output, message)
21
25
  return if message.blank? || error_filtered?(error)
22
26
  puts message if output.present?
23
- terminal_actor.errors.push(message) if terminal_errors?
24
27
  end
25
28
 
26
29
  def format_error(exception)
@@ -31,6 +34,7 @@ module CapistranoSentinel
31
34
  end
32
35
 
33
36
  def log_to_file(message, options = {})
37
+ return unless logging_enabled?
34
38
  worker_log = options.fetch(:job_id, '').present? ? find_worker_log(options[:job_id]) : logger
35
39
  print_to_log_file(worker_log, options.merge(message: message)) if worker_log.present?
36
40
  end
@@ -73,7 +77,9 @@ module CapistranoSentinel
73
77
  exit(1)
74
78
  end
75
79
 
80
+ def show_warning(message)
81
+ warn message
82
+ end
76
83
 
77
-
78
- end
84
+ end
79
85
  end
@@ -17,7 +17,7 @@ module CapistranoSentinel
17
17
  # minor release version
18
18
  MINOR = 0
19
19
  # tiny release version
20
- TINY = 8
20
+ TINY = 9
21
21
  # prelease version ( set this only if it is a prelease)
22
22
  PRE = nil
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_sentinel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada