Skip to content

Commit f9c77d4

Browse files
committed
fix: Update index.html source from RDOC_MAIN_rdoc.html to RDOC_MAIN_md.html
ref. rails/rails#47178
1 parent 0f186fd commit f9c77d4

File tree

3 files changed

+53
-30
lines changed

3 files changed

+53
-30
lines changed

Rakefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ require 'bundler'
55

66
SOURCE_DIR = 'src'
77
INDEX_HTML = 'files/railties/RDOC_MAIN_rdoc.html'
8+
NEW_INDEX_HTML = 'files/railties/RDOC_MAIN_md.html'
89

910
desc 'Generate documentation for default Rails version and build Jekyll site'
1011
task build: :switch_default_rails do
1112
generate_rails_rdoc
12-
generate_src
13+
generate_src(target_version: default_rails_version)
1314
sh 'bundle exec jekyll build'
1415
end
1516

1617
desc 'Switch to default Rails version'
1718
task :switch_default_rails do
18-
switch_rails(config['default_rails_version'])
19+
switch_rails(default_rails_version)
1920
end
2021

2122
desc 'Generate adn build documentation for older versions of Rails'
@@ -34,7 +35,11 @@ task :build_multi do
3435
end
3536

3637
def config
37-
YAML.load_file('./_config.yml')
38+
@config ||= YAML.load_file('./_config.yml')
39+
end
40+
41+
def default_rails_version
42+
config['default_rails_version']
3843
end
3944

4045
def switch_rails(version)
@@ -61,15 +66,18 @@ def generate_rails_rdoc
6166
end
6267
end
6368

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

6974
cd target_dir do
70-
cp INDEX_HTML, 'index.html'
71-
return if target_version.nil?
75+
if Gem::Version.new(target_version) >= Gem::Version.new('7.1')
76+
cp NEW_INDEX_HTML, 'index.html'
77+
return
78+
end
7279

80+
cp INDEX_HTML, 'index.html'
7381
# Prepend version number to the absolute path in navigation.html
7482
content = File.read('navigation.html')
7583
content.gsub!('<a href="/', "<a href=\"/#{target_version}/")

src/index.html

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
title: RDOC_MAIN.rdoc
2+
title: RDOC_MAIN.md
33
layout: default
44
---
55
<div>
66
<div class="banner">
77

8-
<span>Ruby on Rails 7.0.8</span><br />
8+
<span>Ruby on Rails 7.1.0</span><br />
99

1010
<h1>
11-
RDOC_MAIN.rdoc
11+
RDOC_MAIN.md
1212
</h1>
1313
<ul class="files">
1414

1515
<li>
16-
railties/RDOC_MAIN.rdoc
16+
railties/RDOC_MAIN.md
1717

1818
</li>
1919
</ul>
@@ -26,31 +26,48 @@ <h1>
2626

2727
<h1 id="label-Welcome+to+Rails">Welcome to Rails</h1>
2828

29-
<h2 id="label-What-27s+Rails">What’s Rails</h2>
29+
<h2 id="label-What-27s+Rails-3F">What’s Rails?</h2>
3030

3131
<p>Rails is a web-application framework that includes everything needed to create database-backed web applications according to the <a href="https://en.wikipedia.org/wiki/Model-view-controller">Model-View-Controller (MVC)</a> pattern.</p>
3232

3333
<p>Understanding the MVC pattern is key to understanding Rails. MVC divides your application into three layers: Model, View, and Controller, each with a specific responsibility.</p>
3434

3535
<h2 id="label-Model+layer">Model layer</h2>
3636

37-
<p>The <strong><em>Model layer</em></strong> represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from <code>ActiveRecord::Base</code>. <a href="../../files/activerecord/README_rdoc.html">Active Record</a> allows you to present the data from database rows as objects and embellish these data objects with business logic methods. Although most Rails models are backed by a database, models can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as provided by the <a href="../../files/activemodel/README_rdoc.html">Active Model</a> module.</p>
37+
<p>The <strong><em>Model layer</em></strong> represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from <code>ActiveRecord::Base</code>. <a href="files/activerecord/README_rdoc.html">Active Record</a> allows you to present the data from database rows as objects and embellish these data objects with business logic methods. Although most Rails models are backed by a database, models can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as provided by the <a href="files/activemodel/README_rdoc.html">Active Model</a> module.</p>
3838

39-
<h2 id="label-Controller+layer">Controller layer</h2>
39+
<h2 id="label-View+layer">View layer</h2>
4040

41-
<p>The <strong><em>Controller layer</em></strong> is responsible for handling incoming HTTP requests and providing a suitable response. Usually, this means returning HTML, but Rails controllers can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from <code>ActionController::Base</code>. Action Dispatch and Action Controller are bundled together in <a href="../../files/actionpack/README_rdoc.html">Action Pack</a>.</p>
41+
<p>The <strong><em>View layer</em></strong> is composed of “templates” that are responsible for providing appropriate representations of your application’s resources. Templates can come in a variety of formats, but most view templates are HTML with embedded Ruby code (ERB files). Views are typically rendered to generate a controller response or to generate the body of an email. In Rails, View generation is handled by <a href="files/actionview/README_rdoc.html">Action View</a>.</p>
4242

43-
<h2 id="label-View+layer">View layer</h2>
43+
<h2 id="label-Controller+layer">Controller layer</h2>
4444

45-
<p>The <strong><em>View layer</em></strong> is composed of “templates” that are responsible for providing appropriate representations of your application’s resources. Templates can come in a variety of formats, but most view templates are HTML with embedded Ruby code (<a href="../../classes/ERB.html"><code>ERB</code></a> files). Views are typically rendered to generate a controller response, or to generate the body of an email. In Rails, View generation is handled by <a href="../../files/actionview/README_rdoc.html">Action View</a>.</p>
45+
<p>The <strong><em>Controller layer</em></strong> is responsible for handling incoming HTTP requests and providing a suitable response. Usually, this means returning HTML, but Rails controllers can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from <code>ActionController::Base</code>. Action Dispatch and Action Controller are bundled together in <a href="files/actionpack/README_rdoc.html">Action Pack</a>.</p>
4646

4747
<h2 id="label-Frameworks+and+libraries">Frameworks and libraries</h2>
4848

49-
<p><a href="../../files/activerecord/README_rdoc.html">Active Record</a>, <a href="../../files/activemodel/README_rdoc.html">Active Model</a>, <a href="../../files/actionpack/README_rdoc.html">Action Pack</a>, and <a href="../../files/actionview/README_rdoc.html">Action View</a> can each be used independently outside Rails. In addition to that, Rails also comes with <a href="../../files/actionmailer/README_rdoc.html">Action Mailer</a>, a library to generate and send emails; <a href="../../files/actionmailbox/README_md.html">Action Mailbox</a>, a library to receive emails within a Rails application; <a href="../../files/activejob/README_md.html">Active Job</a>, a framework for declaring jobs and making them run on a variety of queueing backends; <a href="../../files/actioncable/README_md.html">Action Cable</a>, a framework to integrate WebSockets with a Rails application; <a href="../../files/activestorage/README_md.html">Active Storage</a>, a library to attach cloud and local files to Rails applications; <a href="../../files/actiontext/README_md.html">Action Text</a>, a library to handle rich text content; and <a href="../../files/activesupport/README_rdoc.html">Active Support</a>, a collection of utility classes and standard library extensions that are useful for Rails, and may also be used independently outside Rails.</p>
49+
<p><a href="files/activerecord/README_rdoc.html">Active Record</a>, <a href="files/activemodel/README_rdoc.html">Active Model</a>, <a href="files/actionpack/README_rdoc.html">Action Pack</a>, and <a href="files/actionview/README_rdoc.html">Action View</a> can each be used independently outside Rails.</p>
50+
51+
<p>In addition to that, Rails also comes with:</p>
52+
<ul><li>
53+
<p><a href="files/actionmailer/README_rdoc.html">Action Mailer</a>, a library to generate and send emails</p>
54+
</li><li>
55+
<p><a href="files/actionmailbox/README_md.html">Action Mailbox</a>, a library to receive emails within a Rails application</p>
56+
</li><li>
57+
<p><a href="files/activejob/README_md.html">Active Job</a>, a framework for declaring jobs and making them run on a variety of queuing backends</p>
58+
</li><li>
59+
<p><a href="files/actioncable/README_md.html">Action Cable</a>, a framework to integrate WebSockets with a Rails application</p>
60+
</li><li>
61+
<p><a href="files/activestorage/README_md.html">Active Storage</a>, a library to attach cloud and local files to Rails applications</p>
62+
</li><li>
63+
<p><a href="files/actiontext/README_md.html">Action Text</a>, a library to handle rich text content</p>
64+
</li><li>
65+
<p><a href="files/activesupport/README_rdoc.html">Active Support</a>, a collection of utility classes and standard library extensions that are useful for Rails, and may also be used independently outside Rails</p>
66+
</li></ul>
5067

5168
<h2 id="label-Getting+Started">Getting Started</h2>
5269
<ol><li>
53-
<p>Install Rails at the command prompt if you havent yet:</p>
70+
<p>Install Rails at the command prompt if you haven't yet:</p>
5471

5572
<pre><code>$ gem install rails
5673
</code></pre>
@@ -60,7 +77,7 @@ <h2 id="label-Getting+Started">Getting Started</h2>
6077
<pre><code>$ rails new myapp
6178
</code></pre>
6279

63-
<p>where myapp is the application name.</p>
80+
<p>where "myapp" is the application name.</p>
6481
</li><li>
6582
<p>Change directory to <code>myapp</code> and start the web server:</p>
6683

@@ -70,27 +87,25 @@ <h2 id="label-Getting+Started">Getting Started</h2>
7087

7188
<p>Run with <code>--help</code> or <code>-h</code> for options.</p>
7289
</li><li>
73-
<p>Go to <code>http://localhost:3000</code>, and youll see: “Yay! You’re on Rails!”</p>
90+
<p>Go to <code>http://localhost:3000</code> and you'll see the Rails bootscreen with your Rails and Ruby versions.</p>
7491
</li><li>
7592
<p>Follow the guidelines to start developing your application. You may find the following resources handy:</p>
7693
<ul><li>
77-
<p>The README file created within your application.</p>
78-
</li><li>
79-
<p><a href="https://guides.rubyonrails.org/getting_started.html">Getting Started with Rails</a>.</p>
94+
<p><a href="https://guides.rubyonrails.org/getting_started.html">Getting Started with Rails</a></p>
8095
</li><li>
81-
<p><a href="https://guides.rubyonrails.org">Ruby on Rails Guides</a>.</p>
96+
<p><a href="https://guides.rubyonrails.org">Ruby on Rails Guides</a></p>
8297
</li><li>
83-
<p><a href="https://api.rubyonrails.org">The API Documentation</a>.</p>
98+
<p><a href="https://api.rubyonrails.org">The API Documentation</a></p>
8499
</li></ul>
85100
</li></ol>
86101

87102
<h2 id="label-Contributing">Contributing</h2>
88103

89-
<p>We encourage you to contribute to Ruby on Rails! Please check out the <a href="https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails guide</a> for guidelines about how to proceed. <a href="http://contributors.rubyonrails.org">Join us!</a></p>
104+
<p>We encourage you to contribute to Ruby on Rails! Please check out the <a href="https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails guide</a> for guidelines about how to proceed. <a href="https://contributors.rubyonrails.org">Join us!</a></p>
90105

91-
<p>Trying to report a possible security vulnerability in Rails? Please check out our <a href="https://rubyonrails.org/security/">security policy</a> for guidelines about how to proceed.</p>
106+
<p>Trying to report a possible security vulnerability in Rails? Please check out our <a href="https://rubyonrails.org/security">security policy</a> for guidelines about how to proceed.</p>
92107

93-
<p>Everyone interacting in Rails and its sub-projects’ codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails <a href="http://rubyonrails.org/conduct/">code of conduct</a>.</p>
108+
<p>Everyone interacting in Rails and its sub-projects’ codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails <a href="https://rubyonrails.org/conduct">code of conduct</a>.</p>
94109

95110
<h2 id="label-License">License</h2>
96111

src/navigation.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)