grape-entity 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -9
- data/README.md +5 -0
- data/lib/grape_entity/entity.rb +47 -11
- data/lib/grape_entity/json.rb +12 -0
- data/lib/grape_entity/version.rb +1 -1
- metadata +12 -50
- data/.coveralls.yml +0 -1
- data/.github/dependabot.yml +0 -20
- data/.github/workflows/ci.yml +0 -41
- data/.gitignore +0 -43
- data/.rspec +0 -3
- data/.rubocop.yml +0 -89
- data/.rubocop_todo.yml +0 -50
- data/.yardopts +0 -2
- data/CONTRIBUTING.md +0 -118
- data/Dangerfile +0 -3
- data/Gemfile +0 -28
- data/Guardfile +0 -16
- data/RELEASING.md +0 -84
- data/Rakefile +0 -20
- data/UPGRADING.md +0 -40
- data/bench/serializing.rb +0 -105
- data/grape-entity.gemspec +0 -26
- data/spec/grape_entity/entity_spec.rb +0 -2179
- data/spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb +0 -58
- data/spec/grape_entity/exposure/represent_exposure_spec.rb +0 -32
- data/spec/grape_entity/exposure_spec.rb +0 -102
- data/spec/grape_entity/hash_spec.rb +0 -91
- data/spec/grape_entity/options_spec.rb +0 -66
- data/spec/spec_helper.rb +0 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a112c98cc0eb8353a9185c5276133d05ad196a076f6184a7a624787e4c050d36
|
|
4
|
+
data.tar.gz: 68ea3662d7df4e23d41812ae5e3e143bf81e8ccab3ee27357cfa4b25875f897a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a481cda35933c22d6a85a6e6fa1b5eebc61914b69f0ae1f97b409767911dc1ad81df6c706a4cc4c23c293e85401b735c49c7498ef40965f4ef6b3da5022596bb
|
|
7
|
+
data.tar.gz: 9f7595af9724f9ec4a41dbbc4a6099f8b87fbc19e87d2c0632dad686940cacc04acd9038e856de0376d06f402812b235ede732dde550bd753be9eee8669f1fd8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
### Next
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### 1.0.3 (2026-04-15)
|
|
4
4
|
|
|
5
|
-
*
|
|
5
|
+
* [#400](https://github.com/ruby-grape/grape-entity/pull/400): Switch to danger-pr-comment for PR checks - [@numbata](https://github.com/numbata).
|
|
6
|
+
* [#397](https://github.com/ruby-grape/grape-entity/pull/397): Reduce gem size by excluding test files - [@yuri-zubov](https://github.com/yuri-zubov).
|
|
7
|
+
* [#401](https://github.com/ruby-grape/grape-entity/pull/401): Modernize gemspec: add metadata, use Dir glob, require MFA - [@numbata](https://github.com/numbata).
|
|
6
8
|
|
|
7
9
|
#### Fixes
|
|
8
10
|
|
|
9
|
-
*
|
|
11
|
+
* [#399](https://github.com/ruby-grape/grape-entity/pull/399): Fix `ArgumentError` for single-argument lambdas in `expose` blocks and `if:` conditions - [@numbata](https://github.com/numbata).
|
|
12
|
+
|
|
13
|
+
### 1.0.2 (2026-04-13)
|
|
14
|
+
|
|
15
|
+
#### Fixes
|
|
10
16
|
|
|
17
|
+
* [#394](https://github.com/ruby-grape/grape-entity/pull/394): Add `Entity.[]` for Grape >= 3.2 param type compatibility - [@numbata](https://github.com/numbata).
|
|
18
|
+
* [#388](https://github.com/ruby-grape/grape-entity/pull/388): Drop ruby-head from test matrix - [@numbata](https://github.com/numbata).
|
|
19
|
+
* [#389](https://github.com/ruby-grape/grape-entity/pull/389): Block arity detection (breaking change) - [@numbata](https://github.com/numbata).
|
|
20
|
+
* [#385](https://github.com/ruby-grape/grape-entity/pull/385): Drop multijson dependency - [@ericproulx](https://github.com/ericproulx).
|
|
21
|
+
* [#384](https://github.com/ruby-grape/grape-entity/pull/384): Fix `inspect` to correctly handle `nil` values - [@fcce](https://github.com/fcce).
|
|
11
22
|
|
|
12
|
-
###
|
|
23
|
+
### 1.0.1 (2024-04-10)
|
|
13
24
|
|
|
14
25
|
#### Fixes
|
|
15
26
|
|
|
16
27
|
* [#381](https://github.com/ruby-grape/grape-entity/pull/381): Fix `expose_nil: false` when using a block - [@magni-](https://github.com/magni-).
|
|
17
28
|
|
|
18
29
|
|
|
19
|
-
###
|
|
30
|
+
### 1.0.0 (2023-02-16)
|
|
20
31
|
|
|
21
32
|
#### Fixes
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
* [#352](https://github.com/ruby-grape/grape-entity/pull/369): Remove `FetchableObject` behavior. - [@danielvdao](https://github.com/danielvdao).
|
|
34
|
+
* [#369](https://github.com/ruby-grape/grape-entity/pull/369): Remove `FetchableObject` behavior (breaking change) - [@danielvdao](https://github.com/danielvdao).
|
|
25
35
|
* [#371](https://github.com/ruby-grape/grape-entity/pull/371): Allow default exposed value to be `false` or any empty data - [@norydev](https://github.com/norydev).
|
|
26
36
|
|
|
27
37
|
|
|
@@ -29,8 +39,8 @@
|
|
|
29
39
|
|
|
30
40
|
#### Fixes
|
|
31
41
|
|
|
32
|
-
* [#366](https://github.com/ruby-grape/grape-entity/pull/366): Don't suppress regular ArgumentError exceptions - [splattael](https://github.com/splattael).
|
|
33
|
-
* [#363](https://github.com/ruby-grape/grape-entity/pull/
|
|
42
|
+
* [#366](https://github.com/ruby-grape/grape-entity/pull/366): Don't suppress regular ArgumentError exceptions - [@splattael](https://github.com/splattael).
|
|
43
|
+
* [#363](https://github.com/ruby-grape/grape-entity/pull/363): Fix typo - [@OuYangJinTing](https://github.com/OuYangJinTing).
|
|
34
44
|
* [#361](https://github.com/ruby-grape/grape-entity/pull/361): Require 'active_support/core_ext' - [@pravi](https://github.com/pravi).
|
|
35
45
|
|
|
36
46
|
|
data/README.md
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
- [Using Entities](#using-entities)
|
|
34
34
|
- [Entity Organization](#entity-organization)
|
|
35
35
|
- [Caveats](#caveats)
|
|
36
|
+
- [Preloading Associations](#preloading-associations)
|
|
36
37
|
- [Installation](#installation)
|
|
37
38
|
- [Testing with Entities](#testing-with-entities)
|
|
38
39
|
- [Project Resources](#project-resources)
|
|
@@ -674,6 +675,10 @@ end
|
|
|
674
675
|
|
|
675
676
|
Also note that an `ArgumentError` is raised when unknown options are passed to either `expose` or `with_options`.
|
|
676
677
|
|
|
678
|
+
### Preloading Associations
|
|
679
|
+
|
|
680
|
+
Use [Grape::Entity::Preloader](https://github.com/OuYangJinTing/grape-entity-preloader) to preload associations and callbacks and avoid N+1 operations.
|
|
681
|
+
|
|
677
682
|
## Installation
|
|
678
683
|
|
|
679
684
|
Add this line to your application's Gemfile:
|
data/lib/grape_entity/entity.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require '
|
|
3
|
+
require 'grape_entity/json'
|
|
4
4
|
|
|
5
5
|
module Grape
|
|
6
6
|
# An Entity is a lightweight structure that allows you to easily
|
|
@@ -129,6 +129,12 @@ module Grape
|
|
|
129
129
|
def delegation_opts
|
|
130
130
|
@delegation_opts ||= { hash_access: hash_access }
|
|
131
131
|
end
|
|
132
|
+
|
|
133
|
+
# Satisfies the respond_to?(:[]) check in Grape::DryTypes (>= 3.2)
|
|
134
|
+
# so Entity subclasses can be used as param types.
|
|
135
|
+
def [](val)
|
|
136
|
+
val
|
|
137
|
+
end
|
|
132
138
|
end
|
|
133
139
|
|
|
134
140
|
@formatters = {}
|
|
@@ -472,8 +478,13 @@ module Grape
|
|
|
472
478
|
|
|
473
479
|
# Prevent default serialization of :options or :delegator.
|
|
474
480
|
def inspect
|
|
475
|
-
|
|
476
|
-
|
|
481
|
+
object = serializable_hash
|
|
482
|
+
if object.nil?
|
|
483
|
+
"#<#{self.class.name}:#{object_id} nil>"
|
|
484
|
+
else
|
|
485
|
+
fields = object.map { |k, v| "#{k}=#{v}" }
|
|
486
|
+
"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>"
|
|
487
|
+
end
|
|
477
488
|
end
|
|
478
489
|
|
|
479
490
|
def initialize(object, options = {})
|
|
@@ -514,19 +525,44 @@ module Grape
|
|
|
514
525
|
end
|
|
515
526
|
|
|
516
527
|
def exec_with_object(options, &block)
|
|
517
|
-
if block
|
|
528
|
+
if symbol_to_proc_wrapper?(block)
|
|
529
|
+
ensure_block_arity!(block)
|
|
530
|
+
instance_exec(object, &block)
|
|
531
|
+
elsif block.arity == 1
|
|
518
532
|
instance_exec(object, &block)
|
|
519
533
|
else
|
|
520
534
|
instance_exec(object, options, &block)
|
|
521
535
|
end
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
def ensure_block_arity!(block)
|
|
539
|
+
# MRI currently always includes "( &:foo )" for symbol-to-proc wrappers.
|
|
540
|
+
# If this format changes in a new Ruby version, this logic must be updated.
|
|
541
|
+
origin_method_name = block.to_s.scan(/(?<=\(&:)[^)]+(?=\))/).first&.to_sym
|
|
542
|
+
return unless origin_method_name
|
|
543
|
+
|
|
544
|
+
unless object.respond_to?(origin_method_name, true)
|
|
545
|
+
raise ArgumentError, <<~MSG
|
|
546
|
+
Cannot use `&:#{origin_method_name}` because that method is not defined in the object.
|
|
547
|
+
MSG
|
|
527
548
|
end
|
|
528
549
|
|
|
529
|
-
|
|
550
|
+
arity = object.method(origin_method_name).arity
|
|
551
|
+
return if arity.zero?
|
|
552
|
+
|
|
553
|
+
raise ArgumentError, <<~MSG
|
|
554
|
+
Cannot use `&:#{origin_method_name}` because that method expects #{arity} argument#{'s' if arity != 1}.
|
|
555
|
+
Symbol‐to‐proc shorthand only works for zero‐argument methods.
|
|
556
|
+
MSG
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
def symbol_to_proc_wrapper?(block)
|
|
560
|
+
params = block.parameters
|
|
561
|
+
|
|
562
|
+
return false unless block.lambda? && block.source_location.nil?
|
|
563
|
+
return false unless params.size >= 2
|
|
564
|
+
|
|
565
|
+
params[0].first == :req && params[1].first == :rest
|
|
530
566
|
end
|
|
531
567
|
|
|
532
568
|
def exec_with_attribute(attribute, &block)
|
|
@@ -558,7 +594,7 @@ module Grape
|
|
|
558
594
|
|
|
559
595
|
def to_json(options = {})
|
|
560
596
|
options = options.to_h if options&.respond_to?(:to_h)
|
|
561
|
-
|
|
597
|
+
Grape::Entity::Json.dump(serializable_hash(options))
|
|
562
598
|
end
|
|
563
599
|
|
|
564
600
|
def to_xml(options = {})
|
data/lib/grape_entity/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grape-entity
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- LeFnord
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2026-04-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
@@ -25,20 +25,6 @@ dependencies:
|
|
|
25
25
|
- - ">="
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
27
|
version: 3.0.0
|
|
28
|
-
- !ruby/object:Gem::Dependency
|
|
29
|
-
name: multi_json
|
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
|
31
|
-
requirements:
|
|
32
|
-
- - ">="
|
|
33
|
-
- !ruby/object:Gem::Version
|
|
34
|
-
version: 1.3.2
|
|
35
|
-
type: :runtime
|
|
36
|
-
prerelease: false
|
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
38
|
-
requirements:
|
|
39
|
-
- - ">="
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: 1.3.2
|
|
42
28
|
description: Extracted from Grape, A Ruby framework for rapid API development with
|
|
43
29
|
great conventions.
|
|
44
30
|
email:
|
|
@@ -48,26 +34,9 @@ executables: []
|
|
|
48
34
|
extensions: []
|
|
49
35
|
extra_rdoc_files: []
|
|
50
36
|
files:
|
|
51
|
-
- ".coveralls.yml"
|
|
52
|
-
- ".github/dependabot.yml"
|
|
53
|
-
- ".github/workflows/ci.yml"
|
|
54
|
-
- ".gitignore"
|
|
55
|
-
- ".rspec"
|
|
56
|
-
- ".rubocop.yml"
|
|
57
|
-
- ".rubocop_todo.yml"
|
|
58
|
-
- ".yardopts"
|
|
59
37
|
- CHANGELOG.md
|
|
60
|
-
- CONTRIBUTING.md
|
|
61
|
-
- Dangerfile
|
|
62
|
-
- Gemfile
|
|
63
|
-
- Guardfile
|
|
64
38
|
- LICENSE
|
|
65
39
|
- README.md
|
|
66
|
-
- RELEASING.md
|
|
67
|
-
- Rakefile
|
|
68
|
-
- UPGRADING.md
|
|
69
|
-
- bench/serializing.rb
|
|
70
|
-
- grape-entity.gemspec
|
|
71
40
|
- lib/grape-entity.rb
|
|
72
41
|
- lib/grape_entity.rb
|
|
73
42
|
- lib/grape_entity/condition.rb
|
|
@@ -92,19 +61,19 @@ files:
|
|
|
92
61
|
- lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb
|
|
93
62
|
- lib/grape_entity/exposure/nesting_exposure/output_builder.rb
|
|
94
63
|
- lib/grape_entity/exposure/represent_exposure.rb
|
|
64
|
+
- lib/grape_entity/json.rb
|
|
95
65
|
- lib/grape_entity/options.rb
|
|
96
66
|
- lib/grape_entity/version.rb
|
|
97
|
-
- spec/grape_entity/entity_spec.rb
|
|
98
|
-
- spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb
|
|
99
|
-
- spec/grape_entity/exposure/represent_exposure_spec.rb
|
|
100
|
-
- spec/grape_entity/exposure_spec.rb
|
|
101
|
-
- spec/grape_entity/hash_spec.rb
|
|
102
|
-
- spec/grape_entity/options_spec.rb
|
|
103
|
-
- spec/spec_helper.rb
|
|
104
67
|
homepage: https://github.com/ruby-grape/grape-entity
|
|
105
68
|
licenses:
|
|
106
69
|
- MIT
|
|
107
|
-
metadata:
|
|
70
|
+
metadata:
|
|
71
|
+
homepage_uri: https://github.com/ruby-grape/grape-entity
|
|
72
|
+
bug_tracker_uri: https://github.com/ruby-grape/grape-entity/issues
|
|
73
|
+
changelog_uri: https://github.com/ruby-grape/grape-entity/blob/v1.0.3/CHANGELOG.md
|
|
74
|
+
documentation_uri: https://www.rubydoc.info/gems/grape-entity/1.0.3
|
|
75
|
+
source_code_uri: https://github.com/ruby-grape/grape-entity/tree/v1.0.3
|
|
76
|
+
rubygems_mfa_required: 'true'
|
|
108
77
|
post_install_message:
|
|
109
78
|
rdoc_options: []
|
|
110
79
|
require_paths:
|
|
@@ -120,15 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
120
89
|
- !ruby/object:Gem::Version
|
|
121
90
|
version: '0'
|
|
122
91
|
requirements: []
|
|
123
|
-
rubygems_version: 3.5.
|
|
92
|
+
rubygems_version: 3.5.22
|
|
124
93
|
signing_key:
|
|
125
94
|
specification_version: 4
|
|
126
95
|
summary: A simple facade for managing the relationship between your model and API.
|
|
127
|
-
test_files:
|
|
128
|
-
- spec/grape_entity/entity_spec.rb
|
|
129
|
-
- spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb
|
|
130
|
-
- spec/grape_entity/exposure/represent_exposure_spec.rb
|
|
131
|
-
- spec/grape_entity/exposure_spec.rb
|
|
132
|
-
- spec/grape_entity/hash_spec.rb
|
|
133
|
-
- spec/grape_entity/options_spec.rb
|
|
134
|
-
- spec/spec_helper.rb
|
|
96
|
+
test_files: []
|
data/.coveralls.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
service_name: travis-ci
|
data/.github/dependabot.yml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
|
3
|
-
# Please see the documentation for all configuration options:
|
|
4
|
-
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
-
|
|
6
|
-
version: 2
|
|
7
|
-
updates:
|
|
8
|
-
- package-ecosystem: "bundler" # See documentation for possible values
|
|
9
|
-
directory: "/" # Location of package manifests
|
|
10
|
-
schedule:
|
|
11
|
-
interval: "weekly"
|
|
12
|
-
day: "friday"
|
|
13
|
-
assignees:
|
|
14
|
-
- "LeFnord"
|
|
15
|
-
- package-ecosystem: "github-actions"
|
|
16
|
-
directory: "/"
|
|
17
|
-
schedule:
|
|
18
|
-
interval: weekly
|
|
19
|
-
assignees:
|
|
20
|
-
- "LeFnord"
|
data/.github/workflows/ci.yml
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
name: Ruby
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- '*'
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- '*'
|
|
10
|
-
|
|
11
|
-
permissions:
|
|
12
|
-
contents: read
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
rubocop:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
- uses: ruby/setup-ruby@v1
|
|
20
|
-
with:
|
|
21
|
-
ruby-version: '3.0'
|
|
22
|
-
bundler-cache: true
|
|
23
|
-
- name: Run rubocop
|
|
24
|
-
run: bundle exec rubocop --parallel --format progress
|
|
25
|
-
|
|
26
|
-
rspec:
|
|
27
|
-
runs-on: ubuntu-latest
|
|
28
|
-
needs: ['rubocop']
|
|
29
|
-
strategy:
|
|
30
|
-
matrix:
|
|
31
|
-
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
|
|
32
|
-
steps:
|
|
33
|
-
- name: Check out branch
|
|
34
|
-
uses: actions/checkout@v4
|
|
35
|
-
- name: Set up Ruby
|
|
36
|
-
uses: ruby/setup-ruby@v1
|
|
37
|
-
with:
|
|
38
|
-
ruby-version: ${{ matrix.ruby-version }}
|
|
39
|
-
bundler-cache: true
|
|
40
|
-
- name: Run rspec rest of the suite
|
|
41
|
-
run: bundle exec rspec
|
data/.gitignore
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
## MAC OS
|
|
2
|
-
.DS_Store
|
|
3
|
-
.com.apple.timemachine.supported
|
|
4
|
-
|
|
5
|
-
## TEXTMATE
|
|
6
|
-
*.tmproj
|
|
7
|
-
tmtags
|
|
8
|
-
|
|
9
|
-
## EMACS
|
|
10
|
-
*~
|
|
11
|
-
\#*
|
|
12
|
-
.\#*
|
|
13
|
-
|
|
14
|
-
## REDCAR
|
|
15
|
-
.redcar
|
|
16
|
-
|
|
17
|
-
## VIM
|
|
18
|
-
*.swp
|
|
19
|
-
*.swo
|
|
20
|
-
|
|
21
|
-
## RUBYMINE
|
|
22
|
-
.idea
|
|
23
|
-
|
|
24
|
-
## PROJECT::GENERAL
|
|
25
|
-
coverage
|
|
26
|
-
doc
|
|
27
|
-
pkg
|
|
28
|
-
.rvmrc
|
|
29
|
-
.bundle
|
|
30
|
-
.yardoc/*
|
|
31
|
-
dist
|
|
32
|
-
Gemfile.lock
|
|
33
|
-
tmp
|
|
34
|
-
coverage/
|
|
35
|
-
.byebug_history
|
|
36
|
-
.ruby-version
|
|
37
|
-
.ruby-gemset
|
|
38
|
-
|
|
39
|
-
## Rubinius
|
|
40
|
-
.rbx
|
|
41
|
-
|
|
42
|
-
## PROJECT::SPECIFIC
|
|
43
|
-
.project
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
|
2
|
-
|
|
3
|
-
AllCops:
|
|
4
|
-
Exclude:
|
|
5
|
-
- vendor/**/*
|
|
6
|
-
- example/**/*
|
|
7
|
-
NewCops: enable
|
|
8
|
-
TargetRubyVersion: 3.0
|
|
9
|
-
SuggestExtensions: false
|
|
10
|
-
|
|
11
|
-
# Layout stuff
|
|
12
|
-
#
|
|
13
|
-
Layout/EmptyLinesAroundArguments:
|
|
14
|
-
Enabled: false
|
|
15
|
-
|
|
16
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
|
17
|
-
Enabled: true
|
|
18
|
-
|
|
19
|
-
Layout/FirstHashElementIndentation:
|
|
20
|
-
EnforcedStyle: consistent
|
|
21
|
-
|
|
22
|
-
Layout/LineLength:
|
|
23
|
-
Max: 120
|
|
24
|
-
Exclude:
|
|
25
|
-
- spec/**/*
|
|
26
|
-
|
|
27
|
-
Layout/SpaceAroundMethodCallOperator:
|
|
28
|
-
Enabled: true
|
|
29
|
-
|
|
30
|
-
# Lint stuff
|
|
31
|
-
#
|
|
32
|
-
Lint/ConstantDefinitionInBlock:
|
|
33
|
-
Enabled: true
|
|
34
|
-
Exclude:
|
|
35
|
-
- spec/**/*
|
|
36
|
-
|
|
37
|
-
# Metrics stuff
|
|
38
|
-
#
|
|
39
|
-
Metrics/AbcSize:
|
|
40
|
-
Max: 25
|
|
41
|
-
AllowedMethods:
|
|
42
|
-
# from lib/grape_entity/exposure/nesting_exposure.rb
|
|
43
|
-
- 'normalized_exposures'
|
|
44
|
-
|
|
45
|
-
Metrics/BlockLength:
|
|
46
|
-
Exclude:
|
|
47
|
-
- spec/**/*
|
|
48
|
-
|
|
49
|
-
Metrics/CyclomaticComplexity:
|
|
50
|
-
Max: 13
|
|
51
|
-
|
|
52
|
-
Metrics/ClassLength:
|
|
53
|
-
Max: 300
|
|
54
|
-
|
|
55
|
-
Metrics/MethodLength:
|
|
56
|
-
Max: 26
|
|
57
|
-
Exclude:
|
|
58
|
-
- spec/**/*
|
|
59
|
-
|
|
60
|
-
Metrics/PerceivedComplexity:
|
|
61
|
-
Max: 11
|
|
62
|
-
AllowedMethods:
|
|
63
|
-
# from lib/grape_entity/entity.rb
|
|
64
|
-
- 'expose'
|
|
65
|
-
- 'merge_options'
|
|
66
|
-
# from lib/grape_entity/exposure/nesting_exposure.rb
|
|
67
|
-
- 'normalized_exposures'
|
|
68
|
-
|
|
69
|
-
# Naming stuff
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
-
Naming:
|
|
73
|
-
Enabled: false
|
|
74
|
-
|
|
75
|
-
# Style stuff
|
|
76
|
-
#
|
|
77
|
-
Style/Documentation:
|
|
78
|
-
Enabled: false
|
|
79
|
-
|
|
80
|
-
Style/HashSyntax:
|
|
81
|
-
Enabled: false
|
|
82
|
-
|
|
83
|
-
Style/OptionalBooleanParameter:
|
|
84
|
-
AllowedMethods:
|
|
85
|
-
# from lib/grape_entity/condition/base.rb
|
|
86
|
-
- 'initialize'
|
|
87
|
-
# form lib/grape_entity/entity.rb
|
|
88
|
-
- 'entity_class'
|
|
89
|
-
- 'present_collection'
|
data/.rubocop_todo.yml
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# This configuration was generated by
|
|
2
|
-
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2022-07-26 21:29:59 UTC using RuboCop version 1.32.0.
|
|
4
|
-
# The point is for the user to remove these configuration records
|
|
5
|
-
# one by one as the offenses are removed from the code base.
|
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
-
|
|
9
|
-
# Offense count: 1
|
|
10
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: Include.
|
|
12
|
-
# Include: **/*.gemspec
|
|
13
|
-
Gemspec/DeprecatedAttributeAssignment:
|
|
14
|
-
Exclude:
|
|
15
|
-
- 'grape-entity.gemspec'
|
|
16
|
-
|
|
17
|
-
# Offense count: 1
|
|
18
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
19
|
-
# Configuration parameters: Include.
|
|
20
|
-
# Include: **/*.gemspec
|
|
21
|
-
Gemspec/RequireMFA:
|
|
22
|
-
Exclude:
|
|
23
|
-
- 'grape-entity.gemspec'
|
|
24
|
-
|
|
25
|
-
# Offense count: 1
|
|
26
|
-
# Configuration parameters: Include.
|
|
27
|
-
# Include: **/*.gemspec
|
|
28
|
-
Gemspec/RequiredRubyVersion:
|
|
29
|
-
Exclude:
|
|
30
|
-
- 'grape-entity.gemspec'
|
|
31
|
-
|
|
32
|
-
# Offense count: 6
|
|
33
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
34
|
-
Lint/BooleanSymbol:
|
|
35
|
-
Exclude:
|
|
36
|
-
- 'spec/grape_entity/exposure_spec.rb'
|
|
37
|
-
|
|
38
|
-
# Offense count: 15
|
|
39
|
-
Style/OpenStructUse:
|
|
40
|
-
Exclude:
|
|
41
|
-
- 'lib/grape_entity/delegator.rb'
|
|
42
|
-
- 'spec/grape_entity/entity_spec.rb'
|
|
43
|
-
|
|
44
|
-
# Offense count: 2
|
|
45
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
46
|
-
# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods, AllowComments.
|
|
47
|
-
# IgnoredMethods: respond_to, define_method
|
|
48
|
-
Style/SymbolProc:
|
|
49
|
-
Exclude:
|
|
50
|
-
- 'spec/grape_entity/entity_spec.rb'
|
data/.yardopts
DELETED