Sha256: 24b0c8f6ac10e9eeba59d7f76d8afa38609bffcb6ea96cf223e5a293d8f10b30
Contents?: true
Size: 907 Bytes
Versions: 3
Compression:
Stored size: 907 Bytes
Contents
module Useless module Doc class Rack # +Doc::Rack::HTML+ is the base application for +Useless::Doc::Rack+. # It expects a +Doc::UI+ instance to be set as 'useless.doc.ui', and a # +Doc::Core+ entity to be set as 'useless.doc.subject', and then simply # passes the latter to the former's +#html+ method. # module HTML def self.call(env) if html = env['useless.doc.ui'].html(env['useless.doc.subject']) if env['useless.doc.logger'] env['useless.doc.logger'].info "rendered subject HTML for #{env['useless.doc.url']}" env['useless.doc.logger'].debug "rendered HTML: #{html}" end [200, {'Content-Type' => 'text/html'}, [html]] else [404, {'Content-Type' => 'text/plain'}, ['Could not render documentation.']] end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
useless-doc-0.4.0 | lib/useless/doc/rack/html.rb |
useless-doc-0.3.1 | lib/useless/doc/rack/html.rb |
useless-doc-0.3.0 | lib/useless/doc/rack/html.rb |