File tree 3 files changed +33
-7
lines changed
3 files changed +33
-7
lines changed Original file line number Diff line number Diff line change 6
6
7
7
#### Fixes
8
8
9
+ * Your contribution here.
10
+ * [ #340 ] ( https://github.com/ruby-grape/grape-entity/pull/340 ) : Preparations for 3.0 - [ @LeFnord ] ( https://github.com/LeFnord ) .
9
11
* [ #338 ] ( https://github.com/ruby-grape/grape-entity/pull/338 ) : Fix ruby 2.7 deprecation warning - [ @begotten63 ] ( https://github.com/begotten63 ) .
10
12
11
13
### 0.8.1 (2020-07-15)
Original file line number Diff line number Diff line change 1
1
Upgrading Grape Entity
2
2
===============
3
3
4
+ ### Upgrading to >= 0.8.2
5
+
6
+ In Ruby 3.0: the block handling will be changed
7
+ [ language-changes point 3, Proc] ( https://github.com/ruby/ruby/blob/v3_0_0_preview1/NEWS.md#language-changes ) .
8
+ This:
9
+ ``` ruby
10
+ expose :that_method_without_args , & :method_without_args
11
+ ```
12
+ will be deprecated.
13
+
14
+ Prefer to use this pattern for simple setting a value
15
+ ``` ruby
16
+ expose :method_without_args , as: :that_method_without_args
17
+ ```
18
+
4
19
### Upgrading to >= 0.6.0
5
20
6
21
#### Changes in Grape::Entity#inspect
Original file line number Diff line number Diff line change @@ -283,16 +283,25 @@ def method_without_args
283
283
end
284
284
285
285
context 'with block passed in via &' do
286
- specify do
287
- subject . expose :that_method_without_args_again , & :method_without_args
288
-
289
- object = SomeObject . new
286
+ if RUBY_VERSION . start_with? ( '3' )
287
+ specify do
288
+ subject . expose :that_method_without_args , & :method_without_args
289
+ subject . expose :method_without_args , as : :that_method_without_args_again
290
290
291
- if RUBY_VERSION . start_with? ( '3' )
291
+ object = SomeObject . new
292
292
expect do
293
- subject . represent ( object ) . value_for ( :that_method_without_args_again )
293
+ subject . represent ( object ) . value_for ( :that_method_without_args )
294
294
end . to raise_error Grape ::Entity ::Deprecated
295
- else
295
+
296
+ value2 = subject . represent ( object ) . value_for ( :that_method_without_args_again )
297
+ expect ( value2 ) . to eq ( 'result' )
298
+ end
299
+ else
300
+ specify do
301
+ subject . expose :that_method_without_args_again , &:method_without_args
302
+
303
+ object = SomeObject . new
304
+
296
305
value2 = subject . represent ( object ) . value_for ( :that_method_without_args_again )
297
306
expect ( value2 ) . to eq ( 'result' )
298
307
end
You can’t perform that action at this time.
0 commit comments