Quakespotter.app/lib/ruby-processing/exporters/base_exporter.rb
def extract_real_requires(source)
      code = source.dup
      requirements = []
      partial_paths = []
      loop do
        matchdata = code.match(/^.*[^::\.\w](require|load)\b.*$/)
        break unless matchdata
        line = matchdata[0].gsub('__FILE__', "'#{@main_file_path}'")
        line = line.gsub(/\b(require|load)\b/, 'partial_paths << ')
        eval(line)
        requirements += Dir["{#{local_dir}/,}{#{partial_paths.join(',')}}.{rb,jar}"]
        code = matchdata.post_match
      end
      return requirements
    end
# Looks for all of the codes require or load commands, checks 
# to see if the file exists (that it's not a gem, or a standard lib) 
# and hands you back all the real ones.
Looks for all of the codes require or load commands, checks
to see if the file exists (that it's not a gem, or a standard lib)
and hands you back all the real ones.
Looks for all of the codes require or load commands checks to see if the file exists ( that it ' s not a gem or a standard lib ) and hands you back all the real ones .
def extract_real_requires(source)
      code = source.dup
      requirements = []
      partial_paths = []
      loop do
        matchdata = code.match(/^.*[^::\.\w](require|load)\b.*$/)
        break unless matchdata
        line = matchdata[0].gsub('__FILE__', "'#{@main_file_path}'")
        line = line.gsub(/\b(require|load)\b/, 'partial_paths << ')
        eval(line)
        requirements += Dir["{#{local_dir}/,}{#{partial_paths.join(',')}}.{rb,jar}"]
        code = matchdata.post_match
      end
      return requirements
    end
def extract_real_requires ( source ) code = source . dup requirements = [ ] partial_paths = [ ] loop do matchdata = code . match ( / ^.*[^:: \. \w ](require|load) \b .*$ / ) break unless matchdata line = matchdata [ 0 ] . gsub ( '__FILE__' , "'#{@main_file_path}'" ) line = line . gsub ( / \b (require|load) \b / , 'partial_paths << ' ) eval ( line ) requirements += Dir [ "{#{local_dir}/,}{#{partial_paths.join(',')}}.{rb,jar}" ] code = matchdata . post_match end return requirements end
Looks for all of the codes require or load commands, checks
to see if the file exists (that it's not a gem, or a standard lib)
and hands you back all the real ones.
Looks for all of the codes require or load commands checks to see if the file exists ( that it ' s not a gem or a standard lib ) and hands you back all the real ones .
source