yard 0.9.25 → 0.9.28

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +0 -0
  3. data/.gitattributes +4 -0
  4. data/.github/FUNDING.yml +3 -0
  5. data/.github/ISSUE_TEMPLATE.md +6 -6
  6. data/.github/PULL_REQUEST_TEMPLATE.md +5 -5
  7. data/.github/workflows/ci.yml +10 -10
  8. data/.github/workflows/gem.yml +19 -0
  9. data/.gitignore +0 -0
  10. data/.rspec +0 -0
  11. data/.rubocop.yml +0 -0
  12. data/.yardopts +0 -0
  13. data/.yardopts_guide +0 -0
  14. data/.yardopts_i18n +0 -0
  15. data/CHANGELOG.md +40 -8
  16. data/CONTRIBUTING.md +2 -2
  17. data/Gemfile +5 -3
  18. data/LICENSE +1 -1
  19. data/README.md +1 -1
  20. data/Rakefile +0 -3
  21. data/lib/yard/cli/stats.rb +4 -1
  22. data/lib/yard/cli/yardoc.rb +4 -2
  23. data/lib/yard/code_objects/method_object.rb +1 -1
  24. data/lib/yard/config.rb +5 -1
  25. data/lib/yard/handlers/c/base.rb +164 -164
  26. data/lib/yard/handlers/ruby/method_handler.rb +2 -2
  27. data/lib/yard/handlers/ruby/mixin_handler.rb +7 -2
  28. data/lib/yard/handlers/ruby/module_function_handler.rb +15 -3
  29. data/lib/yard/parser/ruby/ast_node.rb +9 -2
  30. data/lib/yard/parser/ruby/ruby_parser.rb +1 -1
  31. data/lib/yard/parser/source_parser.rb +1 -1
  32. data/lib/yard/server/commands/base.rb +2 -2
  33. data/lib/yard/server/commands/library_command.rb +1 -1
  34. data/lib/yard/tags/directives.rb +10 -1
  35. data/lib/yard/templates/helpers/html_helper.rb +5 -2
  36. data/lib/yard/templates/helpers/markup_helper.rb +2 -1
  37. data/lib/yard/templates/helpers/method_helper.rb +3 -1
  38. data/lib/yard/templates/section.rb +1 -3
  39. data/lib/yard/templates/template.rb +3 -1
  40. data/lib/yard/version.rb +1 -1
  41. data/lib/yard.rb +6 -0
  42. data/samus.json +15 -46
  43. data/tasks/prepare_tag.rake +45 -0
  44. data/templates/default/fulldoc/html/css/style.css +1 -0
  45. data/templates/default/layout/html/footer.erb +1 -1
  46. data/yard.gemspec +2 -1
  47. metadata +21 -4
  48. data/.travis.yml +0 -52
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '069382132042276687f3551fe9f55d143635a028d5e4a1c5796e122a6871af8d'
4
- data.tar.gz: f9b76a7d6051ce84375ba417a80f477961bfd2a03e9d8b9908615d7958bf96a0
3
+ metadata.gz: 2a014685561249bd72bd38eea2db5386c7a3f5d814ec2cbd0218fc76803d4d88
4
+ data.tar.gz: fbbb78841e6f41798c14cde55e5d55da409bc550005a1f8d67a2491332a9378c
5
5
  SHA512:
6
- metadata.gz: a270998fd0d1efc6b41fa43c0b273935953c57cc17c95a11b7faa91476f2edeae14e481570acdaa3b3e824eaf9da9dd4bc3941b9e2cdbee76a193ac129251573
7
- data.tar.gz: f196bef07edee0bdbca743d03db9e13f589ab9b19f5ebe7fefdee2b7fadf784b88d0c811cf8f67471fd58718247f780abaa67a7a16556729944e6f56ebc7abf0
6
+ metadata.gz: 37666343d2e629ce4cd1c9c1d7e82b678ade120151e79b52ce3110bdbd9c0bdf65c76aa3661a5d6ffd34fe40f9ff90f100b1f7b2c898951737e6ba14f4bacaa3
7
+ data.tar.gz: 6235690efed8749d45e513842f689a273c68ef6424a4881a9e77db2a1590ebc1fb7d55d6d68c2f6013bda045e49e1285169c93a9c7736f3b2ef7a6e8fe1fc4de
data/.dockerignore CHANGED
File without changes
data/.gitattributes ADDED
@@ -0,0 +1,4 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text eol=lf
3
+
4
+ *.png binary
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: lsegal
@@ -22,12 +22,12 @@ visual issues.]
22
22
 
23
23
  ## Environment details:
24
24
 
25
- * OS: [Enter operating system / version here]
26
- * Ruby version (`ruby -v`): [Enter output of `ruby -v`]
27
- * YARD version (`yard -v`): [Enter output of `yard -v`]
28
- * Relevant software dependency/versions:
29
- * [Any 3rd party libs required to reproduce, omit if none]
25
+ - OS: [Enter operating system / version here]
26
+ - Ruby version (`ruby -v`): [Enter output of `ruby -v`]
27
+ - YARD version (`yard -v`): [Enter output of `yard -v`]
28
+ - Relevant software dependency/versions:
29
+ - [Any 3rd party libs required to reproduce, omit if none]
30
30
 
31
31
  I have read the [Contributing Guide][contrib].
32
32
 
33
- [contrib]: https://github.com/lsegal/yard/blob/master/CONTRIBUTING.md
33
+ [contrib]: https://github.com/lsegal/yard/blob/main/CONTRIBUTING.md
@@ -4,9 +4,9 @@ Describe your pull request and problem statement here.
4
4
 
5
5
  # Completed Tasks
6
6
 
7
- * [ ] I have read the [Contributing Guide][contrib].
8
- * [ ] The pull request is complete (implemented / written).
9
- * [ ] Git commits have been cleaned up (squash WIP / revert commits).
10
- * [ ] I wrote tests and ran `bundle exec rake` locally (if code is attached to PR).
7
+ - [ ] I have read the [Contributing Guide][contrib].
8
+ - [ ] The pull request is complete (implemented / written).
9
+ - [ ] Git commits have been cleaned up (squash WIP / revert commits).
10
+ - [ ] I wrote tests and ran `bundle exec rake` locally (if code is attached to PR).
11
11
 
12
- [contrib]: https://github.com/lsegal/yard/blob/master/CONTRIBUTING.md
12
+ [contrib]: https://github.com/lsegal/yard/blob/main/CONTRIBUTING.md
@@ -1,6 +1,6 @@
1
1
  name: Unit Tests
2
2
 
3
- on: [push, pull_request]
3
+ on: [push, pull_request, workflow_dispatch]
4
4
  jobs:
5
5
  build:
6
6
  name: "Ruby: ${{ matrix.ruby }} OS: ${{ matrix.os }}"
@@ -8,20 +8,20 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- os: [macos-latest, windows-latest, ubuntu-latest]
12
- ruby: ["2.4", "2.5", "2.6", "2.7"]
11
+ os: [ubuntu-20.04, macos-10.15, windows-2019]
12
+ # 3.0 is interpreted as 3. also disable 2.5 due to bundler crashes
13
+ ruby: [2.2, 2.3, 2.4, 2.6, 2.7, "3.0", 3.1]
14
+ exclude:
15
+ - { os: windows-2019, ruby: 2.2 }
16
+ - { os: windows-2019, ruby: 2.3 }
13
17
  steps:
14
18
  - name: Checkout
15
19
  uses: actions/checkout@v2
16
- - name: Select Ruby Version
17
- uses: eregon/use-ruby-action@master
20
+ - name: Install Ruby & 'bundle install'
21
+ uses: ruby/setup-ruby@v1
18
22
  with:
19
23
  ruby-version: ${{ matrix.ruby }}
20
- base: update
21
- - name: Update RubyGems & Bundler
22
- run: gem update --system --no-document --conservative
23
- - name: Install Dependencies
24
- run: bundle install --jobs=3 --retry=3
24
+ bundler-cache: true
25
25
  - name: Run Test
26
26
  run: |
27
27
  ruby -v
@@ -0,0 +1,19 @@
1
+ name: Release Version
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ release_version:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - uses: lsegal/github-release-from-changelog-action@latest
14
+ env:
15
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
+ - name: Publish RubyGem
17
+ uses: dawidd6/action-publish-gem@v1
18
+ with:
19
+ api_key: ${{secrets.RUBYGEMS_API_KEY}}
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/.yardopts CHANGED
File without changes
data/.yardopts_guide CHANGED
File without changes
data/.yardopts_i18n CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,6 +1,38 @@
1
- # master
1
+ # main
2
2
 
3
- # 0.9.25 - May 3rd, 2020
3
+ # [0.9.28] - June 1st, 2022
4
+
5
+ [0.9.28]: https://github.com/lsegal/yard/compare/v0.9.27...v0.9.28
6
+
7
+ - Safe load config YAML files (#1385)
8
+ - Handle empty string constants (#1415)
9
+ - Pre-emptively support removal of `Object#taint` in Ruby 3.2 (#1419)
10
+ - Fix Ruby 3.1 forward args Ripper change (#1431)
11
+
12
+ # [0.9.27] - November 29th, 2021
13
+
14
+ [0.9.27]: https://github.com/lsegal/yard/compare/v0.9.26...v0.9.27
15
+
16
+ - Add support for Ruby 3.0 endless method definitions. (#1376, #1381)
17
+ - Add existence check for README file (#1367)
18
+ - Support module_function decorator (#1365)
19
+ - Add CommonMarker markup support (`-m commonmarker`) (#1157, #1388)
20
+ - Fix nested array parsing (#1389)
21
+ - Add WEBrick as a runtime dependency for Ruby 3.0 support (#1400)
22
+ - Support `fail_on_warning` option in `yard stats` command (#1392)
23
+ - Better integration with Sorbet (#1401)
24
+ - Handle include mixins on complex paths (#1386)
25
+ - Fix `@!scope` maintaining state in lone comment blocks (#1411)
26
+ - Remove support for Travis CI
27
+
28
+ # [0.9.26] - December 26th, 2020
29
+
30
+ [0.9.26]: https://github.com/lsegal/yard/compare/v0.9.25...v0.9.26
31
+
32
+ - Add support for Ruby 3.0 and fix tests
33
+ - Fix support for `frozen_string_literal: false` magic comments (#1363)
34
+
35
+ # [0.9.25] - May 3rd, 2020
4
36
 
5
37
  [0.9.25]: https://github.com/lsegal/yard/compare/v0.9.24...v0.9.25
6
38
 
@@ -15,7 +47,7 @@
15
47
  - Omit spec files in gem package (#1307)
16
48
  - README updates (#1322)
17
49
 
18
- # 0.9.24 - January 8th, 2020
50
+ # [0.9.24] - January 8th, 2020
19
51
 
20
52
  [0.9.24]: https://github.com/lsegal/yard/compare/v0.9.23...v0.9.24
21
53
 
@@ -23,20 +55,20 @@
23
55
  cache is changed.
24
56
  - Fix issue where Registry fails to resolve first-time lookups on instance methods.
25
57
 
26
- # 0.9.23 - January 5th, 2020
58
+ # [0.9.23] - January 5th, 2020
27
59
 
28
60
  [0.9.23]: https://github.com/lsegal/yard/compare/v0.9.22...v0.9.23
29
61
 
30
62
  - Fix issues with double encoded code blocks when highlighted from an extra
31
63
  file.
32
64
 
33
- # 0.9.22 - December 31st, 2019
65
+ # [0.9.22] - December 31st, 2019
34
66
 
35
67
  [0.9.22]: https://github.com/lsegal/yard/compare/v0.9.21...v0.9.22
36
68
 
37
69
  - Revert jquery update in last release since it requires more changes. (#1298)
38
70
 
39
- # 0.9.21 - December 31st, 2019
71
+ # [0.9.21] - December 31st, 2019
40
72
 
41
73
  [0.9.21]: https://github.com/lsegal/yard/compare/v0.9.20...v0.9.21
42
74
 
@@ -52,7 +84,7 @@
52
84
  - Update jquery to 3.4.1 (#1294)
53
85
  - Test fixes (#1244)
54
86
 
55
- # 0.9.20 - June 27th, 2019
87
+ # [0.9.20] - June 27th, 2019
56
88
 
57
89
  [0.9.20]: https://github.com/lsegal/yard/compare/v0.9.19...v0.9.20
58
90
 
@@ -62,7 +94,7 @@
62
94
  `yard server` host under certain conditions. Thanks to CuongMX from
63
95
  Viettel Cyber Security for discovering this vulnerability.
64
96
 
65
- # 0.9.19 - April 2nd, 2019
97
+ # [0.9.19] - April 2nd, 2019
66
98
 
67
99
  [0.9.19]: https://github.com/lsegal/yard/compare/v0.9.16...v0.9.19
68
100
 
data/CONTRIBUTING.md CHANGED
@@ -42,7 +42,7 @@ If you believe you have found a bug, please include a few things in your report:
42
42
  if the behavior is intentional or not.
43
43
 
44
44
  Finally, please **DO NOT** submit a report that states a feature simply
45
- *"does not work"* without any additional information in the report. Consider
45
+ _"does not work"_ without any additional information in the report. Consider
46
46
  the issue from the maintainer's perspective: in order to fix your bug, we
47
47
  need to drill down to the broken line of code, and in order to do this,
48
48
  we must be able to reproduce the issue on our end to find that line of
@@ -132,7 +132,7 @@ help handle day-to-day operations, such as releases, bug fixes, and triage.
132
132
  You can do some of this as a non-maintainer too, but if you like this project,
133
133
  we can always use more hands on deck!
134
134
 
135
- [code]: https://github.com/lsegal/yard/blob/master/CODE_OF_CONDUCT.md
135
+ [code]: https://github.com/lsegal/yard/blob/main/CODE_OF_CONDUCT.md
136
136
  [issues]: http://github.com/lsegal/yard/issues
137
137
  [commit]: http://chris.beams.io/posts/git-commit/
138
138
  [pr]: https://help.github.com/articles/using-pull-requests/
data/Gemfile CHANGED
@@ -2,13 +2,14 @@
2
2
  source 'https://rubygems.org'
3
3
 
4
4
  group :development do
5
- gem 'rspec'
5
+ gem 'rspec', '>= 3.11.0'
6
6
  gem 'rake'
7
7
  gem 'rdoc'
8
8
  gem 'json'
9
9
  gem 'simplecov'
10
- gem 'samus', '~> 3.0.8', :require => false
11
- gem 'coveralls', :require => false
10
+ gem 'samus', '~> 3.0.9', :require => false
11
+ gem 'coveralls_reborn', :require => false
12
+ gem 'webrick'
12
13
  end
13
14
 
14
15
  group :asciidoc do
@@ -17,6 +18,7 @@ end
17
18
 
18
19
  group :markdown do
19
20
  gem 'redcarpet'
21
+ gem 'commonmarker'
20
22
  end
21
23
 
22
24
  group :textile do
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2018 Loren Segal
1
+ Copyright (c) 2007-2022 Loren Segal
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Documentation](https://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://rubydoc.org/gems/yard/frames)
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/yard.svg)](http://github.com/lsegal/yard/releases)
8
- [![Build Status](https://travis-ci.org/lsegal/yard.svg?branch=master)](https://travis-ci.org/lsegal/yard)
8
+ [![Unit Tests](https://github.com/lsegal/yard/actions/workflows/ci.yml/badge.svg)](https://github.com/lsegal/yard/actions/workflows/ci.yml)
9
9
  [![Coverage Status](https://coveralls.io/repos/github/lsegal/yard/badge.svg)](https://coveralls.io/github/lsegal/yard)
10
10
  [![License](https://img.shields.io/badge/license-MIT-yellowgreen.svg)](#license)
11
11
 
data/Rakefile CHANGED
@@ -2,7 +2,6 @@
2
2
  require File.dirname(__FILE__) + '/lib/yard'
3
3
  require File.dirname(__FILE__) + '/lib/yard/rubygems/specification'
4
4
  require 'rbconfig'
5
- require 'samus'
6
5
 
7
6
  YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
8
7
 
@@ -35,5 +34,3 @@ task :default => [:spec, :test_doc]
35
34
  YARD::Rake::YardocTask.new do |t|
36
35
  t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
37
36
  end
38
-
39
- Samus::Rake::DockerReleaseTask.new
@@ -43,6 +43,8 @@ module YARD
43
43
 
44
44
  print_statistics
45
45
  print_undocumented_objects
46
+
47
+ abort if fail_on_warning && log.warned
46
48
  end
47
49
 
48
50
  # Prints statistics for different object types
@@ -223,7 +225,8 @@ module YARD
223
225
  end
224
226
 
225
227
  opts.on('--query QUERY', "Only includes objects that match a specific query") do |query|
226
- options[:verifier].add_expressions(query.taint)
228
+ query.taint if query.respond_to?(:taint)
229
+ options[:verifier].add_expressions(query)
227
230
  end
228
231
  end
229
232
  end
@@ -295,9 +295,10 @@ module YARD
295
295
  self.files = Parser::SourceParser::DEFAULT_PATH_GLOB if files.empty?
296
296
  files.delete_if {|x| x =~ /\A\s*\Z/ } # remove empty ones
297
297
  readme = Dir.glob('README{,*[^~]}').
298
+ select {|f| extra_file_valid?(f)}.
298
299
  sort_by {|r| [r.count('.'), r.index('.'), r] }.first
299
300
  readme ||= Dir.glob(files.first).first if options.onefile && !files.empty?
300
- options.readme ||= CodeObjects::ExtraFileObject.new(readme) if readme
301
+ options.readme ||= CodeObjects::ExtraFileObject.new(readme) if readme && extra_file_valid?(readme)
301
302
  options.files.unshift(options.readme).uniq! if options.readme
302
303
 
303
304
  Tags::Library.visible_tags -= hidden_tags
@@ -649,7 +650,8 @@ module YARD
649
650
 
650
651
  opts.on('--query QUERY', "Only show objects that match a specific query") do |query|
651
652
  next if YARD::Config.options[:safe_mode]
652
- options.verifier.add_expressions(query.taint)
653
+ query.taint if query.respond_to?(:taint)
654
+ options.verifier.add_expressions(query)
653
655
  end
654
656
 
655
657
  opts.on('--title TITLE', 'Add a specific title to HTML documents') do |title|
@@ -145,7 +145,7 @@ module YARD::CodeObjects
145
145
  end
146
146
 
147
147
  # Returns all alias names of the object
148
- # @return [Array<Symbol>] the alias names
148
+ # @return [Array<MethodObject>] the alias names
149
149
  def aliases
150
150
  list = []
151
151
  return list unless namespace.is_a?(NamespaceObject)
data/lib/yard/config.rb CHANGED
@@ -236,7 +236,11 @@ module YARD
236
236
  def self.read_config_file
237
237
  if File.file?(CONFIG_FILE)
238
238
  require 'yaml'
239
- YAML.load_file(CONFIG_FILE)
239
+ if YAML.respond_to?(:safe_load_file)
240
+ YAML.safe_load_file(CONFIG_FILE, permitted_classes: [SymbolHash, Symbol])
241
+ else
242
+ YAML.load_file(CONFIG_FILE)
243
+ end
240
244
  else
241
245
  {}
242
246
  end