Skip to content

Commit 74cf2ce

Browse files
Merge branch 'rurema:master' into hashimoto-kei-patch-1
2 parents ebde2b3 + 83f47f5 commit 74cf2ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+813
-488
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ${{ matrix.os }}
3232

3333
steps:
34-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v6
3535
- name: Set up Ruby
3636
uses: ruby/setup-ruby@v1
3737
with:
@@ -58,7 +58,7 @@ jobs:
5858
ls -Name "*.*" | foreach {
5959
tar acf "../artifact/${_}.tar.xz" $_
6060
}
61-
- uses: actions/upload-artifact@v4
61+
- uses: actions/upload-artifact@v7
6262
with:
6363
name: statichtml-${{ matrix.os }}-${{ matrix.ruby }}
6464
path: /tmp/artifact/*.*.tar.xz
@@ -68,7 +68,7 @@ jobs:
6868
cd /tmp
6969
mv -v html html.pr
7070
- name: Checkout base
71-
uses: actions/checkout@v4
71+
uses: actions/checkout@v6
7272
with:
7373
ref: ${{ github.event.pull_request.base.sha }}
7474
- name: Install dependencies (base)
@@ -84,7 +84,7 @@ jobs:
8484
git diff --no-index html.base html.pr --stat || true
8585
git diff --no-index html.base html.pr --output artifact/html.diff || true
8686
if: ${{ steps.generate_base.outcome == 'success' }}
87-
- uses: actions/upload-artifact@v4
87+
- uses: actions/upload-artifact@v7
8888
with:
8989
name: diff-${{ matrix.os }}-${{ matrix.ruby }}
9090
path: /tmp/artifact/html.diff
@@ -94,7 +94,7 @@ jobs:
9494
runs-on: ubuntu-latest
9595

9696
steps:
97-
- uses: actions/checkout@v4
97+
- uses: actions/checkout@v6
9898
- name: Install misspell
9999
run: 'curl -L https://git.io/misspell | bash'
100100
- name: Run misspell

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:3.4.5-bookworm
1+
FROM ruby:4.0.1-bookworm
22
RUN useradd rurema --create-home --shell /bin/bash
33
USER rurema:rurema
44
ENV BUNDLE_AUTO_INSTALL true

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GEM
1919
drb (2.2.1)
2020
nkf (0.2.0)
2121
progressbar (1.13.0)
22-
rack (3.1.16)
22+
rack (3.1.20)
2323
rackup (2.1.0)
2424
rack (>= 3)
2525
webrick (~> 1.8)
@@ -38,4 +38,4 @@ DEPENDENCIES
3838
refe2!
3939

4040
BUNDLED WITH
41-
2.5.11
41+
2.7.1

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ OLD_VERSIONS = %w[
33
1.8.7 1.9.3
44
2.0.0 2.1.0 2.2.0 2.3.0 2.4.0 2.5.0 2.6.0 2.7.0
55
]
6-
SUPPORTED_VERSIONS = %w[3.0 3.1 3.2 3.3]
7-
UNRELEASED_VERSIONS = %w[3.4]
6+
SUPPORTED_VERSIONS = %w[3.0 3.1 3.2 3.3 3.4 4.0]
7+
UNRELEASED_VERSIONS = %w[4.1]
88
ALL_VERSIONS = [*OLD_VERSIONS, *SUPPORTED_VERSIONS, *UNRELEASED_VERSIONS]
99
CI_VERSIONS = [*SUPPORTED_VERSIONS, *UNRELEASED_VERSIONS]
1010
HTML_DIRECTORY_BASE = ENV.fetch("HTML_DIRECTORY_BASE", "/tmp/html/")

refm/api/src/_builtin/Array

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,13 +1517,9 @@ p [1, nil, 3, nil].nitems{|e| e == 1} #=> 2
15171517
--- none?{|obj| ... } -> bool
15181518
--- none?(pattern) -> bool
15191519

1520-
ブロックを指定しない場合は、 配列のすべての
1521-
要素が偽であれば真を返します。そうでなければ偽を返します。
1522-
1523-
ブロックを指定した場合は、配列のすべての要素を
1524-
ブロックで評価した結果が、すべて偽であれば真を返します。
1525-
そうでなければ偽を返します。
1520+
すべての要素が偽である場合に true を返します。真である要素があれば、ただちに false を返します。
15261521

1522+
ブロックを伴う場合は、各要素に対してブロックを評価し、すべての結果が偽である場合に true を返します。ブロックが真を返した時点で、ただちに false を返します。
15271523
要素の数が 0 である配列に対しては true を返します。
15281524

15291525
@param pattern ブロックの代わりに各要素に対して pattern === item を評価します。
@@ -1902,7 +1898,10 @@ a #=> [ "a", "b", "c" ]
19021898
--- sort {|a, b| ... } -> Array
19031899
--- sort! {|a, b| ... } -> self
19041900

1905-
配列の内容をソートします。要素同士の比較は <=> 演算子を使って行います。sort はソートされた配列を生成して返します。
1901+
全ての要素を昇順にソートします。
1902+
要素同士の比較は <=> 演算子を使って行います。
1903+
1904+
sort は self を変更せず、ソートされた配列を生成して返します。
19061905
sort! は self を破壊的にソートし、self を返します。
19071906

19081907
ブロックとともに呼び出された時には、要素同士の比較をブロックを用いて行います。

refm/api/src/_builtin/ENV

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ ENV.slice("unknown") # => {}
426426
ENV.slice("foo", "baz") # => {"foo"=>"bar", "baz"=>"qux"}
427427
#@end
428428

429-
#@since 3.0.0
429+
#@since 3.0
430430
@see [[m:Hash#slice]], [[m:ENV.except]]
431431
#@else
432432
@see [[m:Hash#slice]]
@@ -436,7 +436,7 @@ ENV.slice("foo", "baz") # => {"foo"=>"bar", "baz"=>"qux"}
436436
--- freeze -> ()
437437
ENV.freeze は環境変数の変更を禁止できないため、[[c:TypeError]]を発生させます。
438438
#@end
439-
#@since 3.0.0
439+
#@since 3.0
440440
--- except(*keys) -> Hash
441441

442442
引数で指定された以外のキーとその値だけを含む Hash を返します。

refm/api/src/_builtin/Encoding

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ p Encoding.name_list
101101

102102
Rubyはロケールまたは -E オプションに従って default_external を決定します。ロケールの確認・設定方法については各システムのマニュアルを参照してください。
103103

104-
#@since 3.0.0
104+
#@since 3.0
105105
-E オプションを指定していない場合は、WindowsではUTF-8、その他のOSではロケールに従って default_external を決定します。
106106
#@end
107107

@@ -503,7 +503,7 @@ CP437 エンコーディング。
503503
@see [[url:https://en.wikipedia.org/wiki/Code_page_437]],
504504
[[m:Encoding::CP869]]
505505

506-
#@since 3.0.0
506+
#@since 3.0
507507
--- IBM720 -> Encoding
508508
--- CP720 -> Encoding
509509

refm/api/src/_builtin/GC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ oldmalloc_increase_bytes と呼ばれる。この2つの性質は以下のよう
182182

183183
== Singleton Methods
184184

185-
#@since 3.0.0
185+
#@since 3.0
186186
--- auto_compact -> bool
187187

188188
auto compaction が有効化どうかを返します。

refm/api/src/_builtin/Hash

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,22 +1573,22 @@ h.transform_values!.with_index {|v, i| "#{v}.#{i}" }
15731573
@see [[m:Hash#transform_keys]]
15741574
@see [[m:Hash#transform_keys!]]
15751575
--- transform_keys {|key| ... } -> Hash
1576-
#@since 3.0.0
1576+
#@since 3.0
15771577
--- transform_keys(hash) -> Hash
15781578
#@end
15791579
--- transform_keys -> Enumerator
15801580

15811581
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。
15821582
値は変化しません。
15831583

1584-
#@since 3.0.0
1584+
#@since 3.0
15851585
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
15861586
#@end
15871587

15881588
#@samplecode 例
15891589
h = { a: 1, b: 2, c: 3 }
15901590
h.transform_keys {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
1591-
#@since 3.0.0
1591+
#@since 3.0
15921592
h.transform_keys(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
15931593
#@end
15941594
h.transform_keys(&:to_s) # => {"a"=>1, "b"=>2, "c"=>3}
@@ -1601,15 +1601,15 @@ h.transform_keys.with_index {|k, i| "#{k}.#{i}" }
16011601
@see [[m:Hash#transform_values!]]
16021602

16031603
--- transform_keys! {|key| ... } -> self
1604-
#@since 3.0.0
1604+
#@since 3.0
16051605
--- transform_keys!(hash) -> self
16061606
#@end
16071607
--- transform_keys! -> Enumerator
16081608

16091609
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。
16101610
値は変化しません。
16111611

1612-
#@since 3.0.0
1612+
#@since 3.0
16131613
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
16141614
#@end
16151615
@return transform_keys! は常に self を返します。
@@ -1621,7 +1621,7 @@ h.transform_keys.with_index {|k, i| "#{k}.#{i}" }
16211621
h = { a: 1, b: 2, c: 3 }
16221622
h.transform_keys! {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
16231623
h.transform_keys!(&:to_sym) # => {:a=>1, :b=>2, :c=>3}
1624-
#@since 3.0.0
1624+
#@since 3.0
16251625
h.transform_keys!(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
16261626
#@end
16271627
h.transform_keys!.with_index {|k, i| "#{k}.#{i}" }
@@ -1643,13 +1643,13 @@ h.slice(:c, :b) # => {:c=>300, :b=>200}
16431643
h.slice(:b, :c, :d) # => {:b=>200, :c=>300}
16441644
#@end
16451645

1646-
#@since 3.0.0
1646+
#@since 3.0
16471647
@see [[m:Hash#except]], [[m:ENV.slice]]
16481648
#@else
16491649
@see [[m:ENV.slice]]
16501650
#@end
16511651
#@end
1652-
#@since 3.0.0
1652+
#@since 3.0
16531653
--- except(*keys) -> Hash
16541654

16551655
引数で指定された以外のキーとその値だけを含む Hash を返します。

refm/api/src/_builtin/Marshal

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,25 @@ p Marshal.dump(Hash.new {})
6363

6464
@see [[m:Object#marshal_dump]], [[m:Object#marshal_load]]
6565

66+
#@since 3.1
67+
--- load(port, proc = nil, options = {}) -> object
68+
--- restore(port, proc = nil, options = {}) -> object
69+
#@else
6670
--- load(port, proc = nil) -> object
6771
--- restore(port, proc = nil) -> object
72+
#@end
6873

6974
port からマーシャルデータを読み込んで、元のオブジェクトと同
7075
じ状態をもつオブジェクトを生成します。
7176

7277
proc として手続きオブジェクトが与えられた場合には読み込んだ
7378
オブジェクトを引数にその手続きを呼び出します。
7479

80+
#@since 3.1
81+
options の :freeze キーに真が指定された場合、読み込んだオブジェクトを freeze して返します。
82+
同一の文字列が freeze されているときオブジェクトは一つしか生まれないため、この指定によりメモリ使用効率が向上する場合があります。
83+
#@end
84+
7585
#@samplecode 例
7686
str = Marshal.dump(["a", 1, 10 ** 10, 1.0, :foo])
7787
p Marshal.load(str, proc {|obj| p obj})
@@ -90,6 +100,14 @@ p Marshal.load(str, proc {|obj| p obj})
90100

91101
@param proc 手続きオブジェクト。[[c:Proc]]
92102

103+
#@since 3.1
104+
@param options オプションをハッシュで指定します。指定可能なオプションは以下の通りです。
105+
106+
: :freeze
107+
真偽値を指定します。真を指定すると読み込んだオブジェクトを freeze して返します。
108+
デフォルトは偽です。
109+
#@end
110+
93111
@raise TypeError メジャーバージョンが異なるか、バージョンの大きな
94112
マーシャルデータを読み込んだ場合に発生します。
95113

0 commit comments

Comments
 (0)