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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 230adb183db517d87581a13ad117183b6ed035a0
4
- data.tar.gz: 9a7b29b6b1418f08367304c0413ebcf7a15945cf
3
+ metadata.gz: 04e39a2c99114bcf750f4ca63fa6119ffa0cd5ca
4
+ data.tar.gz: 1875a1693ff3de51c40db11a8c755464a93f09bd
5
5
  SHA512:
6
- metadata.gz: 7c09517473a2401944335070e9d9d9f48ef32358c47b936627d8997f18bcefe08692d64d8e6caa88b1e4fbc4e914c5e26a7b4af76eec2e5525fe27434395b98b
7
- data.tar.gz: 034ba7079bc7dc1e5d1a42d011d92130ea83cef5f673137c1e4622eace4c614fdf4f695bb7614bd2c576df4369990af79c6f14423ef9c03129182810fb9ff0fa
6
+ metadata.gz: 3cc6b4795400645718b1228affae6067dabb1214a13d033f0b979e096d649d03d9b05897df537c7e7d0cba2991914e958fe3d26f96b58c4ae62bfc51a63a42e7
7
+ data.tar.gz: 2cec009315195a548380c46fa057036a21f8e25b7da03a368f150a3cfe2a3e290c5c67b56ccce262db8a485a51b6b130d3d760e992a6aa7d863033af3a4494d7
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
+ --format documentation
1
2
  --color
2
- --format=progress
@@ -13,7 +13,7 @@ Metrics/AbcSize:
13
13
  # Offense count: 2
14
14
  # Configuration parameters: CountComments.
15
15
  Metrics/ClassLength:
16
- Max: 206
16
+ Max: 208
17
17
 
18
18
  # Offense count: 3
19
19
  Metrics/CyclomaticComplexity:
@@ -7,20 +7,19 @@ bundler_args: --without test
7
7
 
8
8
  matrix:
9
9
  include:
10
- - rvm: 2.3.1
10
+ - rvm: 2.4.0
11
11
  script:
12
12
  - bundle exec danger
13
- - rvm: 2.3.1
14
- - rvm: 2.3.0
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.2.0
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.2.0
23
+ - rvm: jruby-9.1.6.0
25
24
  - rvm: jruby-head
26
25
  - rvm: rbx-2
@@ -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.0', require: false
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
@@ -17,4 +17,4 @@ RSpec::Core::RakeTask.new(:spec)
17
17
  require 'rubocop/rake_task'
18
18
  RuboCop::RakeTask.new(:rubocop)
19
19
 
20
- task default: [:rubocop, :spec]
20
+ task default: [:spec, :rubocop]
@@ -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'
@@ -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
- if instance_variable_get("@#{root_type}")
413
- instance_variable_get("@#{root_type}")
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
@@ -34,8 +34,7 @@ module Grape
34
34
  @conditions == other.conditions
35
35
  end
36
36
 
37
- def setup
38
- end
37
+ def setup; end
39
38
 
40
39
  def nesting?
41
40
  false
@@ -7,6 +7,7 @@ module Grape
7
7
 
8
8
  def initialize(exposures)
9
9
  @exposures = exposures
10
+ @deep_complex_nesting = nil
10
11
  end
11
12
 
12
13
  def find_by(attribute)
@@ -1,3 +1,3 @@
1
1
  module GrapeEntity
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.6.1'.freeze
3
3
  end
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.0
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: 2016-11-21 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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.5.1
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: