welaika-suspenders 2.15.0 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +6 -1
- data/README.md +3 -0
- data/lib/suspenders/app_builder.rb +39 -4
- data/lib/suspenders/generators/app_generator.rb +8 -6
- data/lib/suspenders/version.rb +1 -1
- data/spec/features/new_project_spec.rb +20 -0
- data/suspenders.gemspec +1 -1
- data/templates/Gemfile.erb +2 -0
- data/templates/brakeman.rake +18 -0
- data/templates/capybara_rspec.rb.erb +0 -1
- data/templates/circle.yml.erb +6 -5
- data/templates/config_i18n_tasks.yml +1 -0
- data/templates/disable_xml_params.rb +0 -2
- data/templates/rails_helper.rb +1 -0
- data/templates/rubocop.rake +5 -0
- data/templates/rubocop.yml +23 -0
- data/templates/spec_helper.rb +0 -3
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91cc2ea6ed1390515043c8f7ff4ac6449f62d32f
|
4
|
+
data.tar.gz: 7ba87e1804d9e7541ae1f2596c78ccf9b6f9da5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4589cb62f4e0827be0840f0bda3b80af544c99cb90e636044670717d5963503e7efaa4ee6624aec8ef6d48933dbdb6e619850af50996abee0b922d6ba803c6a
|
7
|
+
data.tar.gz: fc793ef996307b6fd202a2e668c1c949b50d555673f2144d9455642bfb1b6e3fce109ca7b0f81c8e1a2634aca6507fe64c0de968aef2ffdc871437f2217b8a5f
|
data/NEWS.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
1.31.0 (
|
1
|
+
1.31.0 (September 3, 2015)
|
2
2
|
|
3
3
|
* Update to Ruby 2.2.3
|
4
|
+
* Add ctags configuration dotfile
|
5
|
+
* Rename `$HOST` to `$APPLICATION_HOST` for zsh compatibility
|
6
|
+
* Update Bitters to 1.1
|
7
|
+
* Remove comments and newlines in config files
|
8
|
+
* Abort tests run if `DATABASE_URL` env variable is set
|
4
9
|
|
5
10
|
1.30.0 (July 30, 2015)
|
6
11
|
|
data/README.md
CHANGED
@@ -83,3 +83,6 @@ List of changes we made since [this is commit](https://github.com/thoughtbot/sus
|
|
83
83
|
- drop support for IE 9 in AutoPrefixer
|
84
84
|
- removed [hound](https://houndci.com) configuration
|
85
85
|
- add [bullet](https://github.com/flyerhzm/bullet)
|
86
|
+
- add [draper](https://github.com/drapergem/draper) gem and rename `presenters` folder to `decorators`
|
87
|
+
- add [rubocop](https://github.com/bbatsov/rubocop) and a template of `.rubocop.yml`
|
88
|
+
- change rake default task: now includes rubocop and brakeman too
|
@@ -355,7 +355,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
355
355
|
copy_file 'suspenders_gitignore', '.gitignore'
|
356
356
|
[
|
357
357
|
'app/forms',
|
358
|
-
'app/
|
358
|
+
'app/decorators',
|
359
359
|
'app/queries',
|
360
360
|
'app/services',
|
361
361
|
'app/views/pages',
|
@@ -363,7 +363,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
|
363
363
|
'spec/forms',
|
364
364
|
'spec/helpers',
|
365
365
|
'spec/lib',
|
366
|
-
'spec/
|
366
|
+
'spec/decorators',
|
367
367
|
'spec/queries',
|
368
368
|
'spec/services',
|
369
369
|
'spec/fixtures',
|
@@ -463,7 +463,15 @@ you can deploy to staging and production with:
|
|
463
463
|
|
464
464
|
def setup_bundler_audit
|
465
465
|
copy_file "bundler_audit.rake", "lib/tasks/bundler_audit.rake"
|
466
|
-
|
466
|
+
end
|
467
|
+
|
468
|
+
def setup_brakeman
|
469
|
+
copy_file "brakeman.rake", "lib/tasks/brakeman.rake"
|
470
|
+
end
|
471
|
+
|
472
|
+
def setup_rubocop
|
473
|
+
copy_file "rubocop.rake", "lib/tasks/rubocop.rake"
|
474
|
+
copy_file "rubocop.yml", ".rubocop.yml"
|
467
475
|
end
|
468
476
|
|
469
477
|
def setup_spring
|
@@ -472,6 +480,7 @@ you can deploy to staging and production with:
|
|
472
480
|
|
473
481
|
def create_binstubs
|
474
482
|
bundle_command "binstubs brakeman"
|
483
|
+
bundle_command "binstubs rubocop"
|
475
484
|
end
|
476
485
|
|
477
486
|
def copy_miscellaneous_files
|
@@ -493,6 +502,28 @@ you can deploy to staging and production with:
|
|
493
502
|
end
|
494
503
|
end
|
495
504
|
|
505
|
+
def remove_config_comment_lines
|
506
|
+
config_files = [
|
507
|
+
"application.rb",
|
508
|
+
"environment.rb",
|
509
|
+
"environments/development.rb",
|
510
|
+
"environments/production.rb",
|
511
|
+
"environments/test.rb",
|
512
|
+
]
|
513
|
+
|
514
|
+
config_files.each do |config_file|
|
515
|
+
path = File.join(destination_root, "config/#{config_file}")
|
516
|
+
|
517
|
+
accepted_content = File.readlines(path).reject do |line|
|
518
|
+
line =~ /^.*#.*$/ || line =~ /^$\n/
|
519
|
+
end
|
520
|
+
|
521
|
+
File.open(path, "w") do |file|
|
522
|
+
accepted_content.each { |line| file.puts line }
|
523
|
+
end
|
524
|
+
end
|
525
|
+
end
|
526
|
+
|
496
527
|
def remove_routes_comment_lines
|
497
528
|
replace_in_file 'config/routes.rb',
|
498
529
|
/Rails\.application\.routes\.draw do.*end/m,
|
@@ -507,7 +538,6 @@ you can deploy to staging and production with:
|
|
507
538
|
append_file 'Rakefile' do
|
508
539
|
<<-EOS
|
509
540
|
task(:default).clear
|
510
|
-
task default: [:spec]
|
511
541
|
|
512
542
|
if defined? RSpec
|
513
543
|
task(:spec).clear
|
@@ -515,6 +545,11 @@ if defined? RSpec
|
|
515
545
|
t.verbose = false
|
516
546
|
end
|
517
547
|
end
|
548
|
+
|
549
|
+
task default: :rubocop
|
550
|
+
task default: :spec
|
551
|
+
task default: "brakeman:check"
|
552
|
+
task default: "bundler:audit"
|
518
553
|
EOS
|
519
554
|
end
|
520
555
|
end
|
@@ -43,13 +43,13 @@ module Suspenders
|
|
43
43
|
invoke :install_refills
|
44
44
|
invoke :copy_miscellaneous_files
|
45
45
|
invoke :customize_error_pages
|
46
|
+
invoke :remove_config_comment_lines
|
46
47
|
invoke :remove_routes_comment_lines
|
47
48
|
invoke :setup_dotfiles
|
48
49
|
invoke :setup_git
|
49
50
|
invoke :setup_database
|
50
51
|
invoke :create_heroku_apps
|
51
52
|
invoke :create_github_repo
|
52
|
-
invoke :setup_bundler_audit
|
53
53
|
invoke :setup_spring
|
54
54
|
invoke :create_binstubs
|
55
55
|
invoke :outro
|
@@ -87,6 +87,9 @@ module Suspenders
|
|
87
87
|
build :provide_dev_prime_task
|
88
88
|
build :configure_generators
|
89
89
|
build :configure_i18n_for_missing_translations
|
90
|
+
build :setup_rubocop
|
91
|
+
build :setup_brakeman
|
92
|
+
build :setup_bundler_audit
|
90
93
|
end
|
91
94
|
|
92
95
|
def setup_test_environment
|
@@ -200,11 +203,6 @@ module Suspenders
|
|
200
203
|
build :gitignore_files
|
201
204
|
end
|
202
205
|
|
203
|
-
def setup_bundler_audit
|
204
|
-
say "Setting up bundler-audit"
|
205
|
-
build :setup_bundler_audit
|
206
|
-
end
|
207
|
-
|
208
206
|
def setup_spring
|
209
207
|
say "Springifying binstubs"
|
210
208
|
build :setup_spring
|
@@ -229,6 +227,10 @@ module Suspenders
|
|
229
227
|
build :customize_error_pages
|
230
228
|
end
|
231
229
|
|
230
|
+
def remove_config_comment_lines
|
231
|
+
build :remove_config_comment_lines
|
232
|
+
end
|
233
|
+
|
232
234
|
def remove_routes_comment_lines
|
233
235
|
build :remove_routes_comment_lines
|
234
236
|
end
|
data/lib/suspenders/version.rb
CHANGED
@@ -158,8 +158,28 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
158
158
|
expect(File).to exist("#{project_path}/spec/rails_helper.rb")
|
159
159
|
end
|
160
160
|
|
161
|
+
it "adds rubocop configuration file" do
|
162
|
+
expect(File).to exist("#{project_path}/.rubocop.yml")
|
163
|
+
end
|
164
|
+
|
161
165
|
it "creates binstubs" do
|
162
166
|
expect(File).to exist("#{project_path}/bin/brakeman")
|
167
|
+
expect(File).to exist("#{project_path}/bin/rubocop")
|
168
|
+
end
|
169
|
+
|
170
|
+
it "removes comments and extra newlines from config files" do
|
171
|
+
config_files = [
|
172
|
+
IO.read("#{project_path}/config/application.rb"),
|
173
|
+
IO.read("#{project_path}/config/environment.rb"),
|
174
|
+
IO.read("#{project_path}/config/environments/development.rb"),
|
175
|
+
IO.read("#{project_path}/config/environments/production.rb"),
|
176
|
+
IO.read("#{project_path}/config/environments/test.rb"),
|
177
|
+
]
|
178
|
+
|
179
|
+
config_files.each do |file|
|
180
|
+
expect(file).not_to match(/.*#.*/)
|
181
|
+
expect(file).not_to match(/^$\n/)
|
182
|
+
end
|
163
183
|
end
|
164
184
|
|
165
185
|
def analytics_partial
|
data/suspenders.gemspec
CHANGED
@@ -25,7 +25,7 @@ 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 'bitters', '~> 1.
|
28
|
+
s.add_dependency 'bitters', '~> 1.1.0'
|
29
29
|
s.add_dependency 'bundler', '~> 1.3'
|
30
30
|
s.add_dependency 'rails', Suspenders::RAILS_VERSION
|
31
31
|
|
data/templates/Gemfile.erb
CHANGED
@@ -7,6 +7,7 @@ gem "autoprefixer-rails"
|
|
7
7
|
gem "bourbon", "~> 4.2.0"
|
8
8
|
gem "coffee-rails", "~> 4.1.0"
|
9
9
|
gem "delayed_job_active_record"
|
10
|
+
gem "draper"
|
10
11
|
gem "email_validator"
|
11
12
|
gem "flutie"
|
12
13
|
gem "high_voltage"
|
@@ -49,6 +50,7 @@ group :development, :test do
|
|
49
50
|
gem "pry-byebug"
|
50
51
|
gem "pry-rails"
|
51
52
|
gem "rspec-rails", "~> 3.3.0"
|
53
|
+
gem "rubocop", require: false
|
52
54
|
end
|
53
55
|
|
54
56
|
group :test do
|
@@ -0,0 +1,18 @@
|
|
1
|
+
if Rails.env.development? || Rails.env.test?
|
2
|
+
namespace :brakeman do
|
3
|
+
desc "Run Brakeman"
|
4
|
+
task :run, :output_files do |_t, args|
|
5
|
+
require 'brakeman'
|
6
|
+
|
7
|
+
files = args[:output_files].split(' ') if args[:output_files]
|
8
|
+
Brakeman.run app_path: ".", output_files: files, print_report: true
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Check your code with Brakeman"
|
12
|
+
task :check do
|
13
|
+
require 'brakeman'
|
14
|
+
result = Brakeman.run app_path: '.', print_report: true
|
15
|
+
exit Brakeman::Warnings_Found_Exit_Code unless result.filtered_warnings.empty?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/templates/circle.yml.erb
CHANGED
data/templates/rails_helper.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
AllCops:
|
2
|
+
RunRailsCops: true
|
3
|
+
Exclude:
|
4
|
+
- 'db/**/*'
|
5
|
+
- 'config/**/*'
|
6
|
+
- 'bin/*'
|
7
|
+
|
8
|
+
Metrics/LineLength:
|
9
|
+
Max: 100
|
10
|
+
|
11
|
+
Style/StringLiterals:
|
12
|
+
Enabled: false
|
13
|
+
EnforcedStyle: double_quotes
|
14
|
+
|
15
|
+
Style/Documentation:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Metrics/AbcSize:
|
19
|
+
Max: 18
|
20
|
+
|
21
|
+
Lint/Debugger:
|
22
|
+
Exclude:
|
23
|
+
- 'spec/support/capybara.rb'
|
data/templates/spec_helper.rb
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
require "simplecov"
|
2
2
|
require "simplecov-json"
|
3
3
|
SimpleCov.start "rails" do
|
4
|
-
add_group "Queries", "app/queries"
|
5
4
|
add_group "Services", "app/services"
|
6
|
-
add_group "Validators", "app/validators"
|
7
|
-
add_group "Presenter", "app/presenters"
|
8
5
|
end
|
9
6
|
SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
|
10
7
|
|
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.17.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-09-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bitters
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: 1.1.0
|
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: 1.
|
27
|
+
version: 1.1.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- templates/application.css.sass
|
130
130
|
- templates/bin_deploy
|
131
131
|
- templates/bin_setup.erb
|
132
|
+
- templates/brakeman.rake
|
132
133
|
- templates/browserslist
|
133
134
|
- templates/bundler_audit.rake
|
134
135
|
- templates/capybara_rspec.rb.erb
|
@@ -151,6 +152,8 @@ files:
|
|
151
152
|
- templates/puma.rb
|
152
153
|
- templates/queries_helper_rspec.rb
|
153
154
|
- templates/rails_helper.rb
|
155
|
+
- templates/rubocop.rake
|
156
|
+
- templates/rubocop.yml
|
154
157
|
- templates/sample.env
|
155
158
|
- templates/secrets.yml
|
156
159
|
- templates/slim.rb
|