Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple project generator for Reel/Webmachine projects
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
template
.gitignore
LICENSE.txt
README.md
Rakefile
reel_template.gemspec

README.md

Reel/Webmachine Project Generator

This is a simple project generator based on a "framework" I extracted from another project.

Usage

  1. Install the reel_template gem
$ gem install reel_template
  1. Use the reel-generate command to make a new project
$ reel-generate my_new_app && cd my_new_app
  1. Install Dependencies
$ bundle
  1. Start the App
$ rake start

Hacking

Generator processes any .erb files located in the template/ directory or its subdirectories. and writes them to the output directory.

Example (template/lib/app.rb.erb):

<%
@file_name = "lib/#{@app_name}.rb"
%>

require '<%= @app_name %>/core'

module <%= @app_module %>
  include Core

  <%= @app_const %>_ROOT = File.expand_path("../../", __FILE__).freeze

  require '<%= @app_name %>/config'
  require '<%= @app_name %>/server'

end

The @file_name variable is the relative path of the file in the generated template. Every ERB file in template/ must set the file name, otherwise the file will not be included in the project. A few additional variables are provided:

  • @app_name: The name of the project: (i.e: my_new_app)
  • @app_module: The project's module name (i.e: MyNewApp)
  • @app_const: The project's constant prefix (i.e: MY_NEW_APP)
Something went wrong with that request. Please try again.