Class: FileScanners::Ignorer
- Inherits:
-
Object
- Object
- FileScanners::Ignorer
- Defined in:
- lib/file_scanners/ignorer.rb
Overview
Takes a list of files and ignores them appropriately
Constant Summary collapse
- DEFAULT_IGNORES =
%w[/test/ /spec/ /db/ /config/ /bin/ /vendor/ /public/].freeze
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #ignore?(file) ⇒ Boolean
-
#initialize(path) ⇒ Ignorer
constructor
A new instance of Ignorer.
Constructor Details
#initialize(path) ⇒ Ignorer
Returns a new instance of Ignorer.
8 9 10 |
# File 'lib/file_scanners/ignorer.rb', line 8 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/file_scanners/ignorer.rb', line 7 def path @path end |
Instance Method Details
#ignore?(file) ⇒ Boolean
12 13 14 15 16 17 |
# File 'lib/file_scanners/ignorer.rb', line 12 def ignore?(file) ignore_rules.each do |rule| return true if rule === file end false end |