StdlibDoc::Config (Class)

In: StdlibDoc/Config.rb
Parent: Object

Contains configuration values used throughout the stdlib-doc software, namely the Ruby source code directory and the documentation generation output directory.

Methods

doc_base=   new   ruby_base=  

Attributes

doc_base  [R]  The base directory where documentation is generated. This is a Pathname object.
ruby_base  [R]  The Ruby source distribution base, where library files, etc., can be found. This is a Pathname object.

Public Class methods

path is the path to a YAML file containing the necessary configuration. The default one will be used if no value is given.

Inside the configuration file, ruby_base must be specified, or else we won’t know where to find the Ruby source files from which the documentation will be generated. doc_base is the target directory for generated documentation. A default value will be used if it is not specified.

[Source]

# File StdlibDoc/Config.rb, line 59
  def initialize(path = nil)
    path ||= DEFAULT_CONFIG_FILE
    data = YAML.load(File.read(path))
    @ruby_base = data["ruby_base"] or raise StdlibDoc::Error,
      "No 'ruby_base' value specified in configuration file #{path}"
    @doc_base = data["doc_base"] || DEFAULT_DOC_BASE
    @ruby_base = Pathname.new(@ruby_base)
    @doc_base = Pathname.new(@doc_base)
  end

Public Instance methods

Sets the ruby_base property, ensuring it is a Pathname object. You may pass it a String or a Pathname.

[Source]

# File StdlibDoc/Config.rb, line 38
  def ruby_base=(dir)
    @ruby_base = Pathname.new(dir).realpath
  end

Sets the doc_base property, ensuring it is a Pathname object. You may pass it a String or a Pathname.

[Source]

# File StdlibDoc/Config.rb, line 46
  def doc_base=(dir)
    @doc_base = Pathname.new(dir).realpath
  end

[Validate]