Parent

Included Modules

Listen::Silencer

Constants

DEFAULT_IGNORED_DIRECTORIES

The default list of directories that get ignored.

DEFAULT_IGNORED_EXTENSIONS

The default list of files that get ignored.

Attributes

ignore_patterns[RW]
listener[RW]
only_patterns[RW]

Public Class Methods

new(listener) click to toggle source
# File lib/listen/silencer.rb, line 36
def initialize(listener)
  @listener = listener
  _init_only_patterns
  _init_ignore_patterns
end

Public Instance Methods

match(args) click to toggle source
# File lib/listen/silencer.rb, line 54
def match(args)
  path, type = args.first
  silenced?(path, type)
end
silenced?(path, type = 'Unknown') click to toggle source
# File lib/listen/silencer.rb, line 42
def silenced?(path, type = 'Unknown')
  silenced = false

  relative_path = _relative_path(path)

  if only_patterns && type == 'File'
    silenced = !only_patterns.any? { |pattern| relative_path =~ pattern }
  end

  silenced || ignore_patterns.any? { |pattern| relative_path =~ pattern }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.