Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ruby 3.4 to CI #2518

Merged
merged 3 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.4
bundler-cache: true
- name: Run Danger
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', ruby-head, truffleruby-head, jruby-head]
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', ruby-head, truffleruby-head, jruby-head]
gemfile: [rails_edge, rack_edge]
exclude:
- ruby: '2.7'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
bundler-cache: true
rubygems: latest

Expand All @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
gemfile: [Gemfile, gemfiles/rack_2_0.gemfile, gemfiles/rack_3_0.gemfile, gemfiles/rack_3_1.gemfile, gemfiles/rails_6_1.gemfile, gemfiles/rails_7_0.gemfile, gemfiles/rails_7_1.gemfile, gemfiles/rails_7_2.gemfile, gemfiles/rails_8_0.gemfile]
specs: ['spec --exclude-pattern=spec/integration/**/*_spec.rb']
include:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [#2513](https://github.com/ruby-grape/grape/pull/2513): Optimize Grape::Path - [@ericproulx](https://github.com/ericproulx).
* [#2514](https://github.com/ruby-grape/grape/pull/2514): Add rails 8.0 to CI - [@ericproulx](https://github.com/ericproulx).
* [#2516](https://github.com/ruby-grape/grape/pull/2516): Dynamic registration for parsers, formatters, versioners - [@ericproulx](https://github.com/ericproulx).
* [#2518](https://github.com/ruby-grape/grape/pull/2518): Add ruby 3.4 to CI - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

#### Fixes
Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

eval_gemfile '../Gemfile'

gem 'mutex_m'
gem 'rails', '~> 6.1'
gem 'tzinfo-data', require: false
1 change: 1 addition & 0 deletions gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

eval_gemfile '../Gemfile'

gem 'mutex_m'
gem 'rails', '~> 7.0.0'
gem 'tzinfo-data', require: false
5 changes: 3 additions & 2 deletions spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2970,9 +2970,10 @@ def self.call(object, _env)
subject.put :yaml do
params[:tag]
end
put '/yaml', '<tag type="symbol">a123</tag>', 'CONTENT_TYPE' => 'application/xml'
body = '<tag type="symbol">a123</tag>'
put '/yaml', body, 'CONTENT_TYPE' => 'application/xml'
expect(last_response).to be_successful
expect(last_response.body).to eql '{"type"=>"symbol", "__content__"=>"a123"}'
expect(last_response.body).to eq(Grape::Xml.parse(body)['tag'].to_s)
end
end
end
Expand Down
13 changes: 8 additions & 5 deletions spec/grape/endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,16 @@ def app
expect(last_response.body).to eq('Bobby T.')
end
else
let(:body) { '<user>Bobby T.</user>' }

it 'converts XML bodies to params' do
post '/request_body', '<user>Bobby T.</user>', 'CONTENT_TYPE' => 'application/xml'
expect(last_response.body).to eq('{"__content__"=>"Bobby T."}')
post '/request_body', body, 'CONTENT_TYPE' => 'application/xml'
expect(last_response.body).to eq(Grape::Xml.parse(body)['user'].to_s)
end

it 'converts XML bodies to params' do
put '/request_body', '<user>Bobby T.</user>', 'CONTENT_TYPE' => 'application/xml'
expect(last_response.body).to eq('{"__content__"=>"Bobby T."}')
put '/request_body', body, 'CONTENT_TYPE' => 'application/xml'
expect(last_response.body).to eq(Grape::Xml.parse(body)['user'].to_s)
end
end

Expand Down Expand Up @@ -685,7 +687,8 @@ def app
if Gem::Version.new(RUBY_VERSION).release <= Gem::Version.new('3.2')
%r{undefined local variable or method `undefined_helper' for #<Class:0x[0-9a-fA-F]+> in '/hey' endpoint}
else
/undefined local variable or method `undefined_helper' for/
opening_quote = Gem::Version.new(RUBY_VERSION).release >= Gem::Version.new('3.4') ? "'" : '`'
/undefined local variable or method #{opening_quote}undefined_helper' for/
end
end

Expand Down
3 changes: 2 additions & 1 deletion spec/grape/middleware/exception_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ def call(_env)

it 'is possible to specify a custom formatter' do
get '/'
expect(last_response.body).to eq('{:custom_formatter=&gt;&quot;rain!&quot;}')
response = Rack::Utils.escape_html({ custom_formatter: 'rain!' }.inspect)
expect(last_response.body).to eq(response)
end
end

Expand Down
Loading