public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-ruby/safe_yaml/files/, dev-ruby/safe_yaml/
@ 2023-04-01  6:25 Hans de Graaff
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Graaff @ 2023-04-01  6:25 UTC (permalink / raw
  To: gentoo-commits

commit:     ef67bb12821ad41b8f4c6bbbd37a0b90d46904f8
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 31 08:02:59 2023 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Sat Apr  1 06:25:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef67bb12

dev-ruby/safe_yaml: update EAPI 7 -> 8, add ruby30

Fix ruby30 compatibility with debian patches. Thanks to matoro for
finding them in the references bug.

Closes: https://bugs.gentoo.org/835405
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 .../files/safe_yaml-1.0.5-ruby30-arity.patch       | 23 ++++++++
 .../safe_yaml-1.0.5-ruby30-openstruct-tests.patch  | 69 ++++++++++++++++++++++
 dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild       | 40 +++++++++++++
 3 files changed, 132 insertions(+)

diff --git a/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-arity.patch b/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-arity.patch
new file mode 100644
index 000000000000..e994a48bbecb
--- /dev/null
+++ b/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-arity.patch
@@ -0,0 +1,23 @@
+From: Daniel Leidert <dleidert@debian.org>
+Date: Wed, 1 Dec 2021 18:51:51 +0100
+Subject: Fix Rubx 3 compatibility
+
+Origin: https://github.com/dtao/safe_yaml/compare/master...paolobrasolin:development
+Bug: https://github.com/dtao/safe_yaml/issues/100
+---
+ lib/safe_yaml/safe_to_ruby_visitor.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/safe_yaml/safe_to_ruby_visitor.rb b/lib/safe_yaml/safe_to_ruby_visitor.rb
+index b980445..5fd71f0 100644
+--- a/lib/safe_yaml/safe_to_ruby_visitor.rb
++++ b/lib/safe_yaml/safe_to_ruby_visitor.rb
+@@ -4,7 +4,7 @@ module SafeYAML
+ 
+     def initialize(resolver)
+       case INITIALIZE_ARITY
+-      when 2
++      when 2, -3
+         # https://github.com/tenderlove/psych/blob/v2.0.0/lib/psych/visitors/to_ruby.rb#L14-L28
+         loader  = Psych::ClassLoader.new
+         scanner = Psych::ScalarScanner.new(loader)

diff --git a/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-openstruct-tests.patch b/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-openstruct-tests.patch
new file mode 100644
index 000000000000..9b597276617b
--- /dev/null
+++ b/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-openstruct-tests.patch
@@ -0,0 +1,69 @@
+From: Sergio Durigan Junior <sergiodj@debian.org>
+Date: Fri, 28 Jan 2022 16:35:01 -0500
+Subject: Adjust tests to reflect OpenStruct changes on Ruby3.0
+
+Ref.: https://github.com/ruby/psych/issues/540
+
+OpenStruct on Ruby3.0 changed its marshalling/unmarshalling code,
+which is now impacting safe_yaml's testcase.  The two adjustments that
+needed to be made are:
+
+- OpenStruct's instance_variable_get will now symbolize its hash keys,
+  instead of using strings.
+
+- OpenStruct's to_yaml method will not output the 'table' entity
+  anymore.
+
+Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
+
+Forwarded: yes, https://github.com/dtao/safe_yaml/pull/102
+---
+ spec/safe_yaml_spec.rb | 26 +++++++++++++++++++++++---
+ 1 file changed, 23 insertions(+), 3 deletions(-)
+
+diff --git a/spec/safe_yaml_spec.rb b/spec/safe_yaml_spec.rb
+index aa701a4..1081173 100644
+--- a/spec/safe_yaml_spec.rb
++++ b/spec/safe_yaml_spec.rb
+@@ -318,7 +318,13 @@ describe YAML do
+       it "will allow objects to be deserialized for whitelisted tags" do
+         result = YAML.safe_load("--- !ruby/object:OpenStruct\ntable:\n  foo: bar\n")
+         expect(result).to be_a(OpenStruct)
+-        expect(result.instance_variable_get(:@table)).to eq({ "foo" => "bar" })
++        if RUBY_VERSION < '3.0'
++          expect(result.instance_variable_get(:@table)).to eq({ "foo" => "bar" })
++        else
++          # Ruby3.0's OpenStruct will now symbolize the hash key.
++          # Ref.: https://github.com/ruby/psych/issues/540
++          expect(result.instance_variable_get(:@table)).to eq({ :foo => "bar" })
++        end
+       end
+ 
+       it "will not deserialize objects without whitelisted tags" do
+@@ -463,10 +469,24 @@ describe YAML do
+ 
+         it "allows the default option to be overridden on a per-call basis" do
+           result = safe_load_round_trip(OpenStruct.new(:foo => "bar"), :whitelisted_tags => [])
+-          expect(result).to eq({ "table" => { :foo => "bar" } })
++          if RUBY_VERSION < '3.0'
++            expect(result).to eq({ "table" => { :foo => "bar" } })
++          else
++            # Ruby3.0's OpenStruct's to_yaml method doesn't output the
++            # 'table' entity anymore.
++            # Ref.: https://github.com/ruby/psych/issues/540
++            expect(result).to eq({ "foo" => "bar" })
++          end
+ 
+           result = safe_load_round_trip(OpenStruct.new(:foo => "bar"), :deserialize_symbols => false, :whitelisted_tags => [])
+-          expect(result).to eq({ "table" => { ":foo" => "bar" } })
++          if RUBY_VERSION < '3.0'
++            expect(result).to eq({ "table" => { ":foo" => "bar" } })
++          else
++            # Ruby3.0's OpenStruct's to_yaml method doesn't output the
++            # 'table' entity anymore.
++            # Ref.: https://github.com/ruby/psych/issues/540
++            expect(result).to eq({ "foo" => "bar" })
++          end
+         end
+       end
+     end

diff --git a/dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild b/dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild
new file mode 100644
index 000000000000..5d6063220f78
--- /dev/null
+++ b/dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Broken with newer psych: https://github.com/dtao/safe_yaml/pull/101
+USE_RUBY="ruby27 ruby30"
+
+RUBY_FAKEGEM_EXTRADOC="README.md"
+RUBY_FAKEGEM_RECIPE_TEST="none"
+
+inherit ruby-fakegem
+
+DESCRIPTION="Parse YAML safely, alternative implementation of YAML.load"
+HOMEPAGE="https://github.com/dtao/safe_yaml"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="test"
+
+PATCHES=( "${FILESDIR}/${P}-ruby30-arity.patch" "${FILESDIR}/${P}-ruby30-openstruct-tests.patch" )
+
+ruby_add_bdepend "test? ( dev-ruby/hashie
+	dev-ruby/heredoc_unindent
+	dev-ruby/rspec:3 )"
+
+all_ruby_prepare() {
+	sed -i -e '/local timezone/askip "timezone"' spec/transform/to_date_spec.rb || die
+
+	sed -i -e '1igem "psych", "~> 3.0"' spec/spec_helper.rb || die
+}
+
+each_ruby_test() {
+	# Run specs with monkeypatch
+	${RUBY} -S rspec-3 spec --tag ~libraries || die
+
+	# Running specs without monkeypatch
+	${RUBY} -S rspec-3 spec --tag libraries || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-ruby/safe_yaml/files/, dev-ruby/safe_yaml/
@ 2023-09-19  5:40 Hans de Graaff
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Graaff @ 2023-09-19  5:40 UTC (permalink / raw
  To: gentoo-commits

commit:     36c63e1de8446c0a465a93e42589a738464b088a
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 19 05:38:20 2023 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Tue Sep 19 05:40:24 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36c63e1d

dev-ruby/safe_yaml: remove masked package

Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-ruby/safe_yaml/Manifest                        |  1 -
 .../files/safe_yaml-1.0.5-ruby30-arity.patch       | 23 --------
 .../safe_yaml-1.0.5-ruby30-openstruct-tests.patch  | 69 ----------------------
 dev-ruby/safe_yaml/metadata.xml                    | 11 ----
 dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild       | 40 -------------
 5 files changed, 144 deletions(-)

diff --git a/dev-ruby/safe_yaml/Manifest b/dev-ruby/safe_yaml/Manifest
deleted file mode 100644
index ca8a9f884fbf..000000000000
--- a/dev-ruby/safe_yaml/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST safe_yaml-1.0.5.gem 30720 BLAKE2B affbf5331cf290c3e7932f53da9b0f488730ae9138f0b28eb1e8e0323c7056635ed73bcadebd52f725895030a153dab13e243d997e84004f5bfac82e82dcebe2 SHA512 d9c8d9c28c3c8708f97cb0545f58152af81056f5e79147424dd7bf625f8e533440d1ed41d6abe2faf84578754823a1215ba28772c2e8593bfcfc397d647187b9

diff --git a/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-arity.patch b/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-arity.patch
deleted file mode 100644
index e994a48bbecb..000000000000
--- a/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-arity.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Daniel Leidert <dleidert@debian.org>
-Date: Wed, 1 Dec 2021 18:51:51 +0100
-Subject: Fix Rubx 3 compatibility
-
-Origin: https://github.com/dtao/safe_yaml/compare/master...paolobrasolin:development
-Bug: https://github.com/dtao/safe_yaml/issues/100
----
- lib/safe_yaml/safe_to_ruby_visitor.rb | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/safe_yaml/safe_to_ruby_visitor.rb b/lib/safe_yaml/safe_to_ruby_visitor.rb
-index b980445..5fd71f0 100644
---- a/lib/safe_yaml/safe_to_ruby_visitor.rb
-+++ b/lib/safe_yaml/safe_to_ruby_visitor.rb
-@@ -4,7 +4,7 @@ module SafeYAML
- 
-     def initialize(resolver)
-       case INITIALIZE_ARITY
--      when 2
-+      when 2, -3
-         # https://github.com/tenderlove/psych/blob/v2.0.0/lib/psych/visitors/to_ruby.rb#L14-L28
-         loader  = Psych::ClassLoader.new
-         scanner = Psych::ScalarScanner.new(loader)

diff --git a/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-openstruct-tests.patch b/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-openstruct-tests.patch
deleted file mode 100644
index 9b597276617b..000000000000
--- a/dev-ruby/safe_yaml/files/safe_yaml-1.0.5-ruby30-openstruct-tests.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From: Sergio Durigan Junior <sergiodj@debian.org>
-Date: Fri, 28 Jan 2022 16:35:01 -0500
-Subject: Adjust tests to reflect OpenStruct changes on Ruby3.0
-
-Ref.: https://github.com/ruby/psych/issues/540
-
-OpenStruct on Ruby3.0 changed its marshalling/unmarshalling code,
-which is now impacting safe_yaml's testcase.  The two adjustments that
-needed to be made are:
-
-- OpenStruct's instance_variable_get will now symbolize its hash keys,
-  instead of using strings.
-
-- OpenStruct's to_yaml method will not output the 'table' entity
-  anymore.
-
-Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
-
-Forwarded: yes, https://github.com/dtao/safe_yaml/pull/102
----
- spec/safe_yaml_spec.rb | 26 +++++++++++++++++++++++---
- 1 file changed, 23 insertions(+), 3 deletions(-)
-
-diff --git a/spec/safe_yaml_spec.rb b/spec/safe_yaml_spec.rb
-index aa701a4..1081173 100644
---- a/spec/safe_yaml_spec.rb
-+++ b/spec/safe_yaml_spec.rb
-@@ -318,7 +318,13 @@ describe YAML do
-       it "will allow objects to be deserialized for whitelisted tags" do
-         result = YAML.safe_load("--- !ruby/object:OpenStruct\ntable:\n  foo: bar\n")
-         expect(result).to be_a(OpenStruct)
--        expect(result.instance_variable_get(:@table)).to eq({ "foo" => "bar" })
-+        if RUBY_VERSION < '3.0'
-+          expect(result.instance_variable_get(:@table)).to eq({ "foo" => "bar" })
-+        else
-+          # Ruby3.0's OpenStruct will now symbolize the hash key.
-+          # Ref.: https://github.com/ruby/psych/issues/540
-+          expect(result.instance_variable_get(:@table)).to eq({ :foo => "bar" })
-+        end
-       end
- 
-       it "will not deserialize objects without whitelisted tags" do
-@@ -463,10 +469,24 @@ describe YAML do
- 
-         it "allows the default option to be overridden on a per-call basis" do
-           result = safe_load_round_trip(OpenStruct.new(:foo => "bar"), :whitelisted_tags => [])
--          expect(result).to eq({ "table" => { :foo => "bar" } })
-+          if RUBY_VERSION < '3.0'
-+            expect(result).to eq({ "table" => { :foo => "bar" } })
-+          else
-+            # Ruby3.0's OpenStruct's to_yaml method doesn't output the
-+            # 'table' entity anymore.
-+            # Ref.: https://github.com/ruby/psych/issues/540
-+            expect(result).to eq({ "foo" => "bar" })
-+          end
- 
-           result = safe_load_round_trip(OpenStruct.new(:foo => "bar"), :deserialize_symbols => false, :whitelisted_tags => [])
--          expect(result).to eq({ "table" => { ":foo" => "bar" } })
-+          if RUBY_VERSION < '3.0'
-+            expect(result).to eq({ "table" => { ":foo" => "bar" } })
-+          else
-+            # Ruby3.0's OpenStruct's to_yaml method doesn't output the
-+            # 'table' entity anymore.
-+            # Ref.: https://github.com/ruby/psych/issues/540
-+            expect(result).to eq({ "foo" => "bar" })
-+          end
-         end
-       end
-     end

diff --git a/dev-ruby/safe_yaml/metadata.xml b/dev-ruby/safe_yaml/metadata.xml
deleted file mode 100644
index 4c04df980ac9..000000000000
--- a/dev-ruby/safe_yaml/metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-<maintainer type="project">
-	<email>ruby@gentoo.org</email>
-	<name>Gentoo Ruby Project</name>
-</maintainer>
-<upstream>
-	<remote-id type="github">dtao/safe_yaml</remote-id>
-</upstream>
-</pkgmetadata>

diff --git a/dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild b/dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild
deleted file mode 100644
index 30a9f3c5e3fa..000000000000
--- a/dev-ruby/safe_yaml/safe_yaml-1.0.5-r2.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# Broken with newer psych: https://github.com/dtao/safe_yaml/pull/101
-USE_RUBY="ruby27 ruby30"
-
-RUBY_FAKEGEM_EXTRADOC="README.md"
-RUBY_FAKEGEM_RECIPE_TEST="none"
-
-inherit ruby-fakegem
-
-DESCRIPTION="Parse YAML safely, alternative implementation of YAML.load"
-HOMEPAGE="https://github.com/dtao/safe_yaml"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc x86 ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="test"
-
-PATCHES=( "${FILESDIR}/${P}-ruby30-arity.patch" "${FILESDIR}/${P}-ruby30-openstruct-tests.patch" )
-
-ruby_add_bdepend "test? ( dev-ruby/hashie
-	dev-ruby/heredoc_unindent
-	dev-ruby/rspec:3 )"
-
-all_ruby_prepare() {
-	sed -i -e '/local timezone/askip "timezone"' spec/transform/to_date_spec.rb || die
-
-	sed -i -e '1igem "psych", "~> 3.0"' spec/spec_helper.rb || die
-}
-
-each_ruby_test() {
-	# Run specs with monkeypatch
-	${RUBY} -S rspec-3 spec --tag ~libraries || die
-
-	# Running specs without monkeypatch
-	${RUBY} -S rspec-3 spec --tag libraries || die
-}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-19  5:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-01  6:25 [gentoo-commits] repo/gentoo:master commit in: dev-ruby/safe_yaml/files/, dev-ruby/safe_yaml/ Hans de Graaff
  -- strict thread matches above, loose matches on Subject: below --
2023-09-19  5:40 Hans de Graaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox