you can use TRails to generate rails application with some enhancements we all do after generating our rails project such as adding rspec, factory_girl and other several modifications.
rails new blog --skip-turbolinks -T -G -d=mysql -m https://raw.githubusercontent.com/RobustaStudio/trails/master/bin/trails.rb$ rails new <project-name> --skip-turbolinks -T -G -d=<db-name> -m path/to/bin/trails.rb- -T : will skip Tests
- -G : will skip .gitignore
- -d : to specify a database driver
$ rails new blog --skip-turbolinks -T -G -d=mysql -m trails/bin/trails.rb- remove comments from file listed in
uncomment.yml - replace
application.jswithapplication.coffee - convert
application.htmllayout to HAML - replaces
.gitignorewith a better template - add RSpec
- add factory girl
- add staging environment
- add basic folders
- exceptions
- validators
- services
- add Database Cleaner gem
- add devise gem
- add branches listed in
branches.yml - use HAML as default template
- stop development from sending emails
template main file is executed in the context of a rails application generator
the following methods are available for you in self and could be used through
modules using ctx parameter.
http://www.rubydoc.info/github/erikhuda/thor/master/Thor/Actions.html http://guides.rubyonrails.org/rails_application_templates.html
you can create a new config YAML file in config directory, file content will be parsed and assigned to global constant corresponding to the config file name (eg. config/branches.yml will be available through BRANCHES)
you can add template files to snippets directory, it will be available
in SNIPPETS hash globally with the file name as key, eg(snippets/application.rb will be available through SNIPPETS[:application]), you can use it as template files, or content holders of any kind (ruby code, template files, JS files, CSS files...etc).
group related logic in single class with a class method called call(context), we will pass the current application generator object to
it in case you needed any method in it (gem, create_file, remove_file, ...).
then add module name to config/modules.yml in the appropriate section.
you can use template.rb as to execute the project.
you can use compile.rb to compile all snippets, modules, configs in a single file bin/trails.rb.