lib/parser/base.rb
# load all files that are included in current spec
load all files that are included in current spec
load all files that are included in current spec
def load_external_files(code_array)
    code_array.collect do |line|       
      match = line.match(Parser::EXTERNAL_FILE_REGEXP) 
      if match
        file_name = match.to_a.last
        begin 
          file = File.open(file_name, 'r')
          data = file.lines.to_a.join("\n")
          file.close
          data = preprocess_code(data)
          data = remove_comments(data)
          data = load_external_files(data)
          data
        rescue Exception => e
          raise Parser::IncludedFileNotFound.new "File not found: #{file_name} or other error."
        end
      else
        line
      end
    end
  end
def load_external_files ( code_array ) code_array . collect do | line | match = line . match ( Parser :: EXTERNAL_FILE_REGEXP ) if match file_name = match . to_a . last begin file = File . open ( file_name , 'r' ) data = file . lines . to_a . join ( "\n" ) file . close data = preprocess_code ( data ) data = remove_comments ( data ) data = load_external_files ( data ) data rescue Exception => e raise Parser :: IncludedFileNotFound . new "File not found: #{file_name} or other error." end else line end end end
load all files that are included in current spec
load all files that are included in current spec
code_array
<not_specific>