fluent-plugin-google-cloud 0.12.10 → 0.12.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,13 +19,13 @@ require 'erb'
19
19
  module Statusz
20
20
  module_function
21
21
 
22
- # Note: The plugin parameter is referenced in STATUSZ_TMPL.
22
+ # NOTE: The plugin parameter is referenced in STATUSZ_TMPL.
23
23
  def response(plugin)
24
24
  uptime = Time.now - SERVER_START
25
- uptime_str = format('%d hr %02d min %02d sec',
26
- uptime / 3600,
27
- (uptime / 60) % 60,
28
- uptime % 60)
25
+ uptime_str = format('%<hours>d hr %<minutes>02d min %<seconds>02d sec',
26
+ hours: uptime / 3600,
27
+ minutes: (uptime / 60) % 60,
28
+ seconds: uptime % 60)
29
29
  ERB.new(STATUSZ_TMPL).result(binding)
30
30
  end
31
31
  end
@@ -34,7 +34,7 @@ SERVER_START = Time.now
34
34
 
35
35
  # Does not include the following deprecated config params:
36
36
  # auth_method, private_key_email, private_key_passphrase, private_key_path
37
- CONFIG_KEYS = %w(
37
+ CONFIG_KEYS = %w[
38
38
  adjust_invalid_timestamps
39
39
  autoformat_stackdriver_trace
40
40
  coerce_to_utf8
@@ -68,9 +68,8 @@ CONFIG_KEYS = %w(
68
68
  vm_id
69
69
  vm_name
70
70
  zone
71
- ).freeze
71
+ ].freeze
72
72
 
73
- # rubocop:disable LineLength
74
73
  STATUSZ_TMPL = %(\
75
74
  <!DOCTYPE html>
76
75
  <html>
@@ -121,4 +120,3 @@ STATUSZ_TMPL = %(\
121
120
  </body>
122
121
  </html>
123
122
  ).freeze
124
- # rubocop:enable LineLength
data/test/helper.rb CHANGED
@@ -17,8 +17,10 @@ require 'bundler'
17
17
  begin
18
18
  Bundler.setup(:default, :development)
19
19
  rescue Bundler::BundlerError => e
20
+ # rubocop:disable Style/StderrPuts
20
21
  $stderr.puts e.message
21
22
  $stderr.puts 'Run `bundle install` to install missing gems'
23
+ # rubocop:enable Style/StderrPuts
22
24
  exit e.status_code
23
25
  end
24
26
  require 'test/unit'
@@ -29,6 +31,10 @@ require 'fluent/test'
29
31
  unless ENV.key?('VERBOSE')
30
32
  nulllogger = Object.new
31
33
  nulllogger.instance_eval do |_|
34
+ def respond_to_missing?(_method, _include_private = false)
35
+ true
36
+ end
37
+
32
38
  def method_missing(_method, *_args)
33
39
  # pass
34
40
  end