Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
josepjaume committed Jun 2, 2011
0 parents commit d90b62a
Show file tree
Hide file tree
Showing 14 changed files with 305 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## MAC OS
.DS_Store

## TEXTMATE
*.tmproj
tmtags

## EMACS
*~
#*
.#*

## VIM
*.swp

## PROJECT::GENERAL
coverage
rdoc
pkg

## PROJECT::SPECIFIC
*.gem
.rvmrc
.bundle

## SASS
.sass-cache
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gem "serve"
gem "activesupport"
gem "compass"
gem "sass"
gem "rack"
gem "slim"
35 changes: 35 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
GEM
specs:
activesupport (3.0.7)
chunky_png (1.2.0)
compass (0.11.1)
chunky_png (~> 1.1)
fssm (>= 0.2.7)
sass (~> 3.1)
fssm (0.2.7)
i18n (0.6.0)
rack (1.3.0)
sass (3.1.2)
serve (1.1.0)
activesupport (~> 3.0.7)
i18n (~> 0.6.0)
rack (~> 1.3.0)
tilt (~> 1.3.1)
tzinfo (~> 0.3.27)
slim (0.9.4)
temple (~> 0.3.0)
tilt (~> 1.2)
temple (0.3.0)
tilt (1.3.2)
tzinfo (0.3.27)

PLATFORMS
ruby

DEPENDENCIES
activesupport
compass
rack
sass
serve
slim
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2011 Josep Jaume

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 changes: 46 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -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 changes: 28 additions & 0 deletions compass.config
Original file line number Diff line number Diff line change
@@ -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/
44 changes: 44 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#\ -p 4000

require "rubygems"
require "bundler/setup"

Bundler.require(:default)

gem 'activesupport'
gem 'serve'

require 'serve'
require 'serve/rack'

# The project root directory
root = ::File.dirname(__FILE__)

# Compile Sass on the fly with the Sass plugin. Some production environments
# don't allow you to write to the file system on the fly (like Heroku).
# Remove this conditional if you want to compile Sass in production.
if ENV['RACK_ENV'] != 'production'
require 'sass/plugin/rack'
require 'compass'

Compass.add_project_configuration(root + '/compass.config')
Compass.configure_sass_plugin!

use Sass::Plugin::Rack # Sass Middleware
end

# Other Rack Middleware
use Rack::ShowStatus # Nice looking 404s and other messages
use Rack::ShowExceptions # Nice looking errors

# Rack Application
if ENV['SERVER_SOFTWARE'] =~ /passenger/i
# Passendger only needs the adapter
run Serve::RackAdapter.new(root + '/views')
else
# Use Rack::Cascade and Rack::Directory on other platforms for static assets
run Rack::Cascade.new([
Serve::RackAdapter.new(root + '/views'),
Rack::Directory.new(root + '/public')
])
end
67 changes: 67 additions & 0 deletions public/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}

body {
line-height: 1;
}

ol, ul {
list-style: none;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

caption, th, td {
text-align: left;
font-weight: normal;
vertical-align: middle;
}

q, blockquote {
quotes: none;
}
q:before, q:after, blockquote:before, blockquote:after {
content: "";
content: none;
}

a img {
border: none;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}

body {
font-size: 90%;
padding: 20px;
}

h1 {
font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
font-size: 260%;
font-weight: bold;
}
12 changes: 12 additions & 0 deletions sass/application.sass
Original file line number Diff line number Diff line change
@@ -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
Empty file added tmp/restart.txt
Empty file.
11 changes: 11 additions & 0 deletions views/_layout.html.erb
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions views/hello.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% @title = "Hello World!" %>

<h1><%= hello "World" %></h1>
1 change: 1 addition & 0 deletions views/index.redirect
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/hello
5 changes: 5 additions & 0 deletions views/view_helpers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module ViewHelpers
def hello(name)
"Hello #{name}!"
end
end

0 comments on commit d90b62a

Please sign in to comment.