[DRE-commits] [ruby-hashie] 04/05: Add patch from upstream improving ruby2.3 compatibility

zeha at debian.org zeha at debian.org
Wed Mar 2 17:11:40 UTC 2016


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

zeha pushed a commit to branch master
in repository ruby-hashie.

commit 0798ad39ff15e44016334b7b5c32751673e4ec36
Author: Christian Hofstaedtler <zeha at debian.org>
Date:   Wed Mar 2 18:06:41 2016 +0100

    Add patch from upstream improving ruby2.3 compatibility
---
 debian/patches/github-pr-349.patch | 46 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series              |  1 +
 2 files changed, 47 insertions(+)

diff --git a/debian/patches/github-pr-349.patch b/debian/patches/github-pr-349.patch
new file mode 100644
index 0000000..ae6991a
--- /dev/null
+++ b/debian/patches/github-pr-349.patch
@@ -0,0 +1,46 @@
+From 1433295e22c49db5851d16b5aef7b590a3bf2d40 Mon Sep 17 00:00:00 2001
+From: Takashi Kokubun <takashikkbn at gmail.com>
+Date: Sat, 6 Feb 2016 23:41:55 +0900
+Subject: [PATCH] Convert Mash keys for #dig
+
+[Debian note: edited to drop changes to CHANGELOG.md, .rubocop_todo.yml]
+
+---
+
+Index: ruby-hashie/lib/hashie/mash.rb
+===================================================================
+--- ruby-hashie.orig/lib/hashie/mash.rb
++++ ruby-hashie/lib/hashie/mash.rb
+@@ -250,6 +250,12 @@ module Hashie
+       Hashie::Mash.new(other_hash).merge(self)
+     end
+ 
++    if RUBY_VERSION >= '2.3.0'
++      def dig(*keys)
++        super(*keys.map { |key| convert_key(key) })
++      end
++    end
++
+     protected
+ 
+     def method_name_and_suffix(method_name)
+Index: ruby-hashie/spec/hashie/mash_spec.rb
+===================================================================
+--- ruby-hashie.orig/spec/hashie/mash_spec.rb
++++ ruby-hashie/spec/hashie/mash_spec.rb
+@@ -679,4 +679,15 @@ describe Hashie::Mash do
+       expect(subject.reverse_merge(a: 5).a).to eq subject.a
+     end
+   end
++
++  if RUBY_VERSION >= '2.3.0'
++    describe '#dig' do
++      subject { described_class.new(a: { b: 1 }) }
++
++      it 'accepts both string and symbol as key' do
++        expect(subject.dig(:a, :b)).to eq(1)
++        expect(subject.dig('a', 'b')).to eq(1)
++      end
++    end
++  end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index e15b691..09b8189 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-spec-spec_helper.rb-don-t-load-pry.patch
 fixup-tests.patch
+github-pr-349.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-hashie.git



More information about the Pkg-ruby-extras-commits mailing list