refrigerator 1.4.0 → 1.5.0

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: 39830c719366bd0e689b7a784879bd834e20f9f410a01aee24adb3bd5b7368ed
4
- data.tar.gz: 7fd6dda21287843f916a63283a2aa9178aec16c89fff5c6bbd24b98e9d14ad67
3
+ metadata.gz: 5a13b3f1a551e9a9f1eb46837702f4cf7c9055648c1cf1b5c40c596fb83b2b61
4
+ data.tar.gz: fedc3a8ffa7f3020bdb7b87eeab6d980dee983c8b06e57bff77886e8554f46d8
5
5
  SHA512:
6
- metadata.gz: ae3d653e46d339c4b50417de2fff4bb8787c7595fc73ca5d66434533419a6a8afdf262dcac33b8b1e85f9828bcc414a5b96ca100f15fb52c1ca15c54a3aeac5c
7
- data.tar.gz: 9a480c31c4a4ffccc58b3ebae576347eae7e70a39ba78978bda81fad767ad098ad2a367d26edcec1b39577a956190a63640c349a8016f3bc0284e38a638bdd82
6
+ metadata.gz: 940bf5dde749c52db0e677538e45aaa511c91e2ace38b2656eca844a6f84dd8986533619d77432f51716f627589062f98c282c931679531b40a83a08d9992f7a
7
+ data.tar.gz: 79f0095f5e891c54989444fec0914d64a9f444e5cd977e16f469962549582327d9086ef2030431cb36c94a77d80daf38c8945e70b4a07db81de6dee8eb696ee0
data/CHANGELOG CHANGED
@@ -1,3 +1,13 @@
1
+ === 1.5.0 (2023-01-11)
2
+
3
+ * Support new classes and modules in Ruby 3.2 (jeremyevans)
4
+
5
+ * Set file and line for all eval calls, to ease debugging (jeremyevans)
6
+
7
+ === 1.4.1 (2022-02-18)
8
+
9
+ * Freeze constants in reverse order, fixes issues with rubygems starting in Ruby 3.1.1 (jeremyevans)
10
+
1
11
  === 1.4.0 (2021-12-25)
2
12
 
3
13
  * Support new classes and modules in Ruby 3.1 (jeremyevans)
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2021 Jeremy Evans
1
+ Copyright (c) 2017-2022 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/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,13 +1,16 @@
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
+ # :nocov:
4
5
  version_int = 31 if version_int > 31
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).
13
+ reverse.
11
14
  freeze
12
15
 
13
16
  # Default frozen options hash
@@ -16,7 +19,7 @@ module Refrigerator
16
19
  # Freeze core classes and modules. Options:
17
20
  # :except :: Don't freeze any of the classes modules listed (array of strings)
18
21
  def self.freeze_core(opts=OPTS)
19
- (CORE_MODULES - Array(opts[:except])).each{|m| eval(m).freeze}
22
+ (CORE_MODULES - Array(opts[:except])).each{|m| eval(m, nil, __FILE__, __LINE__).freeze}
20
23
  nil
21
24
  end
22
25
 
@@ -30,7 +33,7 @@ module Refrigerator
30
33
  require 'rubygems'
31
34
  Array(opts[:depends]).each{|f| require f}
32
35
  Array(opts[:modules]).each{|m| Object.const_set(m, Module.new)}
33
- 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__)))}
34
37
  freeze_core(:except=>%w'Gem Gem::Specification Gem::Deprecate'+Array(opts[:exclude]))
35
38
  require file
36
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.0
4
+ version: 1.5.0
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: 2021-12-25 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -42,7 +42,7 @@ description: |
42
42
  Refrigerator freezes all core classes. It is designed to be used
43
43
  in production, to make sure that none of the core classes are
44
44
  modified at runtime. It can also be used to check libraries to
45
- make sure that don't make unexpected modifications/monkey patches
45
+ make sure that they don't make unexpected modifications/monkey patches
46
46
  to core classes.
47
47
  email: code@jeremyevans.net
48
48
  executables:
@@ -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.3
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: []