| In: |
StdlibDoc/GenDoc/Database.rb
|
| Parent: | Object |
Contains all of the documentation targets and not much else.
| targets | [R] | Array of StdlibDoc::GenDoc::Target objects. |
A Database is constructed by reading a YAML file. If no path is provided, then the default database is used. config is used to resolve path information (relative to the Ruby base directory). If it is nil, the default config is used.
# File StdlibDoc/GenDoc/Database.rb, line 117 def initialize(config, path=nil) path ||= DEFAULT_GENDOC_DATABASE config = config || StdlibDoc::Config.new @targets = [] begin data = YAML.load(File.read(path)) rescue => err raise StdlibDoc::Error, "Failed to load database (#{err.class}): #{err.message}" end targets = data['targets'] @targets = targets.map { |t| Target.new(config, t) } end