module Guard::Ronn::Inspector

Public Class Methods

clean(paths) click to toggle source
# File lib/guard/ronn/inspector.rb, line 5
def clean(paths)
  paths.uniq!
  paths.compact!
  clear_ronn_files_list_after do
    paths = paths.select { |path| ronn_file?(path) }
  end
  paths.reject { |p| included_in_other_path?(p, paths) }
end
ronn_files() click to toggle source
# File lib/guard/ronn/inspector.rb, line 14
def ronn_files
  @ronn_files ||= Dir['man/*.{ronn,md,markdown}']
end

Private Class Methods

clear_ronn_files_list_after() { || ... } click to toggle source
# File lib/guard/ronn/inspector.rb, line 24
def clear_ronn_files_list_after
  yield
  @ronn_files = nil
end
included_in_other_path?(path, paths) click to toggle source
# File lib/guard/ronn/inspector.rb, line 29
def included_in_other_path?(path, paths)
  (paths - [path]).any? { |p| path.include?(p) && path.sub(p, '').include?('/') }
end
ronn_file?(path) click to toggle source
# File lib/guard/ronn/inspector.rb, line 20
def ronn_file?(path)
  ronn_files.include?(path)
end