From 5f4656833c9efba623829a418fcdb682db77cf31 Mon Sep 17 00:00:00 2001 From: Dan Arnfield Date: Wed, 18 Mar 2026 10:03:48 -0500 Subject: [PATCH 1/3] Don't add "show source" button when source isn't present --- lib/docs/filters/rdoc/clean_html.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/rdoc/clean_html.rb b/lib/docs/filters/rdoc/clean_html.rb index ff6d76604d..3264f017a1 100644 --- a/lib/docs/filters/rdoc/clean_html.rb +++ b/lib/docs/filters/rdoc/clean_html.rb @@ -42,7 +42,9 @@ def other link_node.content = 'Show source' link_node['class'] = 'method-click-advice' - node.parent.parent.at_css('.method-heading').add_child(link_node) + # Only add "Show source" if source is present + method_root = node.ancestors('.method-detail').first + method_root.at_css('.method-heading').add_child(link_node) if method_root.at_css('.method-source-code') end # (RDoc for Ruby 3.4+) Remove the additional "Source" toggle from the page From 00128128ec30e5e250db982347bd663ab7989ed1 Mon Sep 17 00:00:00 2001 From: Dan Arnfield Date: Wed, 18 Mar 2026 10:06:14 -0500 Subject: [PATCH 2/3] Move method source to correct location on newer rdoc Source was being moved above the header for ruby 4.0 --- lib/docs/filters/rdoc/clean_html.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/rdoc/clean_html.rb b/lib/docs/filters/rdoc/clean_html.rb index 3264f017a1..731994e74d 100644 --- a/lib/docs/filters/rdoc/clean_html.rb +++ b/lib/docs/filters/rdoc/clean_html.rb @@ -52,7 +52,8 @@ def other # Add class to differentiate Ruby code from C code css('.method-source-code').each do |node| - node.parent.prepend_child(node) + header = node.ancestors('.method-detail').first.at_css('.method-header') + header.add_next_sibling(node) pre = node.at_css('pre') pre['class'] = pre.at_css('.ruby-keyword') ? 'ruby' : 'c' end From a4f87bf46631672b9273f0a4750373dbe92e30b0 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Wed, 18 Mar 2026 18:32:04 +0100 Subject: [PATCH 3/3] Update Ruby on Rails documentation (8.1.2) --- docs/file-scrapers.md | 4 ++-- lib/docs/scrapers/rdoc/rails.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/file-scrapers.md b/docs/file-scrapers.md index 076510fcd9..308a75cd3c 100644 --- a/docs/file-scrapers.md +++ b/docs/file-scrapers.md @@ -272,13 +272,13 @@ cp -r minitest/docs $DEVDOCS/docs/minitest ``` ### Ruby on Rails -* Download a release at https://github.com/rails/rails/releases or clone https://github.com/rails/rails.git (checkout to the branch of the rails' version that is going to be scraped) +* Run `git clone --branch v$RELEASE --depth 7 https://github.com/rails/rails.git && cd rails` * Open `railties/lib/rails/api/task.rb` and comment out any code related to sdoc (`configure_sdoc`) * Run `bundle config set --local without 'db job'` (in the Rails directory) * Run `bundle install && bundle exec rake rdoc` (in the Rails directory) * Run `cd guides && bundle exec rake guides:generate:html && cd ..` * Run `cp -r guides/output html/guides` -* Run `cp -r html $DEVDOCS/docs/rails~[version]` +* Run `cp -r html $DEVDOCS/docs/rails~$VERSION` ### Ruby Download the tarball of Ruby from https://www.ruby-lang.org/en/downloads/, extract it, run diff --git a/lib/docs/scrapers/rdoc/rails.rb b/lib/docs/scrapers/rdoc/rails.rb index 03aad4a356..a78cbd5042 100644 --- a/lib/docs/scrapers/rdoc/rails.rb +++ b/lib/docs/scrapers/rdoc/rails.rb @@ -75,6 +75,10 @@ class Rails < Rdoc end end + version '8.1' do + self.release = '8.1.2' + end + version '8.0' do self.release = '8.0.1' end