Skip to content

Commit ac99599

Browse files
committed
Add support for Ruby 4.0
Ruby 4.0 removed some gems from its standard library (e.g. ostruct), used by Rack. This is fixed in newer versions of Rack, but this require a newer version of Sinatra, which is currently restricted in the gemspec. Bump the minimum version of Sinatra so that we have a version of Rack that includ the fix. Provide appropriate fix to the code, and also include rackup and a webserver that used to be bundled with rack but is not anymore in the Gemfile (so that other components can be used by end users to serve riemann-dash). While here, prevent usage of minitest 6.0 which has some breaking changes we do not cope with (yet).
1 parent c75816a commit ac99599

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- "3.1"
2121
- "3.2"
2222
- "3.3"
23+
- "4.0"
2324
fail-fast: false
2425
steps:
2526
- uses: actions/checkout@v2

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ source 'https://rubygems.org'
44

55
gemspec
66

7+
gem 'puma'
8+
gem 'rackup'

lib/riemann/dash/rack/static.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Riemann::Dash::Static
22
def initialize(app, options = {})
33
@app = app
44
@root = options[:root] or raise ArgumentError, "no root"
5-
@file_server = ::Rack::File.new(@root)
5+
@file_server = ::Rack::Files.new(@root)
66
end
77

88
def call(env)

riemann-dash.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Gem::Specification.new do |gem|
1414
gem.platform = Gem::Platform::RUBY
1515

1616
gem.add_runtime_dependency 'erubi', '~> 1.9.0'
17-
gem.add_runtime_dependency 'sinatra', '>= 1.4.5', '< 2.3.0'
17+
gem.add_runtime_dependency 'sinatra', '>= 4.0.0'
1818
gem.add_runtime_dependency 'sass', '>= 3.1.14'
1919
gem.add_runtime_dependency 'webrick'
2020
gem.add_runtime_dependency 'multi_json', '1.3.6'
21-
gem.add_development_dependency 'minitest'
21+
gem.add_development_dependency 'minitest', '< 6.0'
2222
gem.add_development_dependency 'github_changelog_generator'
2323
gem.add_development_dependency 'rake'
2424
gem.files = `git ls-files`.split($/)

0 commit comments

Comments
 (0)