Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.

Commit c9ff867

Browse files
committed
Fix rubocop lint errors
1 parent 5d4fe1a commit c9ff867

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

.rubocop.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AllCops:
22
Exclude:
3-
- lib/prometheus/api_client/version.rb
3+
- lib/prometheus/alert_buffer_client/version.rb
44

55
AlignHash:
66
EnforcedHashRocketStyle: table
@@ -22,6 +22,7 @@ Metrics/BlockLength:
2222
- 'spec/**/*.rb'
2323

2424
Metrics/LineLength:
25+
Max: 120
2526
Exclude:
2627
- 'spec/**/*.rb'
2728

examples/post_alerts.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55

66
prometheus.post '{"posted":"alert"}'
77
prometheus.post '{"alertId":12}'
8-

lib/prometheus/alert_buffer_client.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
require 'prometheus/alert_buffer_client/client'
66

77
module Prometheus
8-
98
# Alert Client is a ruby implementation for a Prometheus-alert-buffer client.
109
module AlertBufferClient
11-
1210
def self.client(options = {})
1311
Client.new(options)
1412
end
15-
1613
end
1714
end

lib/prometheus/alert_buffer_client/client.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class RequestError < StandardError; end
2121
},
2222
}.freeze
2323

24-
2524
# Create a Prometheus Alert client:
2625
#
2726
# @param [Hash] options
@@ -40,13 +39,12 @@ def initialize(options = {})
4039

4140
@client = Faraday.new(
4241
faraday_options(options),
43-
) do |conn|
42+
) do |conn|
4443
conn.response(:json)
4544
conn.adapter(Faraday.default_adapter)
4645
end
4746
end
4847

49-
5048
# Get alerts:
5149
#
5250
# @param [Hash] options
@@ -101,7 +99,7 @@ def faraday_headers(options)
10199
return unless headers && headers[:token]
102100

103101
{
104-
Authorization: "Bearer #{headers[:token].to_s}",
102+
Authorization: "Bearer #{headers[:token]}",
105103
}
106104
end
107105

@@ -128,7 +126,6 @@ def faraday_options(options)
128126
request: faraday_request(options),
129127
}
130128
end
131-
132129
end
133130
end
134131
end

0 commit comments

Comments
 (0)