module DreddHooks
  module FileLoader
    def self.unique_paths(patterns)
      patterns.inject([]) { |paths, pattern|
        paths += Dir.glob(pattern)
      }.uniq
    end

    def self.load(patterns)
      self.unique_paths(patterns).each do |path|
        puts path
        require path
      end
    end
  end
end


module DreddHooks
  module FileLoader

    def self.load(patterns)
      self.unique_paths(patterns).each do |path|
        puts path
        require path
      end
    end

    private

      def self.unique_paths(patterns)
        patterns.inject([]) { |paths, pattern|
          paths += Dir.glob(pattern)
        }.uniq
      end
  end
end


Refactor make method accessibilty explicit
Refactor make method accessibilty explicit

The FileLoader.unique_paths is not part of its API and should not
be used by other classes/modules.
