Skip to content

Latest commit

 

History

History
115 lines (87 loc) · 7.97 KB

README.md

File metadata and controls

115 lines (87 loc) · 7.97 KB

app_builder

Introduction and Installation

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

Effects of this builder rather than the default

  1. It adds numerous Gems to the Gemfile before initial bundling, as detailed below;
  2. It installs its Gems into vendor/, rather than polluting the system Gem repository (or rvm/rbenv analogue);
  3. It copies several JavaScript files to the vendor/assets/javascripts directory (see below);
  4. It optionally creates a "welcome", or landing-page controller and view;
  5. It sets up for RSpec BDD rather than Test::Unit TDD, with a customised .rspec configuration;
  6. It creates a minimal README.md, in Markdown format rather than RDoc;
  7. It adds several lines to the .gitignore file, involving the Textmate and SublimeText editors, CoffeeScript compiled to JavaScript, the Gem cache and install directories below vendor/, and so on.

Gemfile additions

  1. In the default, no-group "group":
  2. bootstrap-sass
  3. bcrypt-ruby
  4. bootswatch-rails
  5. cancan
  6. configurability
  7. devise
  8. draper
  9. haml-rails
  10. hashie
  11. loggability
  12. rolify
  13. simple_form
  14. thin
  15. validates_email_format_of
  16. yajl-ruby
  17. In the :assets group:
  18. execjs
  19. jquery-rails
  20. In the :development group:
  21. better_errors
  22. binding_of_caller
  23. meta_request
  24. rubocop
  25. In the :development and :test groups:
  26. blind
  27. capybara
  28. capybara-webkit
  29. database_cleaner
  30. factory_girl_rails
  31. naught
  32. pry
  33. pry-rails
  34. quiet_assets
  35. rspec
  36. rspec-html-matchers
  37. rspec-http
  38. rspec-rails
  39. simplecov
  40. tapout

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;

  1. pry-doc
  2. pry-nav
  3. pry-remote
  4. pry-stack_explorer
  5. pry-exception_explorer

Former Gemfile additions

This builder no longer adds:

  • secret_token_replacer to the production group; it is currently judged too problematic for our use;
  • fuubar to 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' own affix, which was all we used that Gem for.
  • adds twitter_bootstrap_form_for, since the base form_for Gem now includes Bootstrap support.

JavaScript files in vendor/assets/javascripts

  1. ba-debug, a simple wrapper for console.log;
  2. jquery++, widely useful DOM and event-listener functions;
  3. mootools, "compact, modular, Object-Oriented JavaScript framework" that enhances several core classes (Array, String, etc);
  4. outerHTML is a plugin that gives jQuery access to an element's outerHTML, just like the DOM;
  5. 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".

Changelog

Please read the CHANGELOG.md file.

To Do

  • 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 install if one forgets to add the --skip-bundle command line option. That output should be captured and presented at the true end of the run.

Bugs and Feedback

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.

License

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.