module HaveAPI::Fs::Help

Included this module to a {Component} to provide help files. All components based on {Components::Directory} already have this module included.

Constants

SEARCH_PATH

When searching for a help file, all directories in this list are checked. Add paths to this list for help files of third-party components.

Public Class Methods

find!(name) click to toggle source

Search for `name` in paths defined in {SEARCH_PATH}. @return [String]

# File lib/haveapi/fs/help.rb, line 80
def find!(name)
  SEARCH_PATH.each do |s|
    path = ::File.join(s, name)

    return path if ::File.exists?(path)
  end

  raise Errno::ENOENT, "help file '#{name}' not found"
end
included(klass) click to toggle source
# File lib/haveapi/fs/help.rb, line 73
def included(klass)
  klass.send(:extend, ClassMethods)
  klass.send(:include, InstanceMethods)
end