Skip to content

Commit 173b6e1

Browse files
authored
Merge pull request #301 from riemann/ruby-3.4
Fix support of Ruby 3.4
2 parents 00c0e6b + 3c6160b commit 173b6e1

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- '3.1'
3434
- '3.2'
3535
- '3.3'
36+
- '3.4'
3637
steps:
3738
- uses: actions/checkout@v4
3839
- name: Setup Ruby

lib/riemann/tools/bench.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# frozen_string_literal: true
22

3-
require 'rubygems'
4-
require 'riemann/client'
3+
require 'riemann/tools'
4+
require 'riemann/tools/version'
55

66
# Connects to a server (first arg) and populates it with a constant stream of
77
# events for testing.
88
module Riemann
99
module Tools
1010
class Bench
11-
attr_accessor :client, :hosts, :services, :states
11+
include Riemann::Tools
12+
attr_accessor :hosts, :services, :states
1213

1314
def initialize
1415
super
@@ -17,7 +18,6 @@ def initialize
1718
@hosts = %w[a b c d e f g h i j]
1819
@services = %w[test1 test2 test3 foo bar baz xyzzy attack cat treat]
1920
@states = {}
20-
@client = Riemann::Client.new(host: ARGV.first || 'localhost')
2121
end
2222

2323
def evolve(state)
@@ -45,7 +45,7 @@ def evolve(state)
4545
def tick
4646
# pp @states
4747
hosts.product(services).each do |id|
48-
client << (states[id] = evolve(states[id]))
48+
report(states[id] = evolve(states[id]))
4949
end
5050
end
5151

lib/riemann/tools/tls_check.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def mysql_tls_socket(uri, address)
478478
capabilities = initial_handshake_packet[5] | (initial_handshake_packet[8] << 16)
479479

480480
ssl_flag = 1 << 11
481-
raise 'No TLS support' if (capabilities & ssl_flag).zero?
481+
raise 'No TLS support' if capabilities.nobits?(ssl_flag)
482482

483483
socket.write(['2000000185ae7f0000000001210000000000000000000000000000000000000000000000'].pack('H*'))
484484
tls_handshake(socket, uri.host)

riemann-tools.gemspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Gem::Specification.new do |spec|
3838
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
3939
spec.require_paths = ['lib']
4040

41-
spec.add_runtime_dependency 'json', '>= 1.8'
42-
spec.add_runtime_dependency 'optimist', '~> 3.0', '>= 3.0.0'
43-
spec.add_runtime_dependency 'riemann-client', '~> 1.1'
41+
spec.add_dependency 'csv', '~> 3.0'
42+
spec.add_dependency 'json', '>= 1.8'
43+
spec.add_dependency 'optimist', '~> 3.0', '>= 3.0.0'
44+
spec.add_dependency 'riemann-client', '~> 1.1'
4445
end

spec/riemann/tools/http_check_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
require 'riemann/tools/http_check'
1818

1919
class TestWebserver < Sinatra::Base
20+
set :host_authorization, { permitted_hosts: [] }
21+
2022
def authorized?
2123
@auth ||= Rack::Auth::Basic::Request.new(request.env)
2224
@auth.provided? && @auth.basic? && @auth.credentials && @auth.credentials == %w[admin secret]

0 commit comments

Comments
 (0)