Sha256: f1e2ea18293c0eaf7bed822e487ff3223f2e0d51a9f16b6ca204a39a9095fb3a

Contents?: true

Size: 450 Bytes

Versions: 44

Compression:

Stored size: 450 Bytes

Contents

module CC
  class Workspace
    class Exclusion
      def initialize(pattern)
        @pattern = simplify(pattern)
      end

      def expand
        if glob?
          Dir.glob(pattern)
        else
          [pattern]
        end
      end

      def glob?
        pattern.include?("*")
      end

      private

      attr_reader :pattern

      def simplify(pattern)
        pattern.to_s.sub(%r{(/\*\*)?(/\*)?$}, "")
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
codeclimate-0.33.0 lib/cc/workspace/exclusion.rb
codeclimate-0.32.1 lib/cc/workspace/exclusion.rb
codeclimate-0.32.0 lib/cc/workspace/exclusion.rb
codeclimate-0.32.0.rc1 lib/cc/workspace/exclusion.rb
codeclimate-0.31.1 lib/cc/workspace/exclusion.rb
codeclimate-0.31.0 lib/cc/workspace/exclusion.rb
codeclimate-0.30.1 lib/cc/workspace/exclusion.rb
codeclimate-0.30.0 lib/cc/workspace/exclusion.rb
codeclimate-0.29.0 lib/cc/workspace/exclusion.rb
codeclimate-0.28.0 lib/cc/workspace/exclusion.rb
codeclimate-0.27.2 lib/cc/workspace/exclusion.rb
codeclimate-0.27.1 lib/cc/workspace/exclusion.rb
codeclimate-0.27.0 lib/cc/workspace/exclusion.rb
codeclimate-0.27.0.rc1 lib/cc/workspace/exclusion.rb
codeclimate-0.26.0 lib/cc/workspace/exclusion.rb
codeclimate-0.25.1 lib/cc/workspace/exclusion.rb
codeclimate-0.25.0 lib/cc/workspace/exclusion.rb
codeclimate-0.24.3 lib/cc/workspace/exclusion.rb
codeclimate-0.24.2 lib/cc/workspace/exclusion.rb
codeclimate-0.24.1 lib/cc/workspace/exclusion.rb