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.33.0 lib/cc/workspace.rb
codeclimate-0.32.1 lib/cc/workspace.rb
codeclimate-0.32.0 lib/cc/workspace.rb
codeclimate-0.32.0.rc1 lib/cc/workspace.rb
codeclimate-0.31.1 lib/cc/workspace.rb
codeclimate-0.31.0 lib/cc/workspace.rb
codeclimate-0.30.1 lib/cc/workspace.rb
codeclimate-0.30.0 lib/cc/workspace.rb
codeclimate-0.29.0 lib/cc/workspace.rb
codeclimate-0.28.0 lib/cc/workspace.rb
codeclimate-0.27.2 lib/cc/workspace.rb
codeclimate-0.27.1 lib/cc/workspace.rb
codeclimate-0.27.0 lib/cc/workspace.rb
codeclimate-0.27.0.rc1 lib/cc/workspace.rb
codeclimate-0.26.0 lib/cc/workspace.rb
codeclimate-0.25.1 lib/cc/workspace.rb
codeclimate-0.25.0 lib/cc/workspace.rb
codeclimate-0.24.3 lib/cc/workspace.rb
codeclimate-0.24.2 lib/cc/workspace.rb
codeclimate-0.24.1 lib/cc/workspace.rb