Sha256: 08c518865ad42cba3cb688f0c8d7edd07853d3a9013cad147bcba2a0fd22f636

Contents?: true

Size: 703 Bytes

Versions: 9

Compression:

Stored size: 703 Bytes

Contents

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

root = "doc/public"
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", "/ruby", "/rails"],
  :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

9 entries across 9 versions & 2 rubygems

Version Path
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/sdoc-2.6.1/config.ru
sdoc-2.6.1 config.ru
sdoc-2.6.0 config.ru
sdoc-2.5.0 config.ru
sdoc-2.4.0 config.ru
sdoc-2.3.2 config.ru
sdoc-2.3.1 config.ru
sdoc-2.3.0 config.ru
sdoc-2.2.0 config.ru