Sha256: 99b9fa6e0d1b6b8e65931153c3408a9b8f650b1c6b200a19d071d9619b83f345

Contents?: true

Size: 441 Bytes

Versions: 2

Compression:

Stored size: 441 Bytes

Contents

module CC
  module Analyzer
    class PathPatterns
      def initialize(patterns, root = Dir.pwd)
        @patterns = patterns
        @root = root
      end

      def expanded
        @expanded ||= expand
      end

      private

      def expand
        results = Dir.chdir(@root) do
          @patterns.flat_map do |pattern|
            Dir.glob(pattern)
          end
        end

        results.sort.uniq
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
codeclimate-0.2 lib/cc/analyzer/path_patterns.rb
codeclimate-0.1.5 lib/cc/analyzer/path_patterns.rb