yard 0.9.9 → 0.9.10
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 +207 -61
- data/docs/Templates.md +1 -1
- data/lib/yard/cli/stats.rb +3 -2
- data/lib/yard/cli/yardoc.rb +10 -0
- data/lib/yard/docstring_parser.rb +1 -0
- data/lib/yard/gem_index.rb +1 -1
- data/lib/yard/handlers/c/class_handler.rb +1 -1
- data/lib/yard/handlers/ruby/constant_handler.rb +1 -0
- data/lib/yard/i18n/pot_generator.rb +2 -2
- data/lib/yard/i18n/text.rb +2 -2
- data/lib/yard/logging.rb +9 -1
- data/lib/yard/parser/c/comment_parser.rb +1 -1
- data/lib/yard/parser/ruby/ast_node.rb +8 -1
- data/lib/yard/parser/ruby/ruby_parser.rb +1 -1
- data/lib/yard/rubygems/specification.rb +11 -3
- data/lib/yard/tags/directives.rb +8 -0
- data/lib/yard/tags/types_explainer.rb +3 -1
- data/lib/yard/templates/helpers/html_helper.rb +7 -0
- data/lib/yard/templates/helpers/markup_helper.rb +4 -0
- data/lib/yard/version.rb +1 -1
- data/spec/cli/stats_spec.rb +4 -4
- data/spec/cli/yardoc_spec.rb +21 -2
- data/spec/examples.txt +1785 -1777
- data/spec/handlers/c/class_handler_spec.rb +2 -1
- data/spec/handlers/constant_handler_spec.rb +8 -0
- data/spec/handlers/examples/constant_handler_001.rb.txt +6 -1
- data/spec/logging_spec.rb +9 -0
- data/spec/parser/c_parser_spec.rb +10 -0
- data/spec/parser/examples/array.c.txt +3521 -1141
- data/spec/parser/ruby/ruby_parser_spec.rb +13 -0
- data/spec/parser/source_parser_spec.rb +1 -1
- data/spec/tags/types_explainer_spec.rb +4 -1
- data/spec/templates/helpers/html_helper_spec.rb +2 -1
- data/spec/templates/helpers/markup_helper_spec.rb +1 -0
- data/templates/default/fulldoc/html/setup.rb +1 -1
- metadata +2 -2
@@ -405,6 +405,19 @@ eof
|
|
405
405
|
expect(Registry.at("Foo::CONST2").docstring).to eq "Another comment here"
|
406
406
|
end
|
407
407
|
|
408
|
+
it "handles comments in the middle of a multi-line statement" do
|
409
|
+
Registry.clear
|
410
|
+
YARD.parse_string <<-eof
|
411
|
+
foo # BREAK
|
412
|
+
.bar
|
413
|
+
|
414
|
+
# Documentation
|
415
|
+
class Baz; end
|
416
|
+
eof
|
417
|
+
expect(Registry.at('Baz')).not_to be_nil
|
418
|
+
expect(Registry.at('Baz').docstring).to eq 'Documentation'
|
419
|
+
end
|
420
|
+
|
408
421
|
%w(if unless).each do |type|
|
409
422
|
it "does not get confused by modifier '#{type}' statements" do
|
410
423
|
Registry.clear
|
@@ -325,7 +325,7 @@ RSpec.describe YARD::Parser::SourceParser do
|
|
325
325
|
expect(Registry.at('Hello2#x').docstring).to eq "ANOTHER PASS"
|
326
326
|
end
|
327
327
|
|
328
|
-
it "takes
|
328
|
+
it "takes preceding comments only if they exist" do
|
329
329
|
YARD.parse_string <<-eof
|
330
330
|
# PASS
|
331
331
|
module Hello # FAIL
|
@@ -189,7 +189,10 @@ RSpec.describe YARD::Tags::TypesExplainer do
|
|
189
189
|
"Hash{String => Symbol, Number}" => "a Hash with keys made of (Strings) and values of (Symbols or Numbers)",
|
190
190
|
"Array<Foo, Bar>, List(String, Symbol, #to_s), {Foo, Bar => Symbol, Number}" => "an Array of (Foos or Bars);
|
191
191
|
a List containing (a String followed by a Symbol followed by an object that responds to #to_s);
|
192
|
-
a Hash with keys made of (Foos or Bars) and values of (Symbols or Numbers)"
|
192
|
+
a Hash with keys made of (Foos or Bars) and values of (Symbols or Numbers)",
|
193
|
+
"#weird_method?, #<=>, #!=" => "an object that responds to #weird_method?;
|
194
|
+
an object that responds to #<=>;
|
195
|
+
an object that responds to #!="
|
193
196
|
}
|
194
197
|
expect.each do |input, expected|
|
195
198
|
explain = YARD::Tags::TypesExplainer.explain(input)
|
@@ -184,7 +184,8 @@ RSpec.describe YARD::Templates::Helpers::HtmlHelper do
|
|
184
184
|
|
185
185
|
it "creates tables (markdown specific)" do
|
186
186
|
log.enter_level(Logger::FATAL) do
|
187
|
-
|
187
|
+
supports_table = %w(RedcarpetCompat Kramdown::Document)
|
188
|
+
unless supports_table.include?(markup_class(:markdown).to_s)
|
188
189
|
pending "This test depends on a markdown engine that supports tables"
|
189
190
|
end
|
190
191
|
end
|
@@ -122,6 +122,7 @@ RSpec.describe YARD::Templates::Helpers::MarkupHelper do
|
|
122
122
|
|
123
123
|
it "looks for a file extension if no shebang is found" do
|
124
124
|
expect(markup_for_file('', 'filename.MD')).to eq :markdown
|
125
|
+
expect(markup_for_file('', 'filename.ORG')).to eq :org
|
125
126
|
end
|
126
127
|
|
127
128
|
Templates::Helpers::MarkupHelper::MARKUP_EXTENSIONS.each do |type, exts|
|
@@ -75,7 +75,7 @@ end
|
|
75
75
|
#
|
76
76
|
# Generates a file to the output with the specified contents.
|
77
77
|
#
|
78
|
-
# @example saving a custom html file to the
|
78
|
+
# @example saving a custom html file to the documentation root
|
79
79
|
#
|
80
80
|
# asset('my_custom.html','<html><body>Custom File</body></html>')
|
81
81
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loren Segal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
YARD is a documentation generation tool for the Ruby programming language.
|