fast_ignore 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dad6489c13a9f963a02bff55376b8ff3f6b933d7
4
- data.tar.gz: '030182407da00aba178d8d9160b8a9cd08d71b87'
2
+ SHA256:
3
+ metadata.gz: dd3cffbf805ab15bbbfe22e5e4afb0462ada58ec1baaf6281e9bb8ef5d80697a
4
+ data.tar.gz: 81a228932c87cc9fbec0a21562b6a6d295a3f45aed8502f9bb38dd4237a826f9
5
5
  SHA512:
6
- metadata.gz: e13027962d2acbc50757129ed768325c18eaa2b12e937d4c2a1f1c51e6af21420c492acdc10d0c39a793c674918744f0a18332d9a63001b723bee38908524c7b
7
- data.tar.gz: 1fb547b9b47186b60d20d4006ecc1662e44ea9259269d219a9b47c7e45591684479a77de80fd7e79a706be0c8747fd7c2cdbb300101f424dc6967e99d914ea2b
6
+ metadata.gz: 24adff6dfcc51add546f9f7ed2e67eee3e71ef574f449f834161d642426e019095394f73733d5cd29a4f0b3db40b7b845cb024a3958b2b6ca8ef27490023e51f
7
+ data.tar.gz: cac2c9eea6dbcce19adbe0ed7c2c0c332e8453e3ff25f0124e2f7850133cec84fdd977c7e24d931654d9150d2b808dd91f7ad43639b9bc9ce7bb133ba58ff2fd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.5.1
2
+ - restore `.allowed?`. now i have tests for it. oops
3
+
1
4
  # v0.5.0
2
5
  - remove deprecated `:rules` and `:files` arguments
3
6
  - ! is now evaluated in sequence for include_rules
@@ -16,5 +16,9 @@ class FastIgnore
16
16
  @dir_only = dir_only
17
17
  @negation = negation
18
18
  end
19
+
20
+ def inspect
21
+ "#<Rule #{'!' if negation?}#{rule}#{'/' if dir_only?}>"
22
+ end
19
23
  end
20
24
  end
@@ -9,9 +9,9 @@ class FastIgnore
9
9
  def initialize(project_root: Dir.pwd, allow: false)
10
10
  @rules = []
11
11
  @non_dir_only_rules = []
12
- @allowed_unrecursive = {}
13
- @allowed_recursive = {}
14
12
  @project_root = project_root
13
+ @allowed_unrecursive = { @project_root => true }
14
+ @allowed_recursive = { @project_root => true }
15
15
  @any_not_anchored = false
16
16
  @empty = true
17
17
  @allow = allow
@@ -29,11 +29,9 @@ class FastIgnore
29
29
  end
30
30
 
31
31
  def allowed_recursive?(path, dir)
32
- return true if path == @project_root
33
-
34
32
  @allowed_recursive.fetch(path) do
35
33
  @allowed_recursive[path] =
36
- allowed_recursive?(path, true) && allowed_unrecusrive?(path, dir)
34
+ allowed_recursive?(::File.dirname(path), true) && allowed_unrecursive?(path, dir)
37
35
  end
38
36
  end
39
37
 
@@ -51,8 +49,8 @@ class FastIgnore
51
49
  end
52
50
 
53
51
  def clear_cache
54
- @allowed_unrecursive = {}
55
- @allowed_recursive = {}
52
+ @allowed_unrecursive = { @project_root => true }
53
+ @allowed_recursive = { @project_root => true }
56
54
  end
57
55
 
58
56
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class FastIgnore
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_ignore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dana Sherson
@@ -145,8 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubyforge_project:
149
- rubygems_version: 2.5.2.1
148
+ rubygems_version: 3.1.2
150
149
  signing_key:
151
150
  specification_version: 4
152
151
  summary: Parse gitignore files, quickly