Browse files

initial commit

  • Loading branch information...
0 parents commit 51e0d10d21d7920d86cc0841083c9e5b5069d1b6 @jlong committed Mar 28, 2011
Showing with 277 additions and 0 deletions.
  1. +25 −0 .gitignore
  2. +5 −0 Gemfile
  3. +23 −0 Gemfile.lock
  4. +20 −0 LICENSE
  5. +46 −0 README.markdown
  6. +28 −0 compass.config
  7. +35 −0 config.ru
  8. +63 −0 public/stylesheets/application.css
  9. +12 −0 sass/application.sass
  10. 0 tmp/restart.txt
  11. +11 −0 views/_layout.html.erb
  12. +3 −0 views/hello.html.erb
  13. +1 −0 views/index.redirect
  14. +5 −0 views/view_helpers.rb
25 .gitignore
@@ -0,0 +1,25 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+#*
+.#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
+*.gem
+.rvmrc
+.bundle
+.sass-cache
5 Gemfile
@@ -0,0 +1,5 @@
+source "http://rubygems.org"
+
+gem 'serve', '~> 1.0.0'
+gem 'haml', '~> 3.0.23'
+gem 'compass', '~> 0.10.6'
23 Gemfile.lock
@@ -0,0 +1,23 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activesupport (3.0.5)
+ compass (0.10.6)
+ haml (>= 3.0.4)
+ haml (3.0.25)
+ i18n (0.4.2)
+ rack (1.2.2)
+ serve (1.0.0)
+ activesupport (~> 3.0.1)
+ i18n (~> 0.4.1)
+ rack (~> 1.2.1)
+ tzinfo (~> 0.3.23)
+ tzinfo (0.3.25)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ compass (~> 0.10.6)
+ haml (~> 3.0.23)
+ serve (~> 1.0.0)
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 John W. Long
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46 README.markdown
@@ -0,0 +1,46 @@
+What is this?
+=============
+
+This is a simple HTML prototype written in HAML or ERB that is designed to be
+viewed with Serve.
+
+What is Serve? Serve is a rapid prototyping framework for Rails applications.
+It is designed to compliment Rails development and enforce a strict separation
+of concerns between designer and developer. Using Serve with Rails allows the
+designer to happily work in his own space creating an HTML prototype of the
+application, while the developer works on the Rails application and copies
+over HTML from the prototype as needed. This allows the designer to focus on
+presentation and flow while the developer can focus on the implementation.
+
+
+How do I install and run Serve?
+-------------------------------
+
+Serve is distributed as a gem to make it easy to get up and running. To
+install, type the following at the command prompt:
+
+ gem install serve
+
+(OSX and Unix users may need to prefix the command with `sudo`.)
+
+After Serve is installed, you can start it up in a given directory like this:
+
+ serve
+
+This will start Serve on port 4000. You can now view the prototype in your
+Web browser at this URL:
+
+<http://localhost:4000>
+
+Click around. You will find that Serve enables you to prototype most
+functionality without writing a single line of backend code.
+
+
+Rack and Passenger
+------------------
+
+Astute users may notice that this project is also a simple Rack application.
+This means that it is easy to deploy it on Passenger or rack it up with the
+`rackup` command. For more information about using Serve and Passenger see:
+
+<http://bit.ly/serve-and-passenger>
28 compass.config
@@ -0,0 +1,28 @@
+#
+# Compass Configuration
+#
+
+# HTTP paths
+http_path = '/'
+http_stylesheets_path = '/stylesheets'
+http_images_path = '/images'
+http_javascripts_path = '/javascripts'
+
+# File system locations
+sass_dir = 'sass'
+css_dir = 'public/stylesheets'
+images_dir = 'public/images'
+javascripts_dir = 'public/javascripts'
+
+# Set to true for easier debugging
+line_comments = false
+
+# CSS output style - :nested, :expanded, :compact, or :compressed
+output_style = :expanded
+
+# Determine whether Compass asset helper functions generate relative
+# or absolute paths
+relative_assets = true
+
+# Learn more:
+# http://compass-style.org/docs/tutorials/configuration-reference/
35 config.ru
@@ -0,0 +1,35 @@
+#\ -p 4000
+
+gem 'activesupport'
+gem 'serve'
+
+require 'serve'
+require 'serve/rack'
+
+require 'sass/plugin/rack'
+require 'compass'
+
+# The project root directory
+root = ::File.dirname(__FILE__)
+
+# Compass
+Compass.add_project_configuration(root + '/compass.config')
+Compass.configure_sass_plugin!
+
+# Rack Middleware
+use Rack::ShowStatus # Nice looking 404s and other messages
+use Rack::ShowExceptions # Nice looking errors
+use Sass::Plugin::Rack # Compile Sass on the fly
+
+# Rack Application
+if ENV['SERVER_SOFTWARE'] =~ /passenger/i
+ # Passendger only needs the adapter
+ run Serve::RackAdapter.new(root + '/views')
+else
+ # We use Rack::Cascade and Rack::Directory on other platforms to handle static
+ # assets
+ run Rack::Cascade.new([
+ Serve::RackAdapter.new(root + '/views'),
+ Rack::Directory.new(root + '/public')
+ ])
+end
63 public/stylesheets/application.css
@@ -0,0 +1,63 @@
+@charset "UTF-8";
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-weight: inherit;
+ font-style: inherit;
+ font-size: 100%;
+ font-family: inherit;
+ vertical-align: baseline;
+}
+
+body {
+ line-height: 1;
+ color: black;
+ background: white;
+}
+
+ol, ul {
+ list-style: none;
+}
+
+table {
+ border-collapse: separate;
+ border-spacing: 0;
+ vertical-align: middle;
+}
+
+caption, th, td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+
+q, blockquote {
+ quotes: "" "";
+}
+q:before, q:after, blockquote:before, blockquote:after {
+ content: "";
+}
+
+a img {
+ border: none;
+}
+
+body {
+ font-size: 90%;
+ padding: 20px;
+}
+
+h1 {
+ font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
+ font-size: 260%;
+ font-weight: bold;
+}
12 sass/application.sass
@@ -0,0 +1,12 @@
+@import "compass"
+
++global-reset
+
+body
+ font-size: 90%
+ padding: 20px
+
+h1
+ font-family: "Trebuchet MS", Helvetica, Arial, sans-serif
+ font-size: 260%
+ font-weight: bold
0 tmp/restart.txt
No changes.
11 views/_layout.html.erb
@@ -0,0 +1,11 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title><%= @title %></title>
+ <link rel="stylesheet" href="/stylesheets/application.css" />
+ </head>
+ <body>
+ <%= yield %>
+ </body>
+</html>
3 views/hello.html.erb
@@ -0,0 +1,3 @@
+<% @title = "Hello World!" %>
+
+<h1><%= hello "World" %></h1>
1 views/index.redirect
@@ -0,0 +1 @@
+/hello
5 views/view_helpers.rb
@@ -0,0 +1,5 @@
+module ViewHelpers
+ def hello(name)
+ "Hello #{name}!"
+ end
+end

0 comments on commit 51e0d10

Please sign in to comment.