-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjr-template.rb
62 lines (45 loc) · 1.71 KB
/
jr-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
gem 'haml-rails'
gem 'simple_form'
gem 'coffeebeans'
gem 'capistrano'
gem 'nifty-generators', :group => :development
gem 'rails3-generators', :group => :development
gem 'rspec-rails', :group => [ :development, :test ]
gem 'cucumber-rails', :group => [ :development, :test ]
gem 'factory_girl_rails', :group => [ :development, :test ]
gem 'database_cleaner', :group => [ :development, :test ]
gem 'capybara', :group => [ :development, :test ]
gem 'therubyracer', :group => :production, :require => 'v8'
run 'bundle install'
generate 'nifty:layout --haml'
remove_file 'app/views/layouts/application.html.erb'
generate 'simple_form:install'
generate 'rspec:install'
generate 'cucumber:install', '--capybara'
inject_into_file 'spec/spec_helper.rb', "\nrequire 'factory_girl'", :after => "require 'rspec/rails'"
inject_into_file 'config/application.rb', :after => "config.assets.enabled = true" do
<<-eos
# Add lib & subdirs to autoload path
config.autoload_paths += %W(\#{config.root}/lib)
config.autoload_paths += Dir["\#{config.root}/lib/**/"]
# Customize generators
config.generators do |g|
g.form_builder :simple_form
g.template_engine :haml
g.test_framework :rspec, :views => false, :fixture => true
g.fixture_replacement :factory_girl, :dir => 'spec/factories'
end
eos
end
generate 'controller', 'home index'
route 'root :to => "home#index"'
remove_file 'public/index.html'
capify!
git :init
git :add => "."
git :commit => "-a -m 'create initial application'"
say <<-eos
============================================================================
Your new Rails application is ready to go.
Don't forget to scroll up for important messages from installed generators.
eos