Skip to content

Instantly share code, notes, and snippets.

@omarismail
Forked from anaerobeth/.rails_aliases
Created September 13, 2013 13:52
Show Gist options
  • Select an option

  • Save omarismail/6551005 to your computer and use it in GitHub Desktop.

Select an option

Save omarismail/6551005 to your computer and use it in GitHub Desktop.

Revisions

  1. @radavis-test3 radavis-test3 created this gist Sep 12, 2013.
    37 changes: 37 additions & 0 deletions .rails_aliases
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    function rails_pg() {
    rails new $1 -T --database=postgresql &&
    cd $1 &&

    echo $1 > .ruby-gemset &&
    echo 2.0 > .ruby-version &&
    echo /config/database.yml >> .gitignore &&
    cp config/database.yml config/database.example.yml &&

    add_rails_gems &&
    bundle &&
    rails g rspec:install &&

    git init &&
    git add . &&
    git commit -m 'Initial commit' &&

    subl .;
    }


    function add_rails_gems() {

    echo "

    group :test, :development do
    gem 'rspec-rails'
    gem 'capybara'
    gem 'factory_girl_rails'
    gem 'shoulda'
    gem 'valid_attribute'
    gem 'launchy'
    end

    " >> Gemfile;

    }