From d156c47018ac5fbeac295555f438af1765e5a0a8 Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Thu, 12 Jan 2023 15:49:58 -0600 Subject: [PATCH] Hide runner:looks_like_a_file_path? This prevents `runner:looks_like_a_file_path?` from showing up in the output of `bin/rails --help`. __Before__ ```console $ bin/rails --help You must specify a command. The most common commands are: ... In addition to those commands, there are: about List versions of all Rails frameworks and... ... runner runner:looks_like_a_file_path? secret Generate a cryptographically secure secre... secrets:edit ... ``` __After__ ```console $ bin/rails --help You must specify a command. The most common commands are: ... In addition to those commands, there are: about List versions of all Rails frameworks and... ... runner secret Generate a cryptographically secure secre... secrets:edit ... ``` --- railties/lib/rails/commands/runner/runner_command.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/railties/lib/rails/commands/runner/runner_command.rb b/railties/lib/rails/commands/runner/runner_command.rb index c0e2f4d5a8..11a375b72b 100644 --- a/railties/lib/rails/commands/runner/runner_command.rb +++ b/railties/lib/rails/commands/runner/runner_command.rb @@ -66,9 +66,10 @@ def perform(code_or_file = nil, *command_argv) end end - def looks_like_a_file_path?(code_or_file) - code_or_file.ends_with?(".rb") - end + private + def looks_like_a_file_path?(code_or_file) + code_or_file.ends_with?(".rb") + end end end end