File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ def generator_options
69
69
skip_action_mailbox : !defined? ( ActionMailbox ::Engine ) ,
70
70
skip_action_text : !defined? ( ActionText ::Engine ) ,
71
71
skip_action_cable : !defined? ( ActionCable ::Engine ) ,
72
- skip_brakeman : skip_brakeman? ,
72
+ skip_brakeman : skip_gem? ( "brakeman" ) ,
73
+ skip_rubocop : skip_gem? ( "rubocop" ) ,
73
74
skip_test : !defined? ( Rails ::TestUnitRailtie ) ,
74
75
skip_system_test : Rails . application . config . generators . system_tests . nil? ,
75
76
asset_pipeline : asset_pipeline ,
@@ -89,8 +90,8 @@ def asset_pipeline
89
90
end
90
91
end
91
92
92
- def skip_brakeman?
93
- require "brakeman"
93
+ def skip_gem? ( gem_name )
94
+ gem gem_name
94
95
false
95
96
rescue LoadError
96
97
true
Original file line number Diff line number Diff line change @@ -296,6 +296,16 @@ def test_app_update_preserves_skip_brakeman
296
296
end
297
297
end
298
298
299
+ def test_app_update_preserves_skip_rubocop
300
+ run_generator [ destination_root , "--skip-rubocop" ]
301
+
302
+ FileUtils . cd ( destination_root ) do
303
+ assert_no_changes -> { File . exist? ( "bin/rubocop" ) } do
304
+ run_app_update
305
+ end
306
+ end
307
+ end
308
+
299
309
def test_app_update_preserves_skip_test
300
310
run_generator [ destination_root , "--skip-test" ]
301
311
You can’t perform that action at this time.
0 commit comments