# File lib/kwala/actions/code_coverage.rb, line 68
  def build_action(context)
    @ouput_dir = File.expand_path(context.output_directory)
    if !File.exists?("#{@ouput_dir}/coverage")
      FileUtils.mkdir("#{@ouput_dir}/coverage")
    end

    @test_cases_count = context.test_files.size

    run_test_cases(context)

    context.ruby_files.each do |ruby_file|
      test_path = test_index_path(context, ruby_file)
      rcov_index = test_path + "index.html"
      file_cov_path = test_path + file_coverage_filename(context, ruby_file)
      loc = count_loc(ruby_file).first
      if File.exist?(test_path)
        percent = parse_coverage_file(file_cov_path)
        @output_data << CodeCoverageFileData.new(ruby_file, percent,
                                                 rcov_index, file_cov_path, loc)
      else
        @output_data << CodeCoverageFileData.new(ruby_file, nil, rcov_index,
                                                 file_cov_path, loc)
      end
    end

  end