Sha256: bfadf742dec161575bd191f0f44b305b0640927ff055a71c6d62b228d4f656b3
Contents?: true
Size: 566 Bytes
Versions: 16
Compression:
Stored size: 566 Bytes
Contents
# Find out if a specific library file was already required def required?(file) rex = Regexp.new("/#{Regexp.quote(file)}\.(so|o|sl|rb)?") $LOADED_FEATURES.find { |f| f =~ rex } end def any_required?(arr) arr.any? { |file| required?(file) } end def all_required?(arr) arr.all? { |file| required?(file) } end def load_task(name, dependencies = []) if all_required? dependencies load File.join(File.dirname(__FILE__), '..', 'capistrano', 'tasks', "#{name}.rake") else fail "To load #{name} you need to include #{dependencies.join ", "}" end end
Version data entries
16 entries across 16 versions & 1 rubygems