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.

Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +207 -61
  3. data/docs/Templates.md +1 -1
  4. data/lib/yard/cli/stats.rb +3 -2
  5. data/lib/yard/cli/yardoc.rb +10 -0
  6. data/lib/yard/docstring_parser.rb +1 -0
  7. data/lib/yard/gem_index.rb +1 -1
  8. data/lib/yard/handlers/c/class_handler.rb +1 -1
  9. data/lib/yard/handlers/ruby/constant_handler.rb +1 -0
  10. data/lib/yard/i18n/pot_generator.rb +2 -2
  11. data/lib/yard/i18n/text.rb +2 -2
  12. data/lib/yard/logging.rb +9 -1
  13. data/lib/yard/parser/c/comment_parser.rb +1 -1
  14. data/lib/yard/parser/ruby/ast_node.rb +8 -1
  15. data/lib/yard/parser/ruby/ruby_parser.rb +1 -1
  16. data/lib/yard/rubygems/specification.rb +11 -3
  17. data/lib/yard/tags/directives.rb +8 -0
  18. data/lib/yard/tags/types_explainer.rb +3 -1
  19. data/lib/yard/templates/helpers/html_helper.rb +7 -0
  20. data/lib/yard/templates/helpers/markup_helper.rb +4 -0
  21. data/lib/yard/version.rb +1 -1
  22. data/spec/cli/stats_spec.rb +4 -4
  23. data/spec/cli/yardoc_spec.rb +21 -2
  24. data/spec/examples.txt +1785 -1777
  25. data/spec/handlers/c/class_handler_spec.rb +2 -1
  26. data/spec/handlers/constant_handler_spec.rb +8 -0
  27. data/spec/handlers/examples/constant_handler_001.rb.txt +6 -1
  28. data/spec/logging_spec.rb +9 -0
  29. data/spec/parser/c_parser_spec.rb +10 -0
  30. data/spec/parser/examples/array.c.txt +3521 -1141
  31. data/spec/parser/ruby/ruby_parser_spec.rb +13 -0
  32. data/spec/parser/source_parser_spec.rb +1 -1
  33. data/spec/tags/types_explainer_spec.rb +4 -1
  34. data/spec/templates/helpers/html_helper_spec.rb +2 -1
  35. data/spec/templates/helpers/markup_helper_spec.rb +1 -0
  36. data/templates/default/fulldoc/html/setup.rb +1 -1
  37. 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 preceeding comments only if they exist" do
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
- unless markup_class(:markdown).to_s == "RedcarpetCompat"
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 documenation root
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.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-04-23 00:00:00.000000000 Z
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.