grape-entity 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/.rubocop_todo.yml +1 -1
- data/.travis.yml +6 -7
- data/CHANGELOG.md +20 -0
- data/Gemfile +3 -8
- data/Rakefile +1 -1
- data/grape-entity.gemspec +3 -1
- data/lib/grape_entity/entity.rb +4 -2
- data/lib/grape_entity/exposure/base.rb +1 -2
- data/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb +1 -0
- data/lib/grape_entity/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04e39a2c99114bcf750f4ca63fa6119ffa0cd5ca
|
4
|
+
data.tar.gz: 1875a1693ff3de51c40db11a8c755464a93f09bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc6b4795400645718b1228affae6067dabb1214a13d033f0b979e096d649d03d9b05897df537c7e7d0cba2991914e958fe3d26f96b58c4ae62bfc51a63a42e7
|
7
|
+
data.tar.gz: 2cec009315195a548380c46fa057036a21f8e25b7da03a368f150a3cfe2a3e290c5c67b56ccce262db8a485a51b6b130d3d760e992a6aa7d863033af3a4494d7
|
data/.rspec
CHANGED
data/.rubocop_todo.yml
CHANGED
data/.travis.yml
CHANGED
@@ -7,20 +7,19 @@ bundler_args: --without test
|
|
7
7
|
|
8
8
|
matrix:
|
9
9
|
include:
|
10
|
-
- rvm: 2.
|
10
|
+
- rvm: 2.4.0
|
11
11
|
script:
|
12
12
|
- bundle exec danger
|
13
|
-
- rvm: 2.
|
14
|
-
- rvm: 2.3.
|
15
|
-
- rvm: 2.2
|
16
|
-
- rvm: 2.1
|
13
|
+
- rvm: 2.4.0
|
14
|
+
- rvm: 2.3.3
|
15
|
+
- rvm: 2.2.6
|
17
16
|
- rvm: ruby-head
|
18
|
-
- rvm: jruby-9.1.
|
17
|
+
- rvm: jruby-9.1.6.0
|
19
18
|
- rvm: jruby-head
|
20
19
|
- rvm: rbx-2
|
21
20
|
|
22
21
|
allow_failures:
|
23
22
|
- rvm: ruby-head
|
24
|
-
- rvm: jruby-9.1.
|
23
|
+
- rvm: jruby-9.1.6.0
|
25
24
|
- rvm: jruby-head
|
26
25
|
- rvm: rbx-2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
### Next
|
2
|
+
|
3
|
+
#### Features
|
4
|
+
|
5
|
+
* Your contribution here.
|
6
|
+
|
7
|
+
#### Fixes
|
8
|
+
|
9
|
+
* Your contribution here.
|
10
|
+
|
11
|
+
### 0.6.1 (2017-01-09)
|
12
|
+
|
13
|
+
#### Features
|
14
|
+
|
15
|
+
* [#253](https://github.com/ruby-grape/grape-entity/pull/253): Adds ruby 2.4.0 support, updates dependencies - [@LeFnord](https://github.com/LeFnord).
|
16
|
+
|
17
|
+
#### Fixes
|
18
|
+
|
19
|
+
* [#251](https://github.com/ruby-grape/grape-entity/pull/251): Avoid noise when code runs with Ruby warnings - [@cpetschnig](https://github.com/cpetschnig).
|
20
|
+
|
1
21
|
### 0.6.0 (2016-11-20)
|
2
22
|
|
3
23
|
#### Features
|
data/Gemfile
CHANGED
@@ -2,19 +2,14 @@ source 'http://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
if RUBY_VERSION < '2.2.2'
|
6
|
-
gem 'rack', '<2.0.0'
|
7
|
-
gem 'activesupport', '<5.0.0'
|
8
|
-
end
|
9
|
-
|
10
5
|
group :development, :test do
|
11
|
-
gem 'ruby-grape-danger', '~> 0.1.
|
6
|
+
gem 'ruby-grape-danger', '~> 0.1.1', require: false
|
12
7
|
end
|
13
8
|
|
14
9
|
group :test do
|
10
|
+
gem 'growl'
|
15
11
|
gem 'guard'
|
16
|
-
gem 'guard-rspec'
|
17
12
|
gem 'guard-bundler'
|
13
|
+
gem 'guard-rspec'
|
18
14
|
gem 'rb-fsevent'
|
19
|
-
gem 'growl'
|
20
15
|
end
|
data/Rakefile
CHANGED
data/grape-entity.gemspec
CHANGED
@@ -12,10 +12,12 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.description = 'Extracted from Grape, A Ruby framework for rapid API development with great conventions.'
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
|
+
s.required_ruby_version = '>= 2.2.6'
|
16
|
+
|
15
17
|
s.rubyforge_project = 'grape-entity'
|
16
18
|
|
17
19
|
s.add_runtime_dependency 'multi_json', '>= 1.3.2'
|
18
|
-
s.add_runtime_dependency 'activesupport'
|
20
|
+
s.add_runtime_dependency 'activesupport', '>= 5.0.0'
|
19
21
|
|
20
22
|
s.add_development_dependency 'bundler'
|
21
23
|
s.add_development_dependency 'rake'
|
data/lib/grape_entity/entity.rb
CHANGED
@@ -392,6 +392,7 @@ module Grape
|
|
392
392
|
# @option options :only [Array] all the fields that should be returned
|
393
393
|
# @option options :except [Array] all the fields that should not be returned
|
394
394
|
def self.represent(objects, options = {})
|
395
|
+
@present_collection ||= nil
|
395
396
|
if objects.respond_to?(:to_ary) && !@present_collection
|
396
397
|
root_element = root_element(:collection_root)
|
397
398
|
inner = objects.to_ary.map { |object| new(object, options.reverse_merge(collection: true)).presented }
|
@@ -409,8 +410,9 @@ module Grape
|
|
409
410
|
# This method returns the entity's root or collection root node, or its parent's
|
410
411
|
# @param root_type: either :collection_root or just :root
|
411
412
|
def self.root_element(root_type)
|
412
|
-
|
413
|
-
|
413
|
+
instance_variable = "@#{root_type}"
|
414
|
+
if instance_variable_defined?(instance_variable) && instance_variable_get(instance_variable)
|
415
|
+
instance_variable_get(instance_variable)
|
414
416
|
elsif superclass.respond_to? :root_element
|
415
417
|
superclass.root_element(root_type)
|
416
418
|
end
|
data/lib/grape_entity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-entity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bleigh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 5.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 5.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
234
|
requirements:
|
235
235
|
- - ">="
|
236
236
|
- !ruby/object:Gem::Version
|
237
|
-
version:
|
237
|
+
version: 2.2.6
|
238
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
239
|
requirements:
|
240
240
|
- - ">="
|
@@ -242,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
242
|
version: '0'
|
243
243
|
requirements: []
|
244
244
|
rubyforge_project: grape-entity
|
245
|
-
rubygems_version: 2.
|
245
|
+
rubygems_version: 2.6.8
|
246
246
|
signing_key:
|
247
247
|
specification_version: 4
|
248
248
|
summary: A simple facade for managing the relationship between your model and API.
|
@@ -253,4 +253,3 @@ test_files:
|
|
253
253
|
- spec/grape_entity/exposure_spec.rb
|
254
254
|
- spec/grape_entity/hash_spec.rb
|
255
255
|
- spec/spec_helper.rb
|
256
|
-
has_rdoc:
|