-
Notifications
You must be signed in to change notification settings - Fork 41
/
fabrication.rb
53 lines (40 loc) · 1.24 KB
/
fabrication.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
gem "fabrication", ">= 0.9.5"
gem "haml-rails", ">= 0.3.4"
gem "jquery-rails", ">= 0.2.7"
gem "rspec-rails", ">= 2.5.0", :group => [:development, :test]
generators = <<-GENERATORS
config.generators do |g|
g.test_framework :rspec, :fixture => true, :views => false
g.fixture_replacement :fabrication, :dir => "spec/fabricators"
g.integration_tool :rspec, :fixture => true, :views => true
end
GENERATORS
application generators
gsub_file 'config/application.rb', 'config.filter_parameters += [:password]', 'config.filter_parameters += [:password, :password_confirmation]'
layout = <<-LAYOUT
!!!
%html
%head
%title #{app_name.humanize}
= stylesheet_link_tag :all
= javascript_include_tag :defaults
= csrf_meta_tag
%body
= yield
LAYOUT
remove_file "app/views/layouts/application.html.erb"
create_file "app/views/layouts/application.html.haml", layout
create_file "log/.gitkeep"
create_file "tmp/.gitkeep"
git :init
git :add => "."
docs = <<-DOCS
Run the following commands to complete the setup of #{app_name.humanize}:
% cd #{app_name}
% rvm use --create --rvmrc default@#{app_name}
% gem install bundler
% bundle install
% script/rails generate jquery:install
% script/rails generate rspec:install
DOCS
log docs