welaika-suspenders 2.11.0 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +65 -69
- data/NEWS.md +8 -1
- data/README.md +9 -2
- data/lib/suspenders/app_builder.rb +38 -1
- data/lib/suspenders/generators/app_generator.rb +21 -0
- data/lib/suspenders/version.rb +2 -2
- data/spec/features/github_spec.rb +8 -3
- data/spec/features/heroku_spec.rb +8 -3
- data/spec/features/new_project_spec.rb +56 -58
- data/spec/spec_helper.rb +0 -4
- data/suspenders.gemspec +1 -2
- data/templates/Gemfile.erb +3 -1
- data/templates/application.css.sass +1 -0
- data/templates/browserslist +1 -1
- data/templates/capybara_rspec.rb.erb +23 -0
- data/templates/fixtures_helper_rspec.rb +9 -0
- data/templates/queries_helper_rspec.rb +20 -0
- data/templates/rails_helper.rb +0 -1
- data/templates/sample.env +1 -0
- data/templates/spec_helper.rb +1 -0
- metadata +12 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebc1d7d5851153cb0c16d9e902e2c1391782082d
|
4
|
+
data.tar.gz: f9afc62258bf8dfe56221aca5b9e0595a465e98f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6672881f0c641fba3af0d7b9af115b3e8fbea2329d0a7656d66d7cb16ca3978f73ab53038501e583c12ec645ea9858b8e14a722c294fc3f31c8856e13d8b0c75
|
7
|
+
data.tar.gz: 6076fc65b6ed635fce682b9265052ebc8fd2881249f93bc1937cbdbbc218526d945fdc53ca4803d0212efab4c99e08e268b93a81b216e85a4442b6731b8223a4
|
data/Gemfile.lock
CHANGED
@@ -1,44 +1,44 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
welaika-suspenders (2.
|
4
|
+
welaika-suspenders (2.12.0)
|
5
5
|
bitters (~> 1.0.0)
|
6
6
|
bundler (~> 1.3)
|
7
|
-
rails (
|
7
|
+
rails (~> 4.2.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionmailer (4.2.
|
13
|
-
actionpack (= 4.2.
|
14
|
-
actionview (= 4.2.
|
15
|
-
activejob (= 4.2.
|
12
|
+
actionmailer (4.2.3)
|
13
|
+
actionpack (= 4.2.3)
|
14
|
+
actionview (= 4.2.3)
|
15
|
+
activejob (= 4.2.3)
|
16
16
|
mail (~> 2.5, >= 2.5.4)
|
17
17
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
18
|
-
actionpack (4.2.
|
19
|
-
actionview (= 4.2.
|
20
|
-
activesupport (= 4.2.
|
18
|
+
actionpack (4.2.3)
|
19
|
+
actionview (= 4.2.3)
|
20
|
+
activesupport (= 4.2.3)
|
21
21
|
rack (~> 1.6)
|
22
22
|
rack-test (~> 0.6.2)
|
23
23
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
24
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
25
|
-
actionview (4.2.
|
26
|
-
activesupport (= 4.2.
|
24
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
25
|
+
actionview (4.2.3)
|
26
|
+
activesupport (= 4.2.3)
|
27
27
|
builder (~> 3.1)
|
28
28
|
erubis (~> 2.7.0)
|
29
29
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
30
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
31
|
-
activejob (4.2.
|
32
|
-
activesupport (= 4.2.
|
30
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
31
|
+
activejob (4.2.3)
|
32
|
+
activesupport (= 4.2.3)
|
33
33
|
globalid (>= 0.3.0)
|
34
|
-
activemodel (4.2.
|
35
|
-
activesupport (= 4.2.
|
34
|
+
activemodel (4.2.3)
|
35
|
+
activesupport (= 4.2.3)
|
36
36
|
builder (~> 3.1)
|
37
|
-
activerecord (4.2.
|
38
|
-
activemodel (= 4.2.
|
39
|
-
activesupport (= 4.2.
|
37
|
+
activerecord (4.2.3)
|
38
|
+
activemodel (= 4.2.3)
|
39
|
+
activesupport (= 4.2.3)
|
40
40
|
arel (~> 6.0)
|
41
|
-
activesupport (4.2.
|
41
|
+
activesupport (4.2.3)
|
42
42
|
i18n (~> 0.7)
|
43
43
|
json (~> 1.7, >= 1.7.7)
|
44
44
|
minitest (~> 5.1)
|
@@ -53,55 +53,46 @@ GEM
|
|
53
53
|
sass (~> 3.4)
|
54
54
|
thor
|
55
55
|
builder (3.2.2)
|
56
|
-
byebug (
|
57
|
-
columnize (
|
58
|
-
debugger-linecache (~> 1.2)
|
59
|
-
slop (~> 3.6)
|
60
|
-
capybara (2.3.0)
|
61
|
-
mime-types (>= 1.16)
|
62
|
-
nokogiri (>= 1.3.3)
|
63
|
-
rack (>= 1.0.0)
|
64
|
-
rack-test (>= 0.5.4)
|
65
|
-
xpath (~> 2.0)
|
56
|
+
byebug (4.0.5)
|
57
|
+
columnize (= 0.9.0)
|
66
58
|
coderay (1.1.0)
|
67
59
|
columnize (0.9.0)
|
68
|
-
debugger-linecache (1.2.0)
|
69
60
|
diff-lcs (1.2.5)
|
70
61
|
erubis (2.7.0)
|
71
62
|
globalid (0.3.5)
|
72
63
|
activesupport (>= 4.1.0)
|
73
64
|
i18n (0.7.0)
|
74
|
-
json (1.8.
|
65
|
+
json (1.8.3)
|
75
66
|
loofah (2.0.2)
|
76
67
|
nokogiri (>= 1.5.9)
|
77
68
|
mail (2.6.3)
|
78
69
|
mime-types (>= 1.16, < 3)
|
79
70
|
method_source (0.8.2)
|
80
|
-
mime-types (2.
|
81
|
-
mini_portile (0.6.
|
82
|
-
minitest (5.
|
83
|
-
nokogiri (1.6.2
|
84
|
-
mini_portile (
|
71
|
+
mime-types (2.6.1)
|
72
|
+
mini_portile (0.6.2)
|
73
|
+
minitest (5.7.0)
|
74
|
+
nokogiri (1.6.6.2)
|
75
|
+
mini_portile (~> 0.6.0)
|
85
76
|
pry (0.10.1)
|
86
77
|
coderay (~> 1.1.0)
|
87
78
|
method_source (~> 0.8.1)
|
88
79
|
slop (~> 3.4)
|
89
|
-
pry-byebug (3.0
|
90
|
-
byebug (~>
|
80
|
+
pry-byebug (3.1.0)
|
81
|
+
byebug (~> 4.0)
|
91
82
|
pry (~> 0.10)
|
92
|
-
rack (1.6.
|
93
|
-
rack-test (0.6.
|
83
|
+
rack (1.6.4)
|
84
|
+
rack-test (0.6.3)
|
94
85
|
rack (>= 1.0)
|
95
|
-
rails (4.2.
|
96
|
-
actionmailer (= 4.2.
|
97
|
-
actionpack (= 4.2.
|
98
|
-
actionview (= 4.2.
|
99
|
-
activejob (= 4.2.
|
100
|
-
activemodel (= 4.2.
|
101
|
-
activerecord (= 4.2.
|
102
|
-
activesupport (= 4.2.
|
86
|
+
rails (4.2.3)
|
87
|
+
actionmailer (= 4.2.3)
|
88
|
+
actionpack (= 4.2.3)
|
89
|
+
actionview (= 4.2.3)
|
90
|
+
activejob (= 4.2.3)
|
91
|
+
activemodel (= 4.2.3)
|
92
|
+
activerecord (= 4.2.3)
|
93
|
+
activesupport (= 4.2.3)
|
103
94
|
bundler (>= 1.3.0, < 2.0)
|
104
|
-
railties (= 4.2.
|
95
|
+
railties (= 4.2.3)
|
105
96
|
sprockets-rails
|
106
97
|
rails-deprecated_sanitizer (1.0.3)
|
107
98
|
activesupport (>= 4.2.0.alpha)
|
@@ -111,25 +102,30 @@ GEM
|
|
111
102
|
rails-deprecated_sanitizer (>= 1.0.1)
|
112
103
|
rails-html-sanitizer (1.0.2)
|
113
104
|
loofah (~> 2.0)
|
114
|
-
railties (4.2.
|
115
|
-
actionpack (= 4.2.
|
116
|
-
activesupport (= 4.2.
|
105
|
+
railties (4.2.3)
|
106
|
+
actionpack (= 4.2.3)
|
107
|
+
activesupport (= 4.2.3)
|
117
108
|
rake (>= 0.8.7)
|
118
109
|
thor (>= 0.18.1, < 2.0)
|
119
110
|
rake (10.4.2)
|
120
|
-
rspec (
|
121
|
-
rspec-core (~>
|
122
|
-
rspec-expectations (~>
|
123
|
-
rspec-mocks (~>
|
124
|
-
rspec-core (
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
111
|
+
rspec (3.3.0)
|
112
|
+
rspec-core (~> 3.3.0)
|
113
|
+
rspec-expectations (~> 3.3.0)
|
114
|
+
rspec-mocks (~> 3.3.0)
|
115
|
+
rspec-core (3.3.1)
|
116
|
+
rspec-support (~> 3.3.0)
|
117
|
+
rspec-expectations (3.3.0)
|
118
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
119
|
+
rspec-support (~> 3.3.0)
|
120
|
+
rspec-mocks (3.3.1)
|
121
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
122
|
+
rspec-support (~> 3.3.0)
|
123
|
+
rspec-support (3.3.0)
|
124
|
+
sass (3.4.15)
|
129
125
|
slop (3.6.0)
|
130
|
-
sprockets (3.
|
126
|
+
sprockets (3.2.0)
|
131
127
|
rack (~> 1.0)
|
132
|
-
sprockets-rails (2.3.
|
128
|
+
sprockets-rails (2.3.2)
|
133
129
|
actionpack (>= 3.0)
|
134
130
|
activesupport (>= 3.0)
|
135
131
|
sprockets (>= 2.8, < 4.0)
|
@@ -137,14 +133,14 @@ GEM
|
|
137
133
|
thread_safe (0.3.5)
|
138
134
|
tzinfo (1.2.2)
|
139
135
|
thread_safe (~> 0.1)
|
140
|
-
xpath (2.0.0)
|
141
|
-
nokogiri (~> 1.3)
|
142
136
|
|
143
137
|
PLATFORMS
|
144
138
|
ruby
|
145
139
|
|
146
140
|
DEPENDENCIES
|
147
|
-
capybara (~> 2.2, >= 2.2.0)
|
148
141
|
pry-byebug
|
149
|
-
rspec (~> 2
|
142
|
+
rspec (~> 3.2)
|
150
143
|
welaika-suspenders!
|
144
|
+
|
145
|
+
BUNDLED WITH
|
146
|
+
1.10.5
|
data/NEWS.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
1.29.0 (June 16, 2015)
|
2
|
+
|
3
|
+
* Generate rake, rails and rspec binstubs with Spring
|
4
|
+
* Remove Capybara and use RSpec 3.2 for development
|
5
|
+
* Improves suspenders' test suite speed
|
6
|
+
* Refills `flashes.scss` bugfix
|
7
|
+
|
1
8
|
1.28.0 (May 9, 2015)
|
2
9
|
|
3
10
|
* Require spec/support files in a certain order
|
@@ -16,7 +23,7 @@
|
|
16
23
|
* Add code of conduct to CONTRIBUTING document
|
17
24
|
* Only use rack-timeout in staging and production
|
18
25
|
* Add SimpleCov
|
19
|
-
* Avoid generation of extra _flashes view
|
26
|
+
* Avoid generation of extra `_flashes` view
|
20
27
|
* Fix Travis CI install step
|
21
28
|
* Cache bundle in Travis CI runs
|
22
29
|
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ You can optionally specify alternate Heroku flags:
|
|
28
28
|
|
29
29
|
welaika-suspenders projectname \
|
30
30
|
--heroku true \
|
31
|
-
--heroku-flags "--region eu --addons newrelic,
|
31
|
+
--heroku-flags "--region eu --addons newrelic,sendgrid,ssl"
|
32
32
|
|
33
33
|
See all possible Heroku flags:
|
34
34
|
|
@@ -69,10 +69,17 @@ List of changes we made since [this is commit](https://github.com/thoughtbot/sus
|
|
69
69
|
- create a .ruby-gemset file with app name
|
70
70
|
- create common folders like `app/queries`, `app/services`, etc.
|
71
71
|
- use `application.css.sass` instead of `application.css.scss`
|
72
|
-
- do not import refills/flashes
|
73
72
|
- add `quiet_assets` gem
|
74
73
|
- add `brakeman` gem
|
75
74
|
- change `i18n_tasks` configuration: set `it` as base locale
|
76
75
|
- set `Rome` as `time_zone`
|
77
76
|
- set `:it` as `default_locale`
|
78
77
|
- add [simplecov](https://github.com/colszowka/simplecov)
|
78
|
+
- add fixtures helper for `rspec`
|
79
|
+
- add queries helper for `rspec`
|
80
|
+
- configure asset host for capybara
|
81
|
+
- add helpers for capybara (`page!`, `screenshot!`)
|
82
|
+
- drop support for IE 9 in AutoPrefixer
|
83
|
+
- removed [hound](https://houndci.com) configuration
|
84
|
+
- add [bullet](https://github.com/flyerhzm/bullet)
|
85
|
+
- set `unicorn` workers to 1 for `webconsole`
|
@@ -19,6 +19,19 @@ module Suspenders
|
|
19
19
|
)
|
20
20
|
end
|
21
21
|
|
22
|
+
def configure_bullet
|
23
|
+
config = <<-RUBY.strip_heredoc
|
24
|
+
config.after_initialize do
|
25
|
+
Bullet.enable = true
|
26
|
+
Bullet.bullet_logger = true
|
27
|
+
Bullet.console = true
|
28
|
+
Bullet.rails_logger = true
|
29
|
+
# Bullet.stacktrace_includes = [ 'your_gem', 'your_middleware' ]
|
30
|
+
end
|
31
|
+
RUBY
|
32
|
+
configure_environment "development", config
|
33
|
+
end
|
34
|
+
|
22
35
|
def raise_on_unpermitted_parameters
|
23
36
|
config = <<-RUBY
|
24
37
|
config.action_controller.action_on_unpermitted_parameters = :raise
|
@@ -58,6 +71,15 @@ module Suspenders
|
|
58
71
|
copy_file 'factory_girl_rspec.rb', 'spec/support/factory_girl.rb'
|
59
72
|
end
|
60
73
|
|
74
|
+
def set_up_capybara_for_rspec
|
75
|
+
template 'capybara_rspec.rb.erb', 'spec/support/capybara.rb', port_number: port
|
76
|
+
end
|
77
|
+
|
78
|
+
def add_helpers_for_rspec
|
79
|
+
copy_file 'queries_helper_rspec.rb', 'spec/support/queries_helper.rb'
|
80
|
+
copy_file 'fixtures_helper_rspec.rb', 'spec/support/fixtures_helper.rb'
|
81
|
+
end
|
82
|
+
|
61
83
|
def configure_newrelic
|
62
84
|
template 'newrelic.yml.erb', 'config/newrelic.yml'
|
63
85
|
end
|
@@ -314,6 +336,12 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
314
336
|
'app/assets/stylesheets/application.css.sass'
|
315
337
|
end
|
316
338
|
|
339
|
+
def install_refills
|
340
|
+
run "rails generate refills:import flashes"
|
341
|
+
run "rm app/views/refills/_flashes.html.erb"
|
342
|
+
run "rmdir app/views/refills"
|
343
|
+
end
|
344
|
+
|
317
345
|
def install_bitters
|
318
346
|
run "bitters install --path app/assets/stylesheets"
|
319
347
|
end
|
@@ -334,6 +362,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
334
362
|
'spec/presenters',
|
335
363
|
'spec/queries',
|
336
364
|
'spec/services',
|
365
|
+
'spec/fixtures',
|
337
366
|
'spec/support/matchers',
|
338
367
|
'spec/support/mixins',
|
339
368
|
'spec/support/shared_examples'
|
@@ -429,6 +458,14 @@ you can deploy to staging and production with:
|
|
429
458
|
append_file "Rakefile", %{\ntask default: "bundler:audit"\n}
|
430
459
|
end
|
431
460
|
|
461
|
+
def setup_spring
|
462
|
+
bundle_command "exec spring binstub --all"
|
463
|
+
end
|
464
|
+
|
465
|
+
def create_binstubs
|
466
|
+
bundle_command "binstubs brakeman"
|
467
|
+
end
|
468
|
+
|
432
469
|
def copy_miscellaneous_files
|
433
470
|
copy_file "browserslist", "browserslist"
|
434
471
|
copy_file "errors.rb", "config/initializers/errors.rb"
|
@@ -499,7 +536,7 @@ end
|
|
499
536
|
end
|
500
537
|
|
501
538
|
def port
|
502
|
-
|
539
|
+
@@port ||= [3000, 4000, 5000, 7000, 8000, 9000].sample
|
503
540
|
end
|
504
541
|
|
505
542
|
def serve_static_files_line
|
@@ -40,6 +40,7 @@ module Suspenders
|
|
40
40
|
invoke :configure_app
|
41
41
|
invoke :setup_stylesheets
|
42
42
|
invoke :install_bitters
|
43
|
+
invoke :install_refills
|
43
44
|
invoke :copy_miscellaneous_files
|
44
45
|
invoke :customize_error_pages
|
45
46
|
invoke :remove_routes_comment_lines
|
@@ -48,6 +49,8 @@ module Suspenders
|
|
48
49
|
invoke :create_heroku_apps
|
49
50
|
invoke :create_github_repo
|
50
51
|
invoke :setup_bundler_audit
|
52
|
+
invoke :setup_spring
|
53
|
+
invoke :create_binstubs
|
51
54
|
invoke :outro
|
52
55
|
end
|
53
56
|
|
@@ -77,6 +80,7 @@ module Suspenders
|
|
77
80
|
say 'Setting up the development environment'
|
78
81
|
build :raise_on_delivery_errors
|
79
82
|
build :configure_letter_opener
|
83
|
+
build :configure_bullet
|
80
84
|
build :raise_on_unpermitted_parameters
|
81
85
|
build :provide_setup_script
|
82
86
|
build :provide_dev_prime_task
|
@@ -87,6 +91,8 @@ module Suspenders
|
|
87
91
|
def setup_test_environment
|
88
92
|
say 'Setting up the test environment'
|
89
93
|
build :set_up_factory_girl_for_rspec
|
94
|
+
build :set_up_capybara_for_rspec
|
95
|
+
build :add_helpers_for_rspec
|
90
96
|
build :generate_rspec
|
91
97
|
build :configure_rspec
|
92
98
|
build :configure_background_jobs_for_rspec
|
@@ -153,6 +159,11 @@ module Suspenders
|
|
153
159
|
build :install_bitters
|
154
160
|
end
|
155
161
|
|
162
|
+
def install_refills
|
163
|
+
say "Install Refills"
|
164
|
+
build :install_refills
|
165
|
+
end
|
166
|
+
|
156
167
|
def setup_git
|
157
168
|
if !options[:skip_git]
|
158
169
|
say 'Initializing git'
|
@@ -188,6 +199,16 @@ module Suspenders
|
|
188
199
|
build :setup_bundler_audit
|
189
200
|
end
|
190
201
|
|
202
|
+
def setup_spring
|
203
|
+
say "Springifying binstubs"
|
204
|
+
build :setup_spring
|
205
|
+
end
|
206
|
+
|
207
|
+
def create_binstubs
|
208
|
+
say "Create binstubs"
|
209
|
+
build :create_binstubs
|
210
|
+
end
|
211
|
+
|
191
212
|
def init_git
|
192
213
|
build :init_git
|
193
214
|
end
|
data/lib/suspenders/version.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
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
|
5
10
|
repo_name = 'test'
|
6
11
|
run_suspenders("--github=#{repo_name}")
|
7
12
|
|
@@ -1,7 +1,12 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
RSpec.describe "Heroku" do
|
4
|
+
before do
|
5
|
+
drop_dummy_database
|
6
|
+
remove_project_directory
|
7
|
+
end
|
8
|
+
|
9
|
+
it "suspends a project for Heroku" do
|
5
10
|
run_suspenders("--heroku=true")
|
6
11
|
|
7
12
|
expect(FakeHeroku).to have_gem_included(project_path, "rails_stdout_logging")
|
@@ -30,7 +35,7 @@ feature "Heroku" do
|
|
30
35
|
expect(readme).to include("./bin/deploy production")
|
31
36
|
end
|
32
37
|
|
33
|
-
|
38
|
+
it "suspends a project with extra Heroku flags" do
|
34
39
|
run_suspenders(%{--heroku=true --heroku-flags="--region eu"})
|
35
40
|
|
36
41
|
expect(FakeHeroku).to have_created_app_for("staging", "--region eu")
|
@@ -1,9 +1,13 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
RSpec.describe "Suspend a new project with default configuration" do
|
4
|
+
before(:all) do
|
5
|
+
drop_dummy_database
|
6
|
+
remove_project_directory
|
5
7
|
run_suspenders
|
8
|
+
end
|
6
9
|
|
10
|
+
it "ensures project specs pass" do
|
7
11
|
Dir.chdir(project_path) do
|
8
12
|
Bundler.with_clean_env do
|
9
13
|
expect(`rake`).to include('0 failures')
|
@@ -11,9 +15,7 @@ feature 'Suspend a new project with default configuration' do
|
|
11
15
|
end
|
12
16
|
end
|
13
17
|
|
14
|
-
|
15
|
-
run_suspenders
|
16
|
-
|
18
|
+
it "inherits staging config from production" do
|
17
19
|
staging_file = IO.read("#{project_path}/config/environments/staging.rb")
|
18
20
|
config_stub = "Rails.application.configure do"
|
19
21
|
|
@@ -21,45 +23,45 @@ feature 'Suspend a new project with default configuration' do
|
|
21
23
|
expect(staging_file).to match(/#{config_stub}/), staging_file
|
22
24
|
end
|
23
25
|
|
24
|
-
|
25
|
-
run_suspenders
|
26
|
-
|
26
|
+
it "creates .ruby-version from Suspenders .ruby-version" do
|
27
27
|
ruby_version_file = IO.read("#{project_path}/.ruby-version")
|
28
28
|
|
29
29
|
expect(ruby_version_file).to eq "#{RUBY_VERSION}\n"
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
run_suspenders
|
34
|
-
|
32
|
+
it 'creates .ruby-gemset from app name' do
|
35
33
|
ruby_gemset_file = IO.read("#{project_path}/.ruby-gemset")
|
36
34
|
|
37
35
|
expect(ruby_gemset_file).to eq "#{SuspendersTestHelpers::APP_NAME}\n"
|
38
36
|
end
|
39
37
|
|
40
|
-
|
41
|
-
run_suspenders
|
42
|
-
|
38
|
+
it "loads secret_key_base from env" do
|
43
39
|
secrets_file = IO.read("#{project_path}/config/secrets.yml")
|
44
40
|
|
45
41
|
expect(secrets_file).to match(/secret_key_base: <%= ENV\["SECRET_KEY_BASE"\] %>/)
|
46
42
|
end
|
47
43
|
|
48
|
-
|
49
|
-
run_suspenders
|
50
|
-
|
44
|
+
it "adds support file for action mailer" do
|
51
45
|
expect(File).to exist("#{project_path}/spec/support/action_mailer.rb")
|
52
46
|
end
|
53
47
|
|
54
|
-
|
55
|
-
run_suspenders
|
56
|
-
|
48
|
+
it "adds support file for i18n" do
|
57
49
|
expect(File).to exist("#{project_path}/spec/support/i18n.rb")
|
58
50
|
end
|
59
51
|
|
60
|
-
|
61
|
-
|
52
|
+
it "adds support file for factory girl" do
|
53
|
+
expect(File).to exist("#{project_path}/spec/support/factory_girl.rb")
|
54
|
+
end
|
55
|
+
|
56
|
+
it "adds rspec helper for fixtures" do
|
57
|
+
expect(File).to exist("#{project_path}/spec/support/fixtures_helper.rb")
|
58
|
+
end
|
59
|
+
|
60
|
+
it "adds rspec helper for queries" do
|
61
|
+
expect(File).to exist("#{project_path}/spec/support/queries_helper.rb")
|
62
|
+
end
|
62
63
|
|
64
|
+
it "ensures newrelic.yml reads NewRelic license from env" do
|
63
65
|
newrelic_file = IO.read("#{project_path}/config/newrelic.yml")
|
64
66
|
|
65
67
|
expect(newrelic_file).to match(
|
@@ -67,9 +69,7 @@ feature 'Suspend a new project with default configuration' do
|
|
67
69
|
)
|
68
70
|
end
|
69
71
|
|
70
|
-
|
71
|
-
run_suspenders
|
72
|
-
|
72
|
+
it "configs locale and timezone" do
|
73
73
|
result = IO.read("#{project_path}/config/application.rb")
|
74
74
|
|
75
75
|
expect(result).to match(/^ +config.i18n.enforce_available_locales = true$/)
|
@@ -79,9 +79,7 @@ feature 'Suspend a new project with default configuration' do
|
|
79
79
|
expect(result).to match(/^ +config.time_zone = 'Rome'$/)
|
80
80
|
end
|
81
81
|
|
82
|
-
|
83
|
-
run_suspenders
|
84
|
-
|
82
|
+
it "raises on unpermitted parameters in all environments" do
|
85
83
|
result = IO.read("#{project_path}/config/application.rb")
|
86
84
|
|
87
85
|
expect(result).to match(
|
@@ -89,9 +87,7 @@ feature 'Suspend a new project with default configuration' do
|
|
89
87
|
)
|
90
88
|
end
|
91
89
|
|
92
|
-
|
93
|
-
run_suspenders
|
94
|
-
|
90
|
+
it "raises on missing translations in development and test" do
|
95
91
|
%w[development test].each do |environment|
|
96
92
|
environment_file =
|
97
93
|
IO.read("#{project_path}/config/environments/#{environment}.rb")
|
@@ -101,54 +97,37 @@ feature 'Suspend a new project with default configuration' do
|
|
101
97
|
end
|
102
98
|
end
|
103
99
|
|
104
|
-
|
105
|
-
run_suspenders
|
106
|
-
|
100
|
+
it "adds specs for missing or unused translations" do
|
107
101
|
expect(File).to exist("#{project_path}/spec/i18n_spec.rb")
|
108
102
|
end
|
109
103
|
|
110
|
-
|
111
|
-
run_suspenders
|
112
|
-
|
104
|
+
it "configs i18n-tasks" do
|
113
105
|
expect(File).to exist("#{project_path}/config/i18n-tasks.yml")
|
114
106
|
end
|
115
107
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
locales_en_file = "#{project_path}/config/locales/en.yml"
|
120
|
-
locales_it_file = "#{project_path}/config/locales/it.yml"
|
108
|
+
it "evaluates en.yml.erb" do
|
109
|
+
locales_it_file = IO.read("#{project_path}/config/locales/it.yml")
|
121
110
|
app_name = SuspendersTestHelpers::APP_NAME
|
122
|
-
|
123
|
-
expect(File.exist?(locales_en_file)).to eq(false)
|
124
|
-
expect(IO.read(locales_it_file)).to match(/application: #{app_name.humanize}/)
|
111
|
+
expect(locales_it_file).to match(/application: #{app_name.humanize}/)
|
125
112
|
end
|
126
113
|
|
127
|
-
|
128
|
-
run_suspenders
|
129
|
-
|
114
|
+
it "configs simple_form" do
|
130
115
|
expect(File).to exist("#{project_path}/config/initializers/simple_form.rb")
|
131
116
|
end
|
132
117
|
|
133
|
-
|
134
|
-
run_suspenders
|
135
|
-
|
118
|
+
it "configs :letter_opener as email delivery method for development" do
|
136
119
|
dev_env_file = IO.read("#{project_path}/config/environments/development.rb")
|
137
120
|
expect(dev_env_file).
|
138
121
|
to match(/^ +config.action_mailer.delivery_method = :letter_opener$/)
|
139
122
|
end
|
140
123
|
|
141
|
-
|
142
|
-
run_suspenders
|
143
|
-
|
124
|
+
it "configs simplecov" do
|
144
125
|
spec_helper_file = IO.read("#{project_path}/spec/spec_helper.rb")
|
145
126
|
expect(spec_helper_file).to match(/^require "simplecov"$/)
|
146
127
|
expect(spec_helper_file).to match(/^SimpleCov.start "rails" do$/)
|
147
128
|
end
|
148
129
|
|
149
|
-
|
150
|
-
run_suspenders
|
151
|
-
|
130
|
+
it "configs active job queue adapter" do
|
152
131
|
application_config = IO.read("#{project_path}/config/application.rb")
|
153
132
|
test_config = IO.read("#{project_path}/config/environments/test.rb")
|
154
133
|
|
@@ -160,6 +139,25 @@ feature 'Suspend a new project with default configuration' do
|
|
160
139
|
)
|
161
140
|
end
|
162
141
|
|
142
|
+
it "adds spring to binstubs" do
|
143
|
+
expect(File).to exist("#{project_path}/bin/spring")
|
144
|
+
|
145
|
+
spring_line = /^ +load File.expand_path\("\.\.\/spring", __FILE__\)$/
|
146
|
+
bin_stubs = %w(rake rails rspec)
|
147
|
+
bin_stubs.each do |bin_stub|
|
148
|
+
expect(IO.read("#{project_path}/bin/#{bin_stub}")).to match(spring_line)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
it "adds rspec's helper files" do
|
153
|
+
expect(File).to exist("#{project_path}/spec/spec_helper.rb")
|
154
|
+
expect(File).to exist("#{project_path}/spec/rails_helper.rb")
|
155
|
+
end
|
156
|
+
|
157
|
+
it "creates binstubs" do
|
158
|
+
expect(File).to exist("#{project_path}/bin/brakeman")
|
159
|
+
end
|
160
|
+
|
163
161
|
def analytics_partial
|
164
162
|
IO.read("#{project_path}/app/views/application/_analytics.html.erb")
|
165
163
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require "capybara/rspec"
|
2
1
|
require "bundler/setup"
|
3
2
|
require "pry-byebug"
|
4
3
|
|
@@ -16,9 +15,6 @@ RSpec.configure do |config|
|
|
16
15
|
end
|
17
16
|
|
18
17
|
config.before(:each) do
|
19
|
-
drop_dummy_database
|
20
|
-
remove_project_directory
|
21
|
-
|
22
18
|
FakeHeroku.clear!
|
23
19
|
FakeGithub.clear!
|
24
20
|
end
|
data/suspenders.gemspec
CHANGED
@@ -29,7 +29,6 @@ weLaika's fork of the famous thoughbot suspenders gem.
|
|
29
29
|
s.add_dependency 'bundler', '~> 1.3'
|
30
30
|
s.add_dependency 'rails', Suspenders::RAILS_VERSION
|
31
31
|
|
32
|
-
s.add_development_dependency 'rspec', '~> 2
|
33
|
-
s.add_development_dependency 'capybara', '~> 2.2', '>= 2.2.0'
|
32
|
+
s.add_development_dependency 'rspec', '~> 3.2'
|
34
33
|
s.add_development_dependency 'pry-byebug'
|
35
34
|
end
|
data/templates/Gemfile.erb
CHANGED
@@ -20,6 +20,7 @@ gem "rack-canonical-host"
|
|
20
20
|
gem "rails", "<%= Suspenders::RAILS_VERSION %>"
|
21
21
|
gem "rails-i18n"
|
22
22
|
gem "recipient_interceptor"
|
23
|
+
gem "refills"
|
23
24
|
gem "sass-rails", "~> 5.0"
|
24
25
|
gem "slim-rails"
|
25
26
|
gem "simple_form"
|
@@ -38,6 +39,7 @@ end
|
|
38
39
|
group :development, :test do
|
39
40
|
gem "awesome_print"
|
40
41
|
gem "brakeman", require:false
|
42
|
+
gem "bullet"
|
41
43
|
gem "bundler-audit", require: false
|
42
44
|
gem "dotenv-rails"
|
43
45
|
gem "faker"
|
@@ -46,7 +48,7 @@ group :development, :test do
|
|
46
48
|
gem "pry-bloodline"
|
47
49
|
gem "pry-byebug"
|
48
50
|
gem "pry-rails"
|
49
|
-
gem "rspec-rails", "~> 3.
|
51
|
+
gem "rspec-rails", "~> 3.3.0"
|
50
52
|
end
|
51
53
|
|
52
54
|
group :test do
|
data/templates/browserslist
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
Capybara.javascript_driver = :webkit
|
2
|
+
Capybara.asset_host = "http://localhost:<%= config[:port_number] %>"
|
3
|
+
|
4
|
+
module CapybaraHelper
|
5
|
+
|
6
|
+
def page!
|
7
|
+
save_and_open_page
|
8
|
+
end
|
9
|
+
|
10
|
+
def screenshot!
|
11
|
+
save_and_open_screenshot
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Capybara::Webkit.configure do |config|
|
16
|
+
config.allow_url(
|
17
|
+
%w(fonts.googleapis.com)
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
RSpec.configure do |config|
|
22
|
+
config.include CapybaraHelper, type: :feature
|
23
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module QueriesHelper
|
2
|
+
def log_queries!
|
3
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
4
|
+
end
|
5
|
+
|
6
|
+
def do_not_log_queries!
|
7
|
+
ActiveRecord::Base.logger = nil
|
8
|
+
end
|
9
|
+
|
10
|
+
def logging_queries
|
11
|
+
log_queries!
|
12
|
+
yield
|
13
|
+
ensure
|
14
|
+
do_not_log_queries!
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
RSpec.configure do |config|
|
19
|
+
config.include QueriesHelper
|
20
|
+
end
|
data/templates/rails_helper.rb
CHANGED
data/templates/sample.env
CHANGED
data/templates/spec_helper.rb
CHANGED
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.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bitters
|
@@ -41,52 +41,32 @@ dependencies:
|
|
41
41
|
version: '1.3'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rails
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - '='
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: 4.2.1
|
49
|
-
type: :runtime
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - '='
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: 4.2.1
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: rspec
|
58
44
|
requirement: !ruby/object:Gem::Requirement
|
59
45
|
requirements:
|
60
46
|
- - "~>"
|
61
47
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
63
|
-
type: :
|
48
|
+
version: 4.2.0
|
49
|
+
type: :runtime
|
64
50
|
prerelease: false
|
65
51
|
version_requirements: !ruby/object:Gem::Requirement
|
66
52
|
requirements:
|
67
53
|
- - "~>"
|
68
54
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
55
|
+
version: 4.2.0
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
57
|
+
name: rspec
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
73
59
|
requirements:
|
74
60
|
- - "~>"
|
75
61
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
77
|
-
- - ">="
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: 2.2.0
|
62
|
+
version: '3.2'
|
80
63
|
type: :development
|
81
64
|
prerelease: false
|
82
65
|
version_requirements: !ruby/object:Gem::Requirement
|
83
66
|
requirements:
|
84
67
|
- - "~>"
|
85
68
|
- !ruby/object:Gem::Version
|
86
|
-
version: '
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 2.2.0
|
69
|
+
version: '3.2'
|
90
70
|
- !ruby/object:Gem::Dependency
|
91
71
|
name: pry-byebug
|
92
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,6 +131,7 @@ files:
|
|
151
131
|
- templates/bin_setup.erb
|
152
132
|
- templates/browserslist
|
153
133
|
- templates/bundler_audit.rake
|
134
|
+
- templates/capybara_rspec.rb.erb
|
154
135
|
- templates/config_i18n_tasks.yml
|
155
136
|
- templates/config_locales_it.yml.erb
|
156
137
|
- templates/database_cleaner_rspec.rb
|
@@ -158,11 +139,13 @@ files:
|
|
158
139
|
- templates/disable_xml_params.rb
|
159
140
|
- templates/errors.rb
|
160
141
|
- templates/factory_girl_rspec.rb
|
142
|
+
- templates/fixtures_helper_rspec.rb
|
161
143
|
- templates/flashes_helper.rb
|
162
144
|
- templates/i18n.rb
|
163
145
|
- templates/json_encoding.rb
|
164
146
|
- templates/newrelic.yml.erb
|
165
147
|
- templates/postgresql_database.yml.erb
|
148
|
+
- templates/queries_helper_rspec.rb
|
166
149
|
- templates/rails_helper.rb
|
167
150
|
- templates/sample.env
|
168
151
|
- templates/secrets.yml
|
@@ -195,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
178
|
version: '0'
|
196
179
|
requirements: []
|
197
180
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.4.
|
181
|
+
rubygems_version: 2.4.8
|
199
182
|
signing_key:
|
200
183
|
specification_version: 4
|
201
184
|
summary: Generate a Rails app using thoughtbot's best practices.
|