diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-03-12 13:05:19 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-03-12 13:05:19 +0000 |
commit | 37bff4c0154b57b35a3194a9b31a9422496b955b (patch) | |
tree | 61592a6bb9d1d9fea378a6e4efa8fdf7d5525b8a /vendor/gems/gettext-2.1.0/samples/cgi/http.rb | |
parent | 8b49dc894066e452232cabd09333895487f86986 (diff) | |
parent | 8acea24f98268fbb9b73b66b9e98a1788a3b30ac (diff) |
Merge branch 'merged-bundler' into develop
Diffstat (limited to 'vendor/gems/gettext-2.1.0/samples/cgi/http.rb')
-rwxr-xr-x | vendor/gems/gettext-2.1.0/samples/cgi/http.rb | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/vendor/gems/gettext-2.1.0/samples/cgi/http.rb b/vendor/gems/gettext-2.1.0/samples/cgi/http.rb deleted file mode 100755 index 632a9a211..000000000 --- a/vendor/gems/gettext-2.1.0/samples/cgi/http.rb +++ /dev/null @@ -1,49 +0,0 @@ -#! /usr/bin/env ruby -=begin - http.rb - An WebServer for helloerb sample. - - Copyright (C) 2005-2009 Masao Mutoh - - You may redistribute it and/or modify it under the same - license terms as Ruby or LGPL. -=end - -require 'webrick' -require 'cgi' -require 'rbconfig' - -interpreter = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) + - Config::CONFIG['EXEEXT'] - -srv = WEBrick::HTTPServer.new({:BindAddress => '127.0.0.1', - :Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG), - :CGIInterpreter => interpreter, - # :CGIInterpreter => "ruby -d", - :Port => 10080}) - -['INT', 'TERM'].each { |signal| - trap(signal){ srv.shutdown} -} - -srv.mount("/", WEBrick::HTTPServlet::FileHandler, File.expand_path('.')) - -srv.mount_proc("/src/") do |req, res| - res.header["Content-Type"] = "text/html; charset=UTF-8" - if req.query_string - file = File.open(req.query_string).read - res.body = %Q[<html> - <head> - <title>View a source code</title> - <meta http-equiv="content-type" content="text/html; charset=UTF-8"> - <link rel="stylesheet" type="text/css" href="/gettext.css" media="all"> - </head> - <body><h1>#{req.query_string}</h1> - <pre>#{CGI.escapeHTML(file)}</pre> - <p><a href="/">Back</a></p> - </body> - </html> - ] - end -end - -srv.start |