diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c13ce8489d..f00e29cb8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 20f7177ede..3b2649f7d7 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -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 diff --git a/Rakefile b/Rakefile index 1a8700aa5f..086f80cf0a 100644 --- a/Rakefile +++ b/Rakefile @@ -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 @@ -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}" @@ -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 @@ -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' @@ -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!('
  • files
  • Core extensions
  • AbstractController
  • ActionCable
  • ActionController
  • ActionDispatch
  • ActionMailbox
  • ActionMailer
  • ActionText
  • ActionView
  • ActiveJob
  • ActiveModel
  • ActiveRecord
  • ActiveStorage
  • ActiveSupport
  • Arel
  • LoggerSilence
  • Mail
  • Mime
  • Minitest
  • PG
  • Rails
  • \ No newline at end of file + \ No newline at end of file diff --git a/src/6.0/navigation.html b/src/6.0/navigation.html index 6784c94b1c..e08b23d668 100644 --- a/src/6.0/navigation.html +++ b/src/6.0/navigation.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/6.1/navigation.html b/src/6.1/navigation.html index d2cffae669..0029ffbea7 100644 --- a/src/6.1/navigation.html +++ b/src/6.1/navigation.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/7.0/navigation.html b/src/7.0/navigation.html new file mode 100644 index 0000000000..9bf6ac45f5 --- /dev/null +++ b/src/7.0/navigation.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/classes/AbstractController.html b/src/classes/AbstractController.html index b64af145f6..cfb0b7a519 100644 --- a/src/classes/AbstractController.html +++ b/src/classes/AbstractController.html @@ -5,7 +5,7 @@