yard 0.9.26 → 0.9.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +104 -8
  3. data/LEGAL +29 -1
  4. data/LICENSE +1 -1
  5. data/README.md +9 -2
  6. data/docs/Tags.md +1 -1
  7. data/docs/WhatsNew.md +2 -2
  8. data/lib/yard/autoload.rb +3 -1
  9. data/lib/yard/cli/command.rb +1 -1
  10. data/lib/yard/cli/stats.rb +4 -1
  11. data/lib/yard/cli/yardoc.rb +5 -3
  12. data/lib/yard/code_objects/base.rb +5 -1
  13. data/lib/yard/code_objects/macro_object.rb +0 -1
  14. data/lib/yard/config.rb +5 -1
  15. data/lib/yard/docstring_parser.rb +1 -2
  16. data/lib/yard/handlers/processor.rb +0 -1
  17. data/lib/yard/handlers/ruby/attribute_handler.rb +1 -1
  18. data/lib/yard/handlers/ruby/legacy/attribute_handler.rb +1 -1
  19. data/lib/yard/handlers/ruby/method_handler.rb +2 -2
  20. data/lib/yard/handlers/ruby/mixin_handler.rb +15 -6
  21. data/lib/yard/handlers/ruby/module_function_handler.rb +15 -3
  22. data/lib/yard/handlers/ruby/visibility_handler.rb +13 -1
  23. data/lib/yard/i18n/locale.rb +1 -1
  24. data/lib/yard/i18n/message.rb +2 -2
  25. data/lib/yard/i18n/messages.rb +1 -1
  26. data/lib/yard/i18n/pot_generator.rb +1 -1
  27. data/lib/yard/logging.rb +116 -61
  28. data/lib/yard/open_struct.rb +67 -0
  29. data/lib/yard/options.rb +1 -1
  30. data/lib/yard/parser/ruby/ast_node.rb +9 -2
  31. data/lib/yard/parser/ruby/legacy/ruby_lex.rb +19 -4
  32. data/lib/yard/parser/ruby/ruby_parser.rb +9 -3
  33. data/lib/yard/parser/source_parser.rb +4 -5
  34. data/lib/yard/registry_resolver.rb +2 -1
  35. data/lib/yard/server/commands/base.rb +1 -1
  36. data/lib/yard/server/commands/library_command.rb +9 -9
  37. data/lib/yard/server/commands/static_file_helpers.rb +1 -2
  38. data/lib/yard/server/http_utils.rb +512 -0
  39. data/lib/yard/server/rack_adapter.rb +13 -5
  40. data/lib/yard/tags/default_factory.rb +1 -0
  41. data/lib/yard/tags/directives.rb +10 -2
  42. data/lib/yard/tags/tag.rb +3 -2
  43. data/lib/yard/tags/types_explainer.rb +1 -1
  44. data/lib/yard/templates/engine.rb +0 -1
  45. data/lib/yard/templates/helpers/html_helper.rb +5 -2
  46. data/lib/yard/templates/helpers/markup_helper.rb +2 -1
  47. data/lib/yard/templates/helpers/method_helper.rb +3 -1
  48. data/lib/yard/templates/template.rb +3 -1
  49. data/lib/yard/templates/template_options.rb +0 -1
  50. data/lib/yard/version.rb +1 -1
  51. data/lib/yard.rb +6 -0
  52. data/po/ja.po +19 -19
  53. data/templates/default/fulldoc/html/css/full_list.css +3 -3
  54. data/templates/default/fulldoc/html/css/style.css +6 -0
  55. data/templates/default/fulldoc/html/frames.erb +9 -4
  56. data/templates/default/fulldoc/html/full_list.erb +5 -2
  57. data/templates/default/fulldoc/html/js/app.js +294 -264
  58. data/templates/default/fulldoc/html/js/full_list.js +30 -4
  59. data/templates/default/fulldoc/html/setup.rb +10 -2
  60. data/templates/default/layout/html/footer.erb +1 -1
  61. data/templates/default/onefile/html/headers.erb +2 -0
  62. data/templates/default/tags/html/example.erb +2 -2
  63. data/templates/default/tags/html/option.erb +1 -1
  64. metadata +5 -41
  65. data/.dockerignore +0 -2
  66. data/.gitattributes +0 -4
  67. data/.github/FUNDING.yml +0 -3
  68. data/.github/ISSUE_TEMPLATE.md +0 -33
  69. data/.github/PULL_REQUEST_TEMPLATE.md +0 -12
  70. data/.github/workflows/ci.yml +0 -42
  71. data/.github/workflows/gem.yml +0 -27
  72. data/.gitignore +0 -14
  73. data/.rspec +0 -2
  74. data/.rubocop.yml +0 -112
  75. data/.travis.yml +0 -49
  76. data/CODE_OF_CONDUCT.md +0 -15
  77. data/CONTRIBUTING.md +0 -140
  78. data/Dockerfile.samus +0 -28
  79. data/Gemfile +0 -33
  80. data/Rakefile +0 -39
  81. data/SECURITY.md +0 -26
  82. data/benchmarks/builtins_vs_eval.rb +0 -24
  83. data/benchmarks/concat_vs_join.rb +0 -13
  84. data/benchmarks/erb_vs_erubis.rb +0 -54
  85. data/benchmarks/format_args.rb +0 -47
  86. data/benchmarks/generation.rb +0 -38
  87. data/benchmarks/marshal_vs_dbm.rb +0 -64
  88. data/benchmarks/parsing.rb +0 -46
  89. data/benchmarks/pathname_vs_string.rb +0 -51
  90. data/benchmarks/rdoc_vs_yardoc.rb +0 -11
  91. data/benchmarks/registry_store_types.rb +0 -49
  92. data/benchmarks/ri_vs_yri.rb +0 -19
  93. data/benchmarks/ripper_parser.rb +0 -13
  94. data/benchmarks/splat_vs_flatten.rb +0 -13
  95. data/benchmarks/template_erb.rb +0 -23
  96. data/benchmarks/template_format.rb +0 -7
  97. data/benchmarks/template_profile.rb +0 -18
  98. data/benchmarks/yri_cache.rb +0 -20
  99. data/samus.json +0 -49
  100. data/tasks/update_error_map.rake +0 -53
  101. data/yard.gemspec +0 -23
data/lib/yard/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module YARD
5
- VERSION = '0.9.26'
5
+ VERSION = '0.9.37'
6
6
  end
data/lib/yard.rb CHANGED
@@ -48,6 +48,12 @@ module YARD
48
48
 
49
49
  # @return [Boolean] whether YARD is being run in Ruby 2.0
50
50
  def self.ruby2?; @ruby2 ||= (RUBY_VERSION >= '2.0.0') end
51
+
52
+ # @return [Boolean] whether YARD is being run in Ruby 3.0
53
+ def self.ruby3?; @ruby3 ||= (RUBY_VERSION >= '3.0.0') end
54
+
55
+ # @return [Boolean] whether YARD is being run in Ruby 3.1
56
+ def self.ruby31?; @ruby31 ||= (RUBY_VERSION >= '3.1.0') end
51
57
  end
52
58
 
53
59
  # Keep track of Ruby version for compatibility code
data/po/ja.po CHANGED
@@ -1501,7 +1501,7 @@ msgstr ""
1501
1501
  "これらのオブジェクトはツリー構造のように振る舞い、これらの直接の子全てのリストを維持している。\n"
1502
1502
  "namespaceではない全てのオブジェクトは単純にベースクラスのサブクラスである。\n"
1503
1503
  "{YARD::CodeObjects::RootObject RootObject} は\n"
1504
- "特別な `NamespaceObject` ともいえ、Rubyの中のトップレベルnamaspaceを参照する。\n"
1504
+ "特別な `NamespaceObject` ともいえ、Rubyの中のトップレベルnamespaceを参照する。\n"
1505
1505
  "パラメータとして namespace オブジェクトを受け入れるメソッドは、\n"
1506
1506
  "root オブジェクト用のショートカットとして `:root` シンボルも受け入れる。"
1507
1507
 
@@ -6175,7 +6175,7 @@ msgstr ""
6175
6175
  "'default/class'から自動的に継承する。\n"
6176
6176
  "そして 'default/class/setup.rb' の中に定義されるもの全ては、\n"
6177
6177
  "'default/class/html/setup.rb' によって上書きされることも意味する。\n"
6178
- "(yard/lib以下の話ではなくyard/templetes以下の話)"
6178
+ "(yard/lib以下の話ではなくyard/templates以下の話)"
6179
6179
 
6180
6180
  #: ../docs/Templates.md:200
6181
6181
  msgid ""
@@ -7124,7 +7124,7 @@ msgstr "#### Rubyのコードを解析する為の新しい `@!parse` ディレ
7124
7124
  #: ../docs/WhatsNew.md:87
7125
7125
  msgid ""
7126
7126
  "A new {tag:!parse} directive was added that allows a developer to have\n"
7127
- "YARD parse code that might not necessarily be parseable in its original\n"
7127
+ "YARD parse code that might not necessarily be parsable in its original\n"
7128
7128
  "form. This is useful when using `instance_eval` and other dynamic\n"
7129
7129
  "meta-programming techniques to define methods or perform functionality.\n"
7130
7130
  "For instance, a common case of the \"self.included\" callback in module\n"
@@ -9452,7 +9452,7 @@ msgid ""
9452
9452
  msgstr ""
9453
9453
  "1. **新しいテンプレートエンジンとテンプレート**\n"
9454
9454
  "2. **yardoc `--query` 引数**\n"
9455
- "3. **Greatly ecpanded API ドキュメント**\n"
9455
+ "3. **Greatly expanded API ドキュメント**\n"
9456
9456
  "4. **新しいプラグインのサポート**\n"
9457
9457
  "5. **新しいタグ(@abstract, @private)**\n"
9458
9458
  "6. **デフォルトのrake taskは`rake yard`コマンドになった**"
@@ -9607,7 +9607,7 @@ msgid ""
9607
9607
  "This tag exists so that you can create a query (`--query !@private`) to\n"
9608
9608
  "ignore all of these private objects in your documentation. You can also\n"
9609
9609
  "use the new `--no-private` switch, which is a shortcut to the "
9610
- "afformentioned\n"
9610
+ "aforementioned\n"
9611
9611
  "query. You can read more about the new tags in the {file:docs/GettingStarted."
9612
9612
  "md}\n"
9613
9613
  "guide."
@@ -9816,7 +9816,7 @@ msgid ""
9816
9816
  " # @overload def to_html(html, autolink = true)\n"
9817
9817
  " # This docstring describes the specific overload only.\n"
9818
9818
  " # @param [String] html the HTML\n"
9819
- " # @param [Boolean] autolink whether or not to atuomatically link\n"
9819
+ " # @param [Boolean] autolink whether or not to automatically link\n"
9820
9820
  " # URL references\n"
9821
9821
  " # @overload def to_html(html, opts = {})\n"
9822
9822
  " # @param [String] html the HTML\n"
@@ -9828,7 +9828,7 @@ msgstr ""
9828
9828
  " # @overload def to_html(html, autolink = true)\n"
9829
9829
  " # This docstring describes the specific overload only.\n"
9830
9830
  " # @param [String] html the HTML\n"
9831
- " # @param [Boolean] autolink whether or not to atuomatically link\n"
9831
+ " # @param [Boolean] autolink whether or not to automatically link\n"
9832
9832
  " # URL references\n"
9833
9833
  " # @overload def to_html(html, opts = {})\n"
9834
9834
  " # @param [String] html the HTML\n"
@@ -11513,7 +11513,7 @@ msgstr ""
11513
11513
 
11514
11514
  # @param [Hash, nil] checksums
11515
11515
  #: ../lib/yard/cli/yardoc.rb:340
11516
- msgid "if supplied, a list of checkums for files."
11516
+ msgid "if supplied, a list of checksums for files."
11517
11517
  msgstr "提供する場合は、ファイルの為のチェックサムのリスト"
11518
11518
 
11519
11519
  # @param [Hash, nil]
@@ -15746,7 +15746,7 @@ msgstr ""
15746
15746
  # YARD::DocstringParser
15747
15747
  #: ../lib/yard/docstring_parser.rb:11
15748
15748
  msgid ""
15749
- "The DocstringParser can be subclassed and subtituted during parsing by\n"
15749
+ "The DocstringParser can be subclassed and substituted during parsing by\n"
15750
15750
  "setting the {Docstring.default_parser} attribute with the name of the\n"
15751
15751
  "subclass. This allows developers to change the way docstrings are\n"
15752
15752
  "parsed, allowing for completely different docstring syntaxes."
@@ -18512,7 +18512,7 @@ msgstr "翻訳目標のメッセージ"
18512
18512
  # @return [String]
18513
18513
  #: ../lib/yard/i18n/locale.rb:45
18514
18514
  msgid ""
18515
- "translated message. If tarnslation isn't\n"
18515
+ "translated message. If translation isn't\n"
18516
18516
  "registered, the +message+ is returned."
18517
18517
  msgstr ""
18518
18518
 
@@ -18525,7 +18525,7 @@ msgstr ""
18525
18525
 
18526
18526
  # @param tag_name
18527
18527
  #: ../lib/yard/i18n/message.rb:11
18528
- msgid "the message ID of the trnslation target message."
18528
+ msgid "the message ID of the translation target message."
18529
18529
  msgstr "翻訳目標のメッセージのメッセージID"
18530
18530
 
18531
18531
  # @param [Fixnum, nil] line
@@ -18545,7 +18545,7 @@ msgstr "メッセージ用のコメントのグループ"
18545
18545
 
18546
18546
  # YARD::Handlers::Processor#initialize
18547
18547
  #: ../lib/yard/i18n/message.rb:21
18548
- msgid "Creates a trasnlate target message for message ID +id+."
18548
+ msgid "Creates a translate target message for message ID +id+."
18549
18549
  msgstr "メッセージID +id+ 用の翻訳目標のメッセージを作成する"
18550
18550
 
18551
18551
  # @return [Tag]
@@ -18652,7 +18652,7 @@ msgstr ""
18652
18652
  # YARD::I18n::Messages#register
18653
18653
  #: ../lib/yard/i18n/messages.rb:31
18654
18654
  msgid ""
18655
- "Registers a {Message}, the mssage ID of which is +id+. If\n"
18655
+ "Registers a {Message}, the message ID of which is +id+. If\n"
18656
18656
  "corresponding +Message+ is already registered, the previously\n"
18657
18657
  "registered object is returned."
18658
18658
  msgstr ""
@@ -18876,7 +18876,7 @@ msgstr ""
18876
18876
  msgid ""
18877
18877
  "Locations of the +Message+ are used to generate the reference\n"
18878
18878
  "line that is started with \"#: \". +relative_base_path+ passed\n"
18879
- "when the generater is created is prepended to each path in location."
18879
+ "when the generator is created is prepended to each path in location."
18880
18880
  msgstr ""
18881
18881
 
18882
18882
  # YARD::I18n::PotGenerator#generate
@@ -19475,7 +19475,7 @@ msgstr "tag|example|ハッシュ構文を用いたオプションの設定"
19475
19475
 
19476
19476
  # @param [Hash] options
19477
19477
  #: ../lib/yard/options.rb:99
19478
- msgid "the optin to set"
19478
+ msgid "the option to set"
19479
19479
  msgstr "設定するためのオプション"
19480
19480
 
19481
19481
  # @param [Object] value
@@ -23736,7 +23736,7 @@ msgid ""
23736
23736
  " def run\n"
23737
23737
  " self.body = 'ERROR! The System is down!'\n"
23738
23738
  " self.status = 500\n"
23739
- " self.headers['Conten-Type'] = 'text/plain'\n"
23739
+ " self.headers['Content-Type'] = 'text/plain'\n"
23740
23740
  " end\n"
23741
23741
  "end"
23742
23742
  msgstr ""
@@ -27892,7 +27892,7 @@ msgstr "任意のタイトルとして、リンクに表示する"
27892
27892
  #: ../lib/yard/templates/helpers/base_helper.rb:143
27893
27893
  #: ../lib/yard/templates/helpers/html_helper.rb:220
27894
27894
  msgid "Links to an extra file"
27895
- msgstr "extarファイルにリンクする"
27895
+ msgstr "extraファイルにリンクする"
27896
27896
 
27897
27897
  # @param [String] anchor
27898
27898
  #: ../lib/yard/templates/helpers/base_helper.rb:149
@@ -30096,7 +30096,7 @@ msgstr "解析された式"
30096
30096
  #~ "{Library.default_factory}."
30097
30097
  #~ msgstr ""
30098
30098
  #~ "次の事に留意する。\n"
30099
- #~ "+tag_facotory+ は、タグを解析する為に利用されるfactoryオブジェクトとな"
30099
+ #~ "+tag_factory+ は、タグを解析する為に利用されるfactoryオブジェクトとな"
30100
30100
  #~ "る。\n"
30101
30101
  #~ "この値は{DefaultFactory}クラスがデフォルトとなり、\n"
30102
30102
  #~ "{Library.default_factory}を変更する事によって設定できる。"
@@ -31067,7 +31067,7 @@ msgstr "解析された式"
31067
31067
 
31068
31068
  #~ msgid ""
31069
31069
  #~ "* **Domain Specific Language (DSL)**: In the context of Ruby, a DSL is a "
31070
- #~ "languge\n"
31070
+ #~ "language\n"
31071
31071
  #~ " optimized for a specific domain (problem) but represented using Ruby "
31072
31072
  #~ "syntax."
31073
31073
  #~ msgstr ""
@@ -20,8 +20,8 @@ h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; }
20
20
  #content.insearch #noresults { margin-left: 7px; }
21
21
  li.collapsed ul { display: none; }
22
22
  li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
23
- li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
24
- li { color: #888; cursor: pointer; }
23
+ li.collapsed a.toggle { cursor: default; background-position: top left; }
24
+ li { color: #666; cursor: pointer; }
25
25
  li.deprecated { text-decoration: line-through; font-style: italic; }
26
26
  li.odd { background: #f0f0f0; }
27
27
  li.even { background: #fafafa; }
@@ -47,7 +47,7 @@ li small { display: block; font-size: 0.8em; }
47
47
  li small:before { content: ""; }
48
48
  li small:after { content: ""; }
49
49
  li small.search_info { display: none; }
50
- #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; }
50
+ #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #666; padding-left: 0; padding-right: 24px; }
51
51
  #content.insearch #search { background-position: center right; }
52
52
  #search input { width: 110px; }
53
53
 
@@ -82,6 +82,11 @@ body {
82
82
  #search { display: none; }
83
83
  }
84
84
 
85
+ @media (max-width: 320px) {
86
+ body { height: 100%; overflow: hidden; overflow-wrap: break-word; }
87
+ #main { height: 100%; overflow: auto; }
88
+ }
89
+
85
90
  #main img { max-width: 100%; }
86
91
  h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; }
87
92
  h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; }
@@ -106,6 +111,7 @@ h2 small a {
106
111
  position: relative;
107
112
  padding: 2px 7px;
108
113
  }
114
+ a { font-weight: 550; }
109
115
  .clear { clear: both; }
110
116
  .inline { display: inline; }
111
117
  .inline p:first-child { display: inline; }
@@ -5,10 +5,15 @@
5
5
  <title><%= options.title %></title>
6
6
  </head>
7
7
  <script type="text/javascript">
8
- var match = unescape(window.location.hash).match(/^#!(.+)/);
9
- var name = match ? match[1] : '<%= url_for_main %>';
10
- name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
11
- window.top.location = name;
8
+ var mainUrl = '<%= url_for_main %>';
9
+ try {
10
+ var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
11
+ var name = match ? match[1] : mainUrl;
12
+ var url = new URL(name, location.href);
13
+ window.top.location.replace(url.origin === location.origin ? name : mainUrl);
14
+ } catch (e) {
15
+ window.top.location.replace(mainUrl);
16
+ }
12
17
  </script>
13
18
  <noscript>
14
19
  <h1>Oops!</h1>
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html <%= "lang=\"#{html_lang}\"" unless html_lang.nil? %>>
3
3
  <head>
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
5
  <meta charset="<%= charset %>" />
@@ -26,7 +26,10 @@
26
26
  <% end %>
27
27
  </div>
28
28
 
29
- <div id="search">Search: <input type="text" /></div>
29
+ <div id="search">
30
+ <label for="search-class">Search:</label>
31
+ <input id="search-class" type="text" />
32
+ </div>
30
33
  </div>
31
34
 
32
35
  <ul id="full_list" class="<%= @list_class || @list_type %>">