rdoc 6.6.2 → 6.6.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rdoc/store.rb +26 -19
  3. data/lib/rdoc/version.rb +1 -1
  4. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 060b06473aafc2a0a07ded738b5be7819ddd0520d7e2033ef72311ff8dd57248
4
- data.tar.gz: 500fd282367d6cefeb9257518a0ed5e5371cf3c09a6addc8ac30be1dbe7ba267
3
+ metadata.gz: febf92bf44319e2f1332649bd680816b7fba107c9b4cbf57f490e6f1d1a72a9f
4
+ data.tar.gz: 35fe427a44b35e1321cd9be4a5d23234643cbceb9ca79937e2f47081e9875012
5
5
  SHA512:
6
- metadata.gz: 52461100f11f5123da6874e2786b4a83248435fd4955609647421c49a71c5d6ba98bd869fc3c510e64d148992461762b4213390b7aa33bd9dd80d7caad665638
7
- data.tar.gz: 87b21e587bc4e2d97b35f56b4be8e28a1ac40961dc5caf2f61ab3500f5f3a9147195b917d329a1264cb6f4605daec30bb5603c2269a09c5a89da359074928805
6
+ metadata.gz: 10f7cd4ec5f7c90aa2214615ebc635680e120ce1eca0b2f8d4b4f77cac3ebdbe87102c3564542ca2e13fc06501478354dda3b443c1a0883f82d50f0092e25a7e
7
+ data.tar.gz: 01530b6cd051f153e33e4a3981f29b4ba5ecdf00ac3c67541de37aeadec0991983697a3a094a3a1d3f8ad85a978e631aaa1507e4091a3b96ca031ea9a60bb548
data/lib/rdoc/store.rb CHANGED
@@ -559,9 +559,7 @@ class RDoc::Store
559
559
  def load_cache
560
560
  #orig_enc = @encoding
561
561
 
562
- File.open cache_path, 'rb' do |io|
563
- @cache = Marshal.load io
564
- end
562
+ @cache = marshal_load(cache_path)
565
563
 
566
564
  load_enc = @cache[:encoding]
567
565
 
@@ -618,9 +616,7 @@ class RDoc::Store
618
616
  def load_class_data klass_name
619
617
  file = class_file klass_name
620
618
 
621
- File.open file, 'rb' do |io|
622
- Marshal.load io
623
- end
619
+ marshal_load(file)
624
620
  rescue Errno::ENOENT => e
625
621
  error = MissingFileError.new(self, file, klass_name)
626
622
  error.set_backtrace e.backtrace
@@ -633,14 +629,10 @@ class RDoc::Store
633
629
  def load_method klass_name, method_name
634
630
  file = method_file klass_name, method_name
635
631
 
636
- File.open file, 'rb' do |io|
637
- obj = Marshal.load io
638
- obj.store = self
639
- obj.parent =
640
- find_class_or_module(klass_name) || load_class(klass_name) unless
641
- obj.parent
642
- obj
643
- end
632
+ obj = marshal_load(file)
633
+ obj.store = self
634
+ obj.parent ||= find_class_or_module(klass_name) || load_class(klass_name)
635
+ obj
644
636
  rescue Errno::ENOENT => e
645
637
  error = MissingFileError.new(self, file, klass_name + method_name)
646
638
  error.set_backtrace e.backtrace
@@ -653,11 +645,9 @@ class RDoc::Store
653
645
  def load_page page_name
654
646
  file = page_file page_name
655
647
 
656
- File.open file, 'rb' do |io|
657
- obj = Marshal.load io
658
- obj.store = self
659
- obj
660
- end
648
+ obj = marshal_load(file)
649
+ obj.store = self
650
+ obj
661
651
  rescue Errno::ENOENT => e
662
652
  error = MissingFileError.new(self, file, page_name)
663
653
  error.set_backtrace e.backtrace
@@ -979,4 +969,21 @@ class RDoc::Store
979
969
  @unique_modules
980
970
  end
981
971
 
972
+ private
973
+ def marshal_load(file)
974
+ File.open(file, 'rb') {|io| Marshal.load(io, MarshalFilter)}
975
+ end
976
+
977
+ MarshalFilter = proc do |obj|
978
+ case obj
979
+ when true, false, nil, Array, Class, Encoding, Hash, Integer, String, Symbol, RDoc::Text
980
+ else
981
+ unless obj.class.name.start_with?("RDoc::")
982
+ raise TypeError, "not permitted class: #{obj.class.name}"
983
+ end
984
+ end
985
+ obj
986
+ end
987
+ private_constant :MarshalFilter
988
+
982
989
  end
data/lib/rdoc/version.rb CHANGED
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '6.6.2'
8
+ VERSION = '6.6.3.1'
9
9
 
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.2
4
+ version: 6.6.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -11,10 +11,9 @@ authors:
11
11
  - Zachary Scott
12
12
  - Hiroshi SHIBATA
13
13
  - ITOYANAGI Sakura
14
- autorequire:
15
14
  bindir: exe
16
15
  cert_chain: []
17
- date: 2023-12-16 00:00:00.000000000 Z
16
+ date: 2024-03-21 00:00:00.000000000 Z
18
17
  dependencies:
19
18
  - !ruby/object:Gem::Dependency
20
19
  name: psych
@@ -253,7 +252,6 @@ metadata:
253
252
  homepage_uri: https://ruby.github.io/rdoc
254
253
  source_code_uri: https://github.com/ruby/rdoc
255
254
  changelog_uri: https://github.com/ruby/rdoc/releases
256
- post_install_message:
257
255
  rdoc_options:
258
256
  - "--main"
259
257
  - README.rdoc
@@ -270,8 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
268
  - !ruby/object:Gem::Version
271
269
  version: '2.2'
272
270
  requirements: []
273
- rubygems_version: 3.5.0.dev
274
- signing_key:
271
+ rubygems_version: 3.6.0.dev
275
272
  specification_version: 4
276
273
  summary: RDoc produces HTML and command-line documentation for Ruby projects
277
274
  test_files: []