refrigerator 1.4.1 → 1.5.1

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: f50c5cac70517434571dcc50228ce88acf013de728fd3cbf4bf4f46a73141ff6
4
- data.tar.gz: 79189cfdf9a9d05b7142c4c2e1f4a121ac5af4e948c97fd096a904345bcb3d03
3
+ metadata.gz: 186c03b5ec32b85e8a2185d748157aba36e487a9c8366680597a2ebb4f336e07
4
+ data.tar.gz: 4d6e2c5eb180e09d5e5a75eb23782a875e25847b80c723f8ab13866071552422
5
5
  SHA512:
6
- metadata.gz: 4098cb941aa128fcf8af272f5f800141c2bb284015306ac7792016326cb3c788ddada67e48d10d4810f7b48b82cb7bc9824165dd26ddfc66fbd8c31ca2bc1f93
7
- data.tar.gz: bd17d0295721f3605e19b6460ad10ba3955380616fe3a1b855c1b35ccf1936e559f31d1e23db98b477a1e5288eb51e89850e15b468b1c3ef3517b48af2f1ad1a
6
+ metadata.gz: a8434dcb03c19ff122b0d5adad2c975b1bdeaed0a59a360b2ca81e2e5bb278df2384455073226cfa650e815cb658567c492be6277c6b8a9b23cdc0e5210a6326
7
+ data.tar.gz: 8013f398f49d68ee64534cdc04f913eab63d6aca56334860041a06e1b8bb971f5e01c0388083f1d15f0b33b3061224aeb590d2899dad76baf6acaad638847241
data/CHANGELOG CHANGED
@@ -1,3 +1,13 @@
1
+ === 1.5.1 (2023-01-13)
2
+
3
+ * Fix the support new classes and modules in Ruby 3.2 (jeremyevans)
4
+
5
+ === 1.5.0 (2023-01-11)
6
+
7
+ * Support new classes and modules in Ruby 3.2 (jeremyevans)
8
+
9
+ * Set file and line for all eval calls, to ease debugging (jeremyevans)
10
+
1
11
  === 1.4.1 (2022-02-18)
2
12
 
3
13
  * Freeze constants in reverse order, fixes issues with rubygems starting in Ruby 3.1.1 (jeremyevans)
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2022 Jeremy Evans
1
+ Copyright (c) 2017-2023 Jeremy Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to
data/README.rdoc CHANGED
@@ -164,6 +164,8 @@ code similar to:
164
164
 
165
165
  ObjectSpace.each_object(Module){|m| p m.name}
166
166
 
167
+ In addition, the +version_int+ variable in +refrigerator.rb+ needs to be updated.
168
+
167
169
  = License
168
170
 
169
171
  MIT
data/Rakefile CHANGED
@@ -25,6 +25,12 @@ end
25
25
 
26
26
  task :default => :spec
27
27
 
28
+ desc "Run tests with coverage"
29
+ task :spec_cov do
30
+ ENV['COVERAGE'] = '1'
31
+ sh "#{FileUtils::RUBY} test/refrigerator_test.rb"
32
+ end
33
+
28
34
  ### RDoc
29
35
 
30
36
  RDOC_DEFAULT_OPTS = ["--quiet", "--line-numbers", "--inline-source", '--title', 'Refrigerator: Freeze core ruby classes']
data/lib/refrigerator.rb CHANGED
@@ -1,12 +1,14 @@
1
1
  # Refrigerator allows for easily freezing core classes and modules.
2
2
  module Refrigerator
3
3
  version_int = RUBY_VERSION[0..2].sub('.', '').to_i
4
- version_int = 31 if version_int > 31
4
+ # :nocov:
5
+ version_int = 32 if version_int > 32
6
+ # :nocov:
5
7
 
6
8
  # Array of strings containing class or module names.
7
9
  CORE_MODULES = File.read(File.expand_path(File.join(File.expand_path(__FILE__), "../../module_names/#{version_int}.txt"))).
8
10
  split(/\s+/).
9
- select{|m| eval("defined?(#{m})")}.
11
+ select{|m| eval("defined?(#{m})", nil, __FILE__, __LINE__)}.
10
12
  each(&:freeze).
11
13
  reverse.
12
14
  freeze
@@ -17,7 +19,7 @@ module Refrigerator
17
19
  # Freeze core classes and modules. Options:
18
20
  # :except :: Don't freeze any of the classes modules listed (array of strings)
19
21
  def self.freeze_core(opts=OPTS)
20
- (CORE_MODULES - Array(opts[:except])).each{|m| eval(m).freeze}
22
+ (CORE_MODULES - Array(opts[:except])).each{|m| eval(m, nil, __FILE__, __LINE__).freeze}
21
23
  nil
22
24
  end
23
25
 
@@ -31,7 +33,7 @@ module Refrigerator
31
33
  require 'rubygems'
32
34
  Array(opts[:depends]).each{|f| require f}
33
35
  Array(opts[:modules]).each{|m| Object.const_set(m, Module.new)}
34
- Array(opts[:classes]).each{|c, *sc| Object.const_set(c, Class.new(sc.empty? ? Object : eval(sc.first.to_s)))}
36
+ Array(opts[:classes]).each{|c, *sc| Object.const_set(c, Class.new(sc.empty? ? Object : eval(sc.first.to_s, nil, __FILE__, __LINE__)))}
35
37
  freeze_core(:except=>%w'Gem Gem::Specification Gem::Deprecate'+Array(opts[:exclude]))
36
38
  require file
37
39
  end
@@ -0,0 +1,325 @@
1
+ ARGF.class
2
+ ArgumentError
3
+ Array
4
+ BasicObject
5
+ Binding
6
+ Class
7
+ ClosedQueueError
8
+ Comparable
9
+ Complex
10
+ Complex::compatible
11
+ Data
12
+ DidYouMean
13
+ DidYouMean::ClassNameChecker
14
+ DidYouMean::ClassNameChecker::ClassName
15
+ DidYouMean::Correctable
16
+ DidYouMean::DeprecatedMapping
17
+ DidYouMean::Formatter
18
+ DidYouMean::Jaro
19
+ DidYouMean::JaroWinkler
20
+ DidYouMean::KeyErrorChecker
21
+ DidYouMean::Levenshtein
22
+ DidYouMean::MethodNameChecker
23
+ DidYouMean::NullChecker
24
+ DidYouMean::PatternKeyNameChecker
25
+ DidYouMean::RequirePathChecker
26
+ DidYouMean::SpellChecker
27
+ DidYouMean::TreeSpellChecker
28
+ DidYouMean::VariableNameChecker
29
+ Dir
30
+ EOFError
31
+ Encoding
32
+ Encoding::CompatibilityError
33
+ Encoding::Converter
34
+ Encoding::ConverterNotFoundError
35
+ Encoding::InvalidByteSequenceError
36
+ Encoding::UndefinedConversionError
37
+ EncodingError
38
+ Enumerable
39
+ Enumerator
40
+ Enumerator::ArithmeticSequence
41
+ Enumerator::Chain
42
+ Enumerator::Generator
43
+ Enumerator::Lazy
44
+ Enumerator::Producer
45
+ Enumerator::Product
46
+ Enumerator::Yielder
47
+ Errno
48
+ Errno::E2BIG
49
+ Errno::EACCES
50
+ Errno::EADDRINUSE
51
+ Errno::EADDRNOTAVAIL
52
+ Errno::EAFNOSUPPORT
53
+ Errno::EAGAIN
54
+ Errno::EALREADY
55
+ Errno::EAUTH
56
+ Errno::EBADF
57
+ Errno::EBADMSG
58
+ Errno::EBADRPC
59
+ Errno::EBUSY
60
+ Errno::ECANCELED
61
+ Errno::ECHILD
62
+ Errno::ECONNABORTED
63
+ Errno::ECONNREFUSED
64
+ Errno::ECONNRESET
65
+ Errno::EDEADLK
66
+ Errno::EDESTADDRREQ
67
+ Errno::EDOM
68
+ Errno::EDQUOT
69
+ Errno::EEXIST
70
+ Errno::EFAULT
71
+ Errno::EFBIG
72
+ Errno::EFTYPE
73
+ Errno::EHOSTDOWN
74
+ Errno::EHOSTUNREACH
75
+ Errno::EIDRM
76
+ Errno::EILSEQ
77
+ Errno::EINPROGRESS
78
+ Errno::EINTR
79
+ Errno::EINVAL
80
+ Errno::EIO
81
+ Errno::EIPSEC
82
+ Errno::EISCONN
83
+ Errno::EISDIR
84
+ Errno::ELAST
85
+ Errno::ELOOP
86
+ Errno::EMEDIUMTYPE
87
+ Errno::EMFILE
88
+ Errno::EMLINK
89
+ Errno::EMSGSIZE
90
+ Errno::ENAMETOOLONG
91
+ Errno::ENEEDAUTH
92
+ Errno::ENETDOWN
93
+ Errno::ENETRESET
94
+ Errno::ENETUNREACH
95
+ Errno::ENFILE
96
+ Errno::ENOATTR
97
+ Errno::ENOBUFS
98
+ Errno::ENODEV
99
+ Errno::ENOENT
100
+ Errno::ENOEXEC
101
+ Errno::ENOLCK
102
+ Errno::ENOMEDIUM
103
+ Errno::ENOMEM
104
+ Errno::ENOMSG
105
+ Errno::ENOPROTOOPT
106
+ Errno::ENOSPC
107
+ Errno::ENOSYS
108
+ Errno::ENOTBLK
109
+ Errno::ENOTCONN
110
+ Errno::ENOTDIR
111
+ Errno::ENOTEMPTY
112
+ Errno::ENOTRECOVERABLE
113
+ Errno::ENOTSOCK
114
+ Errno::ENOTSUP
115
+ Errno::ENOTTY
116
+ Errno::ENXIO
117
+ Errno::EOPNOTSUPP
118
+ Errno::EOVERFLOW
119
+ Errno::EOWNERDEAD
120
+ Errno::EPERM
121
+ Errno::EPFNOSUPPORT
122
+ Errno::EPIPE
123
+ Errno::EPROCLIM
124
+ Errno::EPROCUNAVAIL
125
+ Errno::EPROGMISMATCH
126
+ Errno::EPROGUNAVAIL
127
+ Errno::EPROTONOSUPPORT
128
+ Errno::EPROTOTYPE
129
+ Errno::ERANGE
130
+ Errno::EREMOTE
131
+ Errno::EROFS
132
+ Errno::ERPCMISMATCH
133
+ Errno::ESHUTDOWN
134
+ Errno::ESOCKTNOSUPPORT
135
+ Errno::ESPIPE
136
+ Errno::ESRCH
137
+ Errno::ESTALE
138
+ Errno::ETIMEDOUT
139
+ Errno::ETOOMANYREFS
140
+ Errno::ETXTBSY
141
+ Errno::EUSERS
142
+ Errno::EXDEV
143
+ Errno::NOERROR
144
+ ErrorHighlight
145
+ ErrorHighlight::CoreExt
146
+ ErrorHighlight::DefaultFormatter
147
+ ErrorHighlight::Spotter
148
+ ErrorHighlight::Spotter::NonAscii
149
+ Exception
150
+ FalseClass
151
+ Fiber
152
+ FiberError
153
+ File
154
+ File::Constants
155
+ File::Stat
156
+ FileTest
157
+ Float
158
+ FloatDomainError
159
+ FrozenError
160
+ GC
161
+ GC::Profiler
162
+ Gem
163
+ Gem::BasicSpecification
164
+ Gem::CommandLineError
165
+ Gem::ConflictError
166
+ Gem::Dependency
167
+ Gem::DependencyError
168
+ Gem::DependencyRemovalException
169
+ Gem::DependencyResolutionError
170
+ Gem::Deprecate
171
+ Gem::DocumentError
172
+ Gem::EndOfYAMLException
173
+ Gem::ErrorReason
174
+ Gem::Exception
175
+ Gem::FilePermissionError
176
+ Gem::FormatException
177
+ Gem::GemNotFoundException
178
+ Gem::GemNotInHomeException
179
+ Gem::ImpossibleDependenciesError
180
+ Gem::InstallError
181
+ Gem::InvalidSpecificationException
182
+ Gem::List
183
+ Gem::LoadError
184
+ Gem::MissingSpecError
185
+ Gem::MissingSpecVersionError
186
+ Gem::OperationNotSupportedError
187
+ Gem::PathSupport
188
+ Gem::Platform
189
+ Gem::PlatformMismatch
190
+ Gem::RemoteError
191
+ Gem::RemoteInstallationCancelled
192
+ Gem::RemoteInstallationSkipped
193
+ Gem::RemoteSourceException
194
+ Gem::Requirement
195
+ Gem::Requirement::BadRequirementError
196
+ Gem::RubyVersionMismatch
197
+ Gem::RuntimeRequirementNotMetError
198
+ Gem::SourceFetchProblem
199
+ Gem::SpecificGemNotFoundException
200
+ Gem::Specification
201
+ Gem::StubSpecification
202
+ Gem::StubSpecification::StubLine
203
+ Gem::SystemExitException
204
+ Gem::UninstallError
205
+ Gem::UnknownCommandError
206
+ Gem::UnknownCommandSpellChecker
207
+ Gem::UnsatisfiableDependencyError
208
+ Gem::Util
209
+ Gem::VerificationError
210
+ Gem::Version
211
+ Hash
212
+ IO
213
+ IO::Buffer
214
+ IO::Buffer::AccessError
215
+ IO::Buffer::AllocationError
216
+ IO::Buffer::InvalidatedError
217
+ IO::Buffer::LockedError
218
+ IO::Buffer::MaskError
219
+ IO::EAGAINWaitReadable
220
+ IO::EAGAINWaitWritable
221
+ IO::EINPROGRESSWaitReadable
222
+ IO::EINPROGRESSWaitWritable
223
+ IO::TimeoutError
224
+ IO::WaitReadable
225
+ IO::WaitWritable
226
+ IOError
227
+ IndexError
228
+ Integer
229
+ Interrupt
230
+ Kernel
231
+ KeyError
232
+ LoadError
233
+ LocalJumpError
234
+ Marshal
235
+ MatchData
236
+ Math
237
+ Math::DomainError
238
+ Method
239
+ Module
240
+ Monitor
241
+ MonitorMixin
242
+ MonitorMixin::ConditionVariable
243
+ NameError
244
+ NameError::message
245
+ NilClass
246
+ NoMatchingPatternError
247
+ NoMatchingPatternKeyError
248
+ NoMemoryError
249
+ NoMethodError
250
+ NotImplementedError
251
+ Numeric
252
+ Object
253
+ ObjectSpace
254
+ ObjectSpace::WeakMap
255
+ Proc
256
+ Process
257
+ Process::GID
258
+ Process::Status
259
+ Process::Sys
260
+ Process::Tms
261
+ Process::UID
262
+ Process::Waiter
263
+ Ractor
264
+ Ractor::ClosedError
265
+ Ractor::Error
266
+ Ractor::IsolationError
267
+ Ractor::MovedError
268
+ Ractor::MovedObject
269
+ Ractor::RemoteError
270
+ Ractor::UnsafeError
271
+ Random
272
+ Random::Base
273
+ Random::Formatter
274
+ Range
275
+ RangeError
276
+ Rational
277
+ Rational::compatible
278
+ RbConfig
279
+ Refinement
280
+ Regexp
281
+ Regexp::TimeoutError
282
+ RegexpError
283
+ RubyVM
284
+ RubyVM::AbstractSyntaxTree
285
+ RubyVM::AbstractSyntaxTree::Node
286
+ RubyVM::InstructionSequence
287
+ RubyVM::MJIT
288
+ RubyVM::YJIT
289
+ RuntimeError
290
+ ScriptError
291
+ SecurityError
292
+ Signal
293
+ SignalException
294
+ StandardError
295
+ StopIteration
296
+ String
297
+ Struct
298
+ Symbol
299
+ SyntaxError
300
+ SyntaxSuggest
301
+ SyntaxSuggest::MiniStringIO
302
+ SystemCallError
303
+ SystemExit
304
+ SystemStackError
305
+ Thread
306
+ Thread::Backtrace
307
+ Thread::Backtrace::Location
308
+ Thread::ConditionVariable
309
+ Thread::Mutex
310
+ Thread::Queue
311
+ Thread::SizedQueue
312
+ ThreadError
313
+ ThreadGroup
314
+ Time
315
+ Time::tm
316
+ TracePoint
317
+ TrueClass
318
+ TypeError
319
+ UnboundMethod
320
+ UncaughtThrowError
321
+ UnicodeNormalize
322
+ Warning
323
+ Warning::buffer
324
+ ZeroDivisionError
325
+ fatal
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refrigerator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-18 00:00:00.000000000 Z
11
+ date: 2023-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -71,6 +71,7 @@ files:
71
71
  - module_names/27.txt
72
72
  - module_names/30.txt
73
73
  - module_names/31.txt
74
+ - module_names/32.txt
74
75
  homepage: http://github.com/jeremyevans/ruby-refrigerator
75
76
  licenses:
76
77
  - MIT
@@ -79,7 +80,7 @@ metadata:
79
80
  changelog_uri: https://github.com/jeremyevans/ruby-refrigerator/blob/master/CHANGELOG
80
81
  mailing_list_uri: https://github.com/jeremyevans/ruby-refrigerator/discussions
81
82
  source_code_uri: https://github.com/jeremyevans/ruby-refrigerator
82
- post_install_message:
83
+ post_install_message:
83
84
  rdoc_options:
84
85
  - "--quiet"
85
86
  - "--line-numbers"
@@ -101,8 +102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  - !ruby/object:Gem::Version
102
103
  version: '0'
103
104
  requirements: []
104
- rubygems_version: 3.3.7
105
- signing_key:
105
+ rubygems_version: 3.4.1
106
+ signing_key:
106
107
  specification_version: 4
107
108
  summary: Freeze all core ruby classes
108
109
  test_files: []