Sha256: f585d60956237cbab1878dd449bdfd0cba77e46a7d32088b7ddb6915d0ab507d

Contents?: true

Size: 559 Bytes

Versions: 3

Compression:

Stored size: 559 Bytes

Contents

module Kernel
  # Standard in ruby 1.9.
  def require_relative(relative_feature)
    # Adapted from Pragmatic's "Programming Ruby" (since their version was buggy...)
    file = caller.first.split(/:\d/,2).first
    if /\A\((.*)\)/ =~ file # eval, etc. 
      raise LoadError, "require_relative is called in #{$1}" 
    end 
    require File.expand_path(relative_feature, File.dirname(file))
  end unless method_defined? :require_relative
end

%w(object module enumerable array string symbol fixnum hash).each do |lib|
  require_relative "backports/#{lib}"
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
marcandre-backports-1.1.1 lib/backports.rb
backports-1.1.0 lib/backports.rb
backports-1.1.1 lib/backports.rb