-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded project to use the latest versions of Serve and Compass
- Loading branch information
Showing
16 changed files
with
232 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
Options +MultiViews |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.