github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jlong / serve

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 83
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • v0.10.0
    • 0.9.10
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

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. — Read more

  cancel

http://rubyforge.org/projects/serve/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

fixed typo in Quickstart 
jlong (author)
Tue Feb 02 08:28:15 -0800 2010
commit  dac90a7d540e35fbcaf642b4d1dec4e6748eb81e
tree    a8abfe4bb7585ee864f0e5651117676ae135eb1d
parent  246c7989c01341a2f9d99f5ca17b899fce9f86d8
serve /
name age
history
message
file .document Mon Dec 28 18:00:51 -0800 2009 Dropped Hoe and Newgem in favor of Jeweler [jlong]
file .gitignore Mon Dec 28 18:00:51 -0800 2009 Dropped Hoe and Newgem in favor of Jeweler [jlong]
file CHANGELOG.rdoc Mon Dec 28 19:34:49 -0800 2009 updated changelog [jlong]
file LICENSE Mon Dec 28 19:18:22 -0800 2009 committing aiwilliams changes [jlong]
file QUICKSTART.rdoc Tue Feb 02 08:28:15 -0800 2010 fixed typo in Quickstart [jlong]
file README.rdoc Mon Dec 28 19:23:04 -0800 2009 updated README [jlong]
file Rakefile Mon Dec 28 18:00:51 -0800 2009 Dropped Hoe and Newgem in favor of Jeweler [jlong]
file VERSION Mon Dec 28 19:28:19 -0800 2009 Version bump to 0.10.0 [jlong]
directory bin/ Mon Dec 28 19:18:22 -0800 2009 committing aiwilliams changes [jlong]
directory lib/ Mon Dec 28 19:18:22 -0800 2009 committing aiwilliams changes [jlong]
directory rails/ Mon Dec 28 19:18:22 -0800 2009 committing aiwilliams changes [jlong]
file serve.gemspec Mon Dec 28 19:33:50 -0800 2009 updated version [jlong]
directory spec/ Mon Dec 28 19:18:22 -0800 2009 committing aiwilliams changes [jlong]
directory tasks/ Mon Dec 28 19:50:14 -0800 2009 use Gemcutter, not Rubyforge tasks [jlong]
directory test_project/ Mon Dec 28 19:18:22 -0800 2009 committing aiwilliams changes [jlong]
README.rdoc

Serve

Serve is a small web server (based on WEBrick) that makes it easy to serve ERB or HAML from any directory. Serve is an ideal tool for building HTML prototypes of Rails applications. Serve can also handle SASS, Textile, and Markdown if the appropriate gems are installed.

Usage

At a command prompt all you need to type to start serve is:

  $ serve

This will launch a WEBrick server which you can access from any Web browser at the following address:

  http://localhost:4000

Once the server is going it will output a running log of its activity. To stop the server at any time, type CTRL+C at the command prompt. By default the serve command serves up files from the current directory. To change this behavior, `cd` to the appropriate directory before starting serve.

Advanced Options

The serve command automatically binds to 0.0.0.0 (localhost) and uses port 4000 by default. To serve files over a different IP (that is bound to your computer) or port specify those options on the command line:

  $ serve 4000               # a custom port

  $ serve 192.168.1.6        # a custom IP

  $ serve 192.168.1.6:4000   # a custom IP and port

Rails Applications

For your convenience if the file "script/server" exists in the current directory the serve command will start that instead of launching a WEBrick server. You can specify the environment that you want to start the server with as an option on the command line:

  $ serve production         # start script/server in production mode

File Types

Serve presently does special processing for files with following extensions:

textile :Evaluates the document as Textile (requires the Redcloth gem)
markdown :Evaluates the document as Markdown (requires the Bluecloth gem)
erb :Experimental support for ERB
haml :Evaluates the document as Haml (requires the Haml gem)
sass :Evaluates the document as Sass (requires the Haml gem)
email :Evaluates the document as if it is an e-mail message; the format is identical to a plain/text e-mail message’s source
redirect :Redirects to the URL contained in the document

View Helpers

If you drop a file called view_helpers.rb in the root of a project, you can define custom helpers for your Haml and ERB views. Just declare the ViewHelpers module and begin declaring your helpers:

  module ViewHelpers
    def custom_method
      "Request object: #{request.headers['user-agent']}"
    end
  end

Installation and Setup

It is recommended that you install serve via RubyGems:

  $ sudo gem install serve

More Information

For more information, be sure to look through the documentation over at RubyForge:

  • serve.rubyforge.org

Or visit the project page here:

  • rubyforge.org/projects/serve

All development now takes place on GitHub:

  • github.com/jlong/serve

License

Serve is released under the MIT license and is copyright © 2007-2009 John W. Long and Adam I. Williams. A copy of the MIT license can be found in the LICENSE file.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server