Skip to content
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
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ permissions:

jobs:
build:
name: "Test / Ruby ${{ matrix.ruby }}"
name: "Test / Ruby ${{ matrix.ruby }} / RDoc ${{ matrix.rdoc }}"
runs-on: ubuntu-latest
env:
RDOC_VERSION: "~> ${{ matrix.rdoc }}"
strategy:
matrix:
rdoc:
- "7.2.0"
ruby:
- "3.3"
- "3.4"
- "4.0"
include:
- ruby: "4.0"
rdoc: "8.0"
fail-fast: false

steps:
Expand All @@ -28,7 +35,11 @@ jobs:
- uses: ruby/setup-ruby@a0102e0972be65f351c307e2d64b9314a57c8073 # v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
bundler-cache: ${{ matrix.rdoc == '7.2.0' }}

- name: Install RDoc 8 dependencies
if: matrix.rdoc == '8.0'
run: bundle update rdoc

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ To run the tests:

If nothing complains, congratulations!

CI tests RDoc 7.2 and 8.x. To test RDoc 8.x locally:

$ RDOC_VERSION='~> 8.0' bundle update rdoc
$ RDOC_VERSION='~> 8.0' bundle exec rake

## Releasing a new version

If you are the current maintainer of this gem:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gem "redcarpet", :platforms => :ruby
gem "kramdown", :platforms => :jruby
gem "RedCloth"
gem "commonmarker", "~> 2.8.2"
gem "rdoc", "~> 7.2.0"
gem "rdoc", ENV.fetch("RDOC_VERSION", "~> 7.2.0")
gem "org-ruby", "0.9.12"
gem "creole", "~>0.5.0"
gem "wikicloth", "=0.8.3"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
github-markup (6.0.0)
rdoc (< 8)
rdoc (< 9)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ you wish to run the library. You can also run `script/bootstrap` to fetch them a

* [.markdown, .mdown, .mkdn, .md](http://daringfireball.net/projects/markdown/) -- `gem install commonmarker` (https://github.com/gjtorikian/commonmarker)
* [.textile](https://textile-lang.com/) -- `gem install RedCloth` (https://github.com/jgarber/redcloth)
* [.rdoc](https://ruby.github.io/rdoc/) -- `gem install rdoc -v 3.6.1`
* [.rdoc](https://ruby.github.io/rdoc/) -- `gem install rdoc`
* [.org](http://orgmode.org/) -- `gem install org-ruby` (https://github.com/wallyqs/org-ruby)
* [.creole](http://wikicreole.org/) -- `gem install creole` (https://github.com/larsch/creole)
* [.mediawiki, .wiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `gem install wikicloth` (https://github.com/nricciar/wikicloth)
Expand Down
2 changes: 1 addition & 1 deletion github-markup.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |s|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = %w[lib]

s.add_dependency 'rdoc', '< 8'
s.add_dependency 'rdoc', '< 9'

s.add_development_dependency 'rake', '~> 13'
s.add_development_dependency 'activesupport', '~> 8.1.3'
Expand Down
8 changes: 5 additions & 3 deletions lib/github/markup/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ def initialize
end

def render(filename, content, options: {})
if ::RDoc::VERSION.to_i >= 4
# RDoc 4-7 require positional Options; RDoc 8 uses keyword options.
# Each run covers only the installed RDoc's branch; CI tests both.
# :nocov:
if (4...8).cover?(::RDoc::VERSION.to_i)
h = ::RDoc::Markup::ToHtml.new(::RDoc::Options.new)
else
# :nocov: RDoc < 4 has been unsupported since Ruby 2.4 (2016); modern RDoc requires Options.
h = ::RDoc::Markup::ToHtml.new
# :nocov:
end
# :nocov:
h.convert(content)
end

Expand Down
5 changes: 0 additions & 5 deletions test/coverage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ def test_try_require_returns_false_for_missing_gem
refute md.send(:try_require, "github_markup_definitely_not_a_real_gem_#{Time.now.to_i}")
end

# --- rdoc.rb legacy version branch --------------------------------------
# The `RDoc::VERSION < 4` branch in rdoc.rb is marked :nocov: in source
# because the modern RDoc::Markup::ToHtml constructor requires Options
# and the legacy zero-arg form has been broken since RDoc 4 (2013).

# --- implementation.rb default render and Linguist-less match? ---------

def test_base_implementation_render_raises_not_implemented_error
Expand Down
Loading