Skip to content

Commit

Permalink
Merge 55e3753 into f36011b
Browse files Browse the repository at this point in the history
  • Loading branch information
ericproulx committed Mar 24, 2024
2 parents f36011b + 55e3753 commit 358814e
Show file tree
Hide file tree
Showing 91 changed files with 540 additions and 1,016 deletions.
51 changes: 14 additions & 37 deletions .rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 5000`
# on 2024-01-01 22:17:14 UTC using RuboCop version 1.59.0.
# on 2024-03-24 18:07:49 UTC using RuboCop version 1.59.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -52,7 +52,7 @@ Lint/DuplicateBranch:
Exclude:
- 'spec/support/versioned_helpers.rb'

# Offense count: 75
# Offense count: 76
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
Expand Down Expand Up @@ -84,7 +84,7 @@ Lint/EmptyClass:
- 'spec/grape/entity_spec.rb'
- 'spec/grape/middleware/stack_spec.rb'

# Offense count: 6
# Offense count: 5
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Exclude:
Expand All @@ -93,7 +93,6 @@ Lint/MissingSuper:
- 'lib/grape/namespace.rb'
- 'lib/grape/path.rb'
- 'lib/grape/router/pattern.rb'
- 'lib/grape/validations/validators/base.rb'

# Offense count: 1
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Expand Down Expand Up @@ -136,7 +135,7 @@ RSpec/AnyInstance:
- 'spec/grape/api_spec.rb'
- 'spec/grape/middleware/base_spec.rb'

# Offense count: 344
# Offense count: 345
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand Down Expand Up @@ -193,7 +192,7 @@ RSpec/ContextWording:
- 'spec/grape/validations_spec.rb'
- 'spec/shared/versioning_examples.rb'

# Offense count: 2
# Offense count: 1
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
Expand All @@ -203,7 +202,6 @@ RSpec/DescribeClass:
- '**/spec/system/**/*'
- '**/spec/views/**/*'
- 'spec/grape/named_api_spec.rb'
- 'spec/grape/validations/instance_behaivour_spec.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Expand All @@ -228,7 +226,7 @@ RSpec/ExpectInHook:
- 'spec/grape/api_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'

# Offense count: 48
# Offense count: 46
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Expand Down Expand Up @@ -262,7 +260,6 @@ RSpec/FilePath:
- 'spec/grape/integration/rack_sendfile_spec.rb'
- 'spec/grape/loading_spec.rb'
- 'spec/grape/middleware/exception_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/validators/all_or_none_spec.rb'
- 'spec/grape/validations/validators/allow_blank_spec.rb'
- 'spec/grape/validations/validators/at_least_one_of_spec.rb'
Expand All @@ -275,7 +272,6 @@ RSpec/FilePath:
- 'spec/grape/validations/validators/regexp_spec.rb'
- 'spec/grape/validations/validators/same_as_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'
- 'spec/integration/eager_load/eager_load_spec.rb'
- 'spec/integration/multi_json/json_spec.rb'
- 'spec/integration/multi_xml/xml_spec.rb'
- 'spec/integration/no_dry_validation/no_dry_validation_spec.rb'
Expand Down Expand Up @@ -331,7 +327,7 @@ RSpec/MessageChain:
Exclude:
- 'spec/grape/middleware/formatter_spec.rb'

# Offense count: 147
# Offense count: 144
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Expand Down Expand Up @@ -394,7 +390,6 @@ RSpec/MultipleExpectations:
- 'spec/grape/util/stackable_values_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/contract_scope_spec.rb'
- 'spec/grape/validations/instance_behaivour_spec.rb'
- 'spec/grape/validations/params_scope_spec.rb'
- 'spec/grape/validations/types/array_coercer_spec.rb'
- 'spec/grape/validations/types/primitive_coercer_spec.rb'
Expand Down Expand Up @@ -424,7 +419,7 @@ RSpec/MultipleMemoizedHelpers:
- 'spec/grape/request_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'

# Offense count: 2182
# Offense count: 2180
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Expand Down Expand Up @@ -489,29 +484,14 @@ RSpec/NamedSubject:
- 'spec/grape/validations/validators/presence_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 174
# Offense count: 28
# Configuration parameters: Max, AllowedGroups.
RSpec/NestedGroups:
Exclude:
- 'spec/grape/api_remount_spec.rb'
- 'spec/grape/api_spec.rb'
- 'spec/grape/dsl/headers_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/endpoint_spec.rb'
- 'spec/grape/exceptions/base_spec.rb'
- 'spec/grape/exceptions/invalid_accept_header_spec.rb'
- 'spec/grape/middleware/formatter_spec.rb'
- 'spec/grape/presenters/presenter_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/params_scope_spec.rb'
- 'spec/grape/validations/single_attribute_iterator_spec.rb'
- 'spec/grape/validations/types/primitive_coercer_spec.rb'
- 'spec/grape/validations/validators/all_or_none_spec.rb'
- 'spec/grape/validations/validators/allow_blank_spec.rb'
- 'spec/grape/validations/validators/at_least_one_of_spec.rb'
- 'spec/grape/validations/validators/coerce_spec.rb'
- 'spec/grape/validations/validators/exactly_one_of_spec.rb'
- 'spec/grape/validations/validators/mutual_exclusion_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 18
Expand Down Expand Up @@ -553,14 +533,13 @@ RSpec/RepeatedExampleGroupDescription:
- 'spec/grape/util/inheritable_setting_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'

# Offense count: 6
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
RSpec/ScatteredSetup:
Exclude:
- 'spec/grape/util/inheritable_setting_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 48
# Offense count: 46
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Expand Down Expand Up @@ -595,7 +574,6 @@ RSpec/SpecFilePathFormat:
- 'spec/grape/integration/rack_sendfile_spec.rb'
- 'spec/grape/loading_spec.rb'
- 'spec/grape/middleware/exception_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/validators/all_or_none_spec.rb'
- 'spec/grape/validations/validators/allow_blank_spec.rb'
- 'spec/grape/validations/validators/at_least_one_of_spec.rb'
Expand All @@ -608,17 +586,15 @@ RSpec/SpecFilePathFormat:
- 'spec/grape/validations/validators/regexp_spec.rb'
- 'spec/grape/validations/validators/same_as_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'
- 'spec/integration/eager_load/eager_load_spec.rb'
- 'spec/integration/multi_json/json_spec.rb'
- 'spec/integration/multi_xml/xml_spec.rb'
- 'spec/integration/no_dry_validation/no_dry_validation_spec.rb'
- 'spec/integration/rack_2_0/headers_spec.rb'
- 'spec/integration/rack_3_0/headers_spec.rb'

# Offense count: 9
# Offense count: 8
RSpec/StubbedMock:
Exclude:
- 'spec/grape/api_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/dsl/routing_spec.rb'
- 'spec/grape/middleware/formatter_spec.rb'
Expand Down Expand Up @@ -660,6 +636,7 @@ RSpec/VoidExpect:
- 'spec/grape/dsl/headers_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CombinableLoops:
Exclude:
- 'spec/grape/endpoint_spec.rb'
Expand Down Expand Up @@ -696,7 +673,7 @@ Style/OptionalBooleanParameter:
- 'lib/grape/validations/types/primitive_coercer.rb'
- 'lib/grape/validations/types/set_coercer.rb'

# Offense count: 28
# Offense count: 29
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantConstantBase:
Exclude:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -18,6 +18,7 @@
* [#2408](https://github.com/ruby-grape/grape/pull/2408): Fix params method redefined warnings - [@ericproulx](https://github.com/ericproulx).
* [#2410](https://github.com/ruby-grape/grape/pull/2410): Gem deprecations will raise a DeprecationWarning in specs - [@ericproulx](https://github.com/ericproulx).
* [#2389](https://github.com/ruby-grape/grape/pull/2389): Remove rack-accept dependency - [@ericproulx](https://github.com/ericproulx).
* [#2363](https://github.com/ruby-grape/grape/pull/2363): Replace autoload by zeitwerk - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

#### Fixes
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Expand Up @@ -622,7 +622,7 @@ For PUT, POST, PATCH, and DELETE requests where a non-empty body and a "Content-

Grape no longer uses `multi_json` or `multi_xml` by default and uses `JSON` and `ActiveSupport::XmlMini` instead. This has no visible impact on JSON processing, but the default behavior of the XML parser has changed. For example, an XML POST containing `<user>Bobby T.</user>` was parsed as `Bobby T.` with `multi_xml`, and as now parsed as `{"__content__"=>"Bobby T."}` with `XmlMini`.

If you were using `MultiJson.load`, `MultiJson.dump` or `MultiXml.parse`, you can substitute those with `Grape::Json.load`, `Grape::Json.dump`, `::Grape::Xml.parse`, or directly with `JSON.load`, `JSON.dump`, `XmlMini.parse`, etc.
If you were using `MultiJson.load`, `MultiJson.dump` or `MultiXml.parse`, you can substitute those with `Grape::Util::Json.load`, `Grape::Util::Json.dump`, `::Grape::Util::Xml.parse`, or directly with `JSON.load`, `JSON.dump`, `XmlMini.parse`, etc.

To restore previous behavior, add `multi_json` or `multi_xml` to your `Gemfile` and `require` it.

Expand Down
3 changes: 0 additions & 3 deletions benchmark/compile_many_routes.rb
Expand Up @@ -3,9 +3,6 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'grape'
require 'benchmark/ips'
require 'grape/eager_load'

Grape.eager_load!

class API < Grape::API
prefix :api
Expand Down
1 change: 1 addition & 0 deletions grape.gemspec
Expand Up @@ -25,6 +25,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'dry-types', '>= 1.1'
s.add_runtime_dependency 'mustermann-grape', '~> 1.1.0'
s.add_runtime_dependency 'rack', '>= 1.3.0'
s.add_runtime_dependency 'zeitwerk'

s.files = Dir['lib/**/*', 'CHANGELOG.md', 'CONTRIBUTING.md', 'README.md', 'grape.png', 'UPGRADING.md', 'LICENSE', 'grape.gemspec']
s.require_paths = ['lib']
Expand Down

0 comments on commit 358814e

Please sign in to comment.