Sha256: cf3fa52da490389858743eea3e37f49011a065108775bb308ad996a97cb7bf4f
Contents?: true
Size: 791 Bytes
Versions: 13
Compression:
Stored size: 791 Bytes
Contents
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 'facet/string/blank' } assert( "".respond_to?( :blank? ) ) end end =end
Version data entries
13 entries across 13 versions & 1 rubygems