Skip to content

Instantly share code, notes, and snippets.

@negamorgan
Last active August 29, 2015 13:56
Show Gist options
  • Save negamorgan/9191313 to your computer and use it in GitHub Desktop.
Save negamorgan/9191313 to your computer and use it in GitHub Desktop.
New Ruby project set-up checklist

#New Ruby project set-up checklist

Add a simple README file

touch README.md

mkdir

  • bin
  • lib/models
  • lib/views
  • config

Set up git & .gitignore file

Set up a git repo with git init or by cloning from Github.

.gitignore file with:

*~
.DS_Store
*.sw?
*.un~
*DS_Store

Set up bundler

bundle init

Add gems to Gemfile

Create config/environment.rb file with:

require 'bundler/setup'
Bundler.require
	
require_relative '../lib/path_to_my_files'

Set up rspec

rspec --init

bin/console or rake console

For Rake console, create Rakefile (no extension) in the root of site with:

task :environment do
  require_relative './config/environment'
end

desc "Loads an interactive console."
  task :console => [:environment] do
  load './bin/console'
  exit
end

For bin/console, create a bin/console file (no extension) with this:

#!/usr/bin/env ruby

require_relative '../config/environment'
Pry.start

Set up SimpleCov, if desired

Add SimpleCov gem to Gemfile and add SimpleCov.start to spec/spec_helper.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment