Sha256: c79961ebfc609ab4be8815a25523587c637e40b88a4aeec05d02a96b9a44c2d3

Contents?: true

Size: 502 Bytes

Versions: 2

Compression:

Stored size: 502 Bytes

Contents

require "require_pattern_xt/version"
require 'require_pattern_xt/coloring'
require 'require_pattern_xt/core'

module Kernel
  def require_pattern(*patterns)
    RequirePatternXt::Core.require_pattern(patterns)
  end

  # this has to be in kernel module, so we keep the caller_locations intact
  def require_relative_pattern(*patterns)
    caller_path = caller_locations(1,1)[0].path
    patterns.map! { |pattern| File.join(File.dirname(caller_path), pattern) }
    require_pattern(*patterns)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
require_pattern_xt-1.1.0 lib/require_pattern_xt.rb
require_pattern_xt-1.0.0 lib/require_pattern_xt.rb