Skip to content
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
submodules: true
- name: fetch Rails tags
run: cd rails && git fetch --depth=1 origin refs/tags/v7*:refs/tags/v7* refs/tags/v6*:refs/tags/v6* refs/tags/v5*:refs/tags/v5*
run: cd rails && git fetch --depth=1 origin refs/tags/v7*:refs/tags/v7* refs/tags/v6*:refs/tags/v6* refs/tags/v5*:refs/tags/v5*
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
Expand Down
38 changes: 27 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,31 @@ require 'bundler'

SOURCE_DIR = 'src'
INDEX_HTML = 'files/railties/RDOC_MAIN_rdoc.html'
NEW_INDEX_HTML = 'files/railties/RDOC_MAIN_md.html'

desc 'Generate documentation for default Rails version and build Jekyll site'
task build: :switch_default_rails do
generate_rails_rdoc
generate_src
generate_src(target_version: default_rails_version)
sh 'bundle exec jekyll build'
end

desc 'Switch to default Rails version'
task :switch_default_rails do
switch_rails(config['default_rails_version'])
switch_rails(default_rails_version)
end

desc 'Generate adn build documentation for older versions of Rails'
task :build_multi do
config['rails_versions'].each do |version, detail|
# WORKAROUND: use `reverse_each` instead of `each` to avoid nokogiri installation error
config['rails_versions'].reverse_each do |version, detail|
if detail['latest']
puts "=== Skip Rails v#{version} because it's latest version ==="
next
else
puts "=== Build Rails v#{version} documentation ==="
end

dir = "#{SOURCE_DIR}/#{version}"
mkdir dir unless Dir.exist?(dir)

Expand All @@ -29,11 +38,16 @@ task :build_multi do
generate_rails_rdoc
generate_src(target_version: version)
end
puts
sh 'bundle exec jekyll build'
end

def config
YAML.load_file('./_config.yml')
@config ||= YAML.load_file('./_config.yml')
end

def default_rails_version
config['default_rails_version']
end

def switch_rails(version)
Expand All @@ -46,10 +60,9 @@ end
def generate_rails_rdoc
cd 'rails' do
Bundler.with_unbundled_env do
# TODO: use `BUNDLE_ONLY`(require bundler 2.3.19+).
ENV['BUNDLE_WITHOUT'] = %w[db job storage cable ujs test rubocop view].join(':')
ENV['BUNDLE_WITHOUT'] = %w[db view job storage cable ujs test rubocop lint mdl].join(':')

# replace sdoc gem
# Replace sdoc gem with my forked one
gemfile = File.read('Gemfile')
gemfile.gsub!(/"sdoc".*$/, '"sdoc", github: "toshimaru/sdoc", branch: "railsdoc"')
File.write('Gemfile', gemfile)
Expand All @@ -61,15 +74,18 @@ def generate_rails_rdoc
end
end

def generate_src(target_version: nil)
def generate_src(target_version:)
copy_sources = Dir.glob('rails/doc/rdoc/*').reject { |path| path.end_with?('panel', 'js', 'created.rid') }
target_dir = "#{SOURCE_DIR}/#{target_version}"
target_dir = target_version == default_rails_version ? SOURCE_DIR : "#{SOURCE_DIR}/#{target_version}"
cp_r copy_sources, target_dir

cd target_dir do
cp INDEX_HTML, 'index.html'
return if target_version.nil?
if Gem::Version.new(target_version) >= Gem::Version.new('7.1')
cp NEW_INDEX_HTML, 'index.html'
return
end

cp INDEX_HTML, 'index.html'
# Prepend version number to the absolute path in navigation.html
content = File.read('navigation.html')
content.gsub!('<a href="/', "<a href=\"/#{target_version}/")
Expand Down
14 changes: 12 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ title: RailsDoc(β)
description: Ruby on Rails API Documentation.
url: https://railsdoc.github.io
source: src
default_rails_version: 7.0.8
default_rails_version: '7.1.0'
rails_versions:
"7.1":
specific_version: "7.1.0"
latest: true
"7.0":
specific_version: "7.0.8"
"6.1":
specific_version: "6.1.7"
"6.0":
Expand All @@ -24,10 +29,15 @@ defaults:
- scope:
path: ""
values:
version: 7.0
version: 7.1
image: https://avatars.githubusercontent.com/u/4223
toc: true
root_path: '/'
- scope:
path: "7.0"
values:
version: 7.0
root_path: '/7.0/'
- scope:
path: "6.1"
values:
Expand Down
2 changes: 1 addition & 1 deletion rails
Submodule rails updated 2346 files
122 changes: 122 additions & 0 deletions src/7.0/classes/AbstractController.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: AbstractController
layout: default
---
<div class="main">
<div class="banner">

<span>Ruby on Rails 7.0.8</span><br />

<div class="type">Module</div>
<h1>
AbstractController

</h1>
<ul class="files">

<li><a href="../files/actionpack/lib/abstract_controller/asset_paths_rb.html">actionpack/lib/abstract_controller/asset_paths.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/base_rb.html">actionpack/lib/abstract_controller/base.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/caching_rb.html">actionpack/lib/abstract_controller/caching.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/caching/fragments_rb.html">actionpack/lib/abstract_controller/caching/fragments.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/callbacks_rb.html">actionpack/lib/abstract_controller/callbacks.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/collector_rb.html">actionpack/lib/abstract_controller/collector.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/error_rb.html">actionpack/lib/abstract_controller/error.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/helpers_rb.html">actionpack/lib/abstract_controller/helpers.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/logger_rb.html">actionpack/lib/abstract_controller/logger.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/railties/routes_helpers_rb.html">actionpack/lib/abstract_controller/railties/routes_helpers.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/rendering_rb.html">actionpack/lib/abstract_controller/rendering.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/translation_rb.html">actionpack/lib/abstract_controller/translation.rb</a></li>

<li><a href="../files/actionpack/lib/abstract_controller/url_for_rb.html">actionpack/lib/abstract_controller/url_for.rb</a></li>

<li><a href="../files/actionpack/lib/action_controller/metal/redirecting_rb.html">actionpack/lib/action_controller/metal/redirecting.rb</a></li>

<li><a href="../files/actionpack/lib/action_controller/metal/rendering_rb.html">actionpack/lib/action_controller/metal/rendering.rb</a></li>

<li><a href="../files/railties/lib/rails/mailers_controller_rb.html">railties/lib/rails/mailers_controller.rb</a></li>

</ul>
</div>
<div id="bodyContent">
<div id="content">









<h2 id="namespace">Namespace</h2>


<h3 id="module">Module</h3>
<ul>

<li><a href="AbstractController/Caching.html">AbstractController::Caching</a></li>

<li><a href="AbstractController/Callbacks.html">AbstractController::Callbacks</a></li>

<li><a href="AbstractController/Collector.html">AbstractController::Collector</a></li>

<li><a href="AbstractController/Helpers.html">AbstractController::Helpers</a></li>

<li><a href="AbstractController/Railties.html">AbstractController::Railties</a></li>

<li><a href="AbstractController/Rendering.html">AbstractController::Rendering</a></li>

<li><a href="AbstractController/Translation.html">AbstractController::Translation</a></li>

<li><a href="AbstractController/UrlFor.html">AbstractController::UrlFor</a></li>

</ul>



<h3 id="class">Class</h3>
<ul>

<li><a href="AbstractController/ActionNotFound.html">AbstractController::ActionNotFound</a></li>

<li><a href="AbstractController/Base.html">AbstractController::Base</a></li>

<li><a href="AbstractController/DoubleRenderError.html">AbstractController::DoubleRenderError</a></li>

</ul>
















<!-- Methods -->




</div>

</div>
</div>
66 changes: 66 additions & 0 deletions src/7.0/classes/AbstractController/ActionNotFound.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: AbstractController::ActionNotFound
layout: default
---
<div class="main">
<div class="banner">

<span>Ruby on Rails 7.0.8</span><br />

<div class="type">Class</div>
<h1>
AbstractController::ActionNotFound

<span class="parent">&lt;

StandardError

</span>

</h1>
<ul class="files">

<li><a href="../../files/actionpack/lib/abstract_controller/base_rb.html">actionpack/lib/abstract_controller/base.rb</a></li>

</ul>
</div>
<div id="bodyContent">
<div id="content">

<div class="description">

<p>Raised when a non-existing controller action is triggered.</p>

</div>























<!-- Methods -->




</div>

</div>
</div>
Loading