Skip to content
Snippets Groups Projects
Commit b032963d authored by Markus Reiter's avatar Markus Reiter
Browse files

Use Homebrew’s `require?`.

parent d37f2e7a
No related branches found
No related tags found
No related merge requests found
......@@ -91,17 +91,6 @@ module Hbc
@lookup.fetch(command_string, command_string)
end
# modified from Homebrew
def self.require?(path)
require path
true # OK if already loaded
rescue LoadError => e
# HACK: :( because we should raise on syntax errors
# but not if the file doesn't exist.
# TODO: make robust!
raise unless e.to_s.include? path
end
def self.should_init?(command)
(command.is_a? Class) && (command < CLI::Base) && command.needs_init?
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment