Module: Ignore
- Defined in:
- lib/kicker/recipes/ignore.rb
Overview
A recipe which removes files from the files array, thus “ignoring” them.
By default ignores logs, tmp, and svn and git files.
See Kernel#ignore for info on how to ignore files.
Class Method Summary collapse
-
.call(files) ⇒ Object
:nodoc:.
-
.ignore(regexp_or_string) ⇒ Object
:nodoc:.
-
.ignores ⇒ Object
:nodoc:.
Class Method Details
.call(files) ⇒ Object
:nodoc:
7 8 9 |
# File 'lib/kicker/recipes/ignore.rb', line 7 def self.call(files) #:nodoc: files.reject! { |file| ignores.any? { |ignore| file =~ ignore } } end |
.ignore(regexp_or_string) ⇒ Object
:nodoc:
15 16 17 |
# File 'lib/kicker/recipes/ignore.rb', line 15 def self.ignore(regexp_or_string) #:nodoc: ignores << (regexp_or_string.is_a?(Regexp) ? regexp_or_string : /^#{regexp_or_string}$/) end |
.ignores ⇒ Object
:nodoc:
11 12 13 |
# File 'lib/kicker/recipes/ignore.rb', line 11 def self.ignores #:nodoc: @ignores ||= [] end |