lib/cli/mastermind/loader.rb
# Finds the correct loader for a given extension
#
# @param extension [String] the extensions to search with
# @raise [UnsupportedFileTypeError] if no compatible loader is found
# @return [Loader] the loader for the given +extension+.
Finds the correct loader for a given extension
Finds the correct loader for a given extension
def find_loader(extension)
        loader = @@loaders.find { |l| l.can_load? extension }
        raise UnsupportedFileTypeError.new(extension) unless loader
        loader
      end
def find_loader ( extension ) loader = @@loaders . find { | l | l . can_load? extension } raise UnsupportedFileTypeError . new ( extension ) unless loader loader end
Finds the correct loader for a given extension
Finds the correct loader for a given extension
the loader for the given +extension+.
the loader for the given + extension + .
Loader
[UnsupportedFileTypeError] if no compatible loader is found
[ UnsupportedFileTypeError ] if no compatible loader is found
extension
the extensions to search with
the extensions to search with