grape-entity 1.0.2 → 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 +15 -4
- data/lib/grape_entity/entity.rb +6 -9
- data/lib/grape_entity/version.rb +1 -1
- metadata +10 -37
- 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 -4
- data/.rubocop.yml +0 -89
- data/.rubocop_todo.yml +0 -55
- 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 -24
- data/spec/grape_entity/entity_spec.rb +0 -2238
- data/spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb +0 -56
- data/spec/grape_entity/exposure/represent_exposure_spec.rb +0 -30
- data/spec/grape_entity/exposure_spec.rb +0 -100
- data/spec/grape_entity/hash_spec.rb +0 -89
- data/spec/grape_entity/json_spec.rb +0 -7
- data/spec/grape_entity/options_spec.rb +0 -64
- 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,11 +1,23 @@
|
|
|
1
1
|
### Next
|
|
2
2
|
|
|
3
|
+
### 1.0.3 (2026-04-15)
|
|
4
|
+
|
|
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).
|
|
8
|
+
|
|
9
|
+
#### Fixes
|
|
10
|
+
|
|
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
|
+
|
|
3
13
|
### 1.0.2 (2026-04-13)
|
|
4
14
|
|
|
5
15
|
#### Fixes
|
|
6
16
|
|
|
7
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).
|
|
8
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).
|
|
9
21
|
* [#384](https://github.com/ruby-grape/grape-entity/pull/384): Fix `inspect` to correctly handle `nil` values - [@fcce](https://github.com/fcce).
|
|
10
22
|
|
|
11
23
|
### 1.0.1 (2024-04-10)
|
|
@@ -19,8 +31,7 @@
|
|
|
19
31
|
|
|
20
32
|
#### Fixes
|
|
21
33
|
|
|
22
|
-
|
|
23
|
-
* [#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).
|
|
24
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).
|
|
25
36
|
|
|
26
37
|
|
|
@@ -28,8 +39,8 @@
|
|
|
28
39
|
|
|
29
40
|
#### Fixes
|
|
30
41
|
|
|
31
|
-
* [#366](https://github.com/ruby-grape/grape-entity/pull/366): Don't suppress regular ArgumentError exceptions - [splattael](https://github.com/splattael).
|
|
32
|
-
* [#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).
|
|
33
44
|
* [#361](https://github.com/ruby-grape/grape-entity/pull/361): Require 'active_support/core_ext' - [@pravi](https://github.com/pravi).
|
|
34
45
|
|
|
35
46
|
|
data/lib/grape_entity/entity.rb
CHANGED
|
@@ -525,13 +525,10 @@ module Grape
|
|
|
525
525
|
end
|
|
526
526
|
|
|
527
527
|
def exec_with_object(options, &block)
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
end
|
|
533
|
-
|
|
534
|
-
if arity.zero?
|
|
528
|
+
if symbol_to_proc_wrapper?(block)
|
|
529
|
+
ensure_block_arity!(block)
|
|
530
|
+
instance_exec(object, &block)
|
|
531
|
+
elsif block.arity == 1
|
|
535
532
|
instance_exec(object, &block)
|
|
536
533
|
else
|
|
537
534
|
instance_exec(object, options, &block)
|
|
@@ -542,7 +539,7 @@ module Grape
|
|
|
542
539
|
# MRI currently always includes "( &:foo )" for symbol-to-proc wrappers.
|
|
543
540
|
# If this format changes in a new Ruby version, this logic must be updated.
|
|
544
541
|
origin_method_name = block.to_s.scan(/(?<=\(&:)[^)]+(?=\))/).first&.to_sym
|
|
545
|
-
return
|
|
542
|
+
return unless origin_method_name
|
|
546
543
|
|
|
547
544
|
unless object.respond_to?(origin_method_name, true)
|
|
548
545
|
raise ArgumentError, <<~MSG
|
|
@@ -551,7 +548,7 @@ module Grape
|
|
|
551
548
|
end
|
|
552
549
|
|
|
553
550
|
arity = object.method(origin_method_name).arity
|
|
554
|
-
return
|
|
551
|
+
return if arity.zero?
|
|
555
552
|
|
|
556
553
|
raise ArgumentError, <<~MSG
|
|
557
554
|
Cannot use `&:#{origin_method_name}` because that method expects #{arity} argument#{'s' if arity != 1}.
|
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: 2026-04-
|
|
12
|
+
date: 2026-04-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
@@ -34,26 +34,9 @@ executables: []
|
|
|
34
34
|
extensions: []
|
|
35
35
|
extra_rdoc_files: []
|
|
36
36
|
files:
|
|
37
|
-
- ".coveralls.yml"
|
|
38
|
-
- ".github/dependabot.yml"
|
|
39
|
-
- ".github/workflows/ci.yml"
|
|
40
|
-
- ".gitignore"
|
|
41
|
-
- ".rspec"
|
|
42
|
-
- ".rubocop.yml"
|
|
43
|
-
- ".rubocop_todo.yml"
|
|
44
|
-
- ".yardopts"
|
|
45
37
|
- CHANGELOG.md
|
|
46
|
-
- CONTRIBUTING.md
|
|
47
|
-
- Dangerfile
|
|
48
|
-
- Gemfile
|
|
49
|
-
- Guardfile
|
|
50
38
|
- LICENSE
|
|
51
39
|
- README.md
|
|
52
|
-
- RELEASING.md
|
|
53
|
-
- Rakefile
|
|
54
|
-
- UPGRADING.md
|
|
55
|
-
- bench/serializing.rb
|
|
56
|
-
- grape-entity.gemspec
|
|
57
40
|
- lib/grape-entity.rb
|
|
58
41
|
- lib/grape_entity.rb
|
|
59
42
|
- lib/grape_entity/condition.rb
|
|
@@ -81,18 +64,16 @@ files:
|
|
|
81
64
|
- lib/grape_entity/json.rb
|
|
82
65
|
- lib/grape_entity/options.rb
|
|
83
66
|
- lib/grape_entity/version.rb
|
|
84
|
-
- spec/grape_entity/entity_spec.rb
|
|
85
|
-
- spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb
|
|
86
|
-
- spec/grape_entity/exposure/represent_exposure_spec.rb
|
|
87
|
-
- spec/grape_entity/exposure_spec.rb
|
|
88
|
-
- spec/grape_entity/hash_spec.rb
|
|
89
|
-
- spec/grape_entity/json_spec.rb
|
|
90
|
-
- spec/grape_entity/options_spec.rb
|
|
91
|
-
- spec/spec_helper.rb
|
|
92
67
|
homepage: https://github.com/ruby-grape/grape-entity
|
|
93
68
|
licenses:
|
|
94
69
|
- MIT
|
|
95
|
-
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'
|
|
96
77
|
post_install_message:
|
|
97
78
|
rdoc_options: []
|
|
98
79
|
require_paths:
|
|
@@ -112,12 +93,4 @@ rubygems_version: 3.5.22
|
|
|
112
93
|
signing_key:
|
|
113
94
|
specification_version: 4
|
|
114
95
|
summary: A simple facade for managing the relationship between your model and API.
|
|
115
|
-
test_files:
|
|
116
|
-
- spec/grape_entity/entity_spec.rb
|
|
117
|
-
- spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb
|
|
118
|
-
- spec/grape_entity/exposure/represent_exposure_spec.rb
|
|
119
|
-
- spec/grape_entity/exposure_spec.rb
|
|
120
|
-
- spec/grape_entity/hash_spec.rb
|
|
121
|
-
- spec/grape_entity/json_spec.rb
|
|
122
|
-
- spec/grape_entity/options_spec.rb
|
|
123
|
-
- 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@v6
|
|
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', '3.4']
|
|
32
|
-
steps:
|
|
33
|
-
- name: Check out branch
|
|
34
|
-
uses: actions/checkout@v6
|
|
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,55 +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: 1
|
|
33
|
-
Style/OneClassPerFile:
|
|
34
|
-
Exclude:
|
|
35
|
-
- 'bench/serializing.rb'
|
|
36
|
-
|
|
37
|
-
# Offense count: 6
|
|
38
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
39
|
-
Lint/BooleanSymbol:
|
|
40
|
-
Exclude:
|
|
41
|
-
- 'spec/grape_entity/exposure_spec.rb'
|
|
42
|
-
|
|
43
|
-
# Offense count: 15
|
|
44
|
-
Style/OpenStructUse:
|
|
45
|
-
Exclude:
|
|
46
|
-
- 'lib/grape_entity/delegator.rb'
|
|
47
|
-
- 'spec/grape_entity/entity_spec.rb'
|
|
48
|
-
|
|
49
|
-
# Offense count: 2
|
|
50
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
51
|
-
# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods, AllowComments.
|
|
52
|
-
# IgnoredMethods: respond_to, define_method
|
|
53
|
-
Style/SymbolProc:
|
|
54
|
-
Exclude:
|
|
55
|
-
- 'spec/grape_entity/entity_spec.rb'
|
data/.yardopts
DELETED
data/CONTRIBUTING.md
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
Contributing to Grape-Entity
|
|
2
|
-
============================
|
|
3
|
-
|
|
4
|
-
Grape-Entity is work of [many of contributors](https://github.com/ruby-grape/grape-entity/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/ruby-grape/grape-entity/pulls), [propose features and discuss issues](https://github.com/ruby-grape/grape-entity/issues). When in doubt, ask a question in the [Grape Google Group](http://groups.google.com/group/ruby-grape).
|
|
5
|
-
|
|
6
|
-
#### Fork the Project
|
|
7
|
-
|
|
8
|
-
Fork the [project on Github](https://github.com/ruby-grape/grape-entity) and check out your copy.
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
git clone https://github.com/contributor/grape-entity.git
|
|
12
|
-
cd grape-entity
|
|
13
|
-
git remote add upstream https://github.com/ruby-grape/grape-entity.git
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
#### Create a Topic Branch
|
|
17
|
-
|
|
18
|
-
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
git checkout master
|
|
22
|
-
git pull upstream master
|
|
23
|
-
git checkout -b my-feature-branch
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
#### Bundle Install and Test
|
|
27
|
-
|
|
28
|
-
Ensure that you can build the project and run tests.
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
bundle install
|
|
32
|
-
bundle exec rake
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
#### Write Tests
|
|
36
|
-
|
|
37
|
-
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [spec/grape-entity](spec/grape-entity).
|
|
38
|
-
|
|
39
|
-
We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
|
|
40
|
-
|
|
41
|
-
#### Write Code
|
|
42
|
-
|
|
43
|
-
Implement your feature or bug fix.
|
|
44
|
-
|
|
45
|
-
Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop` and fix any style issues highlighted.
|
|
46
|
-
|
|
47
|
-
Make sure that `bundle exec rake` completes without errors.
|
|
48
|
-
|
|
49
|
-
#### Write Documentation
|
|
50
|
-
|
|
51
|
-
Document any external behavior in the [README](README.md).
|
|
52
|
-
|
|
53
|
-
#### Update Changelog
|
|
54
|
-
|
|
55
|
-
Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*. Make it look like every other line, including your name and link to your Github account.
|
|
56
|
-
|
|
57
|
-
#### Commit Changes
|
|
58
|
-
|
|
59
|
-
Make sure git knows your name and email address:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
git config --global user.name "Your Name"
|
|
63
|
-
git config --global user.email "contributor@example.com"
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Writing good commit logs is important. A commit log should describe what changed and why.
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
git add ...
|
|
70
|
-
git commit
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
#### Push
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
git push origin my-feature-branch
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### Make a Pull Request
|
|
80
|
-
|
|
81
|
-
Go to https://github.com/ruby-grape/grape-entity and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
|
|
82
|
-
|
|
83
|
-
#### Rebase
|
|
84
|
-
|
|
85
|
-
If you've been working on a change for a while, rebase with upstream/master.
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
git fetch upstream
|
|
89
|
-
git rebase upstream/master
|
|
90
|
-
git push origin my-feature-branch -f
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
#### Update CHANGELOG Again
|
|
94
|
-
|
|
95
|
-
Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
* [#123](https://github.com/ruby-grape/grape-entity/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Amend your previous commit and force push the changes.
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
git commit --amend
|
|
105
|
-
git push origin my-feature-branch -f
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
#### Check on Your Pull Request
|
|
109
|
-
|
|
110
|
-
Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
|
|
111
|
-
|
|
112
|
-
#### Be Patient
|
|
113
|
-
|
|
114
|
-
It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
|
|
115
|
-
|
|
116
|
-
#### Thank You
|
|
117
|
-
|
|
118
|
-
Please do know that we really appreciate and value your time and work. We love you, really.
|
data/Dangerfile
DELETED
data/Gemfile
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source 'http://rubygems.org'
|
|
4
|
-
|
|
5
|
-
gemspec
|
|
6
|
-
|
|
7
|
-
group :development, :test do
|
|
8
|
-
gem 'bundler'
|
|
9
|
-
gem 'maruku'
|
|
10
|
-
gem 'pry' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
|
|
11
|
-
gem 'pry-byebug' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
|
|
12
|
-
gem 'rack-test'
|
|
13
|
-
gem 'rake'
|
|
14
|
-
gem 'rspec', '~> 3.9'
|
|
15
|
-
gem 'rubocop', '~> 1.0'
|
|
16
|
-
gem 'yard'
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
group :test do
|
|
20
|
-
gem 'coveralls_reborn', require: false
|
|
21
|
-
gem 'growl'
|
|
22
|
-
gem 'guard'
|
|
23
|
-
gem 'guard-bundler'
|
|
24
|
-
gem 'guard-rspec'
|
|
25
|
-
gem 'rb-fsevent'
|
|
26
|
-
gem 'ruby-grape-danger', '~> 0.2', require: false
|
|
27
|
-
gem 'simplecov', require: false
|
|
28
|
-
end
|
data/Guardfile
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# A sample Guardfile
|
|
4
|
-
# More info at https://github.com/guard/guard#readme
|
|
5
|
-
|
|
6
|
-
guard 'rspec', version: 2 do
|
|
7
|
-
watch(%r{^spec/.+_spec\.rb$})
|
|
8
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
9
|
-
watch(%r{^spec/support/shared_versioning_examples.rb$}) { |_m| 'spec/' }
|
|
10
|
-
watch('spec/spec_helper.rb') { 'spec/' }
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
guard 'bundler' do
|
|
14
|
-
watch('Gemfile')
|
|
15
|
-
watch(/^.+\.gemspec/)
|
|
16
|
-
end
|