Skip to content

Commit

Permalink
Fix compatibility with rack 3
Browse files Browse the repository at this point in the history
  • Loading branch information
timcraft committed Jan 11, 2024
1 parent a8c6712 commit ff9df6b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
strategy:
matrix:
ruby: [ '3.0', '3.1', '3.2', '3.3', jruby, truffleruby ]
rack: [ '2', '3' ]

env:
RACK_VERSION: ${{ matrix.rack }}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ gem 'rspec-core', '~> 3'
gem 'rspec-expectations', '~> 3'
gem 'i18n', '>= 0.9'
gem 'mime-types'
gem 'rack', '~> 2'
gem 'rack', "~> #{ENV['RACK_VERSION'] || '3'}"
4 changes: 3 additions & 1 deletion lib/formeze.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ def env_table
end

def stdinput
@options[:request].body
@options[:request].body.tap do |body|
body.rewind if body.respond_to?(:rewind)
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/formeze_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def multipart_request(body)
input: body
})

Rack::Request.new(env)
Rack::Request.new(env).tap(&:params)
end

context 'after parsing multipart input' do
Expand Down

0 comments on commit ff9df6b

Please sign in to comment.