Sha256: 1f95907e1963ad7e0347f2dd889095f649d6beec006eb47a4f1a012aaaf649c7

Contents?: true

Size: 559 Bytes

Versions: 6

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 array enumerable string symbol fixnum hash).each do |lib|
  require_relative "backports/#{lib}"
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
marcandre-backports-1.2.0 lib/backports.rb
marcandre-backports-1.3.0 lib/backports.rb
marcandre-backports-1.3.1 lib/backports.rb
backports-1.2.0 lib/backports.rb
backports-1.3.0 lib/backports.rb
backports-1.3.1 lib/backports.rb