[DRE-commits] [ruby-grape-entity] 01/07: New upstream version 0.6.1
Lucas Kanashiro
kanashiro at moszumanska.debian.org
Wed Sep 27 16:30:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
kanashiro pushed a commit to branch master
in repository ruby-grape-entity.
commit fb9160e38e96e4df2450d6f5c5a60f5ef2697d3c
Author: Lucas Kanashiro <kanashiro.duarte at gmail.com>
Date: Wed Sep 27 10:15:10 2017 -0300
New upstream version 0.6.1
---
.rspec | 2 +-
.rubocop_todo.yml | 2 +-
.travis.yml | 13 ++++++-------
CHANGELOG.md | 20 ++++++++++++++++++++
Gemfile | 11 +++--------
Rakefile | 2 +-
grape-entity.gemspec | 4 +++-
lib/grape_entity/entity.rb | 6 ++++--
lib/grape_entity/exposure/base.rb | 3 +--
.../exposure/nesting_exposure/nested_exposures.rb | 1 +
lib/grape_entity/version.rb | 2 +-
11 files changed, 42 insertions(+), 24 deletions(-)
diff --git a/.rspec b/.rspec
index 8f815c6..8c18f1a 100644
--- a/.rspec
+++ b/.rspec
@@ -1,2 +1,2 @@
+--format documentation
--color
---format=progress
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 1090807..82baf65 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -13,7 +13,7 @@ Metrics/AbcSize:
# Offense count: 2
# Configuration parameters: CountComments.
Metrics/ClassLength:
- Max: 206
+ Max: 208
# Offense count: 3
Metrics/CyclomaticComplexity:
diff --git a/.travis.yml b/.travis.yml
index 4a993cb..1870012 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,20 +7,19 @@ bundler_args: --without test
matrix:
include:
- - rvm: 2.3.1
+ - rvm: 2.4.0
script:
- bundle exec danger
- - rvm: 2.3.1
- - rvm: 2.3.0
- - rvm: 2.2
- - rvm: 2.1
+ - rvm: 2.4.0
+ - rvm: 2.3.3
+ - rvm: 2.2.6
- rvm: ruby-head
- - rvm: jruby-9.1.2.0
+ - rvm: jruby-9.1.6.0
- rvm: jruby-head
- rvm: rbx-2
allow_failures:
- rvm: ruby-head
- - rvm: jruby-9.1.2.0
+ - rvm: jruby-9.1.6.0
- rvm: jruby-head
- rvm: rbx-2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b4589b2..1edb523 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,23 @@
+### Next
+
+#### Features
+
+* Your contribution here.
+
+#### Fixes
+
+* Your contribution here.
+
+### 0.6.1 (2017-01-09)
+
+#### Features
+
+* [#253](https://github.com/ruby-grape/grape-entity/pull/253): Adds ruby 2.4.0 support, updates dependencies - [@LeFnord](https://github.com/LeFnord).
+
+#### Fixes
+
+* [#251](https://github.com/ruby-grape/grape-entity/pull/251): Avoid noise when code runs with Ruby warnings - [@cpetschnig](https://github.com/cpetschnig).
+
### 0.6.0 (2016-11-20)
#### Features
diff --git a/Gemfile b/Gemfile
index 76e900c..d979b35 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,19 +2,14 @@ source 'http://rubygems.org'
gemspec
-if RUBY_VERSION < '2.2.2'
- gem 'rack', '<2.0.0'
- gem 'activesupport', '<5.0.0'
-end
-
group :development, :test do
- gem 'ruby-grape-danger', '~> 0.1.0', require: false
+ gem 'ruby-grape-danger', '~> 0.1.1', require: false
end
group :test do
+ gem 'growl'
gem 'guard'
- gem 'guard-rspec'
gem 'guard-bundler'
+ gem 'guard-rspec'
gem 'rb-fsevent'
- gem 'growl'
end
diff --git a/Rakefile b/Rakefile
index 86fa412..d37a305 100644
--- a/Rakefile
+++ b/Rakefile
@@ -17,4 +17,4 @@ RSpec::Core::RakeTask.new(:spec)
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop)
-task default: [:rubocop, :spec]
+task default: [:spec, :rubocop]
diff --git a/grape-entity.gemspec b/grape-entity.gemspec
index 10adfce..54eeae4 100644
--- a/grape-entity.gemspec
+++ b/grape-entity.gemspec
@@ -12,10 +12,12 @@ Gem::Specification.new do |s|
s.description = 'Extracted from Grape, A Ruby framework for rapid API development with great conventions.'
s.license = 'MIT'
+ s.required_ruby_version = '>= 2.2.6'
+
s.rubyforge_project = 'grape-entity'
s.add_runtime_dependency 'multi_json', '>= 1.3.2'
- s.add_runtime_dependency 'activesupport'
+ s.add_runtime_dependency 'activesupport', '>= 5.0.0'
s.add_development_dependency 'bundler'
s.add_development_dependency 'rake'
diff --git a/lib/grape_entity/entity.rb b/lib/grape_entity/entity.rb
index 1b583fa..4dc988b 100644
--- a/lib/grape_entity/entity.rb
+++ b/lib/grape_entity/entity.rb
@@ -392,6 +392,7 @@ module Grape
# @option options :only [Array] all the fields that should be returned
# @option options :except [Array] all the fields that should not be returned
def self.represent(objects, options = {})
+ @present_collection ||= nil
if objects.respond_to?(:to_ary) && !@present_collection
root_element = root_element(:collection_root)
inner = objects.to_ary.map { |object| new(object, options.reverse_merge(collection: true)).presented }
@@ -409,8 +410,9 @@ module Grape
# This method returns the entity's root or collection root node, or its parent's
# @param root_type: either :collection_root or just :root
def self.root_element(root_type)
- if instance_variable_get("@#{root_type}")
- instance_variable_get("@#{root_type}")
+ instance_variable = "@#{root_type}"
+ if instance_variable_defined?(instance_variable) && instance_variable_get(instance_variable)
+ instance_variable_get(instance_variable)
elsif superclass.respond_to? :root_element
superclass.root_element(root_type)
end
diff --git a/lib/grape_entity/exposure/base.rb b/lib/grape_entity/exposure/base.rb
index 656c077..40adee9 100644
--- a/lib/grape_entity/exposure/base.rb
+++ b/lib/grape_entity/exposure/base.rb
@@ -34,8 +34,7 @@ module Grape
@conditions == other.conditions
end
- def setup
- end
+ def setup; end
def nesting?
false
diff --git a/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb b/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb
index 013c702..2a71421 100644
--- a/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb
+++ b/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb
@@ -7,6 +7,7 @@ module Grape
def initialize(exposures)
@exposures = exposures
+ @deep_complex_nesting = nil
end
def find_by(attribute)
diff --git a/lib/grape_entity/version.rb b/lib/grape_entity/version.rb
index 0824a1b..e9d04e0 100644
--- a/lib/grape_entity/version.rb
+++ b/lib/grape_entity/version.rb
@@ -1,3 +1,3 @@
module GrapeEntity
- VERSION = '0.6.0'.freeze
+ VERSION = '0.6.1'.freeze
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-grape-entity.git
More information about the Pkg-ruby-extras-commits
mailing list