lib/xcode_summary/plugin.rb
# Reads a file with JSON Xcode summary and reports its warning and error count.
#
# @param    [String] file_path Path for Xcode summary in JSON format.
# @return   [String] JSON string with warningCount and errorCount
Reads a file with JSON Xcode summary and reports its warning and error count.
Reads a file with JSON Xcode summary and reports its warning and error count .
def warning_error_count(file_path)
      if File.file?(file_path)
        xcode_summary = JSON.parse(File.read(file_path), symbolize_names: true)
        warning_count = warnings(xcode_summary).count
        error_count = errors(xcode_summary).count
        result = { warnings: warning_count, errors: error_count }
        result.to_json
      else
        fail 'summary file not found'
      end
    end
def warning_error_count ( file_path ) if File . file? ( file_path ) xcode_summary = JSON . parse ( File . read ( file_path ) , symbolize_names : true ) warning_count = warnings ( xcode_summary ) . count error_count = errors ( xcode_summary ) . count result = { warnings : warning_count , errors : error_count } result . to_json else fail 'summary file not found' end end
Reads a file with JSON Xcode summary and reports its warning and error count.
Reads a file with JSON Xcode summary and reports its warning and error count .
JSON string with warningCount and errorCount
JSON string with warningCount and errorCount
String
file_path
<not_specific>
<not_specific>
file_path Path for Xcode summary in JSON format.
file_path Path for Xcode summary in JSON format .