Skip to content

Commit 96821da

Browse files
authored
Merge pull request #977 from tmaier/generator-2
Update documentation to fix Rubocop errors in 'rails generate' command
2 parents 73fd423 + f5c9e30 commit 96821da

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ your config/application.rb to apply RuboCop autocorrection to code generated by
7171
module YourCoolApp
7272
class Application < Rails::Application
7373
config.generators.after_generate do |files|
74-
system("bundle exec rubocop -A --fail-level=E #{files.shelljoin}", exception: true)
74+
parsable_files = files.filter { |file| file.end_with?('.rb') }
75+
system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
7576
end
7677
end
7778
end

docs/modules/ROOT/pages/usage.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ your config/application.rb to apply RuboCop autocorretion to code generated by `
4141
module YourCoolApp
4242
class Application < Rails::Application
4343
config.generators.after_generate do |files|
44-
system("bundle exec rubocop -A --fail-level=E #{files.shelljoin}", exception: true)
44+
parsable_files = files.filter { |file| file.end_with?('.rb') }
45+
system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
4546
end
4647
end
4748
end

0 commit comments

Comments
 (0)