grape-entity 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecd89442adb3e014be540761d005b20920e8aa847691a69a6c4e166d1ed63f21
4
- data.tar.gz: c556531fdea49f03dfea0ce4d1388016736c7d3987db0957be30b27a82e21e40
3
+ metadata.gz: 040fece8639b5fd085e4c77f1c88172e686e2655adf5e1cbb80aa0bb06c46faf
4
+ data.tar.gz: f688469ee710ac98ed822d41c3724f47d1ec8b6f9aa067eead52c07662c45121
5
5
  SHA512:
6
- metadata.gz: 5a48af786a0d681229aecd0765eccfafb9f28f6178dc5ade649d54b255df13e82f24f4f5243de7cdff9d45a423d101b851137ffb7920e3853529d88fbe23f67b
7
- data.tar.gz: b9b89ee602c3804470c57e6519244e59b78fa5b10470fb2a5d0f1581e821847ab8a6f66145fcf57445090d654c442d33cfc6fa94c6eaea9e36f15ce1038eb362
6
+ metadata.gz: 3f14751f855805e0ea16f5c232a67c70c76d7523075a93ad442de9a31c9eb04816c1deae576d0e68671f6126790e7ca7d96bc8a7da4aa7c61d06f00385863c69
7
+ data.tar.gz: 2d683f2414287de225b0d47e615f91563daf3b73c74e674c24cd2a1c6c2a417098ce0118e23d7272bf165d2895cb09fab824d52dfcb069dbfd8ea6e860b03b63
@@ -0,0 +1,14 @@
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"
@@ -0,0 +1,26 @@
1
+ name: Rubocop
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - '*'
7
+ pull_request:
8
+ branches:
9
+ - '*'
10
+
11
+ jobs:
12
+ rubocop:
13
+ name: Rubocop
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - uses: actions/setup-ruby@v1
18
+ with:
19
+ ruby-version: '3.0'
20
+ - run: gem install rubocop --no-doc
21
+ - run: rubocop --format progress --format json --out rubocop.json
22
+ id: rubocop
23
+ - uses: duderman/rubocop-annotate-action@v0.1.0
24
+ with:
25
+ path: rubocop.json
26
+ if: ${{ failure() }}
@@ -0,0 +1,26 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - '*'
7
+ pull_request:
8
+ branches:
9
+ - '*'
10
+
11
+ jobs:
12
+ spec:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ['2.6', '2.7', '3.0', head, jruby, truffleruby]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true
25
+ - name: Run rspec
26
+ run: bundle exec rspec
data/.rubocop.yml CHANGED
@@ -1,37 +1,86 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
3
- Include:
4
- - Dangerfile
1
+ inherit_from: .rubocop_todo.yml
5
2
 
3
+ AllCops:
6
4
  Exclude:
7
5
  - vendor/**/*
8
- - bin/**/*
9
- - Guardfile
6
+ - example/**/*
7
+ NewCops: enable
8
+ TargetRubyVersion: 3.0
9
+ SuggestExtensions: false
10
10
 
11
- inherit_from: .rubocop_todo.yml
12
-
13
- Gemspec/RequiredRubyVersion:
11
+ # Layout stuff
12
+ #
13
+ Layout/EmptyLinesAroundArguments:
14
14
  Enabled: false
15
15
 
16
- Naming/FileName:
16
+ Layout/EmptyLinesAroundAttributeAccessor:
17
+ Enabled: true
18
+
19
+ Layout/FirstHashElementIndentation:
20
+ EnforcedStyle: consistent
21
+
22
+ Layout/LineLength:
23
+ Max: 120
17
24
  Exclude:
18
- - 'Gemfile'
19
- - 'Rakefile'
20
- - 'grape-entity.gemspec'
21
- - 'lib/grape-entity.rb'
25
+ - spec/**/*
22
26
 
23
- Style/Documentation:
24
- Enabled: false
27
+ Layout/SpaceAroundMethodCallOperator:
28
+ Enabled: true
25
29
 
26
- Style/MultilineIfModifier:
27
- Enabled: false
30
+ # Lint stuff
31
+ #
32
+ Lint/ConstantDefinitionInBlock:
33
+ Enabled: true
34
+ Exclude:
35
+ - spec/**/*
28
36
 
29
- Style/RaiseArgs:
30
- Enabled: false
37
+ # Metrics stuff
38
+ #
39
+ Metrics/AbcSize:
40
+ Max: 25
41
+ IgnoredMethods:
42
+ # from lib/grape_entity/exposure/nesting_exposure.rb
43
+ - 'normalized_exposures'
44
+
45
+ Metrics/BlockLength:
46
+ Exclude:
47
+ - spec/**/*
31
48
 
32
- Lint/BooleanSymbol:
49
+ Metrics/CyclomaticComplexity:
50
+ Max: 13
51
+
52
+ Metrics/ClassLength:
53
+ Max: 300
54
+
55
+ Metrics/MethodLength:
56
+ Max: 26
33
57
  Exclude:
34
- - 'spec/grape_entity/exposure_spec.rb'
58
+ - spec/**/*
59
+
60
+ Metrics/PerceivedComplexity:
61
+ Max: 11
62
+ IgnoredMethods:
63
+ # from lib/grape_entity/entity.rb
64
+ - 'expose'
65
+ - 'merge_options'
66
+ # from lib/grape_entity/exposure/nesting_exposure.rb
67
+ - 'normalized_exposures'
35
68
 
36
- Lint/UnneededDisable:
69
+ # Naming stuff
70
+ #
71
+
72
+ Naming:
37
73
  Enabled: false
74
+
75
+ # Style stuff
76
+ #
77
+ Style/Documentation:
78
+ Enabled: false
79
+
80
+ Style/OptionalBooleanParameter:
81
+ AllowedMethods:
82
+ # from lib/grape_entity/condition/base.rb
83
+ - 'initialize'
84
+ # form lib/grape_entity/entity.rb
85
+ - 'entity_class'
86
+ - 'present_collection'
data/.rubocop_todo.yml CHANGED
@@ -1,47 +1,23 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-01-11 18:20:10 +0100 using RuboCop version 0.52.1.
3
+ # on 2020-11-07 00:01:40 UTC using RuboCop version 1.2.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 1
10
- Lint/AmbiguousBlockAssociation:
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
11
13
  Exclude:
12
- - 'spec/grape_entity/exposure/represent_exposure_spec.rb'
14
+ - 'grape-entity.gemspec'
13
15
 
14
16
  # Offense count: 6
15
- Metrics/AbcSize:
16
- Max: 32
17
-
18
- # Offense count: 35
19
- # Configuration parameters: CountComments, ExcludedMethods.
20
- Metrics/BlockLength:
21
- Max: 1625
22
-
23
- # Offense count: 2
24
- # Configuration parameters: CountComments.
25
- Metrics/ClassLength:
26
- Max: 210
27
-
28
- # Offense count: 2
29
- Metrics/CyclomaticComplexity:
30
- Max: 11
31
-
32
- # Offense count: 7
33
- # Configuration parameters: CountComments.
34
- Metrics/MethodLength:
35
- Max: 28
36
-
37
- # Offense count: 2
38
- Metrics/PerceivedComplexity:
39
- Max: 13
40
-
41
- # Offense count: 1
42
- Style/EvalWithLocation:
17
+ # Cop supports --auto-correct.
18
+ Lint/BooleanSymbol:
43
19
  Exclude:
44
- - 'lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb'
20
+ - 'spec/grape_entity/exposure_spec.rb'
45
21
 
46
22
  # Offense count: 1
47
23
  # Cop supports --auto-correct.
@@ -50,9 +26,3 @@ Style/EvalWithLocation:
50
26
  Style/SymbolProc:
51
27
  Exclude:
52
28
  - 'spec/grape_entity/entity_spec.rb'
53
-
54
- # Offense count: 250
55
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
56
- # URISchemes: http, https
57
- Metrics/LineLength:
58
- Max: 146
data/CHANGELOG.md CHANGED
@@ -8,6 +8,53 @@
8
8
 
9
9
  * Your contribution here.
10
10
 
11
+
12
+ ### 0.9.0 (2021-03-20)
13
+
14
+ #### Features
15
+
16
+ * [#346](https://github.com/ruby-grape/grape-entity/pull/346): Ruby 3 support - [@LeFnord](https://github.com/LeFnord).
17
+
18
+
19
+ ### 0.8.2 (2020-11-08)
20
+
21
+ #### Fixes
22
+
23
+ * [#340](https://github.com/ruby-grape/grape-entity/pull/340): Preparations for 3.0 - [@LeFnord](https://github.com/LeFnord).
24
+ * [#338](https://github.com/ruby-grape/grape-entity/pull/338): Fix ruby 2.7 deprecation warning - [@begotten63](https://github.com/begotten63).
25
+
26
+
27
+ ### 0.8.1 (2020-07-15)
28
+
29
+ #### Fixes
30
+
31
+ * [#336](https://github.com/ruby-grape/grape-entity/pull/336): Pass options to delegators when they accept it - [@dnesteryuk](https://github.com/dnesteryuk).
32
+ * [#333](https://github.com/ruby-grape/grape-entity/pull/333): Fix typo in CHANGELOG.md - [@eitoball](https://github.com/eitoball).
33
+
34
+
35
+ ### 0.8.0 (2020-02-18)
36
+
37
+ #### Features
38
+
39
+ * [#307](https://github.com/ruby-grape/grape-entity/pull/307): Allow exposures to call methods defined in modules included in an entity - [@robertoz-01](https://github.com/robertoz-01).
40
+ * [#319](https://github.com/ruby-grape/grape-entity/pull/319): Support hashes with string keys - [@mhenrixon](https://github.com/mhenrixon).
41
+ * [#300](https://github.com/ruby-grape/grape-entity/pull/300): Loosens activesupport to 3 - [@ericschultz](https://github.com/ericschultz).
42
+
43
+ #### Fixes
44
+
45
+ * [#330](https://github.com/ruby-grape/grape-entity/pull/330): CI: use Ruby 2.5.7, 2.6.5, 2.7.0 - [@budnik](https://github.com/budnik).
46
+ * [#329](https://github.com/ruby-grape/grape-entity/pull/329): Option expose_nil doesn't work when block is passed - [@serbiant](https://github.com/serbiant).
47
+ * [#320](https://github.com/ruby-grape/grape-entity/pull/320): Gemspec: drop eol'd property rubyforge_project - [@olleolleolle](https://github.com/olleolleolle).
48
+ * [#307](https://github.com/ruby-grape/grape-entity/pull/307): Allow exposures to call methods defined in modules included in an entity - [@robertoz-01](https://github.com/robertoz-01).
49
+
50
+
51
+ ### 0.7.1 (2018-01-30)
52
+
53
+ #### Features
54
+
55
+ * [#297](https://github.com/ruby-grape/grape-entity/pull/297): Introduce `override` option for expose (fixes [#286](https://github.com/ruby-grape/grape-entity/issues/296)) - [@DmitryTsepelev](https://github.com/DmitryTsepelev).
56
+
57
+
11
58
  ### 0.7.0 (2018-01-25)
12
59
 
13
60
  #### Features
@@ -26,6 +73,7 @@
26
73
  * [#291](https://github.com/ruby-grape/grape-entity/pull/291): Refactor and simplify various classes and modules - [@DmitryTsepelev](https://github.com/DmitryTsepelev).
27
74
  * [#292](https://github.com/ruby-grape/grape-entity/pull/292): Allow replace non-conditional non-nesting exposures in child classes (fixes [#286](https://github.com/ruby-grape/grape-entity/issues/286)) - [@DmitryTsepelev](https://github.com/DmitryTsepelev).
28
75
 
76
+
29
77
  ### 0.6.1 (2017-01-09)
30
78
 
31
79
  #### Features
@@ -36,6 +84,7 @@
36
84
 
37
85
  * [#251](https://github.com/ruby-grape/grape-entity/pull/251): Avoid noise when code runs with Ruby warnings - [@cpetschnig](https://github.com/cpetschnig).
38
86
 
87
+
39
88
  ### 0.6.0 (2016-11-20)
40
89
 
41
90
  #### Features
@@ -47,6 +96,7 @@
47
96
  * [#249](https://github.com/ruby-grape/grape-entity/issues/249): Fix leaking of options and internals in default serialization - [@dblock](https://github.com/dblock), [@KingsleyKelly](https://github.com/KingsleyKelly).
48
97
  * [#248](https://github.com/ruby-grape/grape-entity/pull/248): Fix `nil` values causing errors when `merge` option passed - [@arempe93](https://github.com/arempe93).
49
98
 
99
+
50
100
  ### 0.5.2 (2016-11-14)
51
101
 
52
102
  #### Features
@@ -62,6 +112,7 @@
62
112
  * [#219](https://github.com/ruby-grape/grape-entity/pull/219): Double pass options in `serializable_hash` - [@sbatykov](https://github.com/sbatykov).
63
113
  * [#231](https://github.com/ruby-grape/grape-entity/pull/231), [#215](https://github.com/ruby-grape/grape-entity/issues/215): Allow `delegate_attribute` for derived entity - [@sbatykov](https://github.com/sbatykov).
64
114
 
115
+
65
116
  ### 0.5.1 (2016-4-4)
66
117
 
67
118
  #### Features
@@ -73,6 +124,7 @@
73
124
 
74
125
  * [#202](https://github.com/ruby-grape/grape-entity/pull/202): Reset `@using_class` memoization on `.setup` - [@rngtng](https://github.com/rngtng).
75
126
 
127
+
76
128
  ### 0.5.0 (2015-12-07)
77
129
 
78
130
  #### Features
@@ -93,18 +145,21 @@
93
145
  * [#151](https://github.com/ruby-grape/grape-entity/pull/151): Serializing of deeply nested presenter exposures: [#155](https://github.com/ruby-grape/grape-entity/issues/155) - [@marshall-lee](https://github.com/marshall-lee).
94
146
  * [#151](https://github.com/ruby-grape/grape-entity/pull/151): Deep projections (`:only`, `:except`) were unaware of nesting: [#156](https://github.com/ruby-grape/grape-entity/issues/156) - [@marshall-lee](https://github.com/marshall-lee).
95
147
 
148
+
96
149
  ### 0.4.8 (2015-08-10)
97
150
 
98
151
  #### Features
99
152
 
100
153
  * [#167](https://github.com/ruby-grape/grape-entity/pull/167), [#166](https://github.com/ruby-grape/grape-entity/issues/166): Regression with global settings (exposures, formatters) on `Grape::Entity` - [@marshall-lee](https://github.com/marshall-lee).
101
154
 
155
+
102
156
  ### 0.4.7 (2015-08-03)
103
157
 
104
158
  #### Features
105
159
 
106
160
  * [#164](https://github.com/ruby-grape/grape-entity/pull/164): Regression: entity instance methods were exposed with `NoMethodError`: [#163](https://github.com/ruby-grape/grape-entity/issues/163) - [@marshall-lee](https://github.com/marshall-lee).
107
161
 
162
+
108
163
  ### 0.4.6 (2015-07-27)
109
164
 
110
165
  #### Features
@@ -123,6 +178,7 @@
123
178
 
124
179
  * [#147](https://github.com/ruby-grape/grape-entity/pull/147), [#142](https://github.com/ruby-grape/grape-entity/pull/142): Private method values were not exposed with `safe` option - [@marshall-lee](https://github.com/marshall-lee).
125
180
 
181
+
126
182
  ### 0.4.5 (2015-03-10)
127
183
 
128
184
  #### Features
@@ -137,6 +193,7 @@
137
193
  * [#110](https://github.com/ruby-grape/grape-entity/pull/110): Safe exposure when using `Hash` models - [@croeck](https://github.com/croeck).
138
194
  * [#91](https://github.com/ruby-grape/grape-entity/pull/91): OpenStruct serializing - [@etehtsea](https://github.com/etehtsea).
139
195
 
196
+
140
197
  ### 0.4.4 (2014-08-17)
141
198
 
142
199
  #### Features
@@ -144,6 +201,7 @@
144
201
  * [#85](https://github.com/ruby-grape/grape-entity/pull/85): Added `present_collection` to indicate that an `Entity` presents an entire Collection - [@dspaeth-faber](https://github.com/dspaeth-faber).
145
202
  * [#85](https://github.com/ruby-grape/grape-entity/pull/85): Hashes can now be passed as object to be presented and the `Hash` keys can be referenced by expose - [@dspaeth-faber](https://github.com/dspaeth-faber).
146
203
 
204
+
147
205
  ### 0.4.3 (2014-06-12)
148
206
 
149
207
  #### Features
@@ -154,6 +212,7 @@
154
212
 
155
213
  * [#77](https://github.com/ruby-grape/grape-entity/pull/77): Compatibility with Rspec 3 - [@justfalter](https://github.com/justfalter).
156
214
 
215
+
157
216
  ### 0.4.2 (2014-04-03)
158
217
 
159
218
  #### Features
@@ -161,12 +220,14 @@
161
220
  * [#60](https://github.com/ruby-grape/grape-entity/issues/59): Performance issues introduced by nested exposures - [@AlexYankee](https://github.com/AlexYankee).
162
221
  * [#60](https://github.com/ruby-grape/grape-entity/issues/57): Nested exposure double-exposes a field - [@AlexYankee](https://github.com/AlexYankee).
163
222
 
223
+
164
224
  ### 0.4.1 (2014-02-13)
165
225
 
166
226
  #### Fixes
167
227
 
168
228
  * [#54](https://github.com/ruby-grape/grape-entity/issues/54): Fix: undefined method `to_set` - [@aj0strow](https://github.com/aj0strow).
169
229
 
230
+
170
231
  ### 0.4.0 (2014-01-27)
171
232
 
172
233
  #### Features
@@ -186,6 +247,7 @@
186
247
  * [#51](https://github.com/ruby-grape/grape-entity/pull/51): Raise `ArgumentError` if an unknown option is used with `expose` - [@aj0strow](https://github.com/aj0strow).
187
248
  * [#51](https://github.com/ruby-grape/grape-entity/pull/51): Alias `:with` to `:using`, consistently with the Grape api endpoints - [@aj0strow](https://github.com/aj0strow).
188
249
 
250
+
189
251
  ### 0.3.0 (2013-03-29)
190
252
 
191
253
  #### Features
@@ -194,12 +256,14 @@
194
256
  * The `instance.entity` method now optionally accepts `options` - [@mbleigh](https://github.com/mbleigh).
195
257
  * You can pass symbols to `:if` and `:unless` to simply check for truthiness/falsiness of the specified options key - [@mbleigh](https://github.com/mbleigh).
196
258
 
259
+
197
260
  ### 0.2.0 (2013-01-11)
198
261
 
199
262
  #### Features
200
263
 
201
264
  * Moved the namespace back to `Grape::Entity` to preserve compatibility with Grape - [@dblock](https://github.com/dblock).
202
265
 
266
+
203
267
  ### 0.1.0 (2013-01-11)
204
268
 
205
269
  * Initial public release - [@agileanimal](https://github.com/agileanimal).
data/Gemfile CHANGED
@@ -5,16 +5,16 @@ source 'http://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  group :development, :test do
8
- gem 'rubocop', '~> 0.51', require: false
8
+ gem 'rubocop', '~> 1.0', require: false
9
9
  end
10
10
 
11
11
  group :test do
12
- gem 'coveralls', require: false
12
+ gem 'coveralls_reborn', require: false
13
13
  gem 'growl'
14
14
  gem 'guard'
15
15
  gem 'guard-bundler'
16
16
  gem 'guard-rspec'
17
17
  gem 'rb-fsevent'
18
- gem 'ruby-grape-danger', '~> 0.1.1', require: false
18
+ gem 'ruby-grape-danger', '~> 0.2', require: false
19
19
  gem 'simplecov', require: false
20
20
  end