-
Notifications
You must be signed in to change notification settings - Fork 0
/
itdoesnothing.rb
58 lines (52 loc) · 1.91 KB
/
itdoesnothing.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
#
# Create your application with:
#
# rails new <name> --skip-test-unit --skip-prototype --template=https://girhub.com/sampierson/rails-templates/raw/master/itdoesnothing.rb
#
TEMPLATES_REPOSITORY = ENV['TEMPLATES_REPOSITORY'] || 'https://github.com/sampierson/rails-templates/raw/master'
templates = [
'utils',
'base+git',
'db',
'debug',
'rspec2',
(RUBY_VERSION =~ /1.9/ ? 'cover_me' : 'rcov'), # Test coverage measurement
'cucumber+webrat', # Integration test framework: cucumber-capybara cucumber+webrat
'compass+html5', # Templating/layout: haml compass+blueprint compass+html5
'style', # Customize layout
'home_controller', # A simple controller around which we can wrap authentication
'devise', # Authentication
'cancan',
# 'jquery' - done already if we're using compass+html5
'i18n',
'jasmine',
'page_specific_js_framework',
'simple-navigation',
'admin_base',
'admin_users',
'admin_settings',
'user_preferences',
'spork'
]
deploy_strategy = ask "Deploy to Heroku [h], using Capistrano [c] or neither [n] ? [h]: "
deploy_strategy = 'h' if deploy_strategy.blank?
case deploy_strategy[0,1].downcase
when 'h'
ENV['DEPLOY_STRATEGY'] = 'heroku'
templates << 'herokuize'
when 'c'
ENV['DEPLOY_STRATEGY'] = 'capistrano'
templates << 'capistrano'
default_deploy_host = "#{app_name}.com"
deploy_host = ask "deploy_to_hostname [#{default_deploy_host}]: "
ENV['CAPISTRANO_DEPLOY_HOST'] = deploy_host.blank? ? default_deploy_host : deploy_host
when 'n'
ENV['DEPLOY_STRATEGY'] = 'none'
end
templates.each do |template|
apply "#{TEMPLATES_REPOSITORY}/_#{template}.rb"
end
git_commit "Change logo to itdoesnothing" do
gsub_file 'app/views/layouts/_header.html.haml', 'Logo', "It Does Nothing!"
end
run_and_commit "bundle package"