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.24.0 lib/cc/workspace/exclusion.rb
codeclimate-0.23.0 lib/cc/workspace/exclusion.rb
codeclimate-0.22.3 lib/cc/workspace/exclusion.rb
codeclimate-0.22.2 lib/cc/workspace/exclusion.rb
codeclimate-0.22.1 lib/cc/workspace/exclusion.rb
codeclimate-0.22.0 lib/cc/workspace/exclusion.rb
codeclimate-0.21.4 lib/cc/workspace/exclusion.rb
codeclimate-0.21.3 lib/cc/workspace/exclusion.rb
codeclimate-0.21.2 lib/cc/workspace/exclusion.rb
codeclimate-0.21.1 lib/cc/workspace/exclusion.rb
codeclimate-0.21.0 lib/cc/workspace/exclusion.rb
codeclimate-0.20.2 lib/cc/workspace/exclusion.rb
codeclimate-0.20.1 lib/cc/workspace/exclusion.rb
codeclimate-0.20.0 lib/cc/workspace/exclusion.rb
codeclimate-0.19.2 lib/cc/workspace/exclusion.rb
codeclimate-0.19.1 lib/cc/workspace/exclusion.rb
codeclimate-0.19.0 lib/cc/workspace/exclusion.rb
codeclimate-0.18.6 lib/cc/workspace/exclusion.rb
codeclimate-0.18.5 lib/cc/workspace/exclusion.rb
codeclimate-0.18.4 lib/cc/workspace/exclusion.rb