Skip to content

Commit 8de048e

Browse files
authored
Add missing requires (#2365)
* 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
1 parent 4753f67 commit 8de048e

16 files changed

+19
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#### Fixes
1212

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

1516
### 1.8.0 (2023/08/30)

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/multi_json.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/multi_xml.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rack_1_0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rack_2_0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rack_3_0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rack_edge.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rails_5_2.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rails_6_0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rails_6_1.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rails_7_0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

gemfiles/rails_7_1.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727

2828
group :test do
2929
gem 'cookiejar'
30-
gem 'grape-entity', '~> 0.6'
30+
gem 'grape-entity', '~> 0.6', require: false
3131
gem 'mime-types'
3232
gem 'rack-jsonp', require: 'rack/jsonp'
3333
gem 'rack-test', '< 2.1'

gemfiles/rails_edge.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626

2727
group :test do
2828
gem 'cookiejar'
29-
gem 'grape-entity', '~> 0.6'
29+
gem 'grape-entity', '~> 0.6', require: false
3030
gem 'mime-types'
3131
gem 'rack-jsonp', require: 'rack/jsonp'
3232
gem 'rack-test', '< 2.1'

lib/grape.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
require 'active_support/core_ext/array/conversions'
1717
require 'active_support/core_ext/array/extract_options'
1818
require 'active_support/core_ext/array/wrap'
19+
require 'active_support/core_ext/enumerable'
1920
require 'active_support/core_ext/hash/conversions'
2021
require 'active_support/core_ext/hash/deep_merge'
2122
require 'active_support/core_ext/hash/except'
@@ -24,7 +25,9 @@
2425
require 'active_support/core_ext/hash/reverse_merge'
2526
require 'active_support/core_ext/hash/slice'
2627
require 'active_support/core_ext/object/blank'
28+
require 'active_support/core_ext/object/deep_dup'
2729
require 'active_support/core_ext/object/duplicable'
30+
require 'active_support/core_ext/string/exclude'
2831
require 'active_support/dependencies/autoload'
2932
require 'active_support/deprecation'
3033
require 'active_support/inflector'

spec/grape/endpoint_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def app
201201
get('/username', {}, 'HTTP_COOKIE' => 'username=user; sandbox=false')
202202
expect(last_response.body).to eq('user_test')
203203
cookies = Array(last_response.headers['Set-Cookie']).flat_map { |h| h.split("\n") }
204-
expect(cookies.first).to match(/username=user_test/)
205-
expect(cookies.second).to match(/sandbox=true/)
204+
expect(cookies[0]).to match(/username=user_test/)
205+
expect(cookies[1]).to match(/sandbox=true/)
206206
end
207207

208208
it 'deletes cookie' do

0 commit comments

Comments
 (0)