welaika-suspenders 2.25.0 → 2.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/LICENSE +1 -1
- data/NEWS.md +29 -1
- data/README.md +0 -6
- data/USAGE +4 -1
- data/lib/suspenders/adapters/heroku.rb +18 -18
- data/lib/suspenders/app_builder.rb +43 -41
- data/lib/suspenders/generators/app_generator.rb +10 -35
- data/lib/suspenders/generators/static_generator.rb +1 -0
- data/lib/suspenders/generators/stylesheet_base_generator.rb +0 -4
- data/lib/suspenders/version.rb +2 -2
- data/lib/welaika-suspenders.rb +7 -1
- data/spec/adapters/heroku_spec.rb +15 -0
- data/spec/features/heroku_spec.rb +3 -3
- data/spec/features/new_project_spec.rb +47 -49
- data/spec/spec_helper.rb +1 -9
- data/spec/support/suspenders.rb +16 -0
- data/suspenders.gemspec +2 -3
- data/templates/Gemfile.erb +19 -12
- data/templates/application.sass +2 -3
- data/templates/bin_setup_review_app.erb +11 -8
- data/templates/bundler_audit.rake +2 -10
- data/templates/capybara_webkit.rb +1 -7
- data/templates/circle.yml.erb +6 -0
- data/templates/database_cleaner_rspec.rb +11 -4
- data/templates/factory_girl_rspec.rb +0 -9
- data/templates/rails_helper.rb +1 -8
- data/templates/suspenders_layout.html.slim +0 -1
- metadata +13 -33
- data/.ruby-gemset +0 -1
- data/spec/fakes/bin/hub +0 -5
- data/spec/features/github_spec.rb +0 -16
- data/spec/support/fake_github.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ecce30cf53025a563d920bdab67f869721f4beb
|
4
|
+
data.tar.gz: 8416bd5f21aaada18c56be47cfaaa918b63edbbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acde67c5a7d352813e7f924c29cdadd7671f70ef119efe4b913fe98a9bba447e71647d07bcc1cb37961e24e90fbeb2c49244458a2c718435e2a9cec70fdc8a8c
|
7
|
+
data.tar.gz: ac6bdc80ed994e47251c51da9f40010b7e1068dddfabe556f67e4cfd3ca5546e6773e703ae3b904c51f56f994c044ba04838114caf19a2bfa7a4a7af8b0c4e1a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.0
|
data/.travis.yml
CHANGED
data/LICENSE
CHANGED
data/NEWS.md
CHANGED
@@ -1,4 +1,32 @@
|
|
1
|
-
|
1
|
+
1.44.0 (January 25, 2017)
|
2
|
+
|
3
|
+
* Improve readability of `bin/setup-review-app` (#819)
|
4
|
+
* Update scripts to be `sh`-compatible (#820)
|
5
|
+
* Remove `rails_stdout_logging` gem (#818)
|
6
|
+
* Remove `12factor` gem (#817)
|
7
|
+
* Update Ruby to 2.4.0 (#814)
|
8
|
+
|
9
|
+
1.43.0 (November 8, 2016)
|
10
|
+
|
11
|
+
* Update Bourbon to 5.0.0.beta.7
|
12
|
+
* Update Neat to 2.0.0.beta.1
|
13
|
+
* Update Bitters to 1.5.0
|
14
|
+
* Drop sprockets-es6
|
15
|
+
* Bugfix: doesn’t generate unused `test/` directory
|
16
|
+
|
17
|
+
1.42.0 (July 23, 2016)
|
18
|
+
|
19
|
+
* [#784] Require refills once
|
20
|
+
* [#790] Ensure stylesheet_base generator runs with a clean bundle
|
21
|
+
* [#791] Use Rails' 5 syntax for `public_file_server.headers`
|
22
|
+
* [#792] Remove turbolinks from application.js file
|
23
|
+
|
24
|
+
1.41.0 (July 1, 2016)
|
25
|
+
|
26
|
+
* Update to Rails 5
|
27
|
+
* Drop quiet_assets
|
28
|
+
* Drop unneeded `suspenders` aliases: `--skip-test-unit`, `--skip-turbolinks`,
|
29
|
+
`--skip-bundle`. Drops `-G` that clashes with Rails’ `--skip-git` alias.
|
2
30
|
|
3
31
|
1.40.0 (June 25, 2016)
|
4
32
|
|
data/README.md
CHANGED
@@ -9,11 +9,6 @@ First install the suspenders gem:
|
|
9
9
|
|
10
10
|
gem install welaika-suspenders
|
11
11
|
|
12
|
-
If you are using RVM, please before create a new gemset named like `projectname`:
|
13
|
-
|
14
|
-
rvm gemset create projectname
|
15
|
-
rvm gemset use projectname
|
16
|
-
|
17
12
|
If you want to use heroku, please install the [heroku toolbelt](https://toolbelt.heroku.com/) and run
|
18
13
|
|
19
14
|
heroku login
|
@@ -62,7 +57,6 @@ List of changes we made since [this is commit](https://github.com/thoughtbot/sus
|
|
62
57
|
- add some html meta tags
|
63
58
|
- use EU region as default for Heroku
|
64
59
|
- use CDATA wrapper for javascript
|
65
|
-
- create a .ruby-gemset file with app name
|
66
60
|
- create common folders like `app/queries`, `app/services`, etc.
|
67
61
|
- use `application.sass` instead of `application.scss`
|
68
62
|
- add `brakeman` gem
|
data/USAGE
CHANGED
@@ -2,12 +2,15 @@ Description:
|
|
2
2
|
Suspenders is a Rails template with thoughtbot standard
|
3
3
|
defaults, ready to deploy to Heroku.
|
4
4
|
|
5
|
+
This is a forked version by weLaika.
|
6
|
+
|
5
7
|
For full details on the changes we've made compared to
|
6
8
|
a vanilla Rails app, check our GitHub project:
|
7
9
|
https://github.com/thoughtbot/suspenders
|
10
|
+
https://github.com/welaika/welaika-suspenders
|
8
11
|
|
9
12
|
Example:
|
10
|
-
suspenders ~/Code/weblog
|
13
|
+
welaika-suspenders ~/Code/weblog
|
11
14
|
|
12
15
|
This generates a Rails installation in ~/Code/weblog configured
|
13
16
|
with our preferred defaults.
|
@@ -6,7 +6,7 @@ module Suspenders
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def set_heroku_remotes
|
9
|
-
remotes =
|
9
|
+
remotes = <<~SHELL
|
10
10
|
#{command_to_join_heroku_app('staging')}
|
11
11
|
#{command_to_join_heroku_app('production')}
|
12
12
|
|
@@ -37,6 +37,15 @@ module Suspenders
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
def set_heroku_backup_schedule
|
41
|
+
%w(staging production).each do |environment|
|
42
|
+
run_toolbelt_command(
|
43
|
+
"pg:backups:schedule DATABASE_URL --at '10:00 UTC'",
|
44
|
+
environment,
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
40
49
|
def create_review_apps_setup_script
|
41
50
|
app_builder.template(
|
42
51
|
"bin_setup_review_app.erb",
|
@@ -70,15 +79,6 @@ module Suspenders
|
|
70
79
|
)
|
71
80
|
end
|
72
81
|
|
73
|
-
def set_heroku_serve_static_files
|
74
|
-
%w(staging production).each do |environment|
|
75
|
-
run_toolbelt_command(
|
76
|
-
"config:add RAILS_SERVE_STATIC_FILES=true",
|
77
|
-
environment,
|
78
|
-
)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
82
|
def set_heroku_application_host
|
83
83
|
%w(staging production).each do |environment|
|
84
84
|
run_toolbelt_command(
|
@@ -94,14 +94,14 @@ module Suspenders
|
|
94
94
|
|
95
95
|
def command_to_join_heroku_app(environment)
|
96
96
|
heroku_app_name = heroku_app_name_for(environment)
|
97
|
-
|
98
|
-
|
99
|
-
if heroku join --app #{heroku_app_name}
|
100
|
-
|
101
|
-
|
102
|
-
else
|
103
|
-
|
104
|
-
fi
|
97
|
+
<<~SHELL
|
98
|
+
|
99
|
+
if heroku join --app #{heroku_app_name} > /dev/null 2>&1; then
|
100
|
+
git remote add #{environment} git@heroku.com:#{heroku_app_name}.git || true
|
101
|
+
printf 'You are a collaborator on the "#{heroku_app_name}" Heroku app\n'
|
102
|
+
else
|
103
|
+
printf 'Ask for access to the "#{heroku_app_name}" Heroku app\n'
|
104
|
+
fi
|
105
105
|
SHELL
|
106
106
|
end
|
107
107
|
|
@@ -12,9 +12,9 @@ module Suspenders
|
|
12
12
|
:create_staging_heroku_app,
|
13
13
|
:create_review_apps_setup_script,
|
14
14
|
:set_heroku_rails_secrets,
|
15
|
+
:set_heroku_backup_schedule,
|
15
16
|
:set_heroku_remotes,
|
16
|
-
:set_heroku_application_host
|
17
|
-
:set_heroku_serve_static_files
|
17
|
+
:set_heroku_application_host
|
18
18
|
|
19
19
|
def readme
|
20
20
|
template 'README.md.erb', 'README.md'
|
@@ -44,7 +44,15 @@ module Suspenders
|
|
44
44
|
'raise_delivery_errors = false', 'raise_delivery_errors = true'
|
45
45
|
end
|
46
46
|
|
47
|
-
def
|
47
|
+
def remove_turbolinks
|
48
|
+
replace_in_file(
|
49
|
+
"app/assets/javascripts/application.js",
|
50
|
+
"//= require turbolinks",
|
51
|
+
""
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
def set_test_delivery_method
|
48
56
|
inject_into_file(
|
49
57
|
"config/environments/development.rb",
|
50
58
|
"\n config.action_mailer.delivery_method = :letter_opener",
|
@@ -79,7 +87,7 @@ module Suspenders
|
|
79
87
|
|
80
88
|
def configure_quiet_assets
|
81
89
|
config = <<-RUBY
|
82
|
-
config.
|
90
|
+
config.assets.quiet = true
|
83
91
|
RUBY
|
84
92
|
|
85
93
|
inject_into_class "config/application.rb", "Application", config
|
@@ -98,8 +106,9 @@ module Suspenders
|
|
98
106
|
config = <<-RUBY
|
99
107
|
|
100
108
|
config.generators do |generate|
|
109
|
+
generate.controller_specs false
|
101
110
|
generate.helper false
|
102
|
-
generate.
|
111
|
+
generate.javascripts false
|
103
112
|
generate.request_specs false
|
104
113
|
generate.routing_specs false
|
105
114
|
generate.stylesheets false
|
@@ -171,10 +180,13 @@ module Suspenders
|
|
171
180
|
"config.assets.version = '1.0'",
|
172
181
|
'config.assets.version = (ENV["ASSETS_VERSION"] || "1.0")'
|
173
182
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
183
|
+
config = <<-EOD
|
184
|
+
config.public_file_server.headers = {
|
185
|
+
"Cache-Control" => "public, max-age=31557600",
|
186
|
+
}
|
187
|
+
EOD
|
188
|
+
|
189
|
+
configure_environment("production", config)
|
178
190
|
end
|
179
191
|
|
180
192
|
def setup_secret_token
|
@@ -235,10 +247,6 @@ module Suspenders
|
|
235
247
|
create_file '.ruby-version', "#{Suspenders::RUBY_VERSION}\n"
|
236
248
|
end
|
237
249
|
|
238
|
-
def create_ruby_gemset_file
|
239
|
-
create_file '.ruby-gemset', "#{app_name}\n"
|
240
|
-
end
|
241
|
-
|
242
250
|
def enable_database_cleaner
|
243
251
|
copy_file 'database_cleaner_rspec.rb', 'spec/support/database_cleaner.rb'
|
244
252
|
end
|
@@ -262,6 +270,10 @@ module Suspenders
|
|
262
270
|
copy_file "spec_helper.rb", "spec/spec_helper.rb"
|
263
271
|
end
|
264
272
|
|
273
|
+
def configure_ci
|
274
|
+
template "circle.yml.erb", "circle.yml"
|
275
|
+
end
|
276
|
+
|
265
277
|
def configure_i18n_for_test_environment
|
266
278
|
copy_file "i18n.rb", "spec/support/i18n.rb"
|
267
279
|
end
|
@@ -283,23 +295,17 @@ module Suspenders
|
|
283
295
|
copy_file "capybara_webkit.rb", "spec/support/capybara_webkit.rb"
|
284
296
|
end
|
285
297
|
|
286
|
-
def
|
298
|
+
def configure_locales_and_time_zone
|
287
299
|
remove_file "config/locales/en.yml"
|
288
300
|
template "config_locales_it.yml.erb", "config/locales/it.yml"
|
289
301
|
|
290
|
-
|
291
|
-
"# config.i18n.default_locale = :de",
|
292
|
-
"config.i18n.default_locale = :it"
|
293
|
-
|
294
|
-
replace_in_file "config/application.rb",
|
295
|
-
"# config.time_zone = 'Central Time (US & Canada)'",
|
296
|
-
"config.time_zone = 'Rome'"
|
297
|
-
|
298
|
-
available_locales_config = <<-RUBY
|
302
|
+
config = <<-RUBY
|
299
303
|
config.i18n.available_locales = [:en, :it]
|
304
|
+
config.i18n.default_locale = :it
|
305
|
+
config.time_zone = 'Rome'
|
300
306
|
RUBY
|
301
307
|
|
302
|
-
inject_into_class 'config/application.rb', 'Application',
|
308
|
+
inject_into_class 'config/application.rb', 'Application', config
|
303
309
|
end
|
304
310
|
|
305
311
|
def configure_rack_timeout
|
@@ -335,8 +341,8 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
335
341
|
generate 'rspec:install'
|
336
342
|
end
|
337
343
|
|
338
|
-
def
|
339
|
-
copy_file "puma.rb", "config/puma.rb"
|
344
|
+
def replace_default_puma_configuration
|
345
|
+
copy_file "puma.rb", "config/puma.rb", force: true
|
340
346
|
end
|
341
347
|
|
342
348
|
def set_up_forego
|
@@ -345,19 +351,19 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
345
351
|
|
346
352
|
def setup_default_directories
|
347
353
|
[
|
348
|
-
'app/forms',
|
349
354
|
'app/decorators',
|
355
|
+
'app/forms',
|
350
356
|
'app/queries',
|
351
357
|
'app/services',
|
352
358
|
'app/views/pages',
|
353
|
-
'spec/
|
359
|
+
'spec/decorators',
|
360
|
+
'spec/fixtures',
|
354
361
|
'spec/forms',
|
355
362
|
'spec/helpers',
|
356
363
|
'spec/lib',
|
357
|
-
'spec/decorators',
|
358
364
|
'spec/queries',
|
365
|
+
'spec/requests',
|
359
366
|
'spec/services',
|
360
|
-
'spec/fixtures',
|
361
367
|
'spec/support/matchers',
|
362
368
|
'spec/support/mixins',
|
363
369
|
'spec/support/shared_examples'
|
@@ -389,22 +395,14 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
389
395
|
If you have previously run the `./bin/setup` script,
|
390
396
|
you can deploy to staging and production with:
|
391
397
|
|
392
|
-
|
393
|
-
|
398
|
+
% ./bin/deploy staging
|
399
|
+
% ./bin/deploy production
|
394
400
|
MARKDOWN
|
395
401
|
|
396
402
|
append_file "README.md", instructions
|
397
403
|
run "chmod a+x bin/deploy"
|
398
404
|
end
|
399
405
|
|
400
|
-
def create_github_repo(repo_name)
|
401
|
-
run "hub create #{repo_name}"
|
402
|
-
end
|
403
|
-
|
404
|
-
def setup_bundler_audit
|
405
|
-
copy_file "bundler_audit.rake", "lib/tasks/bundler_audit.rake"
|
406
|
-
end
|
407
|
-
|
408
406
|
def setup_brakeman
|
409
407
|
copy_file "brakeman.rake", "lib/tasks/brakeman.rake"
|
410
408
|
end
|
@@ -414,6 +412,10 @@ you can deploy to staging and production with:
|
|
414
412
|
copy_file "rubocop.yml", ".rubocop.yml"
|
415
413
|
end
|
416
414
|
|
415
|
+
def setup_bundler_audit
|
416
|
+
copy_file "bundler_audit.rake", "lib/tasks/bundler_audit.rake"
|
417
|
+
end
|
418
|
+
|
417
419
|
def setup_spring
|
418
420
|
bundle_command "exec spring binstub --all"
|
419
421
|
end
|
@@ -485,7 +487,7 @@ end
|
|
485
487
|
task default: :rubocop
|
486
488
|
task default: :spec
|
487
489
|
task default: "brakeman:check"
|
488
|
-
task default: "
|
490
|
+
task default: "bundle:audit"
|
489
491
|
EOS
|
490
492
|
end
|
491
493
|
end
|
@@ -14,18 +14,6 @@ module Suspenders
|
|
14
14
|
class_option :heroku_flags, type: :string, default: "--region eu",
|
15
15
|
desc: "Set extra Heroku flags"
|
16
16
|
|
17
|
-
class_option :github, type: :string, aliases: "-G", default: nil,
|
18
|
-
desc: "Create Github repository and add remote origin pointed to repo"
|
19
|
-
|
20
|
-
class_option :skip_test_unit, type: :boolean, aliases: "-T", default: true,
|
21
|
-
desc: "Skip Test::Unit files"
|
22
|
-
|
23
|
-
class_option :skip_turbolinks, type: :boolean, default: true,
|
24
|
-
desc: "Skip turbolinks gem"
|
25
|
-
|
26
|
-
class_option :skip_bundle, type: :boolean, aliases: "-B", default: true,
|
27
|
-
desc: "Don't run bundle install"
|
28
|
-
|
29
17
|
class_option :version, type: :boolean, aliases: "-v", group: :suspenders,
|
30
18
|
desc: "Show Suspenders version number and quit"
|
31
19
|
|
@@ -35,6 +23,9 @@ module Suspenders
|
|
35
23
|
class_option :path, type: :string, default: nil,
|
36
24
|
desc: "Path to the gem"
|
37
25
|
|
26
|
+
class_option :skip_test, type: :boolean, default: true,
|
27
|
+
desc: "Skip Test Unit"
|
28
|
+
|
38
29
|
def finish_template
|
39
30
|
invoke :suspenders_customization
|
40
31
|
super
|
@@ -48,25 +39,22 @@ module Suspenders
|
|
48
39
|
invoke :setup_secret_token
|
49
40
|
invoke :create_suspenders_views
|
50
41
|
invoke :configure_app
|
51
|
-
invoke :setup_stylesheets
|
52
42
|
invoke :copy_miscellaneous_files
|
53
43
|
invoke :customize_error_pages
|
54
44
|
invoke :remove_config_comment_lines
|
55
45
|
invoke :remove_routes_comment_lines
|
56
46
|
invoke :setup_dotfiles
|
57
|
-
invoke :setup_git
|
58
47
|
invoke :setup_database
|
59
48
|
invoke :create_local_heroku_setup
|
60
49
|
invoke :create_heroku_apps
|
61
|
-
invoke :create_github_repo
|
62
50
|
invoke :setup_spring
|
63
51
|
invoke :create_binstubs
|
64
52
|
invoke :generate_default
|
53
|
+
invoke :setup_git
|
65
54
|
invoke :outro
|
66
55
|
end
|
67
56
|
|
68
57
|
def customize_gemfile
|
69
|
-
build :create_ruby_gemset_file
|
70
58
|
build :replace_gemfile, options[:path]
|
71
59
|
build :set_ruby_to_version_being_used
|
72
60
|
bundle_command 'install'
|
@@ -87,7 +75,8 @@ module Suspenders
|
|
87
75
|
say 'Setting up the development environment'
|
88
76
|
build :raise_on_missing_assets_in_test
|
89
77
|
build :raise_on_delivery_errors
|
90
|
-
build :
|
78
|
+
build :remove_turbolinks
|
79
|
+
build :set_test_delivery_method
|
91
80
|
build :add_bullet_gem_configuration
|
92
81
|
build :raise_on_unpermitted_parameters
|
93
82
|
build :provide_setup_script
|
@@ -111,6 +100,7 @@ module Suspenders
|
|
111
100
|
build :enable_database_cleaner
|
112
101
|
build :provide_shoulda_matchers_config
|
113
102
|
build :configure_spec_support_features
|
103
|
+
build :configure_ci
|
114
104
|
build :configure_i18n_for_test_environment
|
115
105
|
build :configure_action_mailer_in_specs
|
116
106
|
build :set_up_faker
|
@@ -143,21 +133,16 @@ module Suspenders
|
|
143
133
|
def configure_app
|
144
134
|
say 'Configuring app'
|
145
135
|
build :configure_action_mailer
|
146
|
-
build :
|
136
|
+
build :configure_locales_and_time_zone
|
147
137
|
build :configure_active_job
|
148
138
|
build :configure_slim
|
149
139
|
build :configure_time_formats
|
150
140
|
build :setup_default_rake_task
|
151
|
-
build :
|
141
|
+
build :replace_default_puma_configuration
|
152
142
|
build :set_up_forego
|
153
143
|
build :setup_rack_mini_profiler
|
154
144
|
end
|
155
145
|
|
156
|
-
def setup_stylesheets
|
157
|
-
say 'Set up stylesheets'
|
158
|
-
build :setup_stylesheets
|
159
|
-
end
|
160
|
-
|
161
146
|
def setup_git
|
162
147
|
if !options[:skip_git]
|
163
148
|
say "Initializing git"
|
@@ -177,22 +162,15 @@ module Suspenders
|
|
177
162
|
if options[:heroku]
|
178
163
|
say "Creating Heroku apps"
|
179
164
|
build :create_heroku_apps, options[:heroku_flags]
|
180
|
-
build :set_heroku_serve_static_files
|
181
165
|
build :set_heroku_remotes
|
182
166
|
build :set_heroku_rails_secrets
|
183
167
|
build :set_heroku_application_host
|
168
|
+
build :set_heroku_backup_schedule
|
184
169
|
build :create_heroku_pipeline
|
185
170
|
build :configure_automatic_deployment
|
186
171
|
end
|
187
172
|
end
|
188
173
|
|
189
|
-
def create_github_repo
|
190
|
-
if !options[:skip_git] && options[:github]
|
191
|
-
say 'Creating Github repo'
|
192
|
-
build :create_github_repo, options[:github]
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
174
|
def setup_dotfiles
|
197
175
|
build :copy_dotfiles
|
198
176
|
end
|
@@ -235,11 +213,8 @@ module Suspenders
|
|
235
213
|
|
236
214
|
def generate_default
|
237
215
|
run("spring stop")
|
238
|
-
|
239
216
|
generate("suspenders:static")
|
240
217
|
generate("suspenders:stylesheet_base")
|
241
|
-
|
242
|
-
bundle_command "install"
|
243
218
|
end
|
244
219
|
|
245
220
|
def outro
|
data/lib/suspenders/version.rb
CHANGED
data/lib/welaika-suspenders.rb
CHANGED
@@ -1 +1,7 @@
|
|
1
|
-
require 'suspenders'
|
1
|
+
require 'suspenders/version'
|
2
|
+
require 'suspenders/generators/app_generator'
|
3
|
+
require 'suspenders/generators/static_generator'
|
4
|
+
require 'suspenders/generators/stylesheet_base_generator'
|
5
|
+
require 'suspenders/actions'
|
6
|
+
require "suspenders/adapters/heroku"
|
7
|
+
require 'suspenders/app_builder'
|
@@ -30,6 +30,16 @@ module Suspenders
|
|
30
30
|
)
|
31
31
|
end
|
32
32
|
|
33
|
+
it "sets the heroku backup schedule" do
|
34
|
+
app_builder = double(app_name: app_name)
|
35
|
+
allow(app_builder).to receive(:run)
|
36
|
+
|
37
|
+
Heroku.new(app_builder).set_heroku_backup_schedule
|
38
|
+
|
39
|
+
expect(app_builder).to have_backup_schedule("staging")
|
40
|
+
expect(app_builder).to have_backup_schedule("production")
|
41
|
+
end
|
42
|
+
|
33
43
|
it "sets the application host" do
|
34
44
|
app_builder = double(app_name: app_name)
|
35
45
|
allow(app_builder).to receive(:run)
|
@@ -49,6 +59,11 @@ module Suspenders
|
|
49
59
|
SuspendersTestHelpers::APP_NAME
|
50
60
|
end
|
51
61
|
|
62
|
+
def have_backup_schedule(remote_name)
|
63
|
+
have_received(:run).
|
64
|
+
with(/pg:backups:schedule DATABASE_URL --at '10:00 UTC' --remote #{remote_name}/)
|
65
|
+
end
|
66
|
+
|
52
67
|
def have_configured_var(remote_name, var)
|
53
68
|
have_received(:run).with(/config:add #{var}=.+ --remote #{remote_name}/)
|
54
69
|
end
|
@@ -31,9 +31,9 @@ RSpec.describe "Heroku" do
|
|
31
31
|
bin_setup_path = "#{project_path}/bin/setup"
|
32
32
|
bin_setup = IO.read(bin_setup_path)
|
33
33
|
|
34
|
-
expect(bin_setup).to
|
35
|
-
expect(bin_setup).to
|
36
|
-
expect(bin_setup).to
|
34
|
+
expect(bin_setup).to match(/^if heroku join --app #{app_name}-production/)
|
35
|
+
expect(bin_setup).to match(/^if heroku join --app #{app_name}-staging/)
|
36
|
+
expect(bin_setup).to match(/^git config heroku.remote staging/)
|
37
37
|
expect(File.stat(bin_setup_path)).to be_executable
|
38
38
|
|
39
39
|
readme = IO.read("#{project_path}/README.md")
|
@@ -29,28 +29,35 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
it "includes the bundle:audit task" do
|
33
|
+
Dir.chdir(project_path) do
|
34
|
+
Bundler.with_clean_env do
|
35
|
+
expect(`rake -T`).to include('rake bundle:audit')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
32
40
|
it "creates .ruby-version from Suspenders .ruby-version" do
|
33
41
|
ruby_version_file = IO.read("#{project_path}/.ruby-version")
|
34
42
|
|
35
43
|
expect(ruby_version_file).to eq "#{RUBY_VERSION}\n"
|
36
44
|
end
|
37
45
|
|
38
|
-
it 'creates .ruby-gemset from app name' do
|
39
|
-
ruby_gemset_file = IO.read("#{project_path}/.ruby-gemset")
|
40
|
-
|
41
|
-
expect(ruby_gemset_file).to eq("#{app_name}\n")
|
42
|
-
end
|
43
|
-
|
44
46
|
it "copies dotfiles" do
|
45
47
|
%w[.ctags .env].each do |dotfile|
|
46
48
|
expect(File).to exist("#{project_path}/#{dotfile}")
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
52
|
+
it "doesn't generate test directory" do
|
53
|
+
expect(File).not_to exist("#{project_path}/test")
|
54
|
+
end
|
55
|
+
|
50
56
|
it "loads secret_key_base from env" do
|
51
57
|
secrets_file = IO.read("#{project_path}/config/secrets.yml")
|
52
58
|
|
53
|
-
expect(secrets_file).
|
59
|
+
expect(secrets_file).
|
60
|
+
to match(/secret_key_base: <%= ENV\["SECRET_KEY_BASE"\] %>/)
|
54
61
|
end
|
55
62
|
|
56
63
|
it "adds bin/setup file" do
|
@@ -124,22 +131,17 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
124
131
|
it "adds explicit quiet_assets configuration" do
|
125
132
|
result = IO.read("#{project_path}/config/application.rb")
|
126
133
|
|
127
|
-
expect(result).to match(
|
128
|
-
/^ +config.quiet_assets = true$/
|
129
|
-
)
|
134
|
+
expect(result).to match(/^ +config.assets.quiet = true$/)
|
130
135
|
end
|
131
136
|
|
132
|
-
it "configures
|
133
|
-
|
134
|
-
|
135
|
-
/config.static_cache_control = "public, max-age=.+"/,
|
137
|
+
it "configures public_file_server.headers in production" do
|
138
|
+
expect(production_config).to match(
|
139
|
+
/^ +config.public_file_server.headers = {\n +"Cache-Control" => "public,/,
|
136
140
|
)
|
137
141
|
end
|
138
142
|
|
139
143
|
it "raises on missing translations in development and test" do
|
140
|
-
|
141
|
-
environment_file =
|
142
|
-
IO.read("#{project_path}/config/environments/#{environment}.rb")
|
144
|
+
[development_config, test_config].each do |environment_file|
|
143
145
|
expect(environment_file).to match(
|
144
146
|
/^ +config.action_view.raise_on_missing_translations = true$/
|
145
147
|
)
|
@@ -168,9 +170,8 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
168
170
|
end
|
169
171
|
|
170
172
|
it "uses APPLICATION_HOST, not HOST in the production config" do
|
171
|
-
|
172
|
-
expect(
|
173
|
-
expect(prod_env_file).not_to match(/"HOST"/)
|
173
|
+
expect(production_config).to match(/"APPLICATION_HOST"/)
|
174
|
+
expect(production_config).not_to match(/"HOST"/)
|
174
175
|
end
|
175
176
|
|
176
177
|
it "configures email interceptor in smtp config" do
|
@@ -187,7 +188,6 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
187
188
|
|
188
189
|
it "configs active job queue adapter" do
|
189
190
|
application_config = IO.read("#{project_path}/config/application.rb")
|
190
|
-
test_config = IO.read("#{project_path}/config/environments/test.rb")
|
191
191
|
|
192
192
|
expect(application_config).to match(
|
193
193
|
/^ +config.active_job.queue_adapter = :delayed_job$/
|
@@ -198,16 +198,12 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
198
198
|
end
|
199
199
|
|
200
200
|
it "configs bullet gem in development" do
|
201
|
-
|
202
|
-
|
203
|
-
expect(
|
204
|
-
expect(test_config).to match /^ +Bullet.bullet_logger = true$/
|
205
|
-
expect(test_config).to match /^ +Bullet.rails_logger = true$/
|
201
|
+
expect(development_config).to match /^ +Bullet.enable = true$/
|
202
|
+
expect(development_config).to match /^ +Bullet.bullet_logger = true$/
|
203
|
+
expect(development_config).to match /^ +Bullet.rails_logger = true$/
|
206
204
|
end
|
207
205
|
|
208
206
|
it "configs missing assets to raise in test" do
|
209
|
-
test_config = IO.read("#{project_path}/config/environments/test.rb")
|
210
|
-
|
211
207
|
expect(test_config).to match(
|
212
208
|
/^ +config.assets.raise_runtime_errors = true$/,
|
213
209
|
)
|
@@ -240,9 +236,9 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
240
236
|
config_files = [
|
241
237
|
IO.read("#{project_path}/config/application.rb"),
|
242
238
|
IO.read("#{project_path}/config/environment.rb"),
|
243
|
-
|
244
|
-
|
245
|
-
|
239
|
+
development_config,
|
240
|
+
test_config,
|
241
|
+
production_config,
|
246
242
|
]
|
247
243
|
|
248
244
|
config_files.each do |file|
|
@@ -255,12 +251,12 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
255
251
|
bin_setup_path = "#{project_path}/bin/setup_review_app"
|
256
252
|
bin_setup = IO.read(bin_setup_path)
|
257
253
|
|
258
|
-
expect(bin_setup).to include("
|
259
|
-
|
260
|
-
expect(bin_setup).to include("heroku
|
261
|
-
|
262
|
-
expect(bin_setup).to include("heroku restart "
|
263
|
-
|
254
|
+
expect(bin_setup).to include("PARENT_APP_NAME=#{app_name.dasherize}-staging")
|
255
|
+
expect(bin_setup).to include("APP_NAME=#{app_name.dasherize}-staging-pr-$1")
|
256
|
+
expect(bin_setup).to include("heroku run rake db:migrate --exit-code --app $APP_NAME")
|
257
|
+
expect(bin_setup).to include("heroku ps:scale worker=1 --app $APP_NAME")
|
258
|
+
expect(bin_setup).to include("heroku restart --app $APP_NAME")
|
259
|
+
|
264
260
|
expect(File.stat(bin_setup_path)).to be_executable
|
265
261
|
end
|
266
262
|
|
@@ -278,12 +274,6 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
278
274
|
expect(app_json_file).to match(/"name":"#{app_name.dasherize}"/)
|
279
275
|
end
|
280
276
|
|
281
|
-
it "sets up heroku specific gems" do
|
282
|
-
gemfile_file = IO.read("#{project_path}/Gemfile")
|
283
|
-
|
284
|
-
expect(gemfile_file).to include %{gem "rails_stdout_logging"}
|
285
|
-
end
|
286
|
-
|
287
277
|
def app_name
|
288
278
|
SuspendersTestHelpers::APP_NAME
|
289
279
|
end
|
@@ -293,15 +283,23 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
293
283
|
expect(gemfile).to match(/high_voltage/)
|
294
284
|
end
|
295
285
|
|
296
|
-
it "
|
297
|
-
|
286
|
+
it "doesn't use turbolinks" do
|
287
|
+
app_js = read_project_file(%w(app assets javascripts application.js))
|
288
|
+
expect(app_js).not_to match(/turbolinks/)
|
289
|
+
end
|
290
|
+
|
291
|
+
def development_config
|
292
|
+
@_development_config ||=
|
293
|
+
read_project_file %w(config environments development.rb)
|
294
|
+
end
|
298
295
|
|
299
|
-
|
296
|
+
def test_config
|
297
|
+
@_test_config ||= read_project_file %w(config environments test.rb)
|
300
298
|
end
|
301
299
|
|
302
|
-
|
303
|
-
|
304
|
-
|
300
|
+
def production_config
|
301
|
+
@_production_config ||=
|
302
|
+
read_project_file %w(config environments production.rb)
|
305
303
|
end
|
306
304
|
|
307
305
|
def read_project_file(path)
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require "pry-byebug"
|
1
|
+
require 'bundler/setup'
|
3
2
|
|
4
3
|
Bundler.require(:default, :test)
|
5
4
|
|
@@ -14,11 +13,4 @@ RSpec.configure do |config|
|
|
14
13
|
add_fakes_to_path
|
15
14
|
create_tmp_directory
|
16
15
|
end
|
17
|
-
|
18
|
-
config.before(:each) do
|
19
|
-
FakeGithub.clear!
|
20
|
-
end
|
21
|
-
|
22
|
-
config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
|
23
|
-
config.order = :random
|
24
16
|
end
|
data/spec/support/suspenders.rb
CHANGED
@@ -17,6 +17,12 @@ module SuspendersTestHelpers
|
|
17
17
|
`
|
18
18
|
#{suspenders_bin} #{APP_NAME} #{arguments}
|
19
19
|
`
|
20
|
+
Dir.chdir(APP_NAME) do
|
21
|
+
with_env("HOME", tmp_path) do
|
22
|
+
`git add .`
|
23
|
+
`git commit -m 'Initial commit'`
|
24
|
+
end
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
22
28
|
end
|
@@ -80,4 +86,14 @@ module SuspendersTestHelpers
|
|
80
86
|
def root_path
|
81
87
|
File.expand_path('../../../', __FILE__)
|
82
88
|
end
|
89
|
+
|
90
|
+
def with_env(name, new_value)
|
91
|
+
prior = ENV[name]
|
92
|
+
ENV[name] = new_value.to_s
|
93
|
+
|
94
|
+
yield
|
95
|
+
|
96
|
+
ensure
|
97
|
+
ENV[name] = prior
|
98
|
+
end
|
83
99
|
end
|
data/suspenders.gemspec
CHANGED
@@ -25,9 +25,8 @@ weLaika's fork of the famous thoughbot suspenders gem.
|
|
25
25
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
26
26
|
s.version = Suspenders::VERSION
|
27
27
|
|
28
|
-
s.add_dependency 'bundler', '
|
28
|
+
s.add_dependency 'bundler', '>= 1.8.4'
|
29
29
|
s.add_dependency 'rails', Suspenders::RAILS_VERSION
|
30
30
|
|
31
|
-
s.add_development_dependency 'rspec', '~> 3.
|
32
|
-
s.add_development_dependency 'pry-byebug'
|
31
|
+
s.add_development_dependency 'rspec', '~> 3.6'
|
33
32
|
end
|
data/templates/Gemfile.erb
CHANGED
@@ -1,18 +1,23 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
+
git_source(:github) do |repo_name|
|
4
|
+
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
5
|
+
"https://github.com/#{repo_name}.git"
|
6
|
+
end
|
7
|
+
|
3
8
|
ruby "<%= Suspenders::RUBY_VERSION %>"
|
4
9
|
|
10
|
+
gem "bundler", ">= 1.8.4"
|
11
|
+
|
5
12
|
gem "airbrake"
|
6
13
|
gem "autoprefixer-rails"
|
7
|
-
gem "coffee-rails", "~> 4.
|
14
|
+
gem "coffee-rails", "~> 4.2"
|
8
15
|
gem "delayed_job_active_record"
|
9
|
-
gem "draper"
|
10
16
|
gem "email_validator"
|
11
17
|
gem "flutie"
|
12
18
|
gem "jquery-rails"
|
13
|
-
gem "normalize-rails", "~> 3.0.0"
|
14
19
|
gem "pg"
|
15
|
-
gem "puma"
|
20
|
+
gem "puma", "~> 3.0"
|
16
21
|
gem "rack-canonical-host"
|
17
22
|
gem "rails", "<%= Suspenders::RAILS_VERSION %>"
|
18
23
|
gem "rails-i18n"
|
@@ -21,16 +26,21 @@ gem "sass-rails", "~> 5.0"
|
|
21
26
|
gem "simple_form"
|
22
27
|
gem "skylight"
|
23
28
|
gem "slim-rails"
|
24
|
-
gem "welaika-suspenders", ">= <%= Suspenders::VERSION %>"
|
25
29
|
gem "title"
|
26
|
-
gem "uglifier"
|
30
|
+
gem "uglifier", ">= 1.3.0"
|
31
|
+
gem "welaika-suspenders"
|
32
|
+
|
33
|
+
source "https://rails-assets.org" do
|
34
|
+
gem "rails-assets-normalize-css"
|
35
|
+
end
|
27
36
|
|
28
37
|
group :development do
|
29
38
|
gem "letter_opener"
|
30
|
-
gem "
|
39
|
+
gem "listen", "~> 3.0.5"
|
31
40
|
gem "spring"
|
32
41
|
gem "spring-commands-rspec"
|
33
|
-
gem "
|
42
|
+
gem "spring-watcher-listen", "~> 2.0.0"
|
43
|
+
gem "web-console", ">= 3.3.0"
|
34
44
|
end
|
35
45
|
|
36
46
|
group :development, :test do
|
@@ -41,10 +51,9 @@ group :development, :test do
|
|
41
51
|
gem "dotenv-rails"
|
42
52
|
gem "factory_girl_rails"
|
43
53
|
gem "faker"
|
44
|
-
gem "priscilla"
|
45
54
|
gem "pry-byebug"
|
46
55
|
gem "pry-rails"
|
47
|
-
gem "rspec-rails", "~> 3.
|
56
|
+
gem "rspec-rails", "~> 3.5"
|
48
57
|
gem "rubocop", require: false
|
49
58
|
end
|
50
59
|
|
@@ -55,7 +64,6 @@ end
|
|
55
64
|
group :test do
|
56
65
|
gem "capybara-webkit"
|
57
66
|
gem "database_cleaner"
|
58
|
-
gem "formulaic"
|
59
67
|
gem "launchy"
|
60
68
|
gem "shoulda-matchers"
|
61
69
|
gem "simplecov", require: false
|
@@ -66,5 +74,4 @@ end
|
|
66
74
|
|
67
75
|
group :staging, :production do
|
68
76
|
gem "rack-timeout"
|
69
|
-
gem "rails_stdout_logging"
|
70
77
|
end
|
data/templates/application.sass
CHANGED
@@ -9,11 +9,14 @@ if [ -z "$1" ]; then
|
|
9
9
|
exit 64
|
10
10
|
fi
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
heroku
|
18
|
-
|
19
|
-
heroku
|
12
|
+
PARENT_APP_NAME=<%= app_name.dasherize %>-staging
|
13
|
+
APP_NAME=<%= app_name.dasherize %>-staging-pr-$1
|
14
|
+
|
15
|
+
heroku pg:backups:capture --app $PARENT_APP_NAME
|
16
|
+
|
17
|
+
URL=`heroku pg:backups public-url --app $PARENT_APP_NAME`
|
18
|
+
|
19
|
+
heroku pg:backups restore $URL DATABASE_URL --confirm $APP_NAME --app $APP_NAME
|
20
|
+
heroku run rake db:migrate --exit-code --app $APP_NAME
|
21
|
+
heroku ps:scale worker=1 --app $APP_NAME
|
22
|
+
heroku restart --app $APP_NAME
|
@@ -1,12 +1,4 @@
|
|
1
1
|
if Rails.env.development? || Rails.env.test?
|
2
|
-
require "bundler/audit/
|
3
|
-
|
4
|
-
namespace :bundler do
|
5
|
-
desc "Updates the ruby-advisory-db and runs audit"
|
6
|
-
task :audit do
|
7
|
-
%w(update check).each do |command|
|
8
|
-
Bundler::Audit::CLI.start [command]
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
2
|
+
require "bundler/audit/task"
|
3
|
+
Bundler::Audit::Task.new
|
12
4
|
end
|
@@ -9,16 +9,10 @@ module CapybaraHelper
|
|
9
9
|
def screenshot!
|
10
10
|
save_and_open_screenshot
|
11
11
|
end
|
12
|
-
|
13
|
-
def blur!
|
14
|
-
page.find('body').click
|
15
|
-
end
|
16
12
|
end
|
17
13
|
|
18
14
|
Capybara::Webkit.configure do |config|
|
19
|
-
config.allow_url(
|
20
|
-
%w(fonts.googleapis.com)
|
21
|
-
)
|
15
|
+
config.allow_url(%w[fonts.googleapis.com])
|
22
16
|
end
|
23
17
|
|
24
18
|
RSpec.configure do |config|
|
@@ -1,21 +1,28 @@
|
|
1
1
|
RSpec.configure do |config|
|
2
|
+
config.use_transactional_fixtures = false
|
3
|
+
|
2
4
|
config.before(:suite) do
|
3
|
-
DatabaseCleaner.clean_with(:
|
5
|
+
DatabaseCleaner.clean_with(:truncation)
|
4
6
|
end
|
5
7
|
|
6
8
|
config.before(:each) do
|
7
9
|
DatabaseCleaner.strategy = :transaction
|
8
10
|
end
|
9
11
|
|
10
|
-
config.before(:each,
|
11
|
-
|
12
|
+
config.before(:each, type: :feature) do
|
13
|
+
driver_shares_db_connection_with_specs =
|
14
|
+
Capybara.current_driver == :rack_test
|
15
|
+
|
16
|
+
unless driver_shares_db_connection_with_specs
|
17
|
+
DatabaseCleaner.strategy = :truncation
|
18
|
+
end
|
12
19
|
end
|
13
20
|
|
14
21
|
config.before(:each) do
|
15
22
|
DatabaseCleaner.start
|
16
23
|
end
|
17
24
|
|
18
|
-
config.
|
25
|
+
config.append_after(:each) do
|
19
26
|
DatabaseCleaner.clean
|
20
27
|
end
|
21
28
|
end
|
data/templates/rails_helper.rb
CHANGED
@@ -5,18 +5,11 @@ abort("DATABASE_URL environment variable is set") if ENV["DATABASE_URL"]
|
|
5
5
|
|
6
6
|
require "rspec/rails"
|
7
7
|
|
8
|
-
Dir[Rails.root.join("spec
|
9
|
-
|
10
|
-
module Features
|
11
|
-
# Extend this module in spec/support/features/*.rb
|
12
|
-
include Formulaic::Dsl
|
13
|
-
end
|
8
|
+
Dir[Rails.root.join("spec", "support", "**", "*.rb")].sort.each { |file| require file }
|
14
9
|
|
15
10
|
RSpec.configure do |config|
|
16
|
-
config.include Features, type: :feature
|
17
11
|
config.infer_base_class_for_anonymous_controllers = false
|
18
12
|
config.infer_spec_type_from_file_location!
|
19
|
-
config.use_transactional_fixtures = false
|
20
13
|
|
21
14
|
config.filter_rails_from_backtrace!
|
22
15
|
# arbitrary gems may also be filtered via:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: welaika-suspenders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
@@ -9,64 +9,50 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 1.8.4
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 1.8.4
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rails
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 5.0.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 5.0.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '3.
|
48
|
+
version: '3.6'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '3.
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: pry-byebug
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
55
|
+
version: '3.6'
|
70
56
|
description: 'weLaika''s fork of the famous thoughbot suspenders gem.
|
71
57
|
|
72
58
|
'
|
@@ -80,7 +66,6 @@ extra_rdoc_files:
|
|
80
66
|
files:
|
81
67
|
- ".gitignore"
|
82
68
|
- ".rspec"
|
83
|
-
- ".ruby-gemset"
|
84
69
|
- ".ruby-version"
|
85
70
|
- ".travis.yml"
|
86
71
|
- CONTRIBUTING.md
|
@@ -106,13 +91,10 @@ files:
|
|
106
91
|
- lib/welaika-suspenders.rb
|
107
92
|
- spec/adapters/heroku_spec.rb
|
108
93
|
- spec/fakes/bin/heroku
|
109
|
-
- spec/fakes/bin/hub
|
110
94
|
- spec/features/cli_help_spec.rb
|
111
|
-
- spec/features/github_spec.rb
|
112
95
|
- spec/features/heroku_spec.rb
|
113
96
|
- spec/features/new_project_spec.rb
|
114
97
|
- spec/spec_helper.rb
|
115
|
-
- spec/support/fake_github.rb
|
116
98
|
- spec/support/fake_heroku.rb
|
117
99
|
- spec/support/suspenders.rb
|
118
100
|
- suspenders.gemspec
|
@@ -132,6 +114,7 @@ files:
|
|
132
114
|
- templates/browserslist
|
133
115
|
- templates/bundler_audit.rake
|
134
116
|
- templates/capybara_webkit.rb
|
117
|
+
- templates/circle.yml.erb
|
135
118
|
- templates/config_locales_it.yml.erb
|
136
119
|
- templates/database_cleaner_rspec.rb
|
137
120
|
- templates/dev.rake
|
@@ -172,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
155
|
requirements:
|
173
156
|
- - ">="
|
174
157
|
- !ruby/object:Gem::Version
|
175
|
-
version: 2.
|
158
|
+
version: 2.4.0
|
176
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
160
|
requirements:
|
178
161
|
- - ">="
|
@@ -180,19 +163,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
163
|
version: '0'
|
181
164
|
requirements: []
|
182
165
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.6.
|
166
|
+
rubygems_version: 2.6.11
|
184
167
|
signing_key:
|
185
168
|
specification_version: 4
|
186
169
|
summary: Generate a Rails app using thoughtbot's best practices.
|
187
170
|
test_files:
|
188
171
|
- spec/adapters/heroku_spec.rb
|
189
172
|
- spec/fakes/bin/heroku
|
190
|
-
- spec/fakes/bin/hub
|
191
173
|
- spec/features/cli_help_spec.rb
|
192
|
-
- spec/features/github_spec.rb
|
193
174
|
- spec/features/heroku_spec.rb
|
194
175
|
- spec/features/new_project_spec.rb
|
195
176
|
- spec/spec_helper.rb
|
196
|
-
- spec/support/fake_github.rb
|
197
177
|
- spec/support/fake_heroku.rb
|
198
178
|
- spec/support/suspenders.rb
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
welaika-suspenders
|
data/spec/fakes/bin/hub
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe "GitHub" do
|
4
|
-
before do
|
5
|
-
drop_dummy_database
|
6
|
-
remove_project_directory
|
7
|
-
end
|
8
|
-
|
9
|
-
it "suspends a project with --github option" do
|
10
|
-
repo_name = 'test'
|
11
|
-
run_suspenders("--github=#{repo_name}")
|
12
|
-
setup_app_dependencies
|
13
|
-
|
14
|
-
expect(FakeGithub).to have_created_repo(repo_name)
|
15
|
-
end
|
16
|
-
end
|
data/spec/support/fake_github.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
class FakeGithub
|
2
|
-
RECORDER = File.expand_path(File.join('..', '..', 'tmp', 'hub_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.write @args.join(' ')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.clear!
|
15
|
-
FileUtils.rm_rf RECORDER
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.has_created_repo?(repo_name)
|
19
|
-
File.read(RECORDER) == "create #{repo_name}"
|
20
|
-
end
|
21
|
-
end
|