Skip to content

Commit 6db1f5c

Browse files
authored
Merge branch 'master' into refactor/switch-statement
2 parents 2960f64 + dd3b36e commit 6db1f5c

File tree

112 files changed

+6168
-1443
lines changed

Some content is hidden

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

112 files changed

+6168
-1443
lines changed

.document

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
History.txt
2-
LICENSE.txt
3-
README.txt
4-
RI.txt
1+
*.md
2+
*.rdoc
53
lib
64
doc

.generated_files_rubocop.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This rubocop configuration is ONLY for the generated files (listed in Rakefile). It is not meant to be used for RDoc's
2+
# source code.
3+
# The purpose of this file is to ensure the generated files don't have trailing whitespace or empty lines, which could
4+
# be a problem for ruby/ruby's CI
5+
AllCops:
6+
TargetRubyVersion: 3.3
7+
DisabledByDefault: true
8+
9+
Layout/TrailingWhitespace:
10+
Enabled: true
11+
Layout/TrailingEmptyLines:
12+
Enabled: true

.github/release.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# release.yml
2+
3+
changelog:
4+
categories:
5+
- title: ✨ Enhancements
6+
labels:
7+
- enhancement
8+
- title: 🐛 Bug Fixes
9+
labels:
10+
- bug
11+
- title: 📚 Documentation
12+
labels:
13+
- documentation
14+
- title: 🛠 Other Changes
15+
labels:
16+
- "*"

.github/workflows/gh-pages.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
- name: Checkout
2323
uses: actions/checkout@v4
2424
- name: Setup Ruby
25-
uses: ruby/setup-ruby@5daca165445f0ae10478593083f72ca2625e241d # v1.169.0
25+
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # v1.204.0
2626
with:
2727
ruby-version: '3.2'
2828
bundler-cache: true
2929
- name: Setup Pages
3030
id: pages
31-
uses: actions/configure-pages@v4
31+
uses: actions/configure-pages@v5
3232
- name: Build with RDoc
3333
# Outputs to the './_site' directory by default
3434
run: bundle exec rake rdoc

.github/workflows/lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
permissions: # added using https://github.com/step-security/secure-workflows
6+
contents: read
7+
8+
jobs:
9+
lint:
10+
strategy:
11+
fail-fast: false
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4 # v3.3.0
15+
# libyaml-dev is needed for psych, see https://github.com/ruby/setup-ruby/issues/409
16+
- if: ${{ matrix.os == 'ubuntu-latest' }}
17+
run: sudo apt install libyaml-dev
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@master
20+
with:
21+
ruby-version: 3.3
22+
bundler-cache: true
23+
- name: Run rubocop
24+
run: bundle exec rubocop
25+
- name: Sanity check for the format_generated_files task
26+
run: bundle exec rake generate format_generated_files
27+

.github/workflows/push_gem.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish gem to rubygems.org
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
push:
13+
if: github.repository == 'ruby/rdoc'
14+
runs-on: ubuntu-latest
15+
16+
environment:
17+
name: rubygems.org
18+
url: https://rubygems.org/gems/rdoc
19+
20+
permissions:
21+
contents: write
22+
id-token: write
23+
24+
steps:
25+
- name: Harden Runner
26+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
27+
with:
28+
egress-policy: audit
29+
30+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
31+
32+
- name: Set up Ruby
33+
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # v1.204.0
34+
with:
35+
bundler-cache: true
36+
ruby-version: ruby
37+
38+
- name: Publish to RubyGems
39+
uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
40+
41+
- name: Create GitHub release
42+
run: |
43+
tag_name="$(git describe --tags --abbrev=0)"
44+
gh release create "${tag_name}" --verify-tag --generate-notes
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}

.github/workflows/ruby-core.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: ruby-core
2+
3+
on:
4+
pull_request:
5+
6+
push:
7+
branches:
8+
- master
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}-${{ github.workflow }}
12+
13+
permissions: # added using https://github.com/step-security/secure-workflows
14+
contents: read
15+
16+
jobs:
17+
ruby_core:
18+
name: RDoc under a ruby-core setup
19+
runs-on: ubuntu-20.04
20+
strategy:
21+
fail-fast: false
22+
timeout-minutes: 30
23+
steps:
24+
- name: Set up latest ruby head
25+
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # v1.204.0
26+
with:
27+
ruby-version: head
28+
bundler: none
29+
- name: Save latest buildable revision to environment
30+
run: echo "REF=$(ruby -v | cut -d')' -f1 | cut -d' ' -f5)" >> $GITHUB_ENV
31+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
32+
with:
33+
repository: ruby/ruby
34+
path: ruby/ruby
35+
fetch-depth: 10
36+
- name: Checkout the latest buildable revision
37+
run: git switch -c ${{ env.REF }}
38+
working-directory: ruby/ruby
39+
- name: Install libraries
40+
run: |
41+
set -x
42+
sudo apt-get update -q || :
43+
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
44+
- name: Build Ruby
45+
run: |
46+
autoconf
47+
./configure -C --disable-install-doc
48+
make -j2
49+
working-directory: ruby/ruby
50+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
51+
with:
52+
path: ruby/rdoc
53+
- name: Sync tools
54+
run: |
55+
ruby tool/sync_default_gems.rb rdoc
56+
working-directory: ruby/ruby
57+
- name: Test RDoc
58+
run: make -j2 -s test-all TESTS="rdoc --no-retry"
59+
working-directory: ruby/ruby

.github/workflows/test.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ permissions: # added using https://github.com/step-security/secure-workflows
88
jobs:
99
ruby-versions:
1010
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
11+
with:
12+
# 2.7 breaks `test_parse_statements_nodoc_identifier_alias_method`
13+
min_version: 3.0
14+
engine: cruby-truffleruby
1115

1216
test:
1317
needs: ruby-versions
@@ -21,10 +25,6 @@ jobs:
2125
ruby: truffleruby
2226
- os: windows-latest
2327
ruby: truffleruby-head
24-
- os: windows-latest
25-
ruby: jruby
26-
- os: windows-latest
27-
ruby: jruby-head
2828
runs-on: ${{ matrix.os }}
2929
steps:
3030
- uses: actions/checkout@v4 # v3.3.0
@@ -36,15 +36,16 @@ jobs:
3636
with:
3737
ruby-version: ${{ matrix.ruby }}
3838
bundler-cache: true # 'bundle install' and cache
39-
# Avoid issues on these platforms
40-
- if: ${{ matrix.ruby == '2.6' }}
41-
run: gem update --system
4239
- name: Run test
4340
run: bundle exec rake
4441
env:
4542
RUBYOPT: --enable-frozen_string_literal
46-
continue-on-error: ${{ startsWith(matrix.ruby, 'truffle') }}
43+
- name: Run test with Prism parser
44+
run: bundle exec rake
45+
env:
46+
RUBYOPT: --enable-frozen_string_literal
47+
RDOC_USE_PRISM_PARSER: true
4748
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
4849
run: bundle exec rake rdoc
4950
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
50-
run: bundle exec rake rubocop
51+
run: bundle exec rake install

.rdoc_options

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
exclude:
2+
- lib/rdoc/rd/block_parser.ry
3+
- lib/rdoc/rd/inline_parser.ry
4+
- lib/rdoc/markdown.kpeg
5+
- lib/rdoc/markdown/literals.kpeg
6+
op_dir: _site # for GitHub Pages and should match the config of RDoc task in Rakefile
7+
title: rdoc Documentation
8+
main_page: README.rdoc
9+
warn_missing_rdoc_ref: true

.rubocop.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
AllCops:
2-
TargetRubyVersion: 2.6
2+
TargetRubyVersion: 3.0
33
DisabledByDefault: true
4-
Exclude:
5-
- rdoc.gemspec
4+
SuggestExtensions: false
65

76
Layout/TrailingWhitespace:
87
Enabled: true
8+
99
Layout/TrailingEmptyLines:
1010
Enabled: true
11+
12+
Layout/SpaceAroundKeyword:
13+
Enabled: true
14+
15+
Layout/SpaceBeforeComma:
16+
Enabled: true
17+
18+
Layout/SpaceAfterComma:
19+
Enabled: true
20+
21+
Lint/UnreachableCode:
22+
Enabled: true

CONTRIBUTING.rdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If the tests don't pass on the first run check the {GitHub Actions page}[https:/
4040
You can now use `rake` and `autotest` to run the tests.
4141

4242
Note: the `rake` command must be used first before running any tests, because
43-
its used to generate various parsers implemented in RDoc. Also `rake clean` is
43+
it's used to generate various parsers implemented in RDoc. Also `rake clean` is
4444
helpful to delete these generated files.
4545

4646
== Glossary

ExampleMarkdown.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Example Markdown
2+
13
This document contains example output to show RDoc styling. This file was
24
created from a Markdown file.
35

ExampleRDoc.rdoc

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
= Example \RDoc
2+
13
This document contains example output to show RDoc styling. This file was
24
created from a RDoc Markup file.
35

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ group :development do
1010
gem 'test-unit-ruby-core'
1111
gem 'rubocop', '>= 1.31.0'
1212
gem 'gettext'
13+
gem 'prism', '>= 0.30.0'
1314
end

0 commit comments

Comments
 (0)