* Pretty up default pages

* Echo
This commit is contained in:
Blake Mizerany 2007-10-01 20:56:34 -07:00
parent 09f4eac1bf
commit a4da442ccf
9 changed files with 208 additions and 5 deletions

1
CHANGELOG Normal file
View File

@ -0,0 +1 @@
v0.1.0 Released!

50
Manifest Normal file
View File

@ -0,0 +1,50 @@
CHANGELOG
RakeFile
README
x.rb
examples/hello/hello.rb
examples/hello/views/hello.erb
examples/todo/todo.rb
files/default_index.erb
files/error.erb
files/logo.png
files/not_found.erb
lib/sinatra.rb
lib/sinatra/context.rb
lib/sinatra/dispatcher.rb
lib/sinatra/dsl.rb
lib/sinatra/environment.rb
lib/sinatra/event.rb
lib/sinatra/irb.rb
lib/sinatra/loader.rb
lib/sinatra/logger.rb
lib/sinatra/options.rb
lib/sinatra/pretty_url.rb
lib/sinatra/route.rb
lib/sinatra/server.rb
lib/sinatra/test_methods.rb
lib/sinatra/context/renderer.rb
lib/sinatra/core_ext/array.rb
lib/sinatra/core_ext/class.rb
lib/sinatra/core_ext/hash.rb
lib/sinatra/core_ext/kernel.rb
lib/sinatra/core_ext/metaid.rb
lib/sinatra/core_ext/module.rb
lib/sinatra/core_ext/symbol.rb
site/index.html
site/logo.png
test/helper.rb
test/sinatra/dispatcher_test.rb
test/sinatra/event_test.rb
test/sinatra/pretty_url_test.rb
test/sinatra/renderer_test.rb
test/sinatra/route_test.rb
test/sinatra/static_files_test.rb
test/sinatra/url_test.rb
test/sinatra/static_files/foo.txt
vendor/erb/init.rb
vendor/erb/lib/erb.rb
vendor/haml/init.rb
vendor/haml/lib/haml.rb
Rakefile
Manifest

View File

@ -1,5 +1,29 @@
require 'rake/testtask'
require 'ftools'
require 'hoe'
Version = '0.1.0'
begin
require 'rubygems'
gem 'echoe'
ENV['RUBY_FLAGS'] = ""
require 'echoe'
Echoe.new('sinatra') do |p|
p.rubyforge_name = 'sinatra'
p.dependencies = ['mongrel >=1.0.1', 'rack >=0.2.0']
p.summary = "Sinatra is a classy web-framework dressed in a DSL"
p.description = "Sinatra is a classy web-framework dressed in a DSL"
p.url = "http://sinatra.rubyforge.org/"
p.author = 'Blake Mizerany'
p.email = "blake.mizerany@gmail.com"
p.test_pattern = 'test/**/*_test.rb'
p.include_rakefile = true
end
rescue LoadError
end
task :default => :test

View File

@ -1,9 +1,9 @@
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
require 'sinatra'
get '/' do
"Hello World!"
end
# get '/' do
# "Hello World!"
# end
get '/erb.xml' do
header 'Content-Type' => 'application/xml'

View File

@ -1 +1,42 @@
Default Index!!!!!!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Sinatra has taken the stage!</title>
</head>
<body>
<style type="text/css" media="screen">
body {
color: #333;
font-size: 1.5em;
}
#content {
margin: 0 auto;
text-align: center;
width: 500px;
}
#content pre {
text-align: left;
background-color: #D8D8D8;
padding: 10px;
}
</style>
<div id="content">
<div id="banner">
<img src="http://sinatra.rubyforge.org/logo.png">
</div>
<div id="content">
<h3>Sing this diddy to move on:</h3>
<pre>
get "/" do
... your code here ..
end</pre>
</div>
</div>
</body>
</html>

BIN
files/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -39,7 +39,7 @@
<div id="content">
<div class='message'>
<h3>Sinatra doesn't know this diddy, but he's a quick study.</h3>
<p>Add this to your lyrics:</p>
<p>Sing this one:</p>
<pre><%= request.request_method.downcase %> '<%= request.path_info %>' do
html "Replace this with your code."
end</pre>

87
site/index.html Normal file
View File

@ -0,0 +1,87 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Sinatra : Classy web-development dressed in a DSL</title>
</head>
<body>
<style type="text/css" media="screen">
body {
background-color: #fff;
color: #333;
font-size: 0.75em;
}
#container {
width: 600px;
margin: 0 auto;
font-size: 1.5em;
}
#container pre {
font-size: .8em;
background-color: #F5F6C9;
width: 100%;
}
#container note {
font-size: .7em;
}
#banner {
width: 600px;
text-align: center;
}
pre {
padding: 10px;
}
.clear {
clear: both;
}
</style>
<div id="container">
<div id="banner">
<img src='logo.png' />
<h2><em>Classy web-development dressed in a DSL</em></h2>
</div>
<div class="clear"></div>
<div>
<div>
<p>
<strong>Install!</strong><br/>
<pre>gem install sinatra -y</pre>
</p>
<p>
<strong>Write!</strong> (any filename you wish)<br/>
<pre>
# lyrics.rb
require 'rubygems'
require 'sinatra'</pre>
<note>yup.. that's it for a sec</note><br />
</p>
<p>
<strong>Run!</strong><br />
<pre>ruby lyrics.rb</pre>
</p>
<p>
<strong>Bask!</strong><br />
<pre>http://localhost:4567</pre>
</p>
<p>
<strong>Example!</strong>
<pre>
get '/' do
"Now that's a fine looking dame!"
end</pre>
</p>
</div>
</div>
</div>
</body>
</html>

BIN
site/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB