aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantoine <antoine@FreeBSD.org>2015-02-06 20:54:09 +0800
committerantoine <antoine@FreeBSD.org>2015-02-06 20:54:09 +0800
commita5f4d6d3ea272dc6245f27a4a404e48e11d6ad84 (patch)
tree0c350c1854380638a4104bd53be3a6fc0f842e50
parente3c7f2df47816d2687d0050826a28c14025933ab (diff)
downloadfreebsd-ports-gnome-a5f4d6d3ea272dc6245f27a4a404e48e11d6ad84.tar.gz
freebsd-ports-gnome-a5f4d6d3ea272dc6245f27a4a404e48e11d6ad84.tar.zst
freebsd-ports-gnome-a5f4d6d3ea272dc6245f27a4a404e48e11d6ad84.zip
Fix make patch
Pointy hat: mi@
-rw-r--r--devel/rubygem-hashie/Makefile4
-rw-r--r--devel/rubygem-hashie/files/patch-lib_hashie_extensions_indifferent__access.rb31
-rw-r--r--devel/rubygem-hashie/files/patch-spec_hashie_extensions_indifferent__access__with__rails__hwia__spec.rb36
3 files changed, 67 insertions, 4 deletions
diff --git a/devel/rubygem-hashie/Makefile b/devel/rubygem-hashie/Makefile
index dd731f90d580..3574daf5868a 100644
--- a/devel/rubygem-hashie/Makefile
+++ b/devel/rubygem-hashie/Makefile
@@ -6,10 +6,6 @@ PORTVERSION= 3.4.0
CATEGORIES= devel rubygems
MASTER_SITES= RG
-PATCHFILES= 09821f3c90755d019c5083174ab42f442e182767.diff
-PATCH_SITES= https://github.com/intridea/hashie/commit/
-PATCH_DIST_STRIP=-p1 -S + # We don't care to patch CHANGELOG.md
-
MAINTAINER= ports@FreeBSD.org
COMMENT= Hashie is a simple collection of useful Hash extensions
diff --git a/devel/rubygem-hashie/files/patch-lib_hashie_extensions_indifferent__access.rb b/devel/rubygem-hashie/files/patch-lib_hashie_extensions_indifferent__access.rb
new file mode 100644
index 000000000000..fd862f699efc
--- /dev/null
+++ b/devel/rubygem-hashie/files/patch-lib_hashie_extensions_indifferent__access.rb
@@ -0,0 +1,31 @@
+--- lib/hashie/extensions/indifferent_access.rb.orig 2015-02-06 12:45:47 UTC
++++ lib/hashie/extensions/indifferent_access.rb
+@@ -76,16 +76,16 @@ module Hashie
+ # is injecting itself into member hashes.
+ def convert!
+ keys.each do |k|
+- regular_writer convert_key(k), convert_value(regular_delete(k))
++ regular_writer convert_key(k), indifferent_value(regular_delete(k))
+ end
+ self
+ end
+
+- def convert_value(value)
++ def indifferent_value(value)
+ if hash_lacking_indifference?(value)
+ IndifferentAccess.inject!(value)
+ elsif value.is_a?(::Array)
+- value.replace(value.map { |e| convert_value(e) })
++ value.replace(value.map { |e| indifferent_value(e) })
+ else
+ value
+ end
+@@ -104,7 +104,7 @@ module Hashie
+ end
+
+ def indifferent_writer(key, value)
+- regular_writer convert_key(key), convert_value(value)
++ regular_writer convert_key(key), indifferent_value(value)
+ end
+
+ def indifferent_fetch(key, *args, &block)
diff --git a/devel/rubygem-hashie/files/patch-spec_hashie_extensions_indifferent__access__with__rails__hwia__spec.rb b/devel/rubygem-hashie/files/patch-spec_hashie_extensions_indifferent__access__with__rails__hwia__spec.rb
new file mode 100644
index 000000000000..1cd49c56ddf3
--- /dev/null
+++ b/devel/rubygem-hashie/files/patch-spec_hashie_extensions_indifferent__access__with__rails__hwia__spec.rb
@@ -0,0 +1,36 @@
+--- spec/hashie/extensions/indifferent_access_with_rails_hwia_spec.rb.orig 2015-02-06 12:45:47 UTC
++++ spec/hashie/extensions/indifferent_access_with_rails_hwia_spec.rb
+@@ -1,8 +1,9 @@
+ # This set of tests verifies that Hashie::Extensions::IndifferentAccess works with
+ # ActiveSupport HashWithIndifferentAccess hashes. See #164 and #166 for details.
+
+-require 'spec_helper'
+ require 'active_support/hash_with_indifferent_access'
++require 'active_support/core_ext/hash'
++require 'spec_helper'
+
+ describe Hashie::Extensions::IndifferentAccess do
+ class IndifferentHashWithMergeInitializer < Hash
+@@ -35,6 +36,10 @@ describe Hashie::Extensions::Indifferent
+ include Hashie::Extensions::MergeInitializer
+ end
+
++ class MashWithIndifferentAccess < Hashie::Mash
++ include Hashie::Extensions::IndifferentAccess
++ end
++
+ shared_examples_for 'hash with indifferent access' do
+ it 'is able to access via string or symbol' do
+ indifferent_hash = ActiveSupport::HashWithIndifferentAccess.new(abc: 123)
+@@ -193,4 +198,11 @@ describe Hashie::Extensions::Indifferent
+ expect(instance[:foo]).to be_a(ActiveSupport::HashWithIndifferentAccess)
+ end
+ end
++
++ describe 'Mash with indifferent access' do
++ it 'is able to be created for a deep nested HashWithIndifferentAccess' do
++ indifferent_hash = ActiveSupport::HashWithIndifferentAccess.new(abc: { def: 123 })
++ MashWithIndifferentAccess.new(indifferent_hash)
++ end
++ end
+ end