File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,13 @@ class Railtie < ::Rails::Railtie
13
13
# As of Rails 8.0.0 you can register directories to work with `rails stats`
14
14
if ::Rails ::VERSION ::STRING >= "8.0.0"
15
15
require 'rails/code_statistics'
16
- types = begin
17
- dirs = Dir [ './spec/**/*_spec.rb' ]
18
- . map { |f | f . sub ( /^\. \/ (spec\/ \w +)\/ .*/ , '\\1' ) }
19
- . uniq
20
- . select { |f | File . directory? ( f ) }
21
- Hash [ dirs . map { |d | [ d . split ( '/' ) . last , d ] } ]
22
- end
23
- types . each do |type , dir |
16
+
17
+ dirs = Dir [ './spec/**/*_spec.rb' ]
18
+ . map { |f | f . sub ( /^\. \/ (spec\/ \w +)\/ .*/ , '\\1' ) }
19
+ . uniq
20
+ . select { |f | File . directory? ( f ) }
21
+
22
+ Hash [ dirs . map { |d | [ d . split ( '/' ) . last , d ] } ] . each do |type , dir |
24
23
name = type . singularize . capitalize
25
24
26
25
::Rails ::CodeStatistics . register_directory "#{ name } specs" , dir
You can’t perform that action at this time.
0 commit comments