Move require? to utils.
This commit is contained in:
parent
5a047c7c27
commit
599a618273
@ -21,14 +21,6 @@ if ARGV == %w[--version] || ARGV == %w[-v]
|
|||||||
exit 0
|
exit 0
|
||||||
end
|
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
|
begin
|
||||||
trap("INT", std_trap) # restore default CTRL-C handler
|
trap("INT", std_trap) # restore default CTRL-C handler
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,14 @@ require "utils/svn"
|
|||||||
require "utils/tty"
|
require "utils/tty"
|
||||||
require "time"
|
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)
|
def ohai(title, *sput)
|
||||||
title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose?
|
title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose?
|
||||||
puts Formatter.headline(title, color: :blue)
|
puts Formatter.headline(title, color: :blue)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user