script/base_exporter.rb
# This method looks for all of the codes require or load 
# directives, checks to see if the file exists (that it's 
# not a gem, or a standard lib) and gives you the real ones.
This method looks for all of the codes require or load
directives, checks to see if the file exists (that it's
not a gem, or a standard lib) and gives you the real ones.
This method looks for all of the codes require or load directives checks to see if the file exists ( that it ' s not a gem or a standard lib ) and gives you the real ones .
def extract_real_requires(main_file_path)
      code = File.open(main_file_path) {|f| f.readlines.join }
      code.gsub!("__FILE__", "'#{main_file_path}'")
      requirements = []
      loop do
        matchdata = code.match(/((require)|(load)) .*['"]/)
        break unless matchdata
        path = eval(matchdata[0].sub(/((require)|(load)) /, ""))
        requirements += Dir.glob(path + ".{rb,jar}")
        code = matchdata.post_match
      end
      return requirements
    end
def extract_real_requires ( main_file_path ) code = File . open ( main_file_path ) { | f | f . readlines . join } code . gsub! ( "__FILE__" , "'#{main_file_path}'" ) requirements = [ ] loop do matchdata = code . match ( / ((require)|(load)) .*['"] / ) break unless matchdata path = eval ( matchdata [ 0 ] . sub ( / ((require)|(load))  / , "" ) ) requirements += Dir . glob ( path + ".{rb,jar}" ) code = matchdata . post_match end return requirements end
This method looks for all of the codes require or load
directives, checks to see if the file exists (that it's
not a gem, or a standard lib) and gives you the real ones.
This method looks for all of the codes require or load directives checks to see if the file exists ( that it ' s not a gem or a standard lib ) and gives you the real ones .
main_file_path