Sha256: a07bd53a070adb67e76ed5402b5b7786a46a8a1d211961d9a2bb03dee1d0196a

Contents?: true

Size: 684 Bytes

Versions: 3

Compression:

Stored size: 684 Bytes

Contents

# Rack application for serving the documentation locally.
# After generating the documentation run:
#
#   bundle exec rackup config.ru
#
require 'bundler/setup'

root = "doc/rails"
unless Dir.exists?(root)
  puts <<~MESSAGE
    Could not find any docs in #{root}.
    Run the following command to generate sample documentation:
      bundle exec rake test:rails
  MESSAGE
  exit
end

use Rack::Static,
  :urls => ["/files", "/images", "/js", "/css", "/panel", "/i", "/classes"],
  :root => root
run lambda { |env|
  [
    200,
    { 
      'Content-Type'  => 'text/html',
      'Cache-Control' => 'public, max-age=86400'
    },
    File.open("#{root}/index.html", File::RDONLY)
  ]
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sdoc-2.1.0 config.ru
sdoc-2.0.4 config.ru
sdoc-2.0.3 config.ru