welaika-suspenders 1.4.0 → 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -7
- data/.ruby-version +1 -0
- data/.travis.yml +7 -2
- data/CONTRIBUTING.md +24 -26
- data/Gemfile.lock +94 -69
- data/NEWS.md +183 -0
- data/README.md +21 -127
- data/Rakefile +3 -3
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/setup +13 -0
- data/bin/welaika-suspenders +8 -11
- data/lib/{welaika_suspenders → suspenders}/actions.rb +1 -16
- data/lib/suspenders/app_builder.rb +424 -0
- data/lib/{welaika_suspenders → suspenders}/generators/app_generator.rb +50 -54
- data/lib/suspenders/version.rb +5 -0
- data/lib/suspenders.rb +4 -0
- data/{features/support → spec/fakes}/bin/heroku +0 -0
- data/{features/support → spec/fakes}/bin/hub +0 -0
- data/spec/features/github_spec.rb +10 -0
- data/spec/features/heroku_spec.rb +19 -0
- data/spec/features/new_project_spec.rb +115 -0
- data/spec/spec_helper.rb +24 -0
- data/{features → spec}/support/fake_github.rb +1 -1
- data/spec/support/fake_heroku.rb +38 -0
- data/spec/support/suspenders.rb +49 -0
- data/suspenders.gemspec +36 -0
- data/templates/Gemfile.erb +58 -0
- data/templates/Procfile +1 -2
- data/templates/README.md.erb +28 -2
- data/templates/_flashes.html.slim +4 -3
- data/templates/_javascript.html.slim +3 -0
- data/templates/action_mailer.rb +5 -0
- data/templates/application.css.scss +3 -4
- data/templates/bin_setup.erb +34 -0
- data/templates/config_i18n_tasks.yml +13 -0
- data/templates/config_locales_en.yml.erb +19 -0
- data/templates/database_cleaner_rspec.rb +1 -4
- data/templates/development_seeds.rb +12 -0
- data/templates/errors.rb +22 -16
- data/templates/{factory_girl_syntax_rspec.rb → factory_girl_rspec.rb} +0 -0
- data/templates/i18n.rb +3 -0
- data/templates/newrelic.yml.erb +34 -0
- data/templates/postgresql_database.yml.erb +1 -1
- data/templates/rack_timeout.rb +1 -1
- data/templates/rails_helper.rb +23 -0
- data/templates/sample.env +1 -12
- data/templates/secrets.yml +14 -0
- data/templates/smtp.rb +9 -10
- data/templates/spec_helper.rb +16 -0
- data/templates/staging.rb +5 -0
- data/templates/suspenders_gitignore +10 -9
- data/templates/suspenders_layout.html.slim +14 -0
- data/templates/travis.yml.erb +24 -0
- data/templates/unicorn.rb +12 -9
- metadata +100 -80
- data/.DS_Store +0 -0
- data/features/github_repo.feature +0 -8
- data/features/heroku_true.feature +0 -9
- data/features/rake_clean.feature +0 -15
- data/features/step_definitions/suspenders_steps.rb +0 -69
- data/features/support/env.rb +0 -10
- data/features/support/fake_heroku.rb +0 -21
- data/lib/welaika_suspenders/app_builder.rb +0 -318
- data/lib/welaika_suspenders/version.rb +0 -4
- data/lib/welaika_suspenders/version_check.rb +0 -26
- data/templates/.DS_Store +0 -0
- data/templates/Gemfile_clean +0 -56
- data/templates/bin_setup +0 -11
- data/templates/capybara_selectors.rb +0 -29
- data/templates/config_locales_en.yml +0 -11
- data/templates/create_dragonfly_jobs.rb +0 -9
- data/templates/dragonfly.rb +0 -9
- data/templates/dragonfly_initializer.rb +0 -47
- data/templates/exist_in_db.rb +0 -6
- data/templates/factories_spec.rb +0 -14
- data/templates/factories_spec_rake_task.rb +0 -9
- data/templates/import_common_javascripts +0 -4
- data/templates/model_spec_helper.rb +0 -38
- data/templates/presenters.rb +0 -3
- data/templates/rails_root_definition.rb +0 -2
- data/templates/rspec +0 -2
- data/templates/rspec_config.rb +0 -16
- data/templates/simplecov_init.rb +0 -3
- data/templates/suspenders_layout.html.slim.erb +0 -12
- data/templates/unit_spec_helper.rb +0 -15
- data/welaika-suspenders.gemspec +0 -35
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rails/generators'
|
2
2
|
require 'rails/generators/rails/app/app_generator'
|
3
3
|
|
4
|
-
module
|
4
|
+
module Suspenders
|
5
5
|
class AppGenerator < Rails::Generators::AppGenerator
|
6
6
|
class_option :database, :type => :string, :aliases => '-d', :default => 'postgresql',
|
7
7
|
:desc => "Preconfigure for selected database (options: #{DATABASES.join('/')})"
|
@@ -21,37 +21,36 @@ module WelaikaSuspenders
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def suspenders_customization
|
24
|
-
invoke :remove_files_we_dont_need
|
25
24
|
invoke :customize_gemfile
|
26
|
-
invoke :setup_database
|
27
25
|
invoke :setup_development_environment
|
28
26
|
invoke :setup_test_environment
|
29
27
|
invoke :setup_production_environment
|
30
28
|
invoke :setup_staging_environment
|
29
|
+
invoke :setup_secret_token
|
31
30
|
invoke :create_suspenders_views
|
32
|
-
invoke :
|
33
|
-
invoke :setup_presenters
|
31
|
+
invoke :setup_coffeescript
|
34
32
|
invoke :configure_app
|
35
33
|
invoke :setup_stylesheets
|
34
|
+
invoke :install_bitters
|
36
35
|
invoke :copy_miscellaneous_files
|
37
36
|
invoke :customize_error_pages
|
38
37
|
invoke :remove_routes_comment_lines
|
39
|
-
invoke :configure_dragonfly
|
40
38
|
invoke :setup_git
|
39
|
+
invoke :setup_database
|
41
40
|
invoke :create_heroku_apps
|
42
41
|
invoke :create_github_repo
|
43
42
|
invoke :outro
|
44
43
|
end
|
45
44
|
|
46
|
-
def remove_files_we_dont_need
|
47
|
-
build :remove_public_index
|
48
|
-
build :remove_rails_logo_image
|
49
|
-
end
|
50
|
-
|
51
45
|
def customize_gemfile
|
52
46
|
build :replace_gemfile
|
53
47
|
build :set_ruby_to_version_being_used
|
54
|
-
|
48
|
+
|
49
|
+
if options[:heroku]
|
50
|
+
build :setup_heroku_specific_gems
|
51
|
+
end
|
52
|
+
|
53
|
+
bundle_command 'install'
|
55
54
|
end
|
56
55
|
|
57
56
|
def setup_database
|
@@ -67,32 +66,44 @@ module WelaikaSuspenders
|
|
67
66
|
def setup_development_environment
|
68
67
|
say 'Setting up the development environment'
|
69
68
|
build :raise_on_delivery_errors
|
69
|
+
build :configure_letter_opener
|
70
70
|
build :raise_on_unpermitted_parameters
|
71
71
|
build :provide_setup_script
|
72
|
+
build :provide_dev_prime_task
|
72
73
|
build :configure_generators
|
74
|
+
build :configure_i18n_for_missing_translations
|
73
75
|
end
|
74
76
|
|
75
77
|
def setup_test_environment
|
76
78
|
say 'Setting up the test environment'
|
77
|
-
build :
|
78
|
-
build :test_factories_first
|
79
|
+
build :set_up_factory_girl_for_rspec
|
79
80
|
build :generate_rspec
|
80
81
|
build :configure_rspec
|
81
82
|
build :configure_background_jobs_for_rspec
|
82
83
|
build :enable_database_cleaner
|
83
|
-
build :
|
84
|
-
build :
|
84
|
+
build :configure_spec_support_features
|
85
|
+
build :configure_travis
|
86
|
+
build :configure_i18n_for_test_environment
|
87
|
+
build :configure_i18n_tasks
|
88
|
+
build :configure_action_mailer_in_specs
|
85
89
|
end
|
86
90
|
|
87
91
|
def setup_production_environment
|
88
92
|
say 'Setting up the production environment'
|
93
|
+
build :configure_newrelic
|
89
94
|
build :configure_smtp
|
95
|
+
build :enable_rack_deflater
|
96
|
+
build :setup_asset_host
|
90
97
|
end
|
91
98
|
|
92
99
|
def setup_staging_environment
|
93
100
|
say 'Setting up the staging environment'
|
94
101
|
build :setup_staging_environment
|
95
|
-
|
102
|
+
end
|
103
|
+
|
104
|
+
def setup_secret_token
|
105
|
+
say 'Moving secret token out of version control'
|
106
|
+
build :setup_secret_token
|
96
107
|
end
|
97
108
|
|
98
109
|
def create_suspenders_views
|
@@ -103,35 +114,20 @@ module WelaikaSuspenders
|
|
103
114
|
build :create_application_layout
|
104
115
|
end
|
105
116
|
|
106
|
-
def
|
107
|
-
say 'Setting up
|
108
|
-
build :
|
109
|
-
end
|
110
|
-
|
111
|
-
def setup_presenters
|
112
|
-
say 'Setting up presenters'
|
113
|
-
build :setup_presenters
|
114
|
-
end
|
115
|
-
|
116
|
-
def setup_database
|
117
|
-
say 'Setting up database'
|
118
|
-
|
119
|
-
if 'postgresql' == options[:database]
|
120
|
-
build :use_postgres_config_template
|
121
|
-
end
|
122
|
-
|
123
|
-
build :create_database
|
117
|
+
def setup_coffeescript
|
118
|
+
say 'Setting up CoffeeScript defaults'
|
119
|
+
build :remove_turbolinks
|
124
120
|
end
|
125
121
|
|
126
122
|
def configure_app
|
127
123
|
say 'Configuring app'
|
128
124
|
build :configure_action_mailer
|
129
|
-
build :blacklist_active_record_attributes
|
130
|
-
build :configure_strong_parameters
|
131
125
|
build :configure_time_zone
|
132
126
|
build :configure_time_formats
|
133
127
|
build :configure_rack_timeout
|
134
128
|
build :disable_xml_params
|
129
|
+
build :configure_available_locales
|
130
|
+
build :fix_i18n_deprecation_warning
|
135
131
|
build :setup_default_rake_task
|
136
132
|
build :configure_unicorn
|
137
133
|
build :setup_foreman
|
@@ -142,21 +138,31 @@ module WelaikaSuspenders
|
|
142
138
|
build :setup_stylesheets
|
143
139
|
end
|
144
140
|
|
141
|
+
def install_bitters
|
142
|
+
say 'Install Bitters'
|
143
|
+
build :install_bitters
|
144
|
+
end
|
145
|
+
|
145
146
|
def setup_git
|
146
|
-
|
147
|
-
|
148
|
-
|
147
|
+
if !options[:skip_git]
|
148
|
+
say 'Initializing git'
|
149
|
+
invoke :setup_gitignore
|
150
|
+
invoke :init_git
|
151
|
+
end
|
149
152
|
end
|
150
153
|
|
151
154
|
def create_heroku_apps
|
152
155
|
if options[:heroku]
|
153
156
|
say 'Creating Heroku apps'
|
154
157
|
build :create_heroku_apps
|
158
|
+
build :set_heroku_remotes
|
159
|
+
build :set_heroku_rails_secrets
|
160
|
+
build :set_memory_management_variable
|
155
161
|
end
|
156
162
|
end
|
157
163
|
|
158
164
|
def create_github_repo
|
159
|
-
if options[:github]
|
165
|
+
if !options[:skip_git] && options[:github]
|
160
166
|
say 'Creating Github repo'
|
161
167
|
build :create_github_repo, options[:github]
|
162
168
|
end
|
@@ -170,11 +176,6 @@ module WelaikaSuspenders
|
|
170
176
|
build :init_git
|
171
177
|
end
|
172
178
|
|
173
|
-
def copy_libraries
|
174
|
-
say 'Copying libraries'
|
175
|
-
build :copy_libraries
|
176
|
-
end
|
177
|
-
|
178
179
|
def copy_miscellaneous_files
|
179
180
|
say 'Copying miscellaneous support files'
|
180
181
|
build :copy_miscellaneous_files
|
@@ -189,13 +190,9 @@ module WelaikaSuspenders
|
|
189
190
|
build :remove_routes_comment_lines
|
190
191
|
end
|
191
192
|
|
192
|
-
def configure_dragonfly
|
193
|
-
say 'Configuring dragonfly'
|
194
|
-
build :configure_dragonfly
|
195
|
-
end
|
196
|
-
|
197
193
|
def outro
|
198
|
-
say
|
194
|
+
say "Congratulations!"
|
195
|
+
say "Remember to run 'bin/setup' and configure errbit"
|
199
196
|
end
|
200
197
|
|
201
198
|
def run_bundle
|
@@ -205,7 +202,7 @@ module WelaikaSuspenders
|
|
205
202
|
protected
|
206
203
|
|
207
204
|
def get_builder_class
|
208
|
-
|
205
|
+
Suspenders::AppBuilder
|
209
206
|
end
|
210
207
|
|
211
208
|
def using_active_record?
|
@@ -213,4 +210,3 @@ module WelaikaSuspenders
|
|
213
210
|
end
|
214
211
|
end
|
215
212
|
end
|
216
|
-
|
data/lib/suspenders.rb
ADDED
File without changes
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
feature 'Heroku' do
|
4
|
+
scenario 'Suspend a project with --heroku=true' do
|
5
|
+
run_suspenders('--heroku=true')
|
6
|
+
|
7
|
+
expect(FakeHeroku).to have_gem_included(project_path, 'rails_12factor')
|
8
|
+
expect(FakeHeroku).to have_created_app_for('staging')
|
9
|
+
expect(FakeHeroku).to have_created_app_for('production')
|
10
|
+
expect(FakeHeroku).to have_configured_vars('staging', 'SECRET_KEY_BASE')
|
11
|
+
expect(FakeHeroku).to have_configured_vars('production', 'SECRET_KEY_BASE')
|
12
|
+
|
13
|
+
bin_setup = IO.read("#{project_path}/bin/setup")
|
14
|
+
app_name = SuspendersTestHelpers::APP_NAME
|
15
|
+
|
16
|
+
expect(bin_setup).to include("heroku join --app #{app_name}-staging")
|
17
|
+
expect(bin_setup).to include("heroku join --app #{app_name}-production")
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
feature 'Suspend a new project with default configuration' do
|
4
|
+
scenario 'specs pass' do
|
5
|
+
run_suspenders
|
6
|
+
|
7
|
+
Dir.chdir(project_path) do
|
8
|
+
Bundler.with_clean_env do
|
9
|
+
expect(`rake`).to include('0 failures')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
scenario 'staging config is inherited from production' do
|
15
|
+
run_suspenders
|
16
|
+
|
17
|
+
staging_file = IO.read("#{project_path}/config/environments/staging.rb")
|
18
|
+
config_stub = "Rails.application.configure do"
|
19
|
+
|
20
|
+
expect(staging_file).to match(/^require_relative "production"/)
|
21
|
+
expect(staging_file).to match(/#{config_stub}/), staging_file
|
22
|
+
end
|
23
|
+
|
24
|
+
scenario 'generated .ruby-version is pulled from Suspenders .ruby-version' do
|
25
|
+
run_suspenders
|
26
|
+
|
27
|
+
ruby_version_file = IO.read("#{project_path}/.ruby-version")
|
28
|
+
|
29
|
+
expect(ruby_version_file).to eq "#{RUBY_VERSION}\n"
|
30
|
+
end
|
31
|
+
|
32
|
+
scenario 'secrets.yml reads secret from env' do
|
33
|
+
run_suspenders
|
34
|
+
|
35
|
+
secrets_file = IO.read("#{project_path}/config/secrets.yml")
|
36
|
+
|
37
|
+
expect(secrets_file).to match(/secret_key_base: <%= ENV\["SECRET_KEY_BASE"\] %>/)
|
38
|
+
end
|
39
|
+
|
40
|
+
scenario 'action mailer support file is added' do
|
41
|
+
run_suspenders
|
42
|
+
|
43
|
+
expect(File).to exist("#{project_path}/spec/support/action_mailer.rb")
|
44
|
+
end
|
45
|
+
|
46
|
+
scenario "i18n support file is added" do
|
47
|
+
run_suspenders
|
48
|
+
|
49
|
+
expect(File).to exist("#{project_path}/spec/support/i18n.rb")
|
50
|
+
end
|
51
|
+
|
52
|
+
scenario 'newrelic.yml reads NewRelic license from env' do
|
53
|
+
run_suspenders
|
54
|
+
|
55
|
+
newrelic_file = IO.read("#{project_path}/config/newrelic.yml")
|
56
|
+
|
57
|
+
expect(newrelic_file).to match(
|
58
|
+
/license_key: "<%= ENV\["NEW_RELIC_LICENSE_KEY"\] %>"/
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
scenario "set up available locales" do
|
63
|
+
run_suspenders
|
64
|
+
|
65
|
+
result = IO.read("#{project_path}/config/application.rb")
|
66
|
+
|
67
|
+
expect(result).to match(
|
68
|
+
/^ +config.i18n.available_locales = \[:en, :it\]$/
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
scenario "raises on unpermitted parameters in all environments" do
|
73
|
+
run_suspenders
|
74
|
+
|
75
|
+
result = IO.read("#{project_path}/config/application.rb")
|
76
|
+
|
77
|
+
expect(result).to match(
|
78
|
+
/^ +config.action_controller.action_on_unpermitted_parameters = :raise$/
|
79
|
+
)
|
80
|
+
end
|
81
|
+
|
82
|
+
scenario "raises on missing translations in development and test" do
|
83
|
+
run_suspenders
|
84
|
+
|
85
|
+
%w[development test].each do |environment|
|
86
|
+
environment_file =
|
87
|
+
IO.read("#{project_path}/config/environments/#{environment}.rb")
|
88
|
+
expect(environment_file).to match(
|
89
|
+
/^ +config.action_view.raise_on_missing_translations = true$/
|
90
|
+
)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
scenario "specs for missing or unused translations" do
|
95
|
+
run_suspenders
|
96
|
+
|
97
|
+
expect(File).to exist("#{project_path}/spec/i18n_spec.rb")
|
98
|
+
end
|
99
|
+
|
100
|
+
scenario "config file for i18n tasks" do
|
101
|
+
run_suspenders
|
102
|
+
|
103
|
+
expect(File).to exist("#{project_path}/config/i18n-tasks.yml")
|
104
|
+
end
|
105
|
+
|
106
|
+
scenario "generated en.yml is evaluated" do
|
107
|
+
run_suspenders
|
108
|
+
|
109
|
+
locales_en_file = IO.read("#{project_path}/config/locales/en.yml")
|
110
|
+
app_name = SuspendersTestHelpers::APP_NAME
|
111
|
+
|
112
|
+
expect(locales_en_file).to match(/application: #{app_name.humanize}/)
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'capybara/rspec'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
Bundler.require(:default, :test)
|
5
|
+
|
6
|
+
require (Pathname.new(__FILE__).dirname + '../lib/suspenders').expand_path
|
7
|
+
|
8
|
+
Dir['./spec/support/**/*.rb'].each { |file| require file }
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
config.include SuspendersTestHelpers
|
12
|
+
|
13
|
+
config.before(:all) do
|
14
|
+
create_tmp_directory
|
15
|
+
end
|
16
|
+
|
17
|
+
config.before(:each) do
|
18
|
+
drop_dummy_database
|
19
|
+
remove_project_directory
|
20
|
+
|
21
|
+
FakeHeroku.clear!
|
22
|
+
FakeGithub.clear!
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class FakeHeroku
|
2
|
+
RECORDER = File.expand_path(File.join('..', '..', 'tmp', 'heroku_commands'), File.dirname(__FILE__))
|
3
|
+
|
4
|
+
def initialize(args)
|
5
|
+
@args = args
|
6
|
+
end
|
7
|
+
|
8
|
+
def run!
|
9
|
+
File.open(RECORDER, 'a') do |file|
|
10
|
+
file.puts @args.join(' ')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.clear!
|
15
|
+
FileUtils.rm_rf RECORDER
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.has_gem_included?(project_path, gem_name)
|
19
|
+
gemfile = File.open(File.join(project_path, 'Gemfile'), 'a')
|
20
|
+
|
21
|
+
File.foreach(gemfile).any? do |line|
|
22
|
+
line.match(/#{Regexp.quote(gem_name)}/)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.has_created_app_for?(remote_name)
|
27
|
+
app_name = "#{SuspendersTestHelpers::APP_NAME}-#{remote_name}"
|
28
|
+
expected_line = "create #{app_name} --remote #{remote_name}\n"
|
29
|
+
|
30
|
+
File.foreach(RECORDER).any? { |line| line == expected_line }
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.has_configured_vars?(remote_name, var)
|
34
|
+
File.foreach(RECORDER).any? do |line|
|
35
|
+
line =~ /^config:add #{var}=.+ --remote #{remote_name}\n$/
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module SuspendersTestHelpers
|
2
|
+
APP_NAME = 'dummy'
|
3
|
+
|
4
|
+
def remove_project_directory
|
5
|
+
FileUtils.rm_rf(project_path)
|
6
|
+
end
|
7
|
+
|
8
|
+
def create_tmp_directory
|
9
|
+
FileUtils.mkdir_p(tmp_path)
|
10
|
+
end
|
11
|
+
|
12
|
+
def run_suspenders(arguments = nil)
|
13
|
+
Dir.chdir(tmp_path) do
|
14
|
+
Bundler.with_clean_env do
|
15
|
+
ENV['TESTING'] = '1'
|
16
|
+
|
17
|
+
%x(#{suspenders_bin} #{APP_NAME} #{arguments})
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def drop_dummy_database
|
23
|
+
if File.exist?(project_path)
|
24
|
+
Dir.chdir(project_path) do
|
25
|
+
Bundler.with_clean_env do
|
26
|
+
`rake db:drop`
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def project_path
|
33
|
+
@project_path ||= Pathname.new("#{tmp_path}/#{APP_NAME}")
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def tmp_path
|
39
|
+
@tmp_path ||= Pathname.new("#{root_path}/tmp")
|
40
|
+
end
|
41
|
+
|
42
|
+
def suspenders_bin
|
43
|
+
File.join(root_path, 'bin', 'welaika-suspenders')
|
44
|
+
end
|
45
|
+
|
46
|
+
def root_path
|
47
|
+
File.expand_path('../../../', __FILE__)
|
48
|
+
end
|
49
|
+
end
|
data/suspenders.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'suspenders/version'
|
4
|
+
require 'date'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.required_ruby_version = ">= #{Suspenders::RUBY_VERSION}"
|
8
|
+
s.authors = ['thoughtbot', 'weLaika']
|
9
|
+
s.date = Date.today.strftime('%Y-%m-%d')
|
10
|
+
|
11
|
+
s.description = <<-HERE
|
12
|
+
weLaika's fork of the famous thoughbot suspenders gem.
|
13
|
+
HERE
|
14
|
+
|
15
|
+
s.email = 'info@welaika.com'
|
16
|
+
s.executables = ['welaika-suspenders']
|
17
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.homepage = 'http://github.com/welaika/welaika-suspenders'
|
20
|
+
s.license = 'MIT'
|
21
|
+
s.name = 'welaika-suspenders'
|
22
|
+
s.rdoc_options = ['--charset=UTF-8']
|
23
|
+
s.require_paths = ['lib']
|
24
|
+
s.summary = "Generate a Rails app using thoughtbot's best practices."
|
25
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
26
|
+
s.version = Suspenders::VERSION
|
27
|
+
|
28
|
+
s.add_dependency 'bitters', '~> 0.10.0'
|
29
|
+
s.add_dependency 'bundler', '~> 1.3'
|
30
|
+
s.add_dependency 'rails', Suspenders::RAILS_VERSION
|
31
|
+
|
32
|
+
s.add_development_dependency 'aruba', '~> 0.5'
|
33
|
+
s.add_development_dependency 'cucumber', '~> 1.2'
|
34
|
+
s.add_development_dependency 'rspec', '~> 2.0'
|
35
|
+
s.add_development_dependency 'capybara', '~> 2.2', '>= 2.2.0'
|
36
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
ruby "<%= Suspenders::RUBY_VERSION %>"
|
4
|
+
|
5
|
+
gem "airbrake"
|
6
|
+
gem "bourbon", "~> 3.2.1"
|
7
|
+
gem "coffee-rails"
|
8
|
+
gem "delayed_job_active_record"
|
9
|
+
gem "email_validator"
|
10
|
+
gem "flutie"
|
11
|
+
gem "high_voltage"
|
12
|
+
gem "i18n-tasks"
|
13
|
+
gem "jquery-rails"
|
14
|
+
gem "neat", "~> 1.5.1"
|
15
|
+
gem "newrelic_rpm"
|
16
|
+
gem "normalize-rails", "~> 3.0.0"
|
17
|
+
gem "pg"
|
18
|
+
gem "rack-timeout"
|
19
|
+
gem "rails", "<%= Suspenders::RAILS_VERSION %>"
|
20
|
+
gem "rails-i18n"
|
21
|
+
gem "recipient_interceptor"
|
22
|
+
gem "sass-rails", "~> 4.0.3"
|
23
|
+
gem "slim-rails"
|
24
|
+
gem "simple_form"
|
25
|
+
gem "title"
|
26
|
+
gem "uglifier"
|
27
|
+
gem "unicorn"
|
28
|
+
|
29
|
+
group :development do
|
30
|
+
gem "letter_opener"
|
31
|
+
gem "spring"
|
32
|
+
gem "spring-commands-rspec"
|
33
|
+
end
|
34
|
+
|
35
|
+
group :development, :test do
|
36
|
+
gem "awesome_print"
|
37
|
+
gem "byebug"
|
38
|
+
gem "dotenv-rails"
|
39
|
+
gem "faker"
|
40
|
+
gem "factory_girl_rails"
|
41
|
+
gem "priscilla"
|
42
|
+
gem "pry-bloodline"
|
43
|
+
gem "pry-rails"
|
44
|
+
gem "rspec-rails", "~> 3.0.0"
|
45
|
+
end
|
46
|
+
|
47
|
+
group :test do
|
48
|
+
gem "capybara-webkit", ">= 1.2.0"
|
49
|
+
gem "database_cleaner"
|
50
|
+
gem "formulaic"
|
51
|
+
gem "launchy"
|
52
|
+
gem "shoulda-matchers", require: false
|
53
|
+
gem "timecop"
|
54
|
+
gem "webmock"
|
55
|
+
end
|
56
|
+
|
57
|
+
group :staging, :production do
|
58
|
+
end
|
data/templates/Procfile
CHANGED
data/templates/README.md.erb
CHANGED
@@ -1,5 +1,31 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<%= app_name.humanize %>
|
2
|
+
<%= '=' * app_name.humanize.length %>
|
3
|
+
|
4
|
+
Getting Started
|
5
|
+
---------------
|
6
|
+
|
7
|
+
After you have cloned this repo, run this setup script to set up your machine
|
8
|
+
with the necessary dependencies to run and test this app:
|
9
|
+
|
10
|
+
% ./bin/setup
|
11
|
+
|
12
|
+
It assumes you have a machine equipped with Ruby, Postgres, etc. If not, set up
|
13
|
+
your machine with [this script].
|
14
|
+
|
15
|
+
[this script]: https://github.com/thoughtbot/laptop
|
16
|
+
|
17
|
+
After setting up, you can run the application using [foreman]:
|
18
|
+
|
19
|
+
% foreman start
|
20
|
+
|
21
|
+
If you don't have `foreman`, see [Foreman's install instructions][foreman]. It
|
22
|
+
is [purposefully excluded from the project's `Gemfile`][exclude].
|
23
|
+
|
24
|
+
[foreman]: https://github.com/ddollar/foreman
|
25
|
+
[exclude]: https://github.com/ddollar/foreman/pull/437#issuecomment-41110407
|
26
|
+
|
27
|
+
Guidelines
|
28
|
+
----------
|
3
29
|
|
4
30
|
Use the following guides for getting things done, programming well, and
|
5
31
|
programming in style.
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
- if flash.any?
|
2
|
+
#flash
|
3
|
+
- flash.each do |key, value|
|
4
|
+
div id="flash_#{key}"= value
|
@@ -1,8 +1,7 @@
|
|
1
1
|
@charset 'utf-8';
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
@import 'normalize-rails';
|
5
4
|
@import 'bourbon';
|
5
|
+
@import 'base/grid-settings';
|
6
6
|
@import 'neat';
|
7
|
-
|
8
|
-
///////////////////////////////////////////////////////////////////////////////
|
7
|
+
@import 'base/base';
|