From 9f8bfba61514961b971bcf985ea79ca94c9edf6f Mon Sep 17 00:00:00 2001 From: Guillaume Malette Date: Wed, 4 Jul 2018 10:44:48 -0400 Subject: [PATCH] Change some type annotation in YARD doc Some of the type annotations in the documentation referrenced types that were not in scope for the annotation. This means that a compiler generating the doc could incorrectly associate the constants with another type which would be in scope. --- lib/yard/cli/server.rb | 2 +- lib/yard/docstring.rb | 2 +- lib/yard/docstring_parser.rb | 6 +++--- lib/yard/handlers/base.rb | 2 +- lib/yard/handlers/processor.rb | 2 +- lib/yard/server/commands/base.rb | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/yard/cli/server.rb b/lib/yard/cli/server.rb index b3fcb9471..278fd952e 100644 --- a/lib/yard/cli/server.rb +++ b/lib/yard/cli/server.rb @@ -13,7 +13,7 @@ class Server < Command # @return [Hash] a list of library names and yardoc files to serve attr_accessor :libraries - # @return [Adapter] the adapter to use for loading the web server + # @return [YARD::Server::Adapter] the adapter to use for loading the web server attr_accessor :adapter # @return [Array] a list of scripts to load diff --git a/lib/yard/docstring.rb b/lib/yard/docstring.rb index 8417cd1a5..3f8c05c24 100644 --- a/lib/yard/docstring.rb +++ b/lib/yard/docstring.rb @@ -67,7 +67,7 @@ def hash_flag=(v) @hash_flag = v.nil? ? false : v end # when creating the new docstring object. # # @param [String] text the textual portion of the docstring - # @param [Array] tags the list of tag objects in the docstring + # @param [Array] tags the list of tag objects in the docstring # @param [CodeObjects::Base, nil] object the object associated with the # docstring. May be nil. # @param [String] raw_data the complete docstring, including all diff --git a/lib/yard/docstring_parser.rb b/lib/yard/docstring_parser.rb index 32d873d50..7ce8b6eb3 100644 --- a/lib/yard/docstring_parser.rb +++ b/lib/yard/docstring_parser.rb @@ -35,11 +35,11 @@ class DocstringParser # @return [String] the complete input string to the parser. attr_accessor :raw_text - # @return [Array] the list of meta-data tags identified + # @return [Array] the list of meta-data tags identified # by the parser attr_accessor :tags - # @return [Array] a list of directives identified + # @return [Array] a list of directives identified # by the parser. This list will not be passed on to the # Docstring object. attr_accessor :directives @@ -228,7 +228,7 @@ def create_ref_tag(tag_name, name, object_name) end # Creates a new directive using the registered {#library} - # @return [Directive] the directive object that is created + # @return [Tags::Directive] the directive object that is created def create_directive(tag_name, tag_buf) if library.has_directive?(tag_name) dir = library.directive_create(tag_name, tag_buf, self) diff --git a/lib/yard/handlers/base.rb b/lib/yard/handlers/base.rb index ee5ac12fc..989eb1008 100644 --- a/lib/yard/handlers/base.rb +++ b/lib/yard/handlers/base.rb @@ -181,7 +181,7 @@ def inherited(subclass) # the handlers, otherwise the same code will be parsed # multiple times and slow YARD down. # - # @param [Parser::RubyToken, Symbol, String, Regexp] matches + # @param [Parser::Ruby::Legacy::RubyToken, Symbol, String, Regexp] matches # statements that match the declaration will be # processed by this handler. A {String} match is # equivalent to a +/\Astring/+ regular expression diff --git a/lib/yard/handlers/processor.rb b/lib/yard/handlers/processor.rb index 4c7ff97b5..d6ea675ad 100644 --- a/lib/yard/handlers/processor.rb +++ b/lib/yard/handlers/processor.rb @@ -88,7 +88,7 @@ def namespace_for_handler; @@parser_type_extensions ||= {} end attr_accessor :extra_state # Creates a new Processor for a +file+. - # @param [SourceParser] parser the parser used to initialize the processor + # @param [Parser::SourceParser] parser the parser used to initialize the processor def initialize(parser) @file = parser.file || "(stdin)" @namespace = YARD::Registry.root diff --git a/lib/yard/server/commands/base.rb b/lib/yard/server/commands/base.rb index d32662651..3e58fc624 100644 --- a/lib/yard/server/commands/base.rb +++ b/lib/yard/server/commands/base.rb @@ -45,7 +45,7 @@ class Base # @group Attributes Set Per Request - # @return [Request] request object + # @return [Rack::Request] request object attr_accessor :request # @return [String] the path after the command base URI