-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.rb
56 lines (45 loc) · 1.14 KB
/
base.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Steven H. Allen & Co. (http://stevenhallen.com)
#
# NOTICE: This template uses Postgresql exclusively for now
#
#
# To use this template:
#
# $ rails new <rails_app_name> -m https://gist.github.com/5777772.txt -S -T -d postgresql
# Install gems
gem "haml"
gem_group :development do
gem "better_errors"
end
gem_group :development, :test do
gem "database_cleaner"
gem "factory_girl_rails"
gem "jazz_hands"
gem "rspec-rails"
gem "shoulda"
gem "valid_attribute"
end
run "rvm gemset create #{app_name}"
run "rvm gemset use #{app_name}"
run "bundle install"
# Create .rspec defaults
file '.rspec', <<-CODE
--color
CODE
# Create database user
run "createuser -d #{app_name}"
# Create database
rake "db:create:all"
rake "db:migrate"
# Run the Rails Generator on whatever
generate "rspec:install"
# Add syntactic goodness to spec_helper (via Mark M)
inject_into_file "spec/spec_helper.rb", :after => 'config.order = "random"' do <<-CODE
config.include FactoryGirl::Syntax::Methods
CODE
end
# Clean everything up that we don't need before we check-in
remove_file 'public/index.html'
git :init
git :add => "."
git :commit => "-a -m 'Initial'"