yard 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of yard might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/Rakefile +1 -1
- data/docs/Tags.md +10 -9
- data/lib/rubygems_plugin.rb +7 -3
- data/lib/yard.rb +5 -6
- data/lib/yard/autoload.rb +12 -9
- data/lib/yard/cli/stats.rb +11 -1
- data/lib/yard/cli/yri.rb +2 -2
- data/lib/yard/code_objects/base.rb +12 -2
- data/lib/yard/code_objects/class_object.rb +2 -0
- data/lib/yard/code_objects/class_variable_object.rb +2 -0
- data/lib/yard/code_objects/constant_object.rb +2 -0
- data/lib/yard/code_objects/method_object.rb +3 -0
- data/lib/yard/code_objects/module_object.rb +2 -0
- data/lib/yard/code_objects/namespace_mapper.rb +113 -0
- data/lib/yard/code_objects/namespace_object.rb +3 -0
- data/lib/yard/docstring.rb +1 -1
- data/lib/yard/docstring_parser.rb +28 -1
- data/lib/yard/handlers/c/handler_methods.rb +1 -0
- data/lib/yard/handlers/c/mixin_handler.rb +7 -1
- data/lib/yard/handlers/ruby/alias_handler.rb +4 -3
- data/lib/yard/handlers/ruby/constant_handler.rb +6 -1
- data/lib/yard/handlers/ruby/dsl_handler_methods.rb +20 -3
- data/lib/yard/parser/c/comment_parser.rb +1 -1
- data/lib/yard/parser/ruby/ruby_parser.rb +25 -5
- data/lib/yard/parser/source_parser.rb +1 -0
- data/lib/yard/registry.rb +22 -43
- data/lib/yard/registry_resolver.rb +171 -0
- data/lib/yard/rubygems/hook.rb +164 -0
- data/lib/yard/server.rb +2 -1
- data/lib/yard/server/commands/root_request_command.rb +27 -0
- data/lib/yard/server/commands/static_file_command.rb +3 -16
- data/lib/yard/server/doc_server_helper.rb +1 -1
- data/lib/yard/server/router.rb +16 -6
- data/lib/yard/tags/default_factory.rb +3 -1
- data/lib/yard/tags/directives.rb +4 -0
- data/lib/yard/templates/engine.rb +1 -1
- data/lib/yard/templates/helpers/html_helper.rb +7 -2
- data/lib/yard/templates/helpers/module_helper.rb +1 -0
- data/lib/yard/templates/helpers/text_helper.rb +12 -0
- data/lib/yard/templates/template_options.rb +1 -1
- data/lib/yard/version.rb +1 -1
- data/spec/cli/stats_spec.rb +8 -3
- data/spec/code_objects/base_spec.rb +9 -1
- data/spec/docstring_parser_spec.rb +36 -1
- data/spec/docstring_spec.rb +1 -6
- data/spec/handlers/c/mixin_handler_spec.rb +16 -0
- data/spec/handlers/constant_handler_spec.rb +9 -0
- data/spec/handlers/dsl_handler_spec.rb +18 -0
- data/spec/handlers/examples/dsl_handler_001.rb.txt +29 -0
- data/spec/parser/ruby/ruby_parser_spec.rb +42 -0
- data/spec/registry_spec.rb +46 -3
- data/spec/server/router_spec.rb +1 -1
- data/spec/server_spec.rb +9 -0
- data/spec/tags/default_factory_spec.rb +5 -0
- data/spec/templates/engine_spec.rb +10 -0
- data/spec/templates/examples/constant001.txt +2 -2
- data/spec/templates/helpers/html_helper_spec.rb +8 -1
- data/spec/templates/helpers/module_helper_spec.rb +35 -0
- data/spec/templates/helpers/text_helper_spec.rb +20 -0
- data/templates/default/module/setup.rb +1 -1
- metadata +7 -4
- data/spec/server/commands/static_file_command_spec.rb +0 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec4f1f12885dba0ad0385e0a1f7bd460275291cd
|
4
|
+
data.tar.gz: 2281f497dc0fa185ccc79d8eb5a374bdae40bee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81280e2f91643f20e5fda61e118b97b5cb8868ca9eca7b15ff9572d9a65552df404961f7ad2af281e84937a3a6e67367f72d2746eb2add634e06f62cef126676
|
7
|
+
data.tar.gz: 4ab74c0f9d79622761098afcc0dd349308500d5593f9ea75414f211207b6798c3475aed0d8936eb4e317df76d6981f5b8499bf1e90ae41d180dc8405335aa829
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,36 @@
|
|
1
|
+
# 0.9.1 - July 18th, 2016
|
2
|
+
|
3
|
+
- Added "Attributes" section to `yard stats`.
|
4
|
+
- Added support for RubyGems 2.x `--document=yri,yard` flags. You can now run
|
5
|
+
YARD documentation generation against installed gems by running:
|
6
|
+
`gem install mygem --document=yard,yri`.
|
7
|
+
- Added `/static/*` routing for library-specific routing. This enables static
|
8
|
+
template files to be served on a per-library basis instead of globally shared
|
9
|
+
across the `yard server`.
|
10
|
+
- Added support for inlining of `{include:*}` syntax. Using this syntax in
|
11
|
+
the middle of a docstring paragraph will no longer create a separate paragraph
|
12
|
+
for the included text.
|
13
|
+
- Added support for resolving `{}` syntax in text templates, specifically for
|
14
|
+
use in `{include:*}` syntax.
|
15
|
+
- Improved object resolution logic in `{Foo::Bar}` syntax and {YARD::Registry.resolve}.
|
16
|
+
New resolution logic should now more accurately support resolving compound paths
|
17
|
+
across namespaces and through the inheritance tree (as Ruby does).
|
18
|
+
- The `frozen_string_literal: true` comment line in Ruby source files will now be
|
19
|
+
excluded from docstrings.
|
20
|
+
- Added a workaround for https://bugs.ruby-lang.org/issues/11485
|
21
|
+
- Fixed an issue where type using a docstring reference on an `@!attribute` macro
|
22
|
+
would be incorrectly parsed as a type specifier. This change updates the tag
|
23
|
+
parser to disallow newlines between the tag name and opening bracket of the
|
24
|
+
type specification.
|
25
|
+
- Fixed an issue where `--embed-mixins` would improperly embed methods from
|
26
|
+
inherited classes instead of modules.
|
27
|
+
- Fixed various parsing errors and YARD exceptions.
|
28
|
+
- Added a warning for modules or classes being redefined as constants.
|
29
|
+
- Reverted stripping of HTML in {YARD::Docstring#summary}.
|
30
|
+
- Added optimization to remove initial docstring parse on newly created code objects.
|
31
|
+
- {YARD::CodeObjects::Base#format} now passes the :type parameter to templates.
|
32
|
+
- Hide methods with filtered namespaces in Method Listing.
|
33
|
+
|
1
34
|
# 0.9.0 - July 4th, 2016
|
2
35
|
|
3
36
|
Special thanks to Alex Dowad, MSP-Greg, and Alex McLain for their extended
|
data/Rakefile
CHANGED
data/docs/Tags.md
CHANGED
@@ -97,11 +97,12 @@ following syntaxes are available:
|
|
97
97
|
Note that for extensibility, other bracket types are allowed, such as `<>`,
|
98
98
|
`()` and `{}`. The contents of the list are discussed in detail below.
|
99
99
|
3. **Freeform data with a name and types specifier list** — freeform
|
100
|
-
data beginning with an *optional* types list, as well as a name key
|
101
|
-
name key is *required*. Note that
|
102
|
-
*before* the types list, like:
|
103
|
-
a separating space is not required
|
104
|
-
can still use any of the other brackets
|
100
|
+
data beginning with an *optional* types list, as well as a name key, placed
|
101
|
+
either before or after the types list. The name key is *required*. Note that
|
102
|
+
for extensibility, the name can be placed *before* the types list, like:
|
103
|
+
`name [Types] description`. In this case, a separating space is not required
|
104
|
+
between the name and types, and you can still use any of the other brackets
|
105
|
+
that the type specifier list allows.
|
105
106
|
4. **Freeform data with title** — freeform data where the first line cannot
|
106
107
|
be split into multiple lines. The first line must also always refer to the
|
107
108
|
"title" portion, and therefore, if there is no title, the first line must
|
@@ -190,7 +191,7 @@ The following example shows a method that takes a parameter of any type
|
|
190
191
|
that responds to the "read" method:
|
191
192
|
|
192
193
|
# Reads from any I/O object.
|
193
|
-
# @param [#read]
|
194
|
+
# @param io [#read] the input object to read from
|
194
195
|
def read(io) io.read end
|
195
196
|
|
196
197
|
#### Hashes
|
@@ -238,9 +239,9 @@ A reference tag literally copies the tag data by the given tag name from the
|
|
238
239
|
specified OBJECT. For instance, a method may copy all {tag:param} tags from
|
239
240
|
a given object using the reference tag syntax:
|
240
241
|
|
241
|
-
# @param [String]
|
242
|
-
# @param [String]
|
243
|
-
# @param [Time]
|
242
|
+
# @param user [String] the username for the operation
|
243
|
+
# @param host [String] the host that this user is associated with
|
244
|
+
# @param time [Time] the time that this operation took place
|
244
245
|
def clean(user, host, time = Time.now) end
|
245
246
|
|
246
247
|
# @param (see #clean)
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/yard/rubygems/
|
3
|
-
|
1
|
+
if defined?(Gem::VERSION) && Gem::VERSION >= "2.0."
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/yard/rubygems/hook')
|
3
|
+
else
|
4
|
+
unless defined?(Gem::DocManager.load_yardoc)
|
5
|
+
require File.expand_path(File.dirname(__FILE__) + '/yard/rubygems/specification')
|
6
|
+
require File.expand_path(File.dirname(__FILE__) + '/yard/rubygems/doc_manager')
|
7
|
+
end
|
4
8
|
end
|
data/lib/yard.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
require File.expand_path('../yard/version.rb', __FILE__)
|
2
|
-
|
3
1
|
module YARD
|
4
2
|
# The root path for YARD source libraries
|
5
3
|
ROOT = File.expand_path(File.dirname(__FILE__))
|
6
4
|
|
5
|
+
require File.join(YARD::ROOT, 'yard', 'version')
|
6
|
+
require File.join(YARD::ROOT, 'yard', 'autoload')
|
7
|
+
|
7
8
|
# The root path for YARD builtin templates
|
8
9
|
TEMPLATE_ROOT = File.join(ROOT, '..', 'templates')
|
9
10
|
|
10
11
|
# @deprecated Use {Config::CONFIG_DIR}
|
11
|
-
CONFIG_DIR =
|
12
|
+
CONFIG_DIR = Config::CONFIG_DIR
|
12
13
|
|
13
14
|
# An alias to {Parser::SourceParser}'s parsing method
|
14
15
|
#
|
@@ -63,9 +64,7 @@ end
|
|
63
64
|
# Backport RubyGems SourceIndex and other classes
|
64
65
|
require File.join(YARD::ROOT, 'yard', 'rubygems', 'backports')
|
65
66
|
|
66
|
-
|
67
|
-
require File.join(YARD::ROOT, 'yard', file)
|
68
|
-
end
|
67
|
+
require File.join(YARD::ROOT, 'yard', 'globals')
|
69
68
|
|
70
69
|
# Load YARD configuration options (and plugins)
|
71
70
|
YARD::Config.load
|
data/lib/yard/autoload.rb
CHANGED
@@ -36,6 +36,7 @@ module YARD
|
|
36
36
|
autoload :MacroObject, __p('code_objects/macro_object')
|
37
37
|
autoload :MethodObject, __p('code_objects/method_object')
|
38
38
|
autoload :ModuleObject, __p('code_objects/module_object')
|
39
|
+
autoload :NamespaceMapper, __p('code_objects/namespace_mapper')
|
39
40
|
autoload :NamespaceObject, __p('code_objects/namespace_object')
|
40
41
|
autoload :Proxy, __p('code_objects/proxy')
|
41
42
|
autoload :ProxyMethodError, __p('code_objects/proxy')
|
@@ -216,6 +217,7 @@ module YARD
|
|
216
217
|
autoload :ListCommand, __p('server/commands/list_command')
|
217
218
|
autoload :LibraryCommand, __p('server/commands/library_command')
|
218
219
|
autoload :LibraryIndexCommand, __p('server/commands/library_index_command')
|
220
|
+
autoload :RootRequestCommand, __p('server/commands/root_request_command')
|
219
221
|
autoload :SearchCommand, __p('server/commands/search_command')
|
220
222
|
autoload :StaticFileCommand, __p('server/commands/static_file_command')
|
221
223
|
end
|
@@ -281,15 +283,16 @@ module YARD
|
|
281
283
|
autoload :TemplateOptions, __p('templates/template_options')
|
282
284
|
end
|
283
285
|
|
284
|
-
autoload :Config,
|
285
|
-
autoload :Docstring,
|
286
|
-
autoload :DocstringParser,
|
287
|
-
autoload :Logger,
|
288
|
-
autoload :Options,
|
289
|
-
autoload :Registry,
|
290
|
-
autoload :
|
291
|
-
autoload :
|
292
|
-
autoload :
|
286
|
+
autoload :Config, __p('config')
|
287
|
+
autoload :Docstring, __p('docstring')
|
288
|
+
autoload :DocstringParser, __p('docstring_parser')
|
289
|
+
autoload :Logger, __p('logging')
|
290
|
+
autoload :Options, __p('options')
|
291
|
+
autoload :Registry, __p('registry')
|
292
|
+
autoload :RegistryResolver, __p('registry_resolver')
|
293
|
+
autoload :RegistryStore, __p('registry_store')
|
294
|
+
autoload :StubProxy, __p('serializers/yardoc_serializer')
|
295
|
+
autoload :Verifier, __p('verifier')
|
293
296
|
end
|
294
297
|
|
295
298
|
undef __p
|
data/lib/yard/cli/stats.rb
CHANGED
@@ -8,7 +8,7 @@ module YARD
|
|
8
8
|
# printed.
|
9
9
|
#
|
10
10
|
# @see #print_statistics
|
11
|
-
STATS_ORDER = [:files, :modules, :classes, :constants, :methods]
|
11
|
+
STATS_ORDER = [:files, :modules, :classes, :constants, :attributes, :methods]
|
12
12
|
|
13
13
|
# @return [Boolean] whether to parse and load registry
|
14
14
|
attr_accessor :parse
|
@@ -125,10 +125,20 @@ module YARD
|
|
125
125
|
output "Constants", *type_statistics(:constant)
|
126
126
|
end
|
127
127
|
|
128
|
+
# Statistics for attributes
|
129
|
+
def stats_for_attributes
|
130
|
+
objs = all_objects.select {|m| m.type == :method && m.is_attribute? }
|
131
|
+
objs.uniq! {|m| m.name.to_s.gsub(/=$/, '') }
|
132
|
+
undoc = objs.select {|m| m.docstring.blank? }
|
133
|
+
@undoc_list |= undoc if @undoc_list
|
134
|
+
output "Attributes", objs.size, undoc.size
|
135
|
+
end
|
136
|
+
|
128
137
|
# Statistics for methods
|
129
138
|
def stats_for_methods
|
130
139
|
objs = all_objects.select {|m| m.type == :method }
|
131
140
|
objs.reject! {|m| m.is_alias? }
|
141
|
+
objs.reject! {|m| m.is_attribute? }
|
132
142
|
undoc = objs.select {|m| m.docstring.blank? }
|
133
143
|
@undoc_list |= undoc if @undoc_list
|
134
144
|
output "Methods", objs.size, undoc.size
|
data/lib/yard/cli/yri.rb
CHANGED
@@ -6,12 +6,12 @@ module YARD
|
|
6
6
|
class YRI < Command
|
7
7
|
# The location in {YARD::CONFIG_DIR} where the YRI cache file is loaded
|
8
8
|
# from.
|
9
|
-
CACHE_FILE = File.expand_path('
|
9
|
+
CACHE_FILE = File.expand_path(File.join(YARD::Config::CONFIG_DIR, 'yri_cache'))
|
10
10
|
|
11
11
|
# A file containing all paths, delimited by newlines, to search for
|
12
12
|
# yardoc databases.
|
13
13
|
# @since 0.5.1
|
14
|
-
SEARCH_PATHS_FILE = File.expand_path('
|
14
|
+
SEARCH_PATHS_FILE = File.expand_path(File.join(YARD::Config::CONFIG_DIR, 'yri_search_paths'))
|
15
15
|
|
16
16
|
# Default search paths that should be loaded dynamically into YRI. These paths
|
17
17
|
# take precedence over all other paths ({SEARCH_PATHS_FILE} and RubyGems
|
@@ -27,6 +27,7 @@ module YARD
|
|
27
27
|
alias_method :<<, :push
|
28
28
|
end
|
29
29
|
|
30
|
+
extend NamespaceMapper
|
30
31
|
|
31
32
|
# Namespace separator
|
32
33
|
NSEP = '::'
|
@@ -105,12 +106,20 @@ module YARD
|
|
105
106
|
# though a DSL might create a custom {NamespaceObject} to describe a
|
106
107
|
# specific set of objects.
|
107
108
|
#
|
109
|
+
# == Separators
|
110
|
+
# Custom classes with different separator tokens should define their own
|
111
|
+
# separators using the {NamespaceMapper.register_separator} method. The
|
112
|
+
# standard Ruby separators have already been defined ('::', '#', '.', etc).
|
113
|
+
#
|
108
114
|
# @abstract This class should not be used directly. Instead, create a
|
109
|
-
# subclass that implements {#path}, {#sep} or {#type}.
|
115
|
+
# subclass that implements {#path}, {#sep} or {#type}. You might also
|
116
|
+
# need to register custom separators if {#sep} uses alternate separator
|
117
|
+
# tokens.
|
110
118
|
# @see Registry
|
111
119
|
# @see #path
|
112
120
|
# @see #[]=
|
113
121
|
# @see NamespaceObject
|
122
|
+
# @see NamespaceMapper.register_separator
|
114
123
|
class Base
|
115
124
|
# The files the object was defined in. To add a file, use {#add_file}.
|
116
125
|
# @return [Array<String>] a list of files
|
@@ -225,7 +234,7 @@ module YARD
|
|
225
234
|
@visibility = :public
|
226
235
|
@tags = []
|
227
236
|
@docstrings = {}
|
228
|
-
@docstring = Docstring.new('', self)
|
237
|
+
@docstring = Docstring.new!('', [], self)
|
229
238
|
@namespace = nil
|
230
239
|
self.namespace = namespace
|
231
240
|
yield(self) if block_given?
|
@@ -480,6 +489,7 @@ module YARD
|
|
480
489
|
# @see Templates::Engine#render
|
481
490
|
def format(options = {})
|
482
491
|
options = options.merge(:object => self)
|
492
|
+
options = options.merge(:type => type) if !options[:type]
|
483
493
|
Templates::Engine.render(options)
|
484
494
|
end
|
485
495
|
|
@@ -0,0 +1,113 @@
|
|
1
|
+
module YARD
|
2
|
+
module CodeObjects
|
3
|
+
# This module controls registration and accessing of namespace separators
|
4
|
+
# for {Registry} lookup.
|
5
|
+
#
|
6
|
+
# @since 0.9.1
|
7
|
+
module NamespaceMapper
|
8
|
+
# @!group Registering a Separator for a Namespace
|
9
|
+
|
10
|
+
# Registers a separator with an optional set of valid types that
|
11
|
+
# must follow the separator lexically.
|
12
|
+
#
|
13
|
+
# @param sep [String] the separator string for the namespace
|
14
|
+
# @param valid_types [Array<Symbol>] a list of object types that
|
15
|
+
# must follow the separator. If the list is empty, any type can
|
16
|
+
# follow the separator.
|
17
|
+
# @example Registering separators for a method object
|
18
|
+
# # Anything after a "#" denotes a method object
|
19
|
+
# register_separator "#", :method
|
20
|
+
# # Anything after a "." denotes a method object
|
21
|
+
# register_separator ".", :method
|
22
|
+
def register_separator(sep, *valid_types)
|
23
|
+
NamespaceMapper.invalidate
|
24
|
+
|
25
|
+
valid_types.each do |t|
|
26
|
+
NamespaceMapper.rev_map[t] ||= []
|
27
|
+
NamespaceMapper.rev_map[t] << sep
|
28
|
+
end
|
29
|
+
|
30
|
+
NamespaceMapper.map[sep] ||= []
|
31
|
+
NamespaceMapper.map[sep] += valid_types
|
32
|
+
end
|
33
|
+
|
34
|
+
# Clears the map of separators.
|
35
|
+
#
|
36
|
+
# @return [void]
|
37
|
+
def clear_separators
|
38
|
+
NamespaceMapper.invalidate
|
39
|
+
NamespaceMapper.map = {}
|
40
|
+
NamespaceMapper.rev_map = {}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Gets or sets the default separator value to use when no
|
44
|
+
# separator for the namespace can be determined.
|
45
|
+
#
|
46
|
+
# @param value [String, nil] the default separator, or nil to return the
|
47
|
+
# value
|
48
|
+
# @example
|
49
|
+
# default_separator "::"
|
50
|
+
def default_separator(value = nil)
|
51
|
+
if value
|
52
|
+
NamespaceMapper.default_separator = Regexp.quote value
|
53
|
+
else
|
54
|
+
NamespaceMapper.default_separator
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# @!group Separator and Type Lookup Helpers
|
59
|
+
|
60
|
+
# @return [Array<String>] all of the registered separators
|
61
|
+
def separators
|
62
|
+
NamespaceMapper.map.keys
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [Regexp] the regexp match of all separators
|
66
|
+
def separators_match
|
67
|
+
NamespaceMapper.map_match
|
68
|
+
end
|
69
|
+
|
70
|
+
# @param sep [String] the separator to return types for
|
71
|
+
# @return [Array<Symbol>] a list of types registered to a separator
|
72
|
+
def types_for_separator(sep)
|
73
|
+
NamespaceMapper.map[sep]
|
74
|
+
end
|
75
|
+
|
76
|
+
# @param type [String] the type to return separators for
|
77
|
+
# @return [Array<Symbol>] a list of separators registered to a type
|
78
|
+
def separators_for_type(type)
|
79
|
+
NamespaceMapper.rev_map[type]
|
80
|
+
end
|
81
|
+
|
82
|
+
# Internal methods to act as a singleton registry
|
83
|
+
class << self
|
84
|
+
# @!visibility private
|
85
|
+
|
86
|
+
# @return [Hash] a mapping of types to separators
|
87
|
+
def map
|
88
|
+
@map ||= {}
|
89
|
+
end
|
90
|
+
|
91
|
+
# @return [Hash] a reverse mapping of separators to types
|
92
|
+
def rev_map
|
93
|
+
@rev_map ||= {}
|
94
|
+
end
|
95
|
+
|
96
|
+
# Invalidates all separators
|
97
|
+
# @return [void]
|
98
|
+
def invalidate
|
99
|
+
@map_match = nil
|
100
|
+
end
|
101
|
+
|
102
|
+
# @return [Regexp] the full list of separators as a regexp match
|
103
|
+
def map_match
|
104
|
+
@map_match ||= @map.keys.map {|k| Regexp.quote k }.join('|')
|
105
|
+
end
|
106
|
+
|
107
|
+
# @return [String] the default separator when no separator can begin
|
108
|
+
# determined.
|
109
|
+
attr_accessor :default_separator
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -1,4 +1,7 @@
|
|
1
1
|
module YARD::CodeObjects
|
2
|
+
register_separator NSEP, :namespace
|
3
|
+
default_separator NSEP
|
4
|
+
|
2
5
|
# A "namespace" is any object that can store other objects within itself.
|
3
6
|
# The two main Ruby objects that can act as namespaces are modules
|
4
7
|
# ({ModuleObject}) and classes ({ClassObject}).
|
data/lib/yard/docstring.rb
CHANGED
@@ -171,7 +171,7 @@ module YARD
|
|
171
171
|
def summary
|
172
172
|
resolve_reference
|
173
173
|
return @summary if @summary
|
174
|
-
stripped = self.gsub(
|
174
|
+
stripped = self.gsub(/[\r\n](?![\r\n])/, ' ').strip
|
175
175
|
num_parens = 0
|
176
176
|
idx = length.times do |index|
|
177
177
|
case stripped[index, 1]
|