summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch')
-rw-r--r--dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch b/dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch
new file mode 100644
index 000000000000..91a9843aab22
--- /dev/null
+++ b/dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch
@@ -0,0 +1,35 @@
+From 9e04c58ce10920538dc55ba6e547aa15cff39a84 Mon Sep 17 00:00:00 2001
+From: Phil Ross <phil.ross@gmail.com>
+Date: Sat, 16 Dec 2023 19:14:20 +0000
+Subject: [PATCH] Fix loading the gemspec file from rake with Ruby 3.3.
+
+Calculating the current directory name from within the gemspec would
+fail.
+
+`__FILE__` was '(eval)' with Ruby < 3.3. `File.dirname(__FILE__)` is
+'.'.
+
+`__FILE__` is '(eval at /path/Rakefile:linenumber)' with Ruby >= 3.3.
+`File.dirname(__FILE__)` is '(eval at /path'.
+---
+ Rakefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Rakefile b/Rakefile
+index 8a34fa33..69bee7b5 100644
+--- a/Rakefile
++++ b/Rakefile
+@@ -11,11 +11,11 @@ rescue LoadError, RuntimeError
+ end
+
+ BASE_DIR = File.expand_path(File.dirname(__FILE__))
++GEMSPEC_PATH = File.join(BASE_DIR, 'tzinfo.gemspec')
++spec = TOPLEVEL_BINDING.eval(File.read(GEMSPEC_PATH), GEMSPEC_PATH)
+
+ task default: [:test]
+
+-spec = eval(File.read('tzinfo.gemspec'))
+-
+ class TZInfoPackageTask < Gem::PackageTask
+ alias_method :orig_sh, :sh
+ private :orig_sh