1
0
Fork 0
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:
Kasper Timm Hansen 2018-08-23 11:02:15 +02:00 committed by GitHub
commit 2a321bff40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View file

@ -6,7 +6,7 @@ module Rails
hide_command!
def help(*)
puts self.class.desc
say self.class.desc
Rails::Command.print_commands
end

View file

@ -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

View file

@ -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

View file

@ -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