This repository has been archived by the owner on Jul 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.rb
135 lines (117 loc) · 3.05 KB
/
template.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
remove_file "README.rdoc"
remove_file "public/index.html"
remove_file "public/favicon.ico"
remove_file "public/robots.txt"
remove_file "app/assets/images/rails.png"
remove_file "app/views/layouts/application.html.erb"
create_file ".rvmrc", "rvm use 1.9.3"
gem 'devise'
gem 'simple_form'
gem 'haml-rails'
gem 'jquery-rails'
gem 'kaminari'
gem 'thin'
gem 'carrierwave'
gem 'mini_magick'
gem 'cancan'
gem 'state_machine'
gem_group :assets do
gem 'twitter-bootstrap-rails'
gem 'bootstrap-sass'
gem 'bootswatch-rails'
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', platforms: :ruby
gem 'uglifier', '>= 1.0.3'
end
gem_group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request', '0.2.1'
gem 'bullet'
gem 'awesome_print'
gem 'pry-rails'
end
gem_group :test do
gem 'capybara'
gem 'cucumber-rails'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'database_cleaner'
gem 'growl'
gem 'guard-spork'
gem 'rb-fsevent'
gem 'rspec'
gem 'rspec-mocks'
gem 'rspec-rails-mocha', '~> 0.3.1', require: false
gem 'shoulda-matchers'
gem 'spork-rails'
gem 'sqlite3'
gem 'rb-inotify', '~> 0.8.8' , require:false
gem 'annotate', '~> 2.4.1.beta'
gem 'guard'
gem 'guard-rails'
gem 'guard-livereload'
gem 'guard-spork'
gem 'guard-rspec'
gem 'guard-annotate'
gem 'guard-delayed'
end
run 'bundle install'
rake "db:create", :env => 'development'
rake "db:create", :env => 'test'
generate 'simple_form:install --bootstrap'
generate 'devise:install'
generate 'devise:views'
generate 'bootstrap:install'
generate 'bootstrap:layout'
run "for i in `find app/views/devise -name '*.erb'` ; do html2haml -e $i ${i%erb}haml ; rm $i ; done"
generate 'jquery:install'
generate 'rspec:install'
generate 'cucumber:install --spork'
git :init
append_file '.gitignore', <<-END
config/database.yml
db/*.sqlite3
log/*.log
tmp
public/uploads
.bundle
.sass-cache
.rvmrc
.DS_Store
.sw*
END
remove_file 'spec/spec_helper.rb'
create_file 'spec/spec_helper.rb', <<-END
require 'rubygems'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rails'
require 'capybara/rspec'
require 'capybara/dsl'
require 'factory_girl'
Capybara.ignore_hidden_elements = true
Capybara.javascript_driver = :webkit
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.before do
ActiveRecord::Base.observers.disable :all
end
config.mock_with :rspec
config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = false
ActiveSupport::Dependencies.clear
config.include FactoryGirl::Syntax::Methods
end
end
Spork.each_run do
load "\#{Rails.root}/config/routes.rb"
Dir["\#{Rails.root}/app/**/*.rb"].each { |f| load f }
end
END
run 'cp config/database.yml config/database.example.yml'
git add: '.', commit: '-m "Initial commit"'