fluent-plugin-google-cloud 0.12.10 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,14 +19,16 @@ require 'erb'
19
19
  module Statusz
20
20
  module_function
21
21
 
22
- # Note: The plugin parameter is referenced in STATUSZ_TMPL.
23
22
  def response(plugin)
24
23
  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)
29
- ERB.new(STATUSZ_TMPL).result(binding)
24
+ uptime_str = format('%<hours>d hr %<minutes>02d min %<seconds>02d sec',
25
+ hours: uptime / 3600,
26
+ minutes: (uptime / 60) % 60,
27
+ seconds: uptime % 60)
28
+ ERB.new(STATUSZ_TMPL).result_with_hash(
29
+ plugin: plugin,
30
+ uptime_str: uptime_str
31
+ )
30
32
  end
31
33
  end
32
34
 
@@ -34,7 +36,7 @@ SERVER_START = Time.now
34
36
 
35
37
  # Does not include the following deprecated config params:
36
38
  # auth_method, private_key_email, private_key_passphrase, private_key_path
37
- CONFIG_KEYS = %w(
39
+ CONFIG_KEYS = %w[
38
40
  adjust_invalid_timestamps
39
41
  autoformat_stackdriver_trace
40
42
  coerce_to_utf8
@@ -68,9 +70,8 @@ CONFIG_KEYS = %w(
68
70
  vm_id
69
71
  vm_name
70
72
  zone
71
- ).freeze
73
+ ].freeze
72
74
 
73
- # rubocop:disable LineLength
74
75
  STATUSZ_TMPL = %(\
75
76
  <!DOCTYPE html>
76
77
  <html>
@@ -121,4 +122,3 @@ STATUSZ_TMPL = %(\
121
122
  </body>
122
123
  </html>
123
124
  ).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