Project

carpentry

0.02
No commit activity in last 3 years
No release in over 3 years
Handcrafted prototypes for Rails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.13
>= 0
>= 4.2.0, <= 6.1.4.1

Runtime

>= 4.2.0, <= 6.1.4.1
 Project Readme

Carpentry

Build Status Gem Version

Handcrafted prototypes with ease.

Installation

Add Carpentry to Gemfile:

gem "carpentry"

Run the generator to create the prototypes folder (and inject the Carpentry route):

rails generate carpentry:install

Usage

Put your views in app/views/carpentry/prototypes and view them in browser at /p/path_to_file.

Examples:

URI Path File path
/p app/views/carpentry/prototypes/index.html.erb
/p/home app/views/carpentry/prototypes/home.html.haml
/p/posts/new app/views/carpentry/prototypes/posts/new.html.slim

All available Rails helpers work nicely. Pure prototyping bliss!

If you want an special layout for your prototypes, stick the layout file to app/views/layouts/carpentry/prototypes.html.[format].

You can customize the prototype URI prefix (/p) by editing the engine mount in your roures.rb file, for example:

  mount_carpentry_at "/prototype"

Hooks

Carpentry let's you add a #before_carpentry method in ApplicationController, that will be run before any prototype. You can use it, for example, to provide authentication or prevent prototypes from being rendered in production.

Rails and Ruby compatiblity

Carpentry is compatible with Rails 4.1 and above.

Only Ruby 2.1.x and above are supported, check Travis CI for build details.

If you want to use Carpentry with Ruby 1.9.2 or below, use Carpentry v1.0.1.

Gotchas

When rendering a partial, you must specify the full path (e.g. carpentry/prototypes/posts/form) unless the partial is in app/views/carpentry/prototypes/.

License

MIT License. Copyright 2011-2013 Kisko Labs.

CI Build Status

Build Status