Skip to content

Conversation

@p8
Copy link
Contributor

@p8 p8 commented Jan 18, 2024

The current documentation is incorrect.

  1. "The current directory" is searched before the --include directories.

    See:

    def find_include_file(name)
    to_search = [File.dirname(@input_file_name)].concat @include_path
    to_search.each do |dir|
    full_name = File.join(dir, name)
    stat = File.stat(full_name) rescue next
    return full_name if stat.readable?
    end
    nil
    end

  2. "Searching the file by default in the current directory" could be read as "searching the file in the directory from which RDoc is run". This is incorrect, as the file is first searched in the directory containing the current documented file.

Searching the file in the "current directory" could be read as the
directory from which RDoc is run. This is incorrect, as the file is
first searched in the directory containing the current documented file.

Also this directory is searched before the `--include` directories.
@p8 p8 changed the title Improve documentation of include directive file search Improve documentation of :include: directive file search Jan 18, 2024
@nobu nobu changed the title Improve documentation of :include: directive file search [DOC] Improve documentation of :include: directive file search Mar 9, 2024
@nobu nobu merged commit aa2d98e into ruby:master Mar 9, 2024
@p8 p8 deleted the docs/improve-include-directive-documentation branch March 9, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants