public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-ruby/settingslogic/, dev-ruby/settingslogic/files/
@ 2022-03-14 16:01 Hans de Graaff
  0 siblings, 0 replies; only message in thread
From: Hans de Graaff @ 2022-03-14 16:01 UTC (permalink / raw
  To: gentoo-commits

commit:     668439082818b43deafd721e4cd250540ccc25f1
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 14 16:00:45 2022 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:01:01 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66843908

dev-ruby/settingslogic: add psych 4 compatibility

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 .../files/settingslogic-2.0.9-psych-4.patch        | 31 ++++++++++++++++++++++
 .../settingslogic/settingslogic-2.0.9-r2.ebuild    | 26 ++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/dev-ruby/settingslogic/files/settingslogic-2.0.9-psych-4.patch b/dev-ruby/settingslogic/files/settingslogic-2.0.9-psych-4.patch
new file mode 100644
index 000000000000..aecb968e9766
--- /dev/null
+++ b/dev-ruby/settingslogic/files/settingslogic-2.0.9-psych-4.patch
@@ -0,0 +1,31 @@
+From bd477f59560f3dea86f0cf43dabd814ac459d2ee Mon Sep 17 00:00:00 2001
+From: Tomohiko Mimura <mito.5525@gmail.com>
+Date: Mon, 2 Aug 2021 13:26:22 +0900
+Subject: [PATCH] Support Psych v4.0.0
+
+Ruby master ships with Psych 4.0.0 which makes `YAML.load`
+defaults to safe mode (https://github.com/ruby/psych/pull/487).
+
+Keep compatibility by using `unsafe_load`.
+---
+ lib/settingslogic.rb | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/settingslogic.rb b/lib/settingslogic.rb
+index a99acaf..e7ea37e 100644
+--- a/lib/settingslogic.rb
++++ b/lib/settingslogic.rb
+@@ -100,7 +100,12 @@ def initialize(hash_or_file = self.class.source, section = nil)
+       self.replace hash_or_file
+     else
+       file_contents = open(hash_or_file).read
+-      hash = file_contents.empty? ? {} : YAML.load(ERB.new(file_contents).result).to_hash
++      hash = if file_contents.empty?
++               {}
++             else
++               payload = ERB.new(file_contents).result
++               (YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(payload) : YAML.load(payload)).to_hash
++             end
+       if self.class.namespace
+         hash = hash[self.class.namespace] or return missing_key("Missing setting '#{self.class.namespace}' in #{hash_or_file}")
+       end

diff --git a/dev-ruby/settingslogic/settingslogic-2.0.9-r2.ebuild b/dev-ruby/settingslogic/settingslogic-2.0.9-r2.ebuild
new file mode 100644
index 000000000000..5d2b70ee8217
--- /dev/null
+++ b/dev-ruby/settingslogic/settingslogic-2.0.9-r2.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+USE_RUBY="ruby26 ruby27"
+
+RUBY_FAKEGEM_TASK_DOC=""
+RUBY_FAKEGEM_EXTRADOC="README.rdoc"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A simple configuration / settings solution that uses an ERB enabled YAML file"
+HOMEPAGE="https://github.com/binarylogic/settingslogic"
+LICENSE="MIT"
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE=""
+
+PATCHES=( "${FILESDIR}/${P}-psych-4.patch" )
+
+all_ruby_prepare() {
+	sed -i -e '/check_dependencies/d' Rakefile || die
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-14 16:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-14 16:01 [gentoo-commits] repo/gentoo:master commit in: dev-ruby/settingslogic/, dev-ruby/settingslogic/files/ 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