yard 0.9.34 → 0.9.36

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7531850cba319c703685684605433173f6b55d2d39df481c65492772fe31bc86
4
- data.tar.gz: 61cbee634cd9292024ca7f126f867abbe9b8f9e6087c90f75ea18e87991cd4f2
3
+ metadata.gz: e1f492861606b6ce24d390317f2a97ccbd67bbf73b8b964ea6f9e61bb4096d9e
4
+ data.tar.gz: 1a4ec96bd604c8ab68cf6c971fc22aff400f2d8ed853d3b0b5fc222f4c8e7767
5
5
  SHA512:
6
- metadata.gz: 98abb79648eec38f9b035138e664f251b10530d7b1f38e70f6307749a224fc8237a8a4217be9a8792b4593a8938e199d760ff3b5d73a340cb91c8b3ffb63ba70
7
- data.tar.gz: 7b691f28627be2337780cadd32d4212f9dfe13b5d4c2493ee8720ce7e9d80c28135e96257f46527c10c3924fd8474bd23f0da84558f76060e5a15ab924507c08
6
+ metadata.gz: 04b727cb198fd9559a9314989fae7bcf60202531f5ab634d211780b5bbf15b60341d8a8f5fa6fd890c743c7d1b953e7b49d3c8e73997f3397b7344a70442fd29
7
+ data.tar.gz: c3df5e59c450adfc6d6088bd7c6a6c64f4477c1de65eae7cbd21e1c4ca410d606179bc88c84ed084b22d7b3f8bf66cc67426e9c103558b0a25c5ab01c1900ab9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # main
2
2
 
3
+ # [0.9.36] - February 29th, 2024
4
+
5
+ [0.9.36]: https://github.com/lsegal/yard/compare/v0.9.35...v0.9.36
6
+
7
+ - Further XSS fixes for generated frameset pages (#1538)
8
+ - Improve tests for Ruby 3.3 compatibility (#1519, #1531)
9
+ - Documentation improvements (#1524)
10
+
11
+ # [0.9.35] - February 28th, 2024
12
+
13
+ [0.9.35]: https://github.com/lsegal/yard/compare/v0.9.34...v0.9.35
14
+
15
+ - Fix possible XSS on generated YARD frameset pages (thanks to @RedYetiDev for finding and patching) (2069e2b).
16
+ - Fix errors when using `@option` on non-method objects (#1508)
17
+ - Support Ruby 3.3 changes in Ripper parser (#1510)
18
+
3
19
  # [0.9.34] - April 12nd, 2023
4
20
 
5
21
  [0.9.34]: https://github.com/lsegal/yard/compare/v0.9.33...v0.9.34
data/docs/Tags.md CHANGED
@@ -206,7 +206,7 @@ also be a list of types separated by commas.
206
206
  An order dependent list is a set of types surrounded by "()" and separated by
207
207
  commas. This list must contain exactly those types in exactly the order specified.
208
208
  For instance, an Array containing a String, Fixnum and Hash in that order (and
209
- having exactly those 3 elements) would be listed as: `Array<(String, Fixnum, Hash)>`.
209
+ having exactly those 3 elements) would be listed as: `Array(String, Fixnum, Hash)`.
210
210
 
211
211
  #### Literals
212
212
 
@@ -303,6 +303,7 @@ module YARD
303
303
  # definitions with docstrings first.
304
304
  #
305
305
  # @return [String] a filename
306
+ # @return [nil] if there is no file associated with the object
306
307
  def file
307
308
  @files.first ? @files.first[0] : nil
308
309
  end
@@ -476,9 +476,8 @@ module YARD
476
476
  content.force_encoding('binary')
477
477
  ENCODING_BYTE_ORDER_MARKS.each do |encoding, bom|
478
478
  bom.force_encoding('binary')
479
- if content[0, bom.size] == bom
480
- content.force_encoding(encoding)
481
- return content
479
+ if content.start_with?(bom)
480
+ return content.sub(bom, '').force_encoding(encoding)
482
481
  end
483
482
  end
484
483
  content.force_encoding('utf-8') # UTF-8 is default encoding
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.34'
5
+ VERSION = '0.9.36'
6
6
  end
@@ -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,4 +1,4 @@
1
- <% if object.has_tag?(:option) %>
1
+ <% if object.has_tag?(:option) && object.respond_to?(:parameters) %>
2
2
  <% object.parameters.each do |param, default| %>
3
3
  <% tags = object.tags(:option).select {|x| x.name.to_s == param.to_s.sub(/^\*+|:$/, '') } %>
4
4
  <% next if tags.empty? %>
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.34
4
+ version: 0.9.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-12 00:00:00.000000000 Z
11
+ date: 2024-02-29 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.