Rails New

This is a wrapper over rails new attached to a privately managed repository of templates on http://rails-new.herokuapp.com/admin. We don't store the templates itself but a reference to his repository location (only GIT supported right now). The main objective of this repository is to be to able to put in a single place how the template should be using.

For example, this url: http://rails-new.herokuapp.com/api/v1/templates/julio/base.json returns:

{
  "template": {
    "id": 1,
    "name": "base",
    "git_repository": "https://github.com/juliogarciag/rails-template.git",
    "main_file_location": "template.rb",
    "arguments": [
      {
        "id": 1,
        "key": "--skip-test-unit",
        "has_value": false,
        "value": ""
      },
      {
        "id": 2,
        "key": "--skip-turbolinks",
        "has_value": false,
        "value": ""
      },
      {
        "id": 3,
        "key": "--skip-bundle",
        "has_value": false,
        "value": ""
      },
      {
        "id": 4,
        "key": "--skip-spring",
        "has_value": false,
        "value": ""
      }
    ]
  }
}

This json represents the arguments needed for this template, the repository where this is stored and the location of the template file inside of the the repository.

The fact that is privately managed is just temporal. To make it public, we should need to improve the UI and improve the security to completely remove the chance of shell execution through the pass of parameters or some other arguments. Because we are not totally sure yet of the security of that system, the system is kept privately.

The main point of this gem is to allow to use that template in this way:

rails-new julio/base my-new-project

Installation

Install running:

$ gem install rails-new-gem

Usage

Run rails-new --help for instructions.

Contributing with Templates while private

Create an issue with the git repository of the template, the location inside it, the name of the user you want to keep the repository within, the name of the template and the arguments you expect the template to be called with. This is just temporal until we figure out how to make it more user-friendly and secure at the same time.

Contributing with Code

  1. Fork it ( https://github.com/juliogarciag/rails-new-gem/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request