Skip to content

Commit

Permalink
Add missing requires (ruby-grape#2365)
Browse files Browse the repository at this point in the history
* Add require 'active_support/core_ext/enumerable'

* Add changelog

* Replace first, second by [0], [1]
require missing core_ext/object/deep_dup && core_ext/string/exclude

* grape_entity require false

* Update CHANGELOG.md
  • Loading branch information
ericproulx authored Oct 30, 2023
1 parent 4753f67 commit 8de048e
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#### Fixes

* [#2364](https://github.com/ruby-grape/grape/pull/2364): Add missing requires - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

### 1.8.0 (2023/08/30)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/multi_json.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/multi_xml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_1_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_2_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_3_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

group :test do
gem 'cookiejar'
gem 'grape-entity', '~> 0.6'
gem 'grape-entity', '~> 0.6', require: false
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test', '< 2.1'
Expand Down
3 changes: 3 additions & 0 deletions lib/grape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
require 'active_support/core_ext/array/conversions'
require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/enumerable'
require 'active_support/core_ext/hash/conversions'
require 'active_support/core_ext/hash/deep_merge'
require 'active_support/core_ext/hash/except'
Expand All @@ -24,7 +25,9 @@
require 'active_support/core_ext/hash/reverse_merge'
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/deep_dup'
require 'active_support/core_ext/object/duplicable'
require 'active_support/core_ext/string/exclude'
require 'active_support/dependencies/autoload'
require 'active_support/deprecation'
require 'active_support/inflector'
Expand Down
4 changes: 2 additions & 2 deletions spec/grape/endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def app
get('/username', {}, 'HTTP_COOKIE' => 'username=user; sandbox=false')
expect(last_response.body).to eq('user_test')
cookies = Array(last_response.headers['Set-Cookie']).flat_map { |h| h.split("\n") }
expect(cookies.first).to match(/username=user_test/)
expect(cookies.second).to match(/sandbox=true/)
expect(cookies[0]).to match(/username=user_test/)
expect(cookies[1]).to match(/sandbox=true/)
end

it 'deletes cookie' do
Expand Down

0 comments on commit 8de048e

Please sign in to comment.