With grateful thanks to Ryan Bates for Railscast #148, Custom App Generators (revised), this repo contains my own app builder which produces a Rails app configured somewhat differently than the default.
To use it, clone this project to your system and/or copy the app_builder.rb file to a convenient place, and run
rails new your_project_name -b /path/to/this/app_builder.rb
- It adds numerous Gems to the Gemfile before initial bundling, as detailed below;
- It installs its Gems into
vendor/, rather than polluting the system Gem repository (orrvm/rbenvanalogue); - It copies several JavaScript files to the
vendor/assets/javascriptsdirectory (see below); - It optionally creates a "welcome", or landing-page controller and view;
- It sets up for RSpec BDD rather than Test::Unit TDD, with a customised
.rspecconfiguration; - It creates a minimal
README.md, in Markdown format rather than RDoc; - It adds several lines to the
.gitignorefile, involving the Textmate and SublimeText editors, CoffeeScript compiled to JavaScript, the Gem cache and install directories belowvendor/, and so on.
- In the default, no-group "group":
bootstrap-sassbcrypt-rubybootswatch-railscancanconfigurabilitydevisedraperhaml-railshashieloggabilityrolifysimple_formthinvalidates_email_format_ofyajl-ruby- In the
:assetsgroup: execjsjquery-rails- In the
:developmentgroup: better_errorsbinding_of_callermeta_requestrubocop- In the
:developmentand:testgroups: blindcapybaracapybara-webkitdatabase_cleanerfactory_girl_railsnaughtprypry-railsquiet_assetsrspecrspec-html-matchersrspec-httprspec-railssimplecovtapout
The :development and :test groups have commented-out inclusions of five pry-related Gems that are either very infrequently used or seem to be linked to segfaults in Ruby;
This builder no longer adds:
secret_token_replacerto theproductiongroup; it is currently judged too problematic for our use;fuubarto the development-and-test group; it was simply too rarely used;- 'jasmine-fixtures' to the development-and-test group. We now assume Teaspoon Script testing is using Mocha rather than Jasmine, and Teaspoon has a perfectly-serviceable fixture feature to replace
jasmine-fixtures' ownaffix, which was all we used that Gem for. - adds
twitter_bootstrap_form_for, since the baseform_forGem now includes Bootstrap support.
ba-debug, a simple wrapper forconsole.log;jquery++, widely useful DOM and event-listener functions;mootools, "compact, modular, Object-Oriented JavaScript framework" that enhances several core classes (Array, String, etc);outerHTMLis a plugin that gives jQuery access to an element'souterHTML, just like the DOM;- Underscore.js is a "utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects".
Please read the CHANGELOG.md file.
- I'd rather be able to specify the root controller on the command line than have the script come to a full dead stop and ask if one should be created. A command line option like "--root-controller welcome" will probably make an appearance before a 1.0 release.
- Output from generators and closing remarks are scrolled off the screen by the terminal
bundle installif one forgets to add the--skip-bundlecommand line option. That output should be captured and presented at the true end of the run.
If you discover a possible problem with this builder, please describe it (including your Ruby version, rvm/rbenv setup, OS and version) in the issues tracker. Searching the issues tracker may allow you to take advantage of others' previous experience with similar problems to your own. Direct any questions to the maintainer to jeff.dickey@theprolog.com or jdickey@seven-sigma.com.
Patch requests submitted along with are greatly appreciated and will be responded to more quickly.
Copyright (c) 2013 Jeff Dickey and Prolog Systems Pte Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.