yard 0.9.27 → 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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0e3a62dcbb66515f56fe9a2cb919aa97881dced6e7cf052a7ce0201ff9222cf
4
- data.tar.gz: 06714cb7f3e754d10fb2e784c0a0d49a5fee20aaee75778565daea8b61c453c1
3
+ metadata.gz: 2a014685561249bd72bd38eea2db5386c7a3f5d814ec2cbd0218fc76803d4d88
4
+ data.tar.gz: fbbb78841e6f41798c14cde55e5d55da409bc550005a1f8d67a2491332a9378c
5
5
  SHA512:
6
- metadata.gz: 4a993609ba381fdc0419ac8332605b10a3995ff818626c20e64095f4f845e28297d38a81c890aa95a187ca8fd7d8e7d9f291d7251ac96ba1bee7a5a249f2db3d
7
- data.tar.gz: f71cc60bc0fbe36419f8f142e07bbee5fd19b9e539099256bb644f1f61f57e9fa61c96ff95e879d584bdb48b3f988d5e945277acbc6e0f083cf1a6c8584c45df
6
+ metadata.gz: 37666343d2e629ce4cd1c9c1d7e82b678ade120151e79b52ce3110bdbd9c0bdf65c76aa3661a5d6ffd34fe40f9ff90f100b1f7b2c898951737e6ba14f4bacaa3
7
+ data.tar.gz: 6235690efed8749d45e513842f689a273c68ef6424a4881a9e77db2a1590ebc1fb7d55d6d68c2f6013bda045e49e1285169c93a9c7736f3b2ef7a6e8fe1fc4de
@@ -9,11 +9,11 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  os: [ubuntu-20.04, macos-10.15, windows-2019]
12
- # 3.0 is interpreted as 3
13
- ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, "3.0"]
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
14
  exclude:
15
- - { os: windows-2019 , ruby: 2.2 }
16
- - { os: windows-2019 , ruby: 2.3 }
15
+ - { os: windows-2019, ruby: 2.2 }
16
+ - { os: windows-2019, ruby: 2.3 }
17
17
  steps:
18
18
  - name: Checkout
19
19
  uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # main
2
2
 
3
- # 0.9.27 - November 29th, 2021
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
4
13
 
5
14
  [0.9.27]: https://github.com/lsegal/yard/compare/v0.9.26...v0.9.27
6
15
 
@@ -16,14 +25,14 @@
16
25
  - Fix `@!scope` maintaining state in lone comment blocks (#1411)
17
26
  - Remove support for Travis CI
18
27
 
19
- # 0.9.26 - December 26th, 2020
28
+ # [0.9.26] - December 26th, 2020
20
29
 
21
30
  [0.9.26]: https://github.com/lsegal/yard/compare/v0.9.25...v0.9.26
22
31
 
23
32
  - Add support for Ruby 3.0 and fix tests
24
33
  - Fix support for `frozen_string_literal: false` magic comments (#1363)
25
34
 
26
- # 0.9.25 - May 3rd, 2020
35
+ # [0.9.25] - May 3rd, 2020
27
36
 
28
37
  [0.9.25]: https://github.com/lsegal/yard/compare/v0.9.24...v0.9.25
29
38
 
@@ -38,7 +47,7 @@
38
47
  - Omit spec files in gem package (#1307)
39
48
  - README updates (#1322)
40
49
 
41
- # 0.9.24 - January 8th, 2020
50
+ # [0.9.24] - January 8th, 2020
42
51
 
43
52
  [0.9.24]: https://github.com/lsegal/yard/compare/v0.9.23...v0.9.24
44
53
 
@@ -46,20 +55,20 @@
46
55
  cache is changed.
47
56
  - Fix issue where Registry fails to resolve first-time lookups on instance methods.
48
57
 
49
- # 0.9.23 - January 5th, 2020
58
+ # [0.9.23] - January 5th, 2020
50
59
 
51
60
  [0.9.23]: https://github.com/lsegal/yard/compare/v0.9.22...v0.9.23
52
61
 
53
62
  - Fix issues with double encoded code blocks when highlighted from an extra
54
63
  file.
55
64
 
56
- # 0.9.22 - December 31st, 2019
65
+ # [0.9.22] - December 31st, 2019
57
66
 
58
67
  [0.9.22]: https://github.com/lsegal/yard/compare/v0.9.21...v0.9.22
59
68
 
60
69
  - Revert jquery update in last release since it requires more changes. (#1298)
61
70
 
62
- # 0.9.21 - December 31st, 2019
71
+ # [0.9.21] - December 31st, 2019
63
72
 
64
73
  [0.9.21]: https://github.com/lsegal/yard/compare/v0.9.20...v0.9.21
65
74
 
@@ -75,7 +84,7 @@
75
84
  - Update jquery to 3.4.1 (#1294)
76
85
  - Test fixes (#1244)
77
86
 
78
- # 0.9.20 - June 27th, 2019
87
+ # [0.9.20] - June 27th, 2019
79
88
 
80
89
  [0.9.20]: https://github.com/lsegal/yard/compare/v0.9.19...v0.9.20
81
90
 
@@ -85,7 +94,7 @@
85
94
  `yard server` host under certain conditions. Thanks to CuongMX from
86
95
  Viettel Cyber Security for discovering this vulnerability.
87
96
 
88
- # 0.9.19 - April 2nd, 2019
97
+ # [0.9.19] - April 2nd, 2019
89
98
 
90
99
  [0.9.19]: https://github.com/lsegal/yard/compare/v0.9.16...v0.9.19
91
100
 
data/Gemfile CHANGED
@@ -2,13 +2,13 @@
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
10
  gem 'samus', '~> 3.0.9', :require => false
11
- gem 'coveralls', :require => false
11
+ gem 'coveralls_reborn', :require => false
12
12
  gem 'webrick'
13
13
  end
14
14
 
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
@@ -225,7 +225,8 @@ module YARD
225
225
  end
226
226
 
227
227
  opts.on('--query QUERY', "Only includes objects that match a specific query") do |query|
228
- options[:verifier].add_expressions(query.taint)
228
+ query.taint if query.respond_to?(:taint)
229
+ options[:verifier].add_expressions(query)
229
230
  end
230
231
  end
231
232
  end
@@ -650,7 +650,8 @@ module YARD
650
650
 
651
651
  opts.on('--query QUERY', "Only show objects that match a specific query") do |query|
652
652
  next if YARD::Config.options[:safe_mode]
653
- options.verifier.add_expressions(query.taint)
653
+ query.taint if query.respond_to?(:taint)
654
+ options.verifier.add_expressions(query)
654
655
  end
655
656
 
656
657
  opts.on('--title TITLE', 'Add a specific title to HTML documents') do |title|
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
@@ -97,7 +97,7 @@ class YARD::Handlers::Ruby::MethodHandler < YARD::Handlers::Ruby::Base
97
97
  params << ['**' + args.double_splat_param.source, nil]
98
98
  end
99
99
 
100
- params << ['&' + args.block_param.source, nil] if args.block_param
100
+ params << ['&' + args.block_param.source, nil] if args.block_param && !args.args_forward
101
101
 
102
102
  params
103
103
  end
@@ -426,6 +426,13 @@ module YARD
426
426
  def block_param
427
427
  self[-1] ? self[-1][0] : nil
428
428
  end
429
+
430
+ def args_forward
431
+ # shape is (required, optional, rest, more, keyword, keyword_rest, block)
432
+ # Ruby 3.1 moves :args_forward from rest to keyword_rest
433
+ args_index = YARD.ruby31? ? -2 : 2
434
+ self[args_index].type == :args_forward if self[args_index]
435
+ end
429
436
  end
430
437
 
431
438
  class MethodCallNode < AstNode
@@ -66,7 +66,9 @@ module YARD
66
66
 
67
67
  # @return [String] formats source code of a constant value
68
68
  def format_constant(value)
69
- sp = value.split("\n").last[/^(\s+)/, 1]
69
+ # last can return nil, so default to empty string
70
+ sp = value.split("\n").last || ""
71
+ sp = sp[/^(\s+)/, 1]
70
72
  num = sp ? sp.size : 0
71
73
  html_syntax_highlight value.gsub(/^\s{#{num}}/, '')
72
74
  end
@@ -176,7 +176,9 @@ module YARD
176
176
  def load_setup_rb
177
177
  setup_file = File.join(full_path, 'setup.rb')
178
178
  if File.file? setup_file
179
- module_eval(File.read(setup_file).taint, setup_file, 1)
179
+ setup_code = File.read(setup_file)
180
+ setup_code.taint if setup_code.respond_to?(:taint)
181
+ module_eval(setup_code, setup_file, 1)
180
182
  end
181
183
  end
182
184
  end
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.27'
5
+ VERSION = '0.9.28'
6
6
  end
data/lib/yard.rb CHANGED
@@ -51,6 +51,9 @@ module YARD
51
51
 
52
52
  # @return [Boolean] whether YARD is being run in Ruby 3.0
53
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
54
57
  end
55
58
 
56
59
  # Keep track of Ruby version for compatibility code
@@ -1,5 +1,5 @@
1
1
  <div id="footer">
2
2
  Generated on <%= Time.now.strftime("%c") %> by
3
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
3
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
4
4
  <%= YARD::VERSION %> (ruby-<%= RUBY_VERSION %>).
5
5
  </div>
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.27
4
+ version: 0.9.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-29 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webrick