git: ebc424519cae - main - devel/rubygem-cow_proxy: Add rubygem-cow_proxy 0.3.3

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sat, 27 Aug 2022 10:30:57 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ebc424519cae062d25d749216e8e626b109e186a

commit ebc424519cae062d25d749216e8e626b109e186a
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-08-27 10:10:49 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-08-27 10:10:49 +0000

    devel/rubygem-cow_proxy: Add rubygem-cow_proxy 0.3.3
    
    This is a copy-on-write proxy for frozen Ruby objects, so duplicating frozen
    object is delayed until a method tries to change frozen object.
    
    CowProxy classes for array, hash, string and struct are provided. Objects from
    other classes will be proxied without copy-on-write, you have to create a
    CowProxy class for them to enable copy-on-write. Also you have to create
    CowProxy class for each object which have any getter method with arguments,
    because default CowProxy won't wrap returned value. Immutable classes such as
    Integer or TrueClass doesn't need copy-on-write proxy because they can't be
    changed.
    
    You can wrap every object in a proxy. Proxy will always send method calls to
    wrapped object, and wrap returned value with a CowProxy class if method has no
    argument, so a proxy will always return proxy objects for getters without
    arguments. When a method tries to change a frozen object, if proxy has
    copy-on-write enabled, it will duplicate frozen object and will send next method
    calls to duplicated object, in other case an exception is raised.
    
    WWW: https://github.com/activescaffold/cow_proxy
---
 devel/Makefile                    |  1 +
 devel/rubygem-cow_proxy/Makefile  | 17 +++++++++++++++++
 devel/rubygem-cow_proxy/distinfo  |  3 +++
 devel/rubygem-cow_proxy/pkg-descr | 19 +++++++++++++++++++
 4 files changed, 40 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index c85fb2f7f9e6..b9ba43e97853 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -6316,6 +6316,7 @@
     SUBDIR += rubygem-corefines
     SUBDIR += rubygem-cork
     SUBDIR += rubygem-countries
+    SUBDIR += rubygem-cow_proxy
     SUBDIR += rubygem-crack
     SUBDIR += rubygem-cri
     SUBDIR += rubygem-csv
diff --git a/devel/rubygem-cow_proxy/Makefile b/devel/rubygem-cow_proxy/Makefile
new file mode 100644
index 000000000000..cd6c8e9684d1
--- /dev/null
+++ b/devel/rubygem-cow_proxy/Makefile
@@ -0,0 +1,17 @@
+PORTNAME=	cow_proxy
+PORTVERSION=	0.3.3
+CATEGORIES=	devel rubygems
+MASTER_SITES=	RG
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Copy-on-write proxy for frozen Ruby objects
+
+LICENSE=	MIT
+#LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		gem
+USE_RUBY=	yes
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/rubygem-cow_proxy/distinfo b/devel/rubygem-cow_proxy/distinfo
new file mode 100644
index 000000000000..a3b52b475049
--- /dev/null
+++ b/devel/rubygem-cow_proxy/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1660576710
+SHA256 (rubygem/cow_proxy-0.3.3.gem) = 705b307b714005366a64ce3ec15d5219cdfae0966a46fa4cf075d011bcc8618c
+SIZE (rubygem/cow_proxy-0.3.3.gem) = 11264
diff --git a/devel/rubygem-cow_proxy/pkg-descr b/devel/rubygem-cow_proxy/pkg-descr
new file mode 100644
index 000000000000..d4e2fd1afba3
--- /dev/null
+++ b/devel/rubygem-cow_proxy/pkg-descr
@@ -0,0 +1,19 @@
+This is a copy-on-write proxy for frozen Ruby objects, so duplicating frozen
+object is delayed until a method tries to change frozen object.
+
+CowProxy classes for array, hash, string and struct are provided. Objects from
+other classes will be proxied without copy-on-write, you have to create a
+CowProxy class for them to enable copy-on-write. Also you have to create
+CowProxy class for each object which have any getter method with arguments,
+because default CowProxy won't wrap returned value. Immutable classes such as
+Integer or TrueClass doesn't need copy-on-write proxy because they can't be
+changed.
+
+You can wrap every object in a proxy. Proxy will always send method calls to
+wrapped object, and wrap returned value with a CowProxy class if method has no
+argument, so a proxy will always return proxy objects for getters without
+arguments. When a method tries to change a frozen object, if proxy has
+copy-on-write enabled, it will duplicate frozen object and will send next method
+calls to duplicated object, in other case an exception is raised.
+
+WWW: https://github.com/activescaffold/cow_proxy