J
Jeremy McAnally
Vintage is a very small web framework based on the original idea of
Merb: Mongrel serving up ERb (Embedded Ruby) templates. The idea has
been expanded and now Vintage helps you serve up ERb, HAML, Textile,
Markdown, and Markaby templates. So, basically templates with no MVC
or heavy infrastructure.
To use Vintage, you have two options. You can use it in standard mode
or application mode. In standard mode, there is no configuration and
Vintage will serve up templates and static files from the current
folder. To get this mode, then simply type <tt>vintage start</tt> in
any folder.
$ vintage start
- vintage version 0.0.1
starting server on port 5000
Now navigating to a URL will look in the current folder for the file
or template. For example, going to
<tt>http://localhost:5000/my_template</tt> will look for
<tt>my_template.erb</tt> (or whatever template engine you are using)
in the current folder and render it if available. If a static file is
requested, then
it is served up. If you request
<tt>http://localhost:5000/my_folder/my_template</tt>, then the
application will look in <tt>my_folder</tt> for the
<tt>my_template</tt> template.
Vintage can also be configured to be used as an application server.
To do so, you can either generate an application or hand create a
<tt>configuration.yml</tt> file (see one from a generated project for
an example). To generate an application, simple run +vintage+ with a
project name as the argument.
vintage my_project
This command will generate a number of files. Chief among these is
<tt>configuration.yml</tt> which tells Vintage how you'd like to run
it. Other files include a sample template and the proper folder
structure for the generated configuration to work properly. This
setup allows you to more easily segment your code for easier
maintenance.
You can also create your own helper methods if you drop a module of
methods (in the Vintage::Helpers module) in the helpers/ folder.
There are a few default helpers included, too.
To give you an idea of how much lighter this is than Rails or Merb,
here are the requests per second according to ab on my box:
Merb: 56 rp/s
Rails: 41 rp/s
Vintage: 534 rp/s
Please enjoy; I'm in the #vintage IRC channel on Freenode or you can
use Trac to submit tickets.
Get it (and submit tickets!) at:
http://vintage.devjavu.com
I'm going to create a website and documentation this week.
Cheers,
Jeremy McAnally
--
http://www.jeremymcanally.com/
My books:
Ruby in Practice
http://www.manning.com/mcanally/
My free Ruby e-book
http://www.humblelittlerubybook.com/
My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
Merb: Mongrel serving up ERb (Embedded Ruby) templates. The idea has
been expanded and now Vintage helps you serve up ERb, HAML, Textile,
Markdown, and Markaby templates. So, basically templates with no MVC
or heavy infrastructure.
To use Vintage, you have two options. You can use it in standard mode
or application mode. In standard mode, there is no configuration and
Vintage will serve up templates and static files from the current
folder. To get this mode, then simply type <tt>vintage start</tt> in
any folder.
$ vintage start
- vintage version 0.0.1
starting server on port 5000
Now navigating to a URL will look in the current folder for the file
or template. For example, going to
<tt>http://localhost:5000/my_template</tt> will look for
<tt>my_template.erb</tt> (or whatever template engine you are using)
in the current folder and render it if available. If a static file is
requested, then
it is served up. If you request
<tt>http://localhost:5000/my_folder/my_template</tt>, then the
application will look in <tt>my_folder</tt> for the
<tt>my_template</tt> template.
Vintage can also be configured to be used as an application server.
To do so, you can either generate an application or hand create a
<tt>configuration.yml</tt> file (see one from a generated project for
an example). To generate an application, simple run +vintage+ with a
project name as the argument.
vintage my_project
This command will generate a number of files. Chief among these is
<tt>configuration.yml</tt> which tells Vintage how you'd like to run
it. Other files include a sample template and the proper folder
structure for the generated configuration to work properly. This
setup allows you to more easily segment your code for easier
maintenance.
You can also create your own helper methods if you drop a module of
methods (in the Vintage::Helpers module) in the helpers/ folder.
There are a few default helpers included, too.
To give you an idea of how much lighter this is than Rails or Merb,
here are the requests per second according to ab on my box:
Merb: 56 rp/s
Rails: 41 rp/s
Vintage: 534 rp/s
Please enjoy; I'm in the #vintage IRC channel on Freenode or you can
use Trac to submit tickets.
Get it (and submit tickets!) at:
http://vintage.devjavu.com
I'm going to create a website and documentation this week.
Cheers,
Jeremy McAnally
--
http://www.jeremymcanally.com/
My books:
Ruby in Practice
http://www.manning.com/mcanally/
My free Ruby e-book
http://www.humblelittlerubybook.com/
My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/