Module: YARD

Defined in:
lib/yard/gem_index.rb,
lib/yard.rb,
lib/yard/config.rb,
lib/yard/server.rb,
lib/yard/cli/yri.rb,
lib/yard/logging.rb,
lib/yard/options.rb,
lib/yard/version.rb,
lib/yard/autoload.rb,
lib/yard/cli/diff.rb,
lib/yard/cli/gems.rb,
lib/yard/cli/help.rb,
lib/yard/cli/i18n.rb,
lib/yard/cli/list.rb,
lib/yard/registry.rb,
lib/yard/tags/tag.rb,
lib/yard/verifier.rb,
lib/yard/cli/graph.rb,
lib/yard/cli/stats.rb,
lib/yard/docstring.rb,
lib/yard/i18n/text.rb,
lib/yard/cli/config.rb,
lib/yard/cli/server.rb,
lib/yard/cli/yardoc.rb,
lib/yard/cli/command.rb,
lib/yard/cli/display.rb,
lib/yard/i18n/locale.rb,
lib/yard/parser/base.rb,
lib/yard/i18n/message.rb,
lib/yard/tags/library.rb,
lib/yard/tags/ref_tag.rb,
lib/yard/handlers/base.rb,
lib/yard/i18n/messages.rb,
lib/yard/server/router.rb,
lib/yard/i18n/po_parser.rb,
lib/yard/registry_store.rb,
lib/yard/server/adapter.rb,
lib/yard/handlers/c/base.rb,
lib/yard/tags/directives.rb,
lib/yard/tags/option_tag.rb,
lib/yard/cli/markup_types.rb,
lib/yard/docstring_parser.rb,
lib/yard/rake/yardoc_task.rb,
lib/yard/serializers/base.rb,
lib/yard/tags/default_tag.rb,
lib/yard/templates/engine.rb,
lib/yard/code_objects/base.rb,
lib/yard/parser/c/c_parser.rb,
lib/yard/registry_resolver.rb,
lib/yard/tags/overload_tag.rb,
lib/yard/tags/ref_tag_list.rb,
lib/yard/templates/section.rb,
lib/yard/cli/command_parser.rb,
lib/yard/code_objects/proxy.rb,
lib/yard/handlers/processor.rb,
lib/yard/handlers/ruby/base.rb,
lib/yard/i18n/pot_generator.rb,
lib/yard/parser/c/statement.rb,
lib/yard/templates/template.rb,
lib/yard/server/rack_adapter.rb,
lib/yard/templates/erb_cache.rb,
lib/yard/cli/yardopts_command.rb,
lib/yard/parser/ruby/ast_node.rb,
lib/yard/parser/source_parser.rb,
lib/yard/server/commands/base.rb,
lib/yard/tags/default_factory.rb,
lib/yard/tags/types_explainer.rb,
lib/yard/server/static_caching.rb,
lib/yard/tags/tag_format_error.rb,
lib/yard/server/library_version.rb,
lib/yard/server/webrick_adapter.rb,
lib/yard/parser/c/comment_parser.rb,
lib/yard/parser/ruby/ruby_parser.rb,
lib/yard/code_objects/root_object.rb,
lib/yard/server/doc_server_helper.rb,
lib/yard/code_objects/macro_object.rb,
lib/yard/handlers/ruby/dsl_handler.rb,
lib/yard/handlers/ruby/legacy/base.rb,
lib/yard/handlers/c/handler_methods.rb,
lib/yard/parser/ruby/token_resolver.rb,
lib/yard/templates/template_options.rb,
lib/yard/parser/ruby/legacy/ruby_lex.rb,
lib/yard/parser/ruby/legacy/statement.rb,
lib/yard/server/commands/list_command.rb,
lib/yard/server/doc_server_serializer.rb,
lib/yard/templates/helpers/uml_helper.rb,
lib/yard/code_objects/namespace_mapper.rb,
lib/yard/parser/ruby/legacy/token_list.rb,
lib/yard/serializers/stdout_serializer.rb,
lib/yard/serializers/yardoc_serializer.rb,
lib/yard/templates/helpers/html_helper.rb,
lib/yard/templates/helpers/text_helper.rb,
lib/yard/parser/ruby/legacy/ruby_parser.rb,
lib/yard/serializers/process_serializer.rb,
lib/yard/server/commands/frames_command.rb,
lib/yard/server/commands/search_command.rb,
lib/yard/server/commands/library_command.rb,
lib/yard/templates/helpers/filter_helper.rb,
lib/yard/templates/helpers/markup_helper.rb,
lib/yard/templates/helpers/method_helper.rb,
lib/yard/templates/helpers/module_helper.rb,
lib/yard/handlers/ruby/legacy/dsl_handler.rb,
lib/yard/handlers/ruby/dsl_handler_methods.rb,
lib/yard/parser/ruby/legacy/statement_list.rb,
lib/yard/serializers/file_system_serializer.rb,
lib/yard/server/commands/static_file_command.rb,
lib/yard/server/commands/static_file_helpers.rb,
lib/yard/server/commands/display_file_command.rb,
lib/yard/server/commands/root_request_command.rb,
lib/yard/templates/helpers/markup/rdoc_markup.rb,
lib/yard/server/commands/library_index_command.rb,
lib/yard/handlers/ruby/private_constant_handler.rb,
lib/yard/server/commands/display_object_command.rb,
lib/yard/templates/helpers/markup/rdoc_markdown.rb,
lib/yard/templates/helpers/html_syntax_highlight_helper.rb

Overview

Backward compatibility for gem specification lookup

See Also:

  • Gem::SourceIndex

Defined Under Namespace

Modules: CLI, CodeObjects, GemIndex, Handlers, I18n, Parser, Rake, Registry, Serializers, Server, Tags, Templates Classes: Config, Docstring, DocstringParser, Logger, Options, RegistryResolver, RegistryStore, Verifier

Constant Summary collapse

ROOT =

The root path for YARD source libraries

File.expand_path(File.dirname(__FILE__))
TEMPLATE_ROOT =

The root path for YARD builtin templates

File.join(ROOT, '..', 'templates')
CONFIG_DIR =
Deprecated.
Config::CONFIG_DIR
VERSION =
'0.9.28'

Class Method Summary collapse

Class Method Details

.load_pluginsBoolean

Deprecated.

Loads gems that match the name ‘yard-*’ (recommended) or ‘yard_*’ except those listed in ~/.yard/ignored_plugins. This is called immediately after YARD is loaded to allow plugin support.

Returns:

  • (Boolean)

    true if all plugins loaded successfully, false otherwise.



31
# File 'lib/yard.rb', line 31

def self.load_plugins; YARD::Config.load_plugins end

.parse(*args) ⇒ Object

An alias to YARD::Parser::SourceParser‘s parsing method

Examples:

Parse a glob of files

YARD.parse('lib/**/*.rb')

See Also:



20
# File 'lib/yard.rb', line 20

def self.parse(*args) Parser::SourceParser.parse(*args) end

.parse_string(*args) ⇒ Object

An alias to YARD::Parser::SourceParser‘s parsing method

Examples:

Parse a string of input

YARD.parse_string('class Foo; end')

See Also:



27
# File 'lib/yard.rb', line 27

def self.parse_string(*args) Parser::SourceParser.parse_string(*args) end

.ruby18?Boolean

Returns whether YARD is being run in Ruby 1.8 mode.

Returns:

  • (Boolean)

    whether YARD is being run in Ruby 1.8 mode



44
# File 'lib/yard.rb', line 44

def self.ruby18?; !ruby19? end

.ruby19?Boolean

Returns whether YARD is being run in Ruby 1.9 mode.

Returns:

  • (Boolean)

    whether YARD is being run in Ruby 1.9 mode



47
# File 'lib/yard.rb', line 47

def self.ruby19?; @ruby19 ||= (RUBY_VERSION >= "1.9.1") end

.ruby2?Boolean

Returns whether YARD is being run in Ruby 2.0.

Returns:

  • (Boolean)

    whether YARD is being run in Ruby 2.0



50
# File 'lib/yard.rb', line 50

def self.ruby2?; @ruby2 ||= (RUBY_VERSION >= '2.0.0') end

.ruby31?Boolean

Returns whether YARD is being run in Ruby 3.1.

Returns:

  • (Boolean)

    whether YARD is being run in Ruby 3.1



56
# File 'lib/yard.rb', line 56

def self.ruby31?; @ruby31 ||= (RUBY_VERSION >= '3.1.0') end

.ruby3?Boolean

Returns whether YARD is being run in Ruby 3.0.

Returns:

  • (Boolean)

    whether YARD is being run in Ruby 3.0



53
# File 'lib/yard.rb', line 53

def self.ruby3?; @ruby3 ||= (RUBY_VERSION >= '3.0.0') end

.windows?Boolean

Returns whether YARD is being run inside of Windows.

Returns:

  • (Boolean)

    whether YARD is being run inside of Windows



34
35
36
37
38
39
40
41
# File 'lib/yard.rb', line 34

def self.windows?
  return @windows if defined? @windows
  require 'rbconfig'
  @windows =
    ::RbConfig::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false
ensure
  @windows ||= false
end