Class: WarningShot::CoreLibResolver Private
- Includes:
- Resolver
- Defined in:
- lib/resolvers/core_lib_resolver.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Check to see if core lib packages are available
Created due to issues with some Apt installs not installing all
ruby core classes. This is irresolvable, but at least gives you
a heads up.
Defined Under Namespace
Classes: CoreLibResource
Constant Summary collapse
- @@do_purge =
This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
false
- @@original_requires =
This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
$".clone
- @@original_classes =
This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
Symbol.all_symbols.clone
Class Method Summary collapse
-
.purge(do_purge = false) ⇒ Object
private
optionally purge CoreLIb classes in memory The default behavior is to just remove the reference to loading the class from $“.
-
.purge_classes(classes) ⇒ Object
private
Undefines classes.
-
.unload(files) ⇒ Object
private
removes files from $“ so they can be re-required.
Methods included from Resolver
Class Method Details
.purge(do_purge = false) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
optionally purge CoreLIb classes in memory The default behavior is to just remove the reference to loading the class from $“. Classes stay in memory but can be re-required without returning false
28 29 30 |
# File 'lib/resolvers/core_lib_resolver.rb', line 28 def self.purge(do_purge=false) @@do_purge = do_purge end |
.purge_classes(classes) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Undefines classes
68 69 70 71 72 |
# File 'lib/resolvers/core_lib_resolver.rb', line 68 def purge_classes(classes) classes.each do |klass| Object.send(:remove_const, klass) if Object.is_const_defined? klass end end |
.unload(files) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
removes files from $“ so they can be re-required
56 57 58 59 60 |
# File 'lib/resolvers/core_lib_resolver.rb', line 56 def unload(files) files.each do |req| $".delete(req) end end |