Skip to content

Fix a tag link replacement logic / Bump Ruby from 3.1 to 3.2 / Bump rails from 7.0.4 to 7.0.8 / Update BUNLDE_WITHOUT etc. #125

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

Merged
merged 8 commits into from
Oct 10, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
bundler-cache: true
- name: Jekyll Build
run: bundle exec jekyll build
Expand All @@ -22,9 +22,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: fetch Rails tags
run: cd rails && git fetch --depth=1 origin refs/tags/v7*:refs/tags/v7*
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
bundler-cache: true
- name: Doc Build
run: rake build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
bundler-cache: true
- name: Jekyll Build
run: bundle exec jekyll build
Expand Down
17 changes: 8 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ require 'bundler'
SOURCE_DIR = 'src'
INDEX_HTML = 'files/railties/RDOC_MAIN_rdoc.html'

desc 'Build railsdoc'
task :build do
desc 'Generate documentation for default Rails version and build Jekyll site'
task build: :switch_default_rails do
generate_rails_rdoc
generate_src

sh 'bundle exec jekyll build'
end

Expand All @@ -19,7 +18,7 @@ task :switch_default_rails do
switch_rails(config['default_rails_version'])
end

desc "Build another version's railsdoc"
desc 'Generate adn build documentation for older versions of Rails'
task :build_multi do
config['rails_versions'].each do |version, detail|
dir = "#{SOURCE_DIR}/#{version}"
Expand All @@ -30,6 +29,7 @@ task :build_multi do
generate_rails_rdoc
generate_src(target_version: version)
end
sh 'bundle exec jekyll build'
end

def config
Expand All @@ -47,11 +47,11 @@ def generate_rails_rdoc
cd 'rails' do
Bundler.with_unbundled_env do
# TODO: use `BUNDLE_ONLY`(require bundler 2.3.19+).
ENV['BUNDLE_WITHOUT'] = 'db:job:storage:cable:ujs:test'
ENV['BUNDLE_WITHOUT'] = %w[db job storage cable ujs test rubocop view].join(':')

# replace sdoc gem
gemfile = File.read('Gemfile')
gemfile.gsub!(/"sdoc.*$/, '"sdoc", github: "toshimaru/sdoc", branch: "railsdoc"')
gemfile.gsub!(/"sdoc".*$/, '"sdoc", github: "toshimaru/sdoc", branch: "railsdoc"')
File.write('Gemfile', gemfile)

sh 'bundle install && bundle update sdoc'
Expand All @@ -68,12 +68,11 @@ def generate_src(target_version: nil)

cd target_dir do
cp INDEX_HTML, 'index.html'

return if target_version.nil?

# Replace absolute path in navigation.html
# Prepend version number to the absolute path in navigation.html
content = File.read('navigation.html')
content.gsub!('<a href=\"/', "<a href=\"/#{target_version}/")
content.gsub!('<a href="/', "<a href=\"/#{target_version}/")
File.write('navigation.html', content)
end
end
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: RailsDoc(β)
description: Ruby on Rails API Documentation.
url: https://railsdoc.github.io
source: src
default_rails_version: 7.0.4
default_rails_version: 7.0.8
rails_versions:
"6.1":
specific_version: "6.1.7"
Expand Down
2 changes: 1 addition & 1 deletion rails
Submodule rails updated 435 files
2 changes: 1 addition & 1 deletion src/5.2/navigation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/6.0/navigation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/6.1/navigation.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/7.0/navigation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/classes/AbstractController.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/ActionNotFound.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Class</div>
<h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

<span>Ruby on Rails 6.1.3.2</span><br />
<span>Ruby on Rails 6.1.7</span><br />

<div class="type">Class</div>
<h1>
Expand Down
6 changes: 3 additions & 3 deletions src/classes/AbstractController/Base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Class</div>
<h1>
Expand Down Expand Up @@ -450,7 +450,7 @@ <h3 id="method-i-action_methods">


<div class="description">
<p>Delegates to the class&#39;s <a href="Base.html#method-c-action_methods"><code>::action_methods</code></a>.</p>
<p>Delegates to the classs <a href="Base.html#method-c-action_methods"><code>::action_methods</code></a>.</p>
</div>


Expand Down Expand Up @@ -561,7 +561,7 @@ <h3 id="method-i-controller_path">


<div class="description">
<p>Delegates to the class&#39;s <a href="Base.html#method-c-controller_path"><code>::controller_path</code></a>.</p>
<p>Delegates to the classs <a href="Base.html#method-c-controller_path"><code>::controller_path</code></a>.</p>
</div>


Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Caching.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Caching/ClassMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Caching/ConfigMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
8 changes: 4 additions & 4 deletions src/classes/AbstractController/Caching/Fragments.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand All @@ -25,7 +25,7 @@ <h1>

<p>Fragment caching is used for caching various blocks within views without caching the entire action as a whole. This is useful when certain elements of an action change frequently or depend on complicated state while other parts rarely change or can be shared amongst multiple parties. The caching is done using the <code>cache</code> helper available in the Action View. See <a href="../../ActionView/Helpers/CacheHelper.html"><code>ActionView::Helpers::CacheHelper</code></a> for more information.</p>

<p>While it&#39;s strongly recommended that you use key-based cache expiration (see links in CacheHelper for more information), it is also possible to manually expire caches. For example:</p>
<p>While its strongly recommended that you use key-based cache expiration (see links in CacheHelper for more information), it is also possible to manually expire caches. For example:</p>

<pre><code>expire_fragment(&#39;name_of_cache&#39;)
</code></pre>
Expand Down Expand Up @@ -155,10 +155,10 @@ <h3 id="method-i-expire_fragment">
</li><li>
<p><a href="../../Hash.html"><code>Hash</code></a> - Treated as an implicit call to <code>url_for</code>, like <code>{ controller: &#39;pages&#39;, action: &#39;notes&#39;, id: 45}</code></p>
</li><li>
<p><a href="../../Regexp.html"><code>Regexp</code></a> - Will remove any fragment that matches, so <code>%r{pages/\d*/notes}</code> might remove all notes. Make sure you don&#39;t use anchors in the regex (<code>^</code> or <code>$</code>) because the actual filename matched looks like <code>./cache/filename/path.cache</code>. Note: <a href="../../Regexp.html"><code>Regexp</code></a> expiration is only supported on caches that can iterate over all keys (unlike memcached).</p>
<p><a href="../../Regexp.html"><code>Regexp</code></a> - Will remove any fragment that matches, so <code>%r{pages/\d*/notes}</code> might remove all notes. Make sure you dont use anchors in the regex (<code>^</code> or <code>$</code>) because the actual filename matched looks like <code>./cache/filename/path.cache</code>. Note: <a href="../../Regexp.html"><code>Regexp</code></a> expiration is only supported on caches that can iterate over all keys (unlike memcached).</p>
</li></ul>

<p><code>options</code> is passed through to the cache store&#39;s <code>delete</code> method (or <code>delete_matched</code>, for <a href="../../Regexp.html"><code>Regexp</code></a> keys).</p>
<p><code>options</code> is passed through to the cache stores <code>delete</code> method (or <code>delete_matched</code>, for <a href="../../Regexp.html"><code>Regexp</code></a> keys).</p>
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down Expand Up @@ -75,7 +75,7 @@ <h3 id="method-i-fragment_cache_key">
end
</code></pre>

<p>When it&#39;s time to invalidate all fragments, simply change the string constant. Or, progressively roll out the cache invalidation using a computed value:</p>
<p>When its time to invalidate all fragments, simply change the string constant. Or, progressively roll out the cache invalidation using a computed value:</p>

<pre><code>class ApplicationController
fragment_cache_key do
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Callbacks.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Callbacks/ClassMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Collector.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/DoubleRenderError.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Class</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
38 changes: 21 additions & 17 deletions src/classes/AbstractController/Helpers/ClassMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down Expand Up @@ -117,7 +117,7 @@ <h3 id="method-i-_helpers_for_modification">

</p>
<div id="method-i-_helpers_for_modification_source">
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 184</span>
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 188</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_helpers_for_modification</span>
<span class="ruby-keyword">unless</span> <span class="ruby-ivar">@_helpers</span>
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">_helpers</span> = <span class="ruby-identifier">define_helpers_module</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">superclass</span>.<span class="ruby-identifier">_helpers</span>)
Expand Down Expand Up @@ -155,7 +155,7 @@ <h3 id="method-i-clear_helpers">

</p>
<div id="method-i-clear_helpers_source">
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 158</span>
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 162</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_helpers</span>
<span class="ruby-identifier">inherited_helper_methods</span> = <span class="ruby-identifier">_helper_methods</span>
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">_helpers</span> = <span class="ruby-constant">Module</span>.<span class="ruby-identifier">new</span>
Expand Down Expand Up @@ -243,7 +243,7 @@ <h3 id="method-i-helper">

</p>
<div id="method-i-helper_source">
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 147</span>
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 151</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">helper</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-identifier">modules_for_helpers</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">_helpers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">mod</span>)
Expand Down Expand Up @@ -271,13 +271,14 @@ <h3 id="method-i-helper_method">
<pre><code>class ApplicationController &lt; ActionController::Base
helper_method :current_user, :logged_in?

def current_user
@current_user ||= User.find_by(id: session[:user])
end
private
def current_user
@current_user ||= User.find_by(id: session[:user])
end

def logged_in?
current_user != nil
end
def logged_in?
current_user != nil
end
end
</code></pre>

Expand Down Expand Up @@ -306,7 +307,7 @@ <h4 id="method-i-helper_method-label-Parameters">Parameters</h4>

</p>
<div id="method-i-helper_method_source">
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 79</span>
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 80</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">helper_method</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">methods</span>)
<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">flatten!</span>
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">_helper_methods</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">methods</span>
Expand All @@ -315,10 +316,13 @@ <h4 id="method-i-helper_method-label-Parameters">Parameters</h4>
<span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span> = <span class="ruby-identifier">location</span>.<span class="ruby-identifier">path</span>, <span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span>

<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">_helpers_for_modification</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">&lt;&lt;~ruby_eval</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>
<span class="ruby-value"> def #{method}(*args, &amp;block) # def current_user(*args, &amp;block)
controller.send(:&#39;#{method}&#39;, *args, &amp;block) # controller.send(:&#39;current_user&#39;, *args, &amp;block)
end # end
<span class="ruby-comment"># def current_user(*args, &amp;block)</span>
<span class="ruby-comment"># controller.send(:&#39;current_user&#39;, *args, &amp;block)</span>
<span class="ruby-comment"># end</span>
<span class="ruby-identifier">_helpers_for_modification</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">&lt;&lt;~ruby_eval</span>.<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:strip</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;;&quot;</span>), <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>
<span class="ruby-value"> def #{method}(*args, &amp;block)
controller.send(:&#39;#{method}&#39;, *args, &amp;block)
end
ruby2_keywords(:&#39;#{method}&#39;)
</span><span class="ruby-identifier"> ruby_eval</span>
<span class="ruby-keyword">end</span>
Expand All @@ -337,7 +341,7 @@ <h3 id="method-i-inherited">


<div class="description">
<p>When a class is inherited, wrap its helper module in a new module. This ensures that the parent class&#39;s module can be changed independently of the child class&#39;s.</p>
<p>When a class is inherited, wrap its helper module in a new module. This ensures that the parent classs module can be changed independently of the child classs.</p>
</div>


Expand Down Expand Up @@ -393,7 +397,7 @@ <h3 id="method-i-modules_for_helpers">

</p>
<div id="method-i-modules_for_helpers_source">
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 169</span>
<pre><code class="ruby"><span class="ruby-comment"># File actionpack/lib/abstract_controller/helpers.rb, line 173</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">modules_for_helpers</span>(<span class="ruby-identifier">modules_or_helper_prefixes</span>)
<span class="ruby-identifier">modules_or_helper_prefixes</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">module_or_helper_prefix</span><span class="ruby-operator">|</span>
<span class="ruby-keyword">case</span> <span class="ruby-identifier">module_or_helper_prefix</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Class</div>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AbstractController/Railties.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="main">
<div class="banner">

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

<div class="type">Module</div>
<h1>
Expand Down
Loading