Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 2015 12:54:10 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r378533 - in head/devel/rubygem-hashie: . files
Message-ID:  <201502061254.t16CsAfG000524@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Fri Feb  6 12:54:09 2015
New Revision: 378533
URL: https://svnweb.freebsd.org/changeset/ports/378533
QAT: https://qat.redports.org/buildarchive/r378533/

Log:
  Fix make patch
  
  Pointy hat:	mi@

Added:
  head/devel/rubygem-hashie/files/
  head/devel/rubygem-hashie/files/patch-lib_hashie_extensions_indifferent__access.rb   (contents, props changed)
  head/devel/rubygem-hashie/files/patch-spec_hashie_extensions_indifferent__access__with__rails__hwia__spec.rb   (contents, props changed)
Modified:
  head/devel/rubygem-hashie/Makefile

Modified: head/devel/rubygem-hashie/Makefile
==============================================================================
--- head/devel/rubygem-hashie/Makefile	Fri Feb  6 12:52:52 2015	(r378532)
+++ head/devel/rubygem-hashie/Makefile	Fri Feb  6 12:54:09 2015	(r378533)
@@ -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
 

Added: head/devel/rubygem-hashie/files/patch-lib_hashie_extensions_indifferent__access.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/rubygem-hashie/files/patch-lib_hashie_extensions_indifferent__access.rb	Fri Feb  6 12:54:09 2015	(r378533)
@@ -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)

Added: head/devel/rubygem-hashie/files/patch-spec_hashie_extensions_indifferent__access__with__rails__hwia__spec.rb
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/rubygem-hashie/files/patch-spec_hashie_extensions_indifferent__access__with__rails__hwia__spec.rb	Fri Feb  6 12:54:09 2015	(r378533)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502061254.t16CsAfG000524>