Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (30 sloc) 0.8 kb
$:.unshift( File::dirname( __FILE__ ).untaint )
require 'tdiary/tdiary_application'
use Rack::Reloader
use Rack::Static, :urls => ["/theme"], :root => "."
use Rack::Static, :urls => ["/js"], :root => "."
map "/" do
run TDiary::Application.new(:index)
end
map "/index.rb" do
run TDiary::Application.new(:index)
end
map "/update.rb" do
use Rack::Auth::Basic do |user, pass|
if File.exist?('.htpasswd')
require 'webrick/httpauth/htpasswd'
htpasswd = WEBrick::HTTPAuth::Htpasswd.new('.htpasswd')
crypted = htpasswd.get_passwd(nil, user, false)
crypted == pass.crypt(crypted) if crypted
else
user == 'user' && pass == 'pass'
end
end
run TDiary::Application.new(:update)
end
# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
Jump to Line
Something went wrong with that request. Please try again.