Sha256: a18f41491f2b4adc3750a4e7289b36e6d02ad0436a679dafc7c4c61929b51536

Contents?: true

Size: 629 Bytes

Versions: 32

Compression:

Stored size: 629 Bytes

Contents

module CC
  class Workspace
    autoload :Exclusion, "cc/workspace/exclusion"
    autoload :PathTree, "cc/workspace/path_tree"

    def initialize(path_tree = PathTree.for_path("."))
      @path_tree = path_tree
    end

    def clone
      self.class.new(path_tree.clone)
    end

    def paths
      path_tree.all_paths
    end

    def add(paths)
      if paths.present?
        path_tree.include_paths(paths)
      end
    end

    def remove(patterns)
      Array(patterns).each do |pattern|
        path_tree.exclude_paths(Exclusion.new(pattern).expand)
      end
    end

    private

    attr_reader :path_tree
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
codeclimate-0.24.0 lib/cc/workspace.rb
codeclimate-0.23.0 lib/cc/workspace.rb
codeclimate-0.22.3 lib/cc/workspace.rb
codeclimate-0.22.2 lib/cc/workspace.rb
codeclimate-0.22.1 lib/cc/workspace.rb
codeclimate-0.22.0 lib/cc/workspace.rb
codeclimate-0.21.4 lib/cc/workspace.rb
codeclimate-0.21.3 lib/cc/workspace.rb
codeclimate-0.21.2 lib/cc/workspace.rb
codeclimate-0.21.1 lib/cc/workspace.rb
codeclimate-0.21.0 lib/cc/workspace.rb
codeclimate-0.20.2 lib/cc/workspace.rb