Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up changes for Prism Ruby parser #1145

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ permissions: # added using https://github.com/step-security/secure-workflows
jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
# 2.7 breaks `test_parse_statements_nodoc_identifier_alias_method`
min_version: 3.0

test:
needs: ruby-versions
Expand Down Expand Up @@ -43,6 +46,11 @@ jobs:
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
- name: Run test with Prism parser
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
RDOC_USE_PRISM_PARSER: true
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
run: bundle exec rake rdoc
lint:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ group :development do
gem 'test-unit-ruby-core'
gem 'rubocop', '>= 1.31.0'
gem 'gettext'
gem 'prism', '>= 0.30.0'
end
3 changes: 3 additions & 0 deletions lib/rdoc/parser/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
if ENV['RDOC_USE_PRISM_PARSER']
require 'rdoc/parser/prism_ruby'
RDoc::Parser.const_set(:Ruby, RDoc::Parser::PrismRuby)
puts "========================================================================="
puts "RDoc is using the experimental Prism parser to generate the documentation"
puts "========================================================================="
return
end

Expand Down
3 changes: 1 addition & 2 deletions rdoc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,8 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
s.rdoc_options = ["--main", "README.rdoc"]
s.extra_rdoc_files += s.files.grep(%r[\A[^\/]+\.(?:rdoc|md)\z])

s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
s.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
s.required_rubygems_version = Gem::Requirement.new(">= 2.2")

s.add_dependency 'prism', '>= 0.30.0'
s.add_dependency 'psych', '>= 4.0.0'
end