welaika-suspenders 2.22.0 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/NEWS.md +6 -0
- data/README.md +1 -1
- data/lib/suspenders/adapters/heroku.rb +11 -6
- data/lib/suspenders/app_builder.rb +17 -18
- data/lib/suspenders/generators/app_generator.rb +7 -8
- data/lib/suspenders/version.rb +1 -1
- data/spec/features/new_project_spec.rb +30 -1
- data/spec/support/fake_heroku.rb +1 -1
- data/templates/Gemfile.erb +5 -1
- data/templates/dotfiles/.env +1 -0
- data/templates/rack_mini_profiler.rb +5 -0
- data/templates/rubocop.yml +7 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbe829c6d51e19782944b5685839aab374a0beb6
|
4
|
+
data.tar.gz: 9a9b41d93bb39c3e8a0b84b5613e570bdd5574c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de6b9bf1f9c87a2b6032549f94acfe44614e5bbfa1e8f29915f5943e007134f3a0f7c70daf0abffe84bec1ee80d24901152c1f30a0b35217281011825ab6d414
|
7
|
+
data.tar.gz: f83d2baacdc8076c9b7afacb675c258ad6ec658317c21a275e929007edb8b7139ca6965cb022584b46277d6f066eb71a0bcee42d740ade120324381b01b86766
|
data/LICENSE
CHANGED
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -66,7 +66,6 @@ List of changes we made since [this is commit](https://github.com/thoughtbot/sus
|
|
66
66
|
- create common folders like `app/queries`, `app/services`, etc.
|
67
67
|
- use `application.sass` instead of `application.scss`
|
68
68
|
- add `brakeman` gem
|
69
|
-
- change `i18n_tasks` configuration: set `it` as base locale
|
70
69
|
- set `Rome` as `time_zone`
|
71
70
|
- set `:it` as `default_locale`
|
72
71
|
- add [simplecov](https://github.com/colszowka/simplecov)
|
@@ -87,3 +86,4 @@ List of changes we made since [this is commit](https://github.com/thoughtbot/sus
|
|
87
86
|
- remove bitters and refills
|
88
87
|
- lint factory girl's factories
|
89
88
|
- remove automatic deployment
|
89
|
+
- use airbrake instead of honeybadger
|
@@ -68,12 +68,17 @@ module Suspenders
|
|
68
68
|
end
|
69
69
|
|
70
70
|
heroku_app_name = app_builder.app_name.dasherize
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
run_toolbelt_command(
|
72
|
+
"pipelines:create #{heroku_app_name} \
|
73
|
+
-a #{heroku_app_name}-staging --stage staging",
|
74
|
+
"staging",
|
75
|
+
)
|
76
|
+
|
77
|
+
run_toolbelt_command(
|
78
|
+
"pipelines:add #{heroku_app_name} \
|
79
|
+
-a #{heroku_app_name}-production --stage production",
|
80
|
+
"production",
|
81
|
+
)
|
77
82
|
end
|
78
83
|
|
79
84
|
def set_heroku_serve_static_files
|
@@ -20,6 +20,21 @@ module Suspenders
|
|
20
20
|
template 'README.md.erb', 'README.md'
|
21
21
|
end
|
22
22
|
|
23
|
+
def gitignore
|
24
|
+
copy_file "suspenders_gitignore", ".gitignore"
|
25
|
+
end
|
26
|
+
|
27
|
+
def gemfile
|
28
|
+
template "Gemfile.erb", "Gemfile"
|
29
|
+
end
|
30
|
+
|
31
|
+
def setup_rack_mini_profiler
|
32
|
+
copy_file(
|
33
|
+
"rack_mini_profiler.rb",
|
34
|
+
"config/initializers/rack_mini_profiler.rb",
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
23
38
|
def raise_on_missing_assets_in_test
|
24
39
|
inject_into_file(
|
25
40
|
"config/environments/test.rb",
|
@@ -229,11 +244,6 @@ end
|
|
229
244
|
bundle_command 'exec rake db:create db:migrate'
|
230
245
|
end
|
231
246
|
|
232
|
-
def replace_gemfile
|
233
|
-
remove_file 'Gemfile'
|
234
|
-
template 'Gemfile.erb', 'Gemfile'
|
235
|
-
end
|
236
|
-
|
237
247
|
def set_ruby_to_version_being_used
|
238
248
|
create_file '.ruby-version', "#{Suspenders::RUBY_VERSION}\n"
|
239
249
|
end
|
@@ -336,14 +346,6 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
336
346
|
configure_environment "test", "config.active_job.queue_adapter = :inline"
|
337
347
|
end
|
338
348
|
|
339
|
-
def fix_i18n_deprecation_warning
|
340
|
-
config = <<-RUBY
|
341
|
-
config.i18n.enforce_available_locales = true
|
342
|
-
RUBY
|
343
|
-
|
344
|
-
inject_into_class 'config/application.rb', 'Application', config
|
345
|
-
end
|
346
|
-
|
347
349
|
def generate_rspec
|
348
350
|
generate 'rspec:install'
|
349
351
|
end
|
@@ -362,9 +364,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
362
364
|
'app/assets/stylesheets/application.sass'
|
363
365
|
end
|
364
366
|
|
365
|
-
def
|
366
|
-
remove_file '.gitignore'
|
367
|
-
copy_file 'suspenders_gitignore', '.gitignore'
|
367
|
+
def setup_default_directories
|
368
368
|
[
|
369
369
|
'app/forms',
|
370
370
|
'app/decorators',
|
@@ -383,8 +383,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
383
383
|
'spec/support/mixins',
|
384
384
|
'spec/support/shared_examples'
|
385
385
|
].each do |dir|
|
386
|
-
|
387
|
-
run "touch #{dir}/.keep"
|
386
|
+
empty_directory_with_keep_file dir
|
388
387
|
end
|
389
388
|
end
|
390
389
|
|
@@ -54,7 +54,6 @@ module Suspenders
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def customize_gemfile
|
57
|
-
build :replace_gemfile
|
58
57
|
build :create_ruby_gemset_file
|
59
58
|
build :set_ruby_to_version_being_used
|
60
59
|
|
@@ -146,10 +145,10 @@ module Suspenders
|
|
146
145
|
build :configure_slim
|
147
146
|
build :disable_xml_params
|
148
147
|
build :configure_available_locales
|
149
|
-
build :fix_i18n_deprecation_warning
|
150
148
|
build :setup_default_rake_task
|
151
149
|
build :configure_puma
|
152
150
|
build :set_up_forego
|
151
|
+
build :setup_rack_mini_profiler
|
153
152
|
end
|
154
153
|
|
155
154
|
def setup_stylesheets
|
@@ -159,8 +158,8 @@ module Suspenders
|
|
159
158
|
|
160
159
|
def setup_git
|
161
160
|
if !options[:skip_git]
|
162
|
-
say
|
163
|
-
invoke :
|
161
|
+
say "Initializing git"
|
162
|
+
invoke :setup_default_directories
|
164
163
|
invoke :init_git
|
165
164
|
end
|
166
165
|
end
|
@@ -190,8 +189,8 @@ module Suspenders
|
|
190
189
|
build :copy_dotfiles
|
191
190
|
end
|
192
191
|
|
193
|
-
def
|
194
|
-
build :
|
192
|
+
def setup_default_directories
|
193
|
+
build :setup_default_directories
|
195
194
|
end
|
196
195
|
|
197
196
|
def setup_spring
|
@@ -227,8 +226,8 @@ module Suspenders
|
|
227
226
|
end
|
228
227
|
|
229
228
|
def outro
|
230
|
-
say "Congratulations!"
|
231
|
-
say "
|
229
|
+
say "Congratulations! You just pulled our suspenders."
|
230
|
+
say "Read README.md and configure Errbit."
|
232
231
|
end
|
233
232
|
|
234
233
|
protected
|
data/lib/suspenders/version.rb
CHANGED
@@ -7,6 +7,19 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
7
7
|
run_suspenders
|
8
8
|
end
|
9
9
|
|
10
|
+
it "uses custom Gemfile" do
|
11
|
+
gemfile_file = IO.read("#{project_path}/Gemfile")
|
12
|
+
expect(gemfile_file).to match(
|
13
|
+
/^ruby "#{Suspenders::RUBY_VERSION}"$/,
|
14
|
+
)
|
15
|
+
expect(gemfile_file).to match(
|
16
|
+
/^gem "autoprefixer-rails"$/,
|
17
|
+
)
|
18
|
+
expect(gemfile_file).to match(
|
19
|
+
/^gem "rails", "#{Suspenders::RAILS_VERSION}"$/,
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
10
23
|
it "ensures project specs pass" do
|
11
24
|
Dir.chdir(project_path) do
|
12
25
|
Bundler.with_clean_env do
|
@@ -77,6 +90,23 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
77
90
|
expect(File).to exist("#{project_path}/spec/support/fixtures_helper.rb")
|
78
91
|
end
|
79
92
|
|
93
|
+
it "ensures Gemfile contains `rack-mini-profiler`" do
|
94
|
+
gemfile = IO.read("#{project_path}/Gemfile")
|
95
|
+
|
96
|
+
expect(gemfile).to include %{gem "rack-mini-profiler", require: false}
|
97
|
+
end
|
98
|
+
|
99
|
+
it "ensures .sample.env defaults to RACK_MINI_PROFILER=0" do
|
100
|
+
env = IO.read("#{project_path}/.env")
|
101
|
+
|
102
|
+
expect(env).to include "RACK_MINI_PROFILER=0"
|
103
|
+
end
|
104
|
+
|
105
|
+
it "creates a rack-mini-profiler initializer" do
|
106
|
+
expect(File).
|
107
|
+
to exist("#{project_path}/config/initializers/rack_mini_profiler.rb")
|
108
|
+
end
|
109
|
+
|
80
110
|
it "adds rspec helper for queries" do
|
81
111
|
expect(File).to exist("#{project_path}/spec/support/queries_helper.rb")
|
82
112
|
end
|
@@ -84,7 +114,6 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
84
114
|
it "configs locale and timezone" do
|
85
115
|
result = IO.read("#{project_path}/config/application.rb")
|
86
116
|
|
87
|
-
expect(result).to match(/^ +config.i18n.enforce_available_locales = true$/)
|
88
117
|
expect(result).to match(/^ +config.i18n.available_locales = \[:en, :it\]$/)
|
89
118
|
expect(result).to match(/^ +config.i18n.default_locale = :it$/)
|
90
119
|
|
data/spec/support/fake_heroku.rb
CHANGED
@@ -44,7 +44,7 @@ class FakeHeroku
|
|
44
44
|
|
45
45
|
def self.has_setup_pipeline_for?(app_name)
|
46
46
|
commands_ran =~ /^pipelines:create #{app_name} -a #{app_name}-staging --stage staging/ &&
|
47
|
-
commands_ran =~ /^pipelines:
|
47
|
+
commands_ran =~ /^pipelines:add #{app_name} -a #{app_name}-production --stage production/
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.commands_ran
|
data/templates/Gemfile.erb
CHANGED
@@ -28,7 +28,6 @@ gem "uglifier"
|
|
28
28
|
|
29
29
|
group :development do
|
30
30
|
gem "letter_opener"
|
31
|
-
gem "quiet_assets"
|
32
31
|
gem "spring"
|
33
32
|
gem "spring-commands-rspec"
|
34
33
|
gem "web-console"
|
@@ -45,10 +44,15 @@ group :development, :test do
|
|
45
44
|
gem "priscilla"
|
46
45
|
gem "pry-byebug"
|
47
46
|
gem "pry-rails"
|
47
|
+
gem "quiet_assets"
|
48
48
|
gem "rspec-rails", "~> 3.4.0"
|
49
49
|
gem "rubocop", require: false
|
50
50
|
end
|
51
51
|
|
52
|
+
group :development, :staging do
|
53
|
+
gem "rack-mini-profiler", require: false
|
54
|
+
end
|
55
|
+
|
52
56
|
group :test do
|
53
57
|
gem "capybara-webkit"
|
54
58
|
gem "database_cleaner"
|
data/templates/dotfiles/.env
CHANGED
data/templates/rubocop.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
Rails:
|
2
|
+
Enabled: true
|
3
|
+
|
1
4
|
AllCops:
|
2
|
-
|
5
|
+
TargetRubyVersion: 2.3
|
3
6
|
Exclude:
|
4
7
|
- "db/**/*"
|
5
8
|
- "config/**/*"
|
@@ -15,6 +18,9 @@ Style/StringLiterals:
|
|
15
18
|
Style/Documentation:
|
16
19
|
Enabled: false
|
17
20
|
|
21
|
+
Style/FrozenStringLiteralComment:
|
22
|
+
Enabled: false
|
23
|
+
|
18
24
|
Metrics/AbcSize:
|
19
25
|
Max: 18
|
20
26
|
|
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.23.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: 2016-
|
12
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- templates/postgresql_database.yml.erb
|
145
145
|
- templates/puma.rb
|
146
146
|
- templates/queries_helper_rspec.rb
|
147
|
+
- templates/rack_mini_profiler.rb
|
147
148
|
- templates/rails_helper.rb
|
148
149
|
- templates/rubocop.rake
|
149
150
|
- templates/rubocop.yml
|