Move require? to utils.

This commit is contained in:
Markus Reiter 2017-06-14 12:51:36 +02:00
parent 5a047c7c27
commit 599a618273
2 changed files with 8 additions and 8 deletions

View File

@ -21,14 +21,6 @@ if ARGV == %w[--version] || ARGV == %w[-v]
exit 0
end
def require?(path)
return false if path.nil?
require path
rescue LoadError => e
# we should raise on syntax errors but not if the file doesn't exist.
raise unless e.message.include?(path)
end
begin
trap("INT", std_trap) # restore default CTRL-C handler

View File

@ -15,6 +15,14 @@ require "utils/svn"
require "utils/tty"
require "time"
def require?(path)
return false if path.nil?
require path
rescue LoadError => e
# we should raise on syntax errors but not if the file doesn't exist.
raise unless e.message.include?(path)
end
def ohai(title, *sput)
title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose?
puts Formatter.headline(title, color: :blue)