fast_ignore 0.8.2 → 0.8.3

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
  SHA256:
3
- metadata.gz: 03c81966a545152071086c49d90057bc1950731affd0abdaabfe622c1b357d78
4
- data.tar.gz: 312e624e3a542e3ee179d02f11070fe2a78d43cf7304b92a8420071ffdde75aa
3
+ metadata.gz: 9218ac549a0d5f73ff24a656320561307b89c7137f105e2921d4adb81074bcd8
4
+ data.tar.gz: 6ed5b5a316d48e7a10bd87b3159fa61f750154c7614c9ad11a1ceb992df0bace
5
5
  SHA512:
6
- metadata.gz: 98af14403dd1ba3dd9ac4800077324ed21d00a0a57e9761e3e720fe81e723de589e016ae78696c8ce173ab60e027361a37181c61492fbd8240a85657612b13ad
7
- data.tar.gz: df3f1d628a6f42b8630ee6c8aacc23722720e88e782001809bb4106da68853e365f573b4796b3e0fa828fc640428ac7e820ab6b0eade1a8eee1affbea605118d
6
+ metadata.gz: 366a9500c6a9e1b725bb7fcb691040bbd0385b20f4e8e496f7199f4640c05bbc51de4593a634f82166ec81d5c9a1fd2251c38a1bfc37a5bacf06934154965c94
7
+ data.tar.gz: 11b0afcc962cd225be140384dd3dc3e61c4006c699b22b1016e6b339b11fae26f30a59f4f98740ad46769653761850b4385b04e9c62b53457a1244075dec8dbe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.8.3
2
+ - fix `ignore_rules` not matching directories when using `include_shebangs:`
3
+
1
4
  # v0.8.2
2
5
  - fix `include_rules` not matching filenames with no extension when using `include_shebangs:`
3
6
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class FastIgnore
4
- VERSION = '0.8.2'
4
+ VERSION = '0.8.3'
5
5
  end
data/lib/fast_ignore.rb CHANGED
@@ -35,7 +35,7 @@ class FastIgnore
35
35
  @root_trailing_slash = "#{@root}/"
36
36
  @shebang_pattern = prepare_shebang_pattern(include_shebangs)
37
37
 
38
- @rule_sets = ::FastIgnore::RuleSetBuilder.from_args(
38
+ rule_sets = ::FastIgnore::RuleSetBuilder.from_args(
39
39
  root: @root,
40
40
  ignore_rules: ignore_rules,
41
41
  ignore_files: ignore_files,
@@ -45,7 +45,7 @@ class FastIgnore
45
45
  argv_rules: argv_rules
46
46
  )
47
47
 
48
- @include_rule_sets, @ignore_rule_sets = @rule_sets.partition(&:allow?)
48
+ @include_rule_sets, @ignore_rule_sets = rule_sets.partition(&:allow?)
49
49
  @has_include_rule_sets = !@include_rule_sets.empty?
50
50
  @relative = relative
51
51
  end
@@ -85,13 +85,13 @@ class FastIgnore
85
85
  child = path + basename
86
86
  dir = ::File.stat(child).directory? # equivalent to directory? and exist?
87
87
 
88
+ next unless @ignore_rule_sets.all? { |r| r.allowed_unrecursive?(child, dir) }
89
+
88
90
  if dir
89
- next unless @shebang_pattern || @rule_sets.all? { |r| r.allowed_unrecursive?(child, dir) }
91
+ next unless @shebang_pattern || @include_rule_sets.all? { |r| r.allowed_unrecursive?(child, dir) }
90
92
 
91
93
  each_allowed("#{child}/", &block)
92
94
  else
93
- next unless @ignore_rule_sets.all? { |r| r.allowed_unrecursive?(child, dir) }
94
-
95
95
  if @shebang_pattern
96
96
  unless (@has_include_rule_sets &&
97
97
  @include_rule_sets.all? { |r| r.allowed_unrecursive?(child, dir) }) ||
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.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dana Sherson