mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #33696 from bogdanvlviv/follow-up-44007c070
Use `say`/`error` instead of `puts`/`$stderr.puts`
This commit is contained in:
commit
2a321bff40
4 changed files with 10 additions and 10 deletions
|
@ -6,7 +6,7 @@ module Rails
|
|||
hide_command!
|
||||
|
||||
def help(*)
|
||||
puts self.class.desc
|
||||
say self.class.desc
|
||||
|
||||
Rails::Command.print_commands
|
||||
end
|
||||
|
|
|
@ -10,8 +10,8 @@ module Rails
|
|||
end
|
||||
|
||||
def perform(*)
|
||||
puts "Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.\n"
|
||||
puts "Type 'rails' for help."
|
||||
say "Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.\n"
|
||||
say "Type 'rails' for help."
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ module Rails
|
|||
|
||||
if File.exist?(railsrc)
|
||||
extra_args = File.read(railsrc).split(/\n+/).flat_map(&:split)
|
||||
puts "Using #{extra_args.join(" ")} from #{railsrc}"
|
||||
say "Using #{extra_args.join(" ")} from #{railsrc}"
|
||||
plugin_args.insert(1, *extra_args)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ module Rails
|
|||
no_commands do
|
||||
def help
|
||||
super
|
||||
puts self.class.desc
|
||||
say self.class.desc
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -39,11 +39,11 @@ module Rails
|
|||
else
|
||||
begin
|
||||
eval(code_or_file, TOPLEVEL_BINDING, __FILE__, __LINE__)
|
||||
rescue SyntaxError, NameError => error
|
||||
$stderr.puts "Please specify a valid ruby command or the path of a script to run."
|
||||
$stderr.puts "Run '#{self.class.executable} -h' for help."
|
||||
$stderr.puts
|
||||
$stderr.puts error
|
||||
rescue SyntaxError, NameError => e
|
||||
error "Please specify a valid ruby command or the path of a script to run."
|
||||
error "Run '#{self.class.executable} -h' for help."
|
||||
error ""
|
||||
error e
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue