[DRE-commits] [ruby-grape-entity] 01/02: 0004-Add-is_a-and-kind_of-to-OutputBuilder-to-check-its-o.patch to restore compatibility of ruby-grape-entity with ruby-grape and avoid test failures (Closes: #826317, #826316)

Cédric Boutillier boutil at moszumanska.debian.org
Thu Jul 7 12:27:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository ruby-grape-entity.

commit 08789078074ce06e725c05452d1a6d3efa4b872e
Author: Cédric Boutillier <boutil at debian.org>
Date:   Thu Jul 7 11:07:35 2016 +0200

    0004-Add-is_a-and-kind_of-to-OutputBuilder-to-check-its-o.patch to restore compatibility of ruby-grape-entity with ruby-grape and avoid test failures (Closes: #826317, #826316)
---
 debian/changelog                                   |  6 +++
 ...d-kind_of-to-OutputBuilder-to-check-its-o.patch | 43 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 50 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 18da790..7dc9a0b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,15 @@
 ruby-grape-entity (0.5.1-1.1) UNRELEASED; urgency=medium
 
+  [ Pirate Praveen ]
   * Team upload
   * Use unshift in gemspec for LOADPATH (it now takes correct version
     even when old version is installed during build)
 
+  [ Cédric Boutillier ]
+  * 0004-Add-is_a-and-kind_of-to-OutputBuilder-to-check-its-o.patch to restore
+    compatibility of ruby-grape-entity with ruby-grape and avoid test failures
+    (Closes: #826317, #826316)
+
  -- Pirate Praveen <praveen at debian.org>  Sat, 04 Jun 2016 23:18:42 +0530
 
 ruby-grape-entity (0.5.1-1) unstable; urgency=medium
diff --git a/debian/patches/0004-Add-is_a-and-kind_of-to-OutputBuilder-to-check-its-o.patch b/debian/patches/0004-Add-is_a-and-kind_of-to-OutputBuilder-to-check-its-o.patch
new file mode 100644
index 0000000..918cd45
--- /dev/null
+++ b/debian/patches/0004-Add-is_a-and-kind_of-to-OutputBuilder-to-check-its-o.patch
@@ -0,0 +1,43 @@
+From: Alexander Yunin <use.skills at gmail.com>
+Date: Mon, 4 Jul 2016 22:09:59 +0300
+Subject: Add #is_a? and #kind_of? to OutputBuilder to check its output object
+ class, specify rack,
+ json and active_support version for supporting old rubies (#232)
+Applied-Upstream: https://github.com/ruby-grape/grape-entity/commit/c5abc1bc83ee01f8cb23b4e77e21846bcb733157
+Bug: https://github.com/ruby-grape/grape/issues/1350
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826316
+Reviewed-by: Cédric Boutillier <boutil at debian.org>
+
+---
+ lib/grape_entity/exposure/nesting_exposure/output_builder.rb | 5 +++++
+ spec/grape_entity/entity_spec.rb                             | 1 +
+ 2 files changed, 6 insertions(+)
+
+diff --git a/lib/grape_entity/exposure/nesting_exposure/output_builder.rb b/lib/grape_entity/exposure/nesting_exposure/output_builder.rb
+index 0064759..5fc4a63 100644
+--- a/lib/grape_entity/exposure/nesting_exposure/output_builder.rb
++++ b/lib/grape_entity/exposure/nesting_exposure/output_builder.rb
+@@ -25,6 +25,11 @@ module Grape
+             end
+           end
+ 
++          def kind_of?(klass)
++            klass == output.class || super
++          end
++          alias_method :is_a?, :kind_of?
++
+           def __getobj__
+             output
+           end
+diff --git a/spec/grape_entity/entity_spec.rb b/spec/grape_entity/entity_spec.rb
+index 0b3069e..2100b7a 100644
+--- a/spec/grape_entity/entity_spec.rb
++++ b/spec/grape_entity/entity_spec.rb
+@@ -905,6 +905,7 @@ describe Grape::Entity do
+ 
+         representation = subject.represent(4.times.map { Object.new }, serializable: true)
+         expect(representation).to be_kind_of(Grape::Entity::Exposure::NestingExposure::OutputBuilder)
++        expect(representation).to be_kind_of(Hash)
+         expect(representation).to have_key :my_items
+         expect(representation[:my_items]).to be_kind_of Array
+         expect(representation[:my_items].size).to be 4
diff --git a/debian/patches/series b/debian/patches/series
index c6b7c09..e9fe89c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 use-unshift-in-gemspec.patch
 0002-require_activesupport_hash.patch
 0001-Cleanup-require-stuff-in-spec_helper.patch
+0004-Add-is_a-and-kind_of-to-OutputBuilder-to-check-its-o.patch

-- 
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