diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-04-04 11:22:15 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-04-04 11:22:15 +0100 |
commit | 7f6382ebb44b75c53021d4c4ab77d6b34aed21ac (patch) | |
tree | 4d92ef3af5a26ff8a8a5a1ec4f21d18c65f56fe2 /dev-ruby/pathutil | |
parent | 41e5b5c1f11820df590e0a245bbddf224bc07823 (diff) |
gentoo auto-resync : 04:04:2023 - 11:22:14
Diffstat (limited to 'dev-ruby/pathutil')
-rw-r--r-- | dev-ruby/pathutil/Manifest | 1 | ||||
-rw-r--r-- | dev-ruby/pathutil/files/pathutil-0.16.2-ruby30.patch | 195 |
2 files changed, 196 insertions, 0 deletions
diff --git a/dev-ruby/pathutil/Manifest b/dev-ruby/pathutil/Manifest index 8b5f0e9e1bdc..2bd35f6343ce 100644 --- a/dev-ruby/pathutil/Manifest +++ b/dev-ruby/pathutil/Manifest @@ -1,3 +1,4 @@ +AUX pathutil-0.16.2-ruby30.patch 5578 BLAKE2B eb42f2c3ec294b25d86312966c39613fbd0ca646b6eb3e933b0f849bf9f9a2dbea80b340c62d1342abbd10e2598a60d48c102e2f12e49dba24c21d7eaec72f5c SHA512 cc9f7f94b5a830c6f377e5414da317492caf6b5bd89ee8c414753c09c427b2a87852ce8767effacfd0af2ca260c8b05e322e7772b7cc786c4f4531bcf8107cc2 DIST pathutil-0.16.2.tar.gz 26079 BLAKE2B 5a9d1dac1f1171ee6bc447725c04883cb56a9071927f3e0fdbcb9754345ac77a6609533a1308a411cb22658caeb2a4bed49225923af109bca288cfb3aeb3d669 SHA512 d06daf365b94dacd33966f3928a53f0f00d2fca7b9f6348a7efd2b55ab5ba937459e5bd78fde241f30749a1ae55e4ae3ba1ed8945b5333464e7d3ce9666cd054 EBUILD pathutil-0.16.2-r1.ebuild 955 BLAKE2B 02b346d9ebc67e43fbc05e23bc16b18d9b4724a60c718e6e166ac888cb626804d72c3579214f1b5b681c1a548c4318df250f3fb0901c749c89293999d0a6a792 SHA512 e3ffca48a818a20238f37a48aea17e06cfe012318fb064cbdad0be26e95ff0e725c0a127215c1a64fa3c4d1fc8377c97aaf8b88e9cbe925025d15f6d58a032ca MISC metadata.xml 397 BLAKE2B 3f14fd5aaeb2954c6d714e28bf89c6cae920c80c130de454d453a61b81598a673200ed6ce07035be2769bf5f3f36eb926540f0ff7236b5da65cd021b508f104b SHA512 58d97f4464d9603f6c3dddd30c5258cccb03a4d0784ba8f268710d977d49437a677c9b9596485656762e5e2ef4694ca2b1f4018fefb9e84066c3296d73cfb18d diff --git a/dev-ruby/pathutil/files/pathutil-0.16.2-ruby30.patch b/dev-ruby/pathutil/files/pathutil-0.16.2-ruby30.patch new file mode 100644 index 000000000000..374cd4005930 --- /dev/null +++ b/dev-ruby/pathutil/files/pathutil-0.16.2-ruby30.patch @@ -0,0 +1,195 @@ +From 3451a10c362fc867b20c7e471a551b31c40a0246 Mon Sep 17 00:00:00 2001 +From: Tom Dunlap <tom@motevets.com> +Date: Tue, 9 Jun 2020 12:59:32 -0400 +Subject: [PATCH] Fix ruby keyword parameter deprecation warnings + +In ruby 2.7, using the last argument as keyword parameters became +deprecated in preparation for ruby 3.0. When running the tests, we saw +numerous deprecation warnings. This commit fixes up those deprecation +warnings by explicitly passing the last argument(s) as keyword +argument(s). + +See: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ + +Fixes #4 + +Side note: this commit did not fix the `#binread` method because it was +untested, and when attempting to add tests, we got the following failing +test: + +``` +1) Pathutil#binread when set to normalize should use encode to convert CRLF to LF + Failure/Error: + File.binread(self, *args, kwd).encode({ + :universal_newline => true + }) + + TypeError: + no implicit conversion of Hash into Integer + # ./lib/pathutil.rb:509:in `binread' + # ./lib/pathutil.rb:509:in `binread' + # ./spec/tests/lib/pathutil_spec.rb:943:in `block (4 levels) in <top (required)>' +``` + +...which appears to be occuring because of an interface mismatch as +`IO#binread` does not take keyword arguments. + +https://ruby-doc.org/core-2.7.1/IO.html#method-c-binread +--- + lib/pathutil.rb | 36 ++++++++----------------- + spec/tests/lib/pathutil/helpers_spec.rb | 4 +-- + spec/tests/lib/pathutil_spec.rb | 13 +++------ + 3 files changed, 16 insertions(+), 37 deletions(-) + +diff --git a/lib/pathutil.rb b/lib/pathutil.rb +index 1a15873..80913f2 100644 +--- a/lib/pathutil.rb ++++ b/lib/pathutil.rb +@@ -456,14 +456,10 @@ def safe_copy(to, root: nil, ignore: []) + to = self.class.new(to) + + if directory? +- safe_copy_directory(to, { +- :root => root, :ignore => ignore +- }) ++ safe_copy_directory(to, root: root, ignore: ignore) + + else +- safe_copy_file(to, { +- :root => root +- }) ++ safe_copy_file(to, root: root) + end + end + +@@ -494,14 +490,10 @@ def read(*args, **kwd) + kwd[:encoding] ||= encoding + + if normalize[:read] +- File.read(self, *args, kwd).encode({ +- :universal_newline => true +- }) ++ File.read(self, *args, **kwd).encode(universal_newline: true) + + else +- File.read( +- self, *args, kwd +- ) ++ File.read(self, *args, **kwd) + end + end + +@@ -534,13 +526,13 @@ def readlines(*args, **kwd) + kwd[:encoding] ||= encoding + + if normalize[:read] +- File.readlines(self, *args, kwd).encode({ ++ File.readlines(self, *args, **kwd).encode({ + :universal_newline => true + }) + + else + File.readlines( +- self, *args, kwd ++ self, *args, **kwd + ) + end + end +@@ -556,11 +548,11 @@ def write(data, *args, **kwd) + if normalize[:write] + File.write(self, data.encode( + :crlf_newline => true +- ), *args, kwd) ++ ), *args, **kwd) + + else + File.write( +- self, data, *args, kwd ++ self, data, *args, **kwd + ) + end + end +@@ -670,9 +662,7 @@ def expanded_paths(path) + private + def safe_copy_file(to, root: nil) + raise Errno::EPERM, "#{self} not in #{root}" unless in_path?(root) +- FileUtils.cp(self, to, { +- :preserve => true +- }) ++ FileUtils.cp(self, to, preserve: true) + end + + # -- +@@ -697,15 +687,11 @@ def safe_copy_directory(to, root: nil, ignore: []) + }" + + elsif file.file? +- FileUtils.cp(file, to, { +- :preserve => true +- }) ++ FileUtils.cp(file, to, preserve: true) + + else + path = file.realpath +- path.safe_copy(to.join(file.basename), { +- :root => root, :ignore => ignore +- }) ++ path.safe_copy(to.join(file.basename), root: root, ignore: ignore) + end + end + end +diff --git a/spec/tests/lib/pathutil/helpers_spec.rb b/spec/tests/lib/pathutil/helpers_spec.rb +index 4d64d0a..0dfbc00 100644 +--- a/spec/tests/lib/pathutil/helpers_spec.rb ++++ b/spec/tests/lib/pathutil/helpers_spec.rb +@@ -76,9 +76,7 @@ + # + + after do +- described_class.load_yaml("hello: world", { +- :aliases => true +- }) ++ described_class.load_yaml("hello: world", aliases: true) + end + end + +diff --git a/spec/tests/lib/pathutil_spec.rb b/spec/tests/lib/pathutil_spec.rb +index 784a16b..0ee7a12 100644 +--- a/spec/tests/lib/pathutil_spec.rb ++++ b/spec/tests/lib/pathutil_spec.rb +@@ -944,9 +944,7 @@ + + context "with an encoding argument" do + before do +- file.write("hello", { +- :encoding => "ASCII" +- }) ++ file.write("hello", encoding: "ASCII") + end + + # +@@ -1050,11 +1048,10 @@ + name1.join(name2.basename, name1.basename).touch + name1.join(name1.basename).touch + +- name1.safe_copy(name2, { +- :root => tmpdir1, :ignore => [ ++ name1.safe_copy(name2, root: tmpdir1, ignore: [ + name1.join(name2.basename, name1.basename) + ] +- }) ++ ) + end + + # +@@ -1077,9 +1074,7 @@ + name1.join(name2.basename, name1.basename).touch + name1.join(name1.basename).touch + +- name1.safe_copy(name2, { +- :root => tmpdir1 +- }) ++ name1.safe_copy(name2, root: tmpdir1) + end + + # |