Minor cleanups, less matching, very minor speedup
git-svn-id: file:///home/svn/framework3/trunk@4567 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
35680b10ca
commit
46c9c510dd
|
@ -760,17 +760,15 @@ protected
|
|||
|
||||
# Try to load modules from all the files in the supplied path
|
||||
Rex::Find.find(path) { |file|
|
||||
# Skip unit test files
|
||||
next if (file =~ /rb\.ut\.rb$/)
|
||||
|
||||
# Skip test-suite files
|
||||
next if (file =~ /rb\.ts\.rb$/)
|
||||
|
||||
# Skip non-ruby files
|
||||
next if (file !~ /\.rb$/i)
|
||||
|
||||
# Skip unit test files
|
||||
next if (file =~ /rb\.(ut|ts)\.rb$/)
|
||||
|
||||
# Skip files with a leading period
|
||||
next if (file =~ /^\./i)
|
||||
next if (file =~ /^\./)
|
||||
|
||||
begin
|
||||
load_module_from_file(path, file, loaded, recalc, counts, demand)
|
||||
|
@ -794,7 +792,7 @@ protected
|
|||
load_module_from_file(path, file, loaded, recalc, counts, demand)
|
||||
|
||||
# Remove this file path from the list of delay load files
|
||||
# because if we get here it means all when swell...maybe.
|
||||
# because if we get here it means all went swell...maybe.
|
||||
delay.delete(file)
|
||||
|
||||
# Keep scanning since we just successfully loaded a delay load
|
||||
|
@ -830,14 +828,10 @@ protected
|
|||
#
|
||||
def load_module_from_file(path, file, loaded, recalc, counts, demand = false)
|
||||
|
||||
# If the file doesn't end in the expected extension...
|
||||
return nil if (!file.match(/\.rb$/))
|
||||
|
||||
# If the file on disk hasn't changed with what we have stored in the
|
||||
# cache, then there's no sense in loading it
|
||||
if (!has_module_file_changed?(file))
|
||||
dlog("Cached module from file #{file} has not changed.", 'core',
|
||||
LEV_2)
|
||||
dlog("Cached module from file #{file} has not changed.", 'core', LEV_2)
|
||||
return false
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue