Sha256: ade6d37e92cbf5a8444ea1ac0963370bc82a8058dd66e13ccdd47e9ace77c95c
Contents?: true
Size: 783 Bytes
Versions: 9
Compression:
Stored size: 783 Bytes
Contents
require 'facet/kernel/op_esc' module Kernel # Require a file with puncuation marks escaped using NANOESC table. # # require_esc '[].rb' # # in actuality requires the file 'op_fetch.rb'. private 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 'facet/string/blank' } assert( "".respond_to?( :blank? ) ) end end =end
Version data entries
9 entries across 9 versions & 1 rubygems