Class: Gonzui::SourceServlet
- Inherits:
-
GonzuiAbstractServlet
- Object
- HTTPServlet::AbstractServlet
- GonzuiAbstractServlet
- Gonzui::SourceServlet
- Defined in:
- lib/gonzui/webapp/source.rb
Constant Summary
Constants included from URIMaker
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from GonzuiAbstractServlet
#format_html, #get_media_type, #get_mime_type, #init_servlet, #initialize, #log, #make_path, #set_content_type_text_html
Methods included from HTMLMaker
#make_content_script_type, #make_css, #make_footer, #make_format_select, #make_h1, #make_html, #make_license_select, #make_meta, #make_meta_and_css, #make_navi, #make_property_select, #make_script, #make_search_form, #make_spacer, #make_status_line, #make_title
Methods included from URIMaker
#decompose_search_query, #escape_path, #get_default_query_value, #get_query_value, #get_short_name, #make_advanced_search_uri, #make_doc_uri, #make_google_uri, #make_lineno_uri, #make_markup_uri, #make_search_uri, #make_search_uri_partial, #make_source_uri, #make_stat_uri, #make_top_uri, #make_uri_general, #make_uri_with_options
Methods included from GetText
#gettext, #gettext_noop, #load_catalog, #set_catalog
Methods included from Util
assert, assert_equal, assert_equal_all, assert_non_nil, assert_not_reached, benchmark, command_exist?, commify, eprintf, format_bytes, program_name, protect_from_signals, require_command, set_verbosity, shell_escape, unix?, vprintf, windows?, wprintf
Constructor Details
This class inherits a constructor from Gonzui::GonzuiAbstractServlet
Class Method Details
.mount_point ⇒ Object
14 15 16 |
# File 'lib/gonzui/webapp/source.rb', line 14 def self.mount_point "source" end |
Instance Method Details
#do_GET(request, response) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gonzui/webapp/source.rb', line 18 def do_GET(request, response) init_servlet(request, response) path = make_path log(path) path_id = @dbm.get_path_id(path) if path_id content = @dbm.get_content(path_id) response.body = content mime_type = get_mime_type(path) response["Content-Type"] = mime_type else response.body = sprintf("%s: not found", path) response.status = 404 end end |