Sha256: 12cae0418ae4fa09dc6ec63388cbc4fb3e3adebb6470845d17245b5e877156fa

Contents?: true

Size: 775 Bytes

Versions: 29

Compression:

Stored size: 775 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'

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

29 entries across 29 versions & 4 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/backports-3.12.0/lib/backports/std_lib.rb
backports-3.16.0 lib/backports/std_lib.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/backports-3.15.0/lib/backports/std_lib.rb
backports-3.15.0 lib/backports/std_lib.rb
backports-3.14.0 lib/backports/std_lib.rb
backports-3.13.0 lib/backports/std_lib.rb
backports-3.12.0 lib/backports/std_lib.rb
backports-3.11.4 lib/backports/std_lib.rb
backports-3.11.3 lib/backports/std_lib.rb
backports-3.11.2 lib/backports/std_lib.rb
backports-3.11.1 lib/backports/std_lib.rb
backports-3.11.0 lib/backports/std_lib.rb
backports-3.10.3 lib/backports/std_lib.rb
backports-3.10.2 lib/backports/std_lib.rb
backports-3.10.1 lib/backports/std_lib.rb
backports-3.10.0 lib/backports/std_lib.rb
backports-3.9.1 lib/backports/std_lib.rb
backports-3.9.0 lib/backports/std_lib.rb
backports-3.8.0 lib/backports/std_lib.rb
backports-3.7.0 lib/backports/std_lib.rb