buff-ignore 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,8 @@
1
1
  CHANGELOG
2
2
  =========
3
+ v1.1.0
4
+ ------
5
+ - Make `ignored?` a public function
3
6
 
4
7
  v1.0.4
5
8
  ------
@@ -63,6 +63,20 @@ module Buff
63
63
  end
64
64
  end
65
65
 
66
+ # Determine if a given filename should be ignored
67
+ #
68
+ # @param [String] filename
69
+ # the file to match
70
+ #
71
+ # @return [Boolean]
72
+ # true if the file should be ignored, false otherwise
73
+ def ignored?(filename)
74
+ base = File.expand_path(options[:base] || File.dirname(filepath))
75
+ basename = filename.sub(base + File::SEPARATOR, '')
76
+
77
+ ignores.any? { |ignore| File.fnmatch?(ignore, basename) }
78
+ end
79
+
66
80
  private
67
81
  # The list of options
68
82
  #
@@ -77,20 +91,6 @@ module Buff
77
91
  line.empty? || line =~ COMMENT_OR_WHITESPACE
78
92
  end
79
93
  end
80
-
81
- # Helper boolean to determine if a given filename should be ignored
82
- #
83
- # @param [String] filename
84
- # the file to match
85
- #
86
- # @return [Boolean]
87
- # true if the file should be ignored, false otherwise
88
- def ignored?(filename)
89
- base = File.expand_path(options[:base] || File.dirname(filepath))
90
- basename = filename.sub(base + File::SEPARATOR, '')
91
-
92
- ignores.any? { |ignore| File.fnmatch?(ignore, basename) }
93
- end
94
94
  end
95
95
  end
96
96
  end
@@ -1,6 +1,6 @@
1
1
  module Buff
2
2
  module Ignore
3
3
  # The version of Buff::Ignore
4
- VERSION = '1.0.4'
4
+ VERSION = '1.1.0'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buff-ignore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: