module Kamaze::Project::Tools::Yardoc::Watchable
Provide watch related methods
Yardoc
(wrapper class) is used by a Watcher
using tools it MUST provide some methods used to:
-
initialize “Listen“
-
provide patterns (glob pattern matching)
Instance of “YARD::CLI::Yardoc“ is retrieved through “core“ method
Public Instance Methods
excluded()
click to toggle source
Ignores files matching path match (regexp)
@return [Array<String>]
# File lib/kamaze/project/tools/yardoc/watchable.rb, line 61 def excluded core.excluded end
files()
click to toggle source
Get files
Mostly patterns, addition of “files“ with “options.files“ SHOULD include “README“ file, when “.yardopts“ defined
@return [Array<Kamaze::Project::Tools::Yardoc::File>]
# File lib/kamaze/project/tools/yardoc/watchable.rb, line 49 def files # @formatter:off [ core.files.to_a.flatten.map { |f| File.new(f, true) }, core.options.files.to_a.map { |f| File.new(f.filename, false) } ].flatten # @formatter:on end
paths()
click to toggle source
Get paths
@return [Array<Pathname>]
# File lib/kamaze/project/tools/yardoc/watchable.rb, line 29 def paths files.map do |file| file.to_a.min end.flatten.compact.uniq.sort end
patterns()
click to toggle source
Get patterns (usable for glob pattern matching)
@return [Array<String>]
# File lib/kamaze/project/tools/yardoc/watchable.rb, line 38 def patterns files.map(&:to_s) end