Skip to content

Commit

Permalink
Generate test documentation to doc/public
Browse files Browse the repository at this point in the history
  • Loading branch information
mikdiet committed Apr 22, 2021
1 parent b36594c commit abf4673
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ rake test:rails
```

This task will generate documentation for the Rails main branch.
Since the task doesn't do any file filtering it contains a lot of extra pages.

To view the just generated documentation start up a rack application by running:

Expand Down
15 changes: 13 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@ directory rails do
end

namespace :test do
task :rails => rails
desc 'Deletes all generated test documentation'
task :reset_docs do
FileUtils.remove_dir(File.expand_path('doc'), force: true)
end

desc 'Generates test rails documentation'
task :rails => [rails, :generate_rails] do
FileUtils.mv(
File.expand_path('doc/rails'),
File.expand_path('doc/public')
)
end

RDoc::Task.new(:rails) do |rdoc|
RDoc::Task.new(:generate_rails) do |rdoc|
rdoc.rdoc_dir = 'doc/rails'
rdoc.generator = 'sdoc'
rdoc.template = 'rails'
Expand Down
4 changes: 2 additions & 2 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
require 'bundler/setup'

root = "doc/rails"
root = "doc/public"
unless Dir.exists?(root)
puts <<~MESSAGE
Could not find any docs in #{root}.
Expand All @@ -21,7 +21,7 @@ use Rack::Static,
run lambda { |env|
[
200,
{
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
command = "rake install && sdoc -o doc/rails -T rails -f sdoc"
publish = "doc/rails"
command = "rake install && sdoc -o doc/public -T rails -f sdoc"
publish = "doc/public"

[build.processing]
skip_processing = false
Expand Down

0 comments on commit abf4673

Please sign in to comment.