Git Product home page Git Product logo

rails-templater's Introduction

Rails Templater

This is a template which allows creating new Ruby on Rails 3 applications quickly using some opinionated defaults. It is inspired by ffmike's BigOldRailsTemplate Rails 2 template project. To use templater with your Rails apps, use the -m switch when creating your application:

After cloning the rails-templater to your hard drive, you can generate a new app like so:

If you want to use Active Record with MySql: rails new application_name -JT -d mysql -m /path/to/rails-templater/templater.rb

If you want to use Mongo DB with Mongoid: rails new application_name -JOT -m /path/to/rails-templater/templater.rb

For use with RVM (recommended)

To have a hermetic gem environment, it is advisable to create a gemset just for your new rails app. To create a new rails app with its own gemset:

  • Clone rails-templater to your hard drive

  • Run the bootstrap.rb file with the RVM installed rubie and the name of your app as arguments

    ruby /path/to/rails-templater/bootstrap.rb [rvm-rubie] [name of new app]

This will:

  • create a new gemset in the RVM rubie you specified and give it the name you chose for your app
  • change into the new gemset (start using it)
  • install the bundler and rails gem into your new gemset
  • run the command to generate a new rails app with the name you picked

Note that the line to generate the new rails app assumes that you want Active Record/MySql. If you intend to use Mongo, then just change the last line in bootstrap.rb from

system("rails new #{app_name} -JT -d mysql -m #{template_file}")

to:

system("rails new #{app_name} -JOT -m #{template_file}")

Generated Application

Rails Templater will generate the following:

Ruby on Rails

  • Uses Haml as the template engine
  • Uses Sass for generating CSS
  • jQuery for JavaScript over Prototype
  • Optionally uses Compass for design with the blueprint/semantic framework

Database

  • Uses Active Record as the default ORM
  • Optionally uses Mongoid as the Object Document Model

Testing

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Send me a pull request. Bonus points for topic branches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.