codeclimate 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 384de14b21a594200f41bb4f4f2580d040b1c478
4
- data.tar.gz: 508d83821de8a6ee98144c0e27f3a3b506a4f6e8
3
+ metadata.gz: 0d15169a255ac95cf8dd9aadacafda760c8b625c
4
+ data.tar.gz: b09e76c34dfc01c63fcc33dc5382974e2afd1da0
5
5
  SHA512:
6
- metadata.gz: 059ee02c1e0b08f8ad79ca823fd3616baa0df733ee662b05b0ba0484492af21e3a7af487d641253710ebd7afe6e80c298879626b7d7c6b69310c8963a680d7a4
7
- data.tar.gz: 3ab5616a8294db10b64d135ee03420b809f641a8390966aaba7d6ab467f2cc061912146b24422d9c272385c20464a053867ccf3370ca95d91408f05c0f810ada
6
+ metadata.gz: 5b539204d43582ac52f2011ec299e245827bcd786523c34384a30d259e9ae0f921f130a99068c4e9a7ac405c4a6474f439795fcc4c6b28279cf3c83e24d9d6a5
7
+ data.tar.gz: 3dcb0c380df659c3fb8fcedc9d33568aaaf7eaab6304b1ddbb50048a5010e7cdc9ec404aaa453bb5089a2d7a88a8a53a3715d703183a927b6db1a69f5a7e2db6
data/lib/cc/workspace.rb CHANGED
@@ -23,7 +23,12 @@ module CC
23
23
 
24
24
  def remove(patterns)
25
25
  Array(patterns).each do |pattern|
26
- path_tree.exclude_paths(Exclusion.new(pattern).expand)
26
+ exclusion = Exclusion.new(pattern)
27
+ if exclusion.negated?
28
+ path_tree.include_paths(exclusion.expand)
29
+ else
30
+ path_tree.exclude_paths(exclusion.expand)
31
+ end
27
32
  end
28
33
  end
29
34
 
@@ -2,6 +2,7 @@ module CC
2
2
  class Workspace
3
3
  class Exclusion
4
4
  def initialize(pattern)
5
+ @negated = pattern.starts_with?("!")
5
6
  @pattern = simplify(pattern)
6
7
  end
7
8
 
@@ -17,12 +18,16 @@ module CC
17
18
  pattern.include?("*")
18
19
  end
19
20
 
21
+ def negated?
22
+ negated
23
+ end
24
+
20
25
  private
21
26
 
22
- attr_reader :pattern
27
+ attr_reader :negated, :pattern
23
28
 
24
29
  def simplify(pattern)
25
- pattern.to_s.sub(%r{(/\*\*)?(/\*)?$}, "")
30
+ pattern.to_s.sub(%r{(/\*\*)?(/\*)?$}, "").sub(/^\!/, "")
26
31
  end
27
32
  end
28
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-03 00:00:00.000000000 Z
11
+ date: 2016-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport