Skip to content

Commit f53d284

Browse files
committed
Fix ruby-spec failtures reg. UTF-8 CLI patch
1 parent ddda949 commit f53d284

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

mingw-w64-ruby-head/0015-Windows-Change-command-line-interface-to-UTF-8.patch

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From fc347d3c3571264b7e35ebcac36762c084b01825 Mon Sep 17 00:00:00 2001
1+
From ab0eda3a4172a6def66559b680f46262fc702262 Mon Sep 17 00:00:00 2001
22
From: Lars Kanis <lars@greiz-reinsdorf.de>
33
Date: Wed, 2 Oct 2024 22:44:21 +0200
44
Subject: [PATCH] Windows: Change command line interface to UTF-8
@@ -7,9 +7,10 @@ Subject: [PATCH] Windows: Change command line interface to UTF-8
77
- include paths
88
- script input from stdin
99
---
10-
ruby.c | 25 ++++---------------------
11-
test/ruby/test_rubyoptions.rb | 14 +++-----------
12-
2 files changed, 7 insertions(+), 32 deletions(-)
10+
ruby.c | 25 ++++--------------------
11+
spec/ruby/language/magic_comment_spec.rb | 8 +++++++-
12+
test/ruby/test_rubyoptions.rb | 14 +++----------
13+
3 files changed, 14 insertions(+), 33 deletions(-)
1314

1415
diff --git a/ruby.c b/ruby.c
1516
index 61de5cdcbe..e79d4b69da 100644
@@ -76,6 +77,25 @@ index 61de5cdcbe..e79d4b69da 100644
7677
}
7778
else {
7879
enc = rb_utf8_encoding();
80+
diff --git a/spec/ruby/language/magic_comment_spec.rb b/spec/ruby/language/magic_comment_spec.rb
81+
index f2bf3a08e5..98f424c3d0 100644
82+
--- a/spec/ruby/language/magic_comment_spec.rb
83+
+++ b/spec/ruby/language/magic_comment_spec.rb
84+
@@ -3,7 +3,13 @@
85+
# See core/kernel/eval_spec.rb for more magic comments specs for eval()
86+
describe :magic_comments, shared: true do
87+
before :each do
88+
- @default = @method == :locale ? Encoding.find('locale') : Encoding::UTF_8
89+
+ @default = if @method == :locale &&
90+
+ ( platform_is_not(:windows) || ruby_version_is(""..."3.4") )
91+
+ then
92+
+ Encoding.find('locale')
93+
+ else
94+
+ Encoding::UTF_8
95+
+ end
96+
end
97+
98+
it "are optional" do
7999
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
80100
index ac4b5870eb..fac0901fdf 100644
81101
--- a/test/ruby/test_rubyoptions.rb
@@ -104,5 +124,5 @@ index ac4b5870eb..fac0901fdf 100644
104124
end
105125

106126
--
107-
2.47.1.windows.1
127+
2.49.0
108128

mingw-w64-ruby-head/PKGBUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
_realname=ruby
22
pkgbase=mingw-w64-ruby-head
33
pkgname="${MINGW_PACKAGE_PREFIX}-ruby-head"
4-
pkgver=r20250602
4+
pkgver=r20251221
55
pkgver() {
66
echo r`date +%Y%m%d`
77
}
@@ -37,7 +37,7 @@ noextract=("snapshot-master.tar.xz")
3737
sha256sums=('SKIP'
3838
'a50c81ab8c178689485257f8eaa70bd8184b878a798780084668f838912e2832'
3939
'f26122cca5e289801c0dde1f54643a960246a69691c6c8b9bccb27e536344f69'
40-
'840955023a6829ed862ee626f4f3e337be1203c3facb49e62e7f04bb826229e0'
40+
'576c6dca87493d5543ce1da790aa50c9a4e86aca9ecdec34077e8e3d4b90648f'
4141
'6c80ba2ca49840e387a08b7fedc6e7acd298ac2ec853155209efb2af20397b22'
4242
'c30fb04ac0e88ba634daaa811a81ea5a75027646617b895acd14df9518a4a55a'
4343
'c7a555d4826453efe7e33a2ebf78462b1fa665dffd7e4972143b48b1c9c71375')

0 commit comments

Comments
 (0)