Sha256: 5a9b0f05937adf635e73cd240bd99b954859d3b3ef7e4e7b1a8d6d08cefcb94b
Contents?: true
Size: 914 Bytes
Versions: 18
Compression:
Stored size: 914 Bytes
Contents
# Will intercept future and past 'require' calls of std_lib # and load additionally the updated libraries. require 'backports/tools/std_lib' require 'backports/tools/alias_method_chain' require 'backports/tools/deprecation' Backports.deprecate :require_std_lib, 'Requiring backports/std_lib is deprecated. Use gems instead' module Kernel def require_with_backports(lib) begin return false unless require_without_backports(lib) paths = Backports::StdLib.extended_lib.fetch(lib, nil) rescue LoadError return false if Backports::StdLib::LoadedFeatures.new.include?(lib) raise unless paths = Backports::StdLib.extended_lib.fetch(lib, nil) Backports::StdLib::LoadedFeatures.mark_as_loaded(lib) end if paths paths.each do |path| require_without_backports(path) end end true end Backports.alias_method_chain self, :require, :backports end
Version data entries
18 entries across 18 versions & 1 rubygems