Skip to content

Commit

Permalink
Upgraded project to use the latest versions of Serve and Compass
Browse files Browse the repository at this point in the history
  • Loading branch information
jlong committed Jul 26, 2011
1 parent c55ab96 commit 8e558c0
Show file tree
Hide file tree
Showing 16 changed files with 232 additions and 93 deletions.
28 changes: 28 additions & 0 deletions Gemfile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,28 @@
source :rubygems

gem 'serve', '1.5.1'

# Use edge instead:
# gem 'serve', :git => 'git://github.com/jlong/serve.git'

# Use Compass and Sass
gem 'compass', '0.11.5'

# Markdown and Textile
# gem 'rdiscount' # Markdown
# gem 'RedCloth' # Textile

# Haml
gem 'haml'

# Other templating languages
# gem 'erubis'
# gem 'slim'
# gem 'radius'
# gem 'less'

# Coffee Script
# gem 'coffee-script'

# Use mongrel for the Web server
# gem 'mongrel'
33 changes: 33 additions & 0 deletions Gemfile.lock
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,33 @@
GEM
remote: http://rubygems.org/
specs:
activesupport (3.0.9)
chunky_png (1.2.0)
compass (0.11.5)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
fssm (0.2.7)
haml (3.1.2)
i18n (0.6.0)
rack (1.3.2)
rack-test (0.6.0)
rack (>= 1.0)
sass (3.1.5)
serve (1.5.1)
activesupport (~> 3.0)
i18n
rack (~> 1.2)
rack-test (~> 0.5)
tilt (~> 1.3)
tzinfo
tilt (1.3.2)
tzinfo (0.3.29)

PLATFORMS
ruby

DEPENDENCIES
compass (= 0.11.5)
haml
serve (= 1.5.1)
45 changes: 0 additions & 45 deletions README

This file was deleted.

92 changes: 92 additions & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,92 @@
What is this?
=============

This is a simple HTML prototype of Radiant written in HAML that is designed
to be viewed with serve.

What is Serve? Serve is an open-source rapid prototyping framework for Web
applications. It makes it easy to prototype functionality without writing a
single line of backend code.


Can I contribute?
-----------------

Sure! We welcome contributions to the prototype. If you have an idea for a
new feature this is the perfect place to get the action rolling. Once you
have it prototyped using serve, create a ticket on the dev site and attach
your patch. Then give us a holler on the dev mailing list and we can debate
the merits of your idea there.


How do I install and run Serve?
-------------------------------

Serve is distributed as a Ruby gem to make it easy to get up and running. You
must have Ruby installed in order to download and use Serve. The Ruby download
page provides instructions for getting Ruby setup on different platforms:

<http://www.ruby-lang.org/en/downloads/>

After you have Ruby installed, open up the command prompt and type:

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>


Compass and Sass
----------------

This prototype uses Compass and Sass to generate CSS. Both are distributed as
Ruby gems and can be easily installed from the command prompt. Since the
Compass gem depends on Sass, you can install them both with one command:

gem install compass

Learn more about Sass:

<http://sass-lang.org>

Learn more about Compass:

<http://compass-style.org>


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 in any other
Rack-friendly environment. Rack it up with the `rackup` command. For more
information about using Serve and Passenger see:

<http://bit.ly/serve-and-passenger>


Exporting
---------

To export your project, use the new "export" command:

serve export <project> <output>

Where "project" is the path to the project and "output" is the path to the
directory where you would like your HTML and CSS generated.


Learning More
-------------

You can learn more about Serve on the GitHub project page:

<http://github.com/jlong/serve>
35 changes: 26 additions & 9 deletions compass.config
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,28 @@
http_path = "/" #
http_stylesheets_path = "/stylesheets" # Compass Configuration
http_images_path = "/images" #
http_javascripts_path = "/javascripts"


sass_dir = "stylesheets" # HTTP paths
css_dir = "public/stylesheets" http_path = '/'
images_dir = "public/images" http_stylesheets_path = '/stylesheets'
javascripts_dir = "public/javascripts" http_images_path = '/images'
http_javascripts_path = '/javascripts'


relative_assets = true # File system locations
sass_dir = 'stylesheets'
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/
40 changes: 26 additions & 14 deletions config.ru
Original file line number Original file line Diff line number Diff line change
@@ -1,35 +1,47 @@
#\ -p 4000 #\ -p 4000


gem 'activesupport', '>= 2.3.5' require 'rubygems'
gem 'serve', '>= 0.11.6' require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end


require 'serve' require 'serve'
require 'serve/rack' require 'serve/rack'


require 'sass/plugin/rack'
require 'compass'

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


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

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

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


# Middleware # Other Rack Middleware
use Rack::ShowStatus # Nice looking 404s and other messages use Rack::ShowStatus # Nice looking 404s and other messages
use Rack::ShowExceptions # Nice looking errors use Rack::ShowExceptions # Nice looking errors
use Sass::Plugin::Rack # Compile Sass on the fly


# Rack Application # Rack Application
if ENV['SERVER_SOFTWARE'] =~ /passenger/i if ENV['SERVER_SOFTWARE'] =~ /passenger/i
# Passenger only needs the adapter # Passendger only needs the adapter
run Serve::RackAdapter.new(root + '/views') run Serve::RackAdapter.new(root + '/views')
else else
# We use Rack::Cascade and Rack::Directory on other platforms to # Use Rack::Cascade and Rack::Directory on other platforms for static assets
# handle static assets
run Rack::Cascade.new([ run Rack::Cascade.new([
Serve::RackAdapter.new(root + '/views'), Serve::RackAdapter.new(root + '/views'),
Rack::Directory.new(root + '/public') Rack::Directory.new(root + '/public')
]) ])
end end
1 change: 1 addition & 0 deletions public/.htaccess
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
Options +MultiViews
3 changes: 2 additions & 1 deletion stylesheets/admin/_base.sass
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ $primary-tab: rgba(white, 0.3)
$primary-tab-current: white $primary-tab-current: white


// Modules // Modules
@import "compass" @import compass/utilities
@import compass/css3
@import "modules/links" @import "modules/links"
@import "modules/boxes" @import "modules/boxes"
2 changes: 1 addition & 1 deletion stylesheets/admin/modules/_boxes.sass
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
=alt-box =alt-box
background: #d8d8d8 background: #d8d8d8
+linear-gradient(color-stops(#fff, #ccc)) +background-image(linear-gradient(#fff, #ccc))
+border-radius(8px) +border-radius(8px)
+box-shadow(rgba(0,0,0,0.15), 2px, 2px, 3px) +box-shadow(rgba(0,0,0,0.15), 2px, 2px, 3px)
padding: 12px 10px padding: 12px 10px
10 changes: 5 additions & 5 deletions stylesheets/admin/partials/_actions.sass
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
right: 0 right: 0
bottom: 0 bottom: 0
background: #777 background: #777
+linear-gradient(color-stops(#555, #666, #777, #777)) +background-image(linear-gradient(#555, #666, #777, #777))
ul ul
padding: 14px 8px padding: 14px 8px
li li
display: inline display: inline
margin-right: 5px margin-right: 5px
a a
background: #d8d8d8 background: #d8d8d8
+linear-gradient(color-stops(#fff, #ccc)) +background-image(linear-gradient(#fff, #ccc))
color: #333 color: #333
font-size: 80% font-size: 80%
padding: 8px 12px padding: 8px 12px
Expand Down Expand Up @@ -47,7 +47,7 @@
padding: 6px 12px 6px 12px padding: 6px 12px 6px 12px
margin-right: 1px margin-right: 1px
background: #ddd background: #ddd
+linear-gradient(color-stops(#c5c5c5, #f0f0f0 20%, #fff 35%, #fff)) +background-image(linear-gradient(#c5c5c5, #f0f0f0 20%, #fff 35%, #fff))
color: #999 color: #999
font-size: 80% font-size: 80%
text-decoration: none text-decoration: none
Expand All @@ -57,7 +57,7 @@
text-shadow: 1px 1px 1px #eee text-shadow: 1px 1px 1px #eee
&:hover &:hover
background: #d8d8d8 background: #d8d8d8
+linear-gradient(color-stops(#fff, #fff, #ddd)) +background-image(linear-gradient(#fff, #fff, #ddd))
color: #0076a3 color: #0076a3
+button-shadow +button-shadow
&:active &:active
Expand All @@ -66,7 +66,7 @@
span.disabled span.disabled
color: #666 color: #666
background-color: #999 background-color: #999
+linear-gradient(color-stops(#888, #999, #999, #999)) +background-image(linear-gradient(#888, #999, #999, #999))
span.current span.current
color: #000 color: #000
background: white background: white
Expand Down
6 changes: 3 additions & 3 deletions stylesheets/admin/partials/_forms.sass
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
content: "\0020" content: "\0020"
display: block display: block
width: 100% width: 100%
+linear-gradient(color-stops(rgba(black,0.3), rgba(black, 0))) +background-image(linear-gradient(rgba(black,0.3), rgba(black, 0)))
height: 3px height: 3px
margin-bottom: -3px margin-bottom: -3px
table.fieldset table.fieldset
Expand Down Expand Up @@ -155,7 +155,7 @@
* *
position: relative position: relative
&:before &:before
+linear-gradient(color-stops(white, #f5f1e2 50%, #f5f1e2)) +background-image(linear-gradient(white, #f5f1e2 50%, #f5f1e2))
+border-top-radius(10px) +border-top-radius(10px)
content: "\0020" content: "\0020"
display: block display: block
Expand Down Expand Up @@ -257,7 +257,7 @@ body.single_form
#content #content
#single_form #single_form
background: #f5f1e2 background: #f5f1e2
+linear-gradient(color-stops(#fdfcf9, #f5f1e2 25%, #f5f1e2)) +background-image(linear-gradient(#fdfcf9, #f5f1e2 25%, #f5f1e2))
border: 0.35em solid #efead3 border: 0.35em solid #efead3
padding: 0.5em 1.5em padding: 0.5em 1.5em
padding-right: 22px padding-right: 22px
Expand Down
Loading

0 comments on commit 8e558c0

Please sign in to comment.