require 'facets/core/kernel/op_esc'

module Kernel

  private

  # Require a file with puncuation marks escaped using NANOESC table.
  #
  #   require_esc '[].rb'
  #
  # in actuality requires the file 'op_fetch.rb'.

  def require_esc( fpath )
    fdir, fname = File.split(fpath)
    ename = op_esc( fname )
    case ename[-1,1] ; when '!','=','?' then ename = ename[0...-1] ; end
    epath = File.join( fdir, ename )
    require( epath )
  end

end



#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCKernel < Test::Unit::TestCase

    def test_require_esc
      assert_nothing_raised { require_esc 'facets/core/string/blank' }
      assert( "".respond_to?( :blank? ) )
    end

  end

=end
