Skip to content

Commit

Permalink
Use railsdoc main branch (#131)
Browse files Browse the repository at this point in the history
* Use railsdoc main branch

* Add `remove_existing_files` method

* Update docs
  • Loading branch information
toshimaru authored Nov 12, 2023
1 parent 0803980 commit ecb5ead
Show file tree
Hide file tree
Showing 2,422 changed files with 93,498 additions and 115,998 deletions.
10 changes: 9 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def generate_rails_rdoc

# Replace sdoc gem with my forked one
gemfile = File.read('Gemfile')
gemfile.gsub!(/"sdoc".*$/, '"sdoc", github: "toshimaru/sdoc", branch: "railsdoc"')
gemfile.gsub!(/"sdoc".*$/, '"sdoc", github: "toshimaru/sdoc", branch: "main"')
File.write('Gemfile', gemfile)

sh 'bundle install && bundle update sdoc'
Expand All @@ -77,6 +77,7 @@ end
def generate_src(target_version:)
copy_sources = Dir.glob('rails/doc/rdoc/*').reject { |path| path.end_with?('panel', 'js', 'created.rid') }
target_dir = target_version == default_rails_version ? SOURCE_DIR : "#{SOURCE_DIR}/#{target_version}"
remove_existing_files(target_dir)
cp_r copy_sources, target_dir

cd target_dir do
Expand All @@ -92,3 +93,10 @@ def generate_src(target_version:)
File.write('navigation.html', content)
end
end

EXISTING_DIRS = %w[classes files].freeze
def remove_existing_files(target_dir)
EXISTING_DIRS.each do |dir|
rm_rf "#{target_dir}/#{dir}"
end
end
157 changes: 0 additions & 157 deletions src/classes/AbstractController/ActionNotFound/Correction.html

This file was deleted.

Loading

0 comments on commit ecb5ead

Please sign in to comment.