Class: Danger::DangerXcodeSummary
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerXcodeSummary
- Defined in:
- lib/xcode_summary/plugin.rb
Overview
Shows all build errors, warnings and unit tests results generated from ‘xcodebuild`. You need to use [xcpretty](github.com/supermarin/xcpretty) with [xcpretty-json-formatter](github.com/marcelofabri/xcpretty-json-formatter) to generate a JSON file that this plugin can read.
Instance Attribute Summary collapse
-
#ignored_files ⇒ [String]
A globbed string or array of strings which should match the files that you want to ignore warnings on.
-
#project_root ⇒ String
The project root, which will be used to make the paths relative.
-
#sticky_summary ⇒ Boolean
Defines if the test summary will be sticky or not.
-
#test_summary ⇒ Boolean
Defines if the build summary is shown or not.
Instance Method Summary collapse
-
#report(file_path) ⇒ void
Reads a file with JSON Xcode summary and reports it.
Instance Attribute Details
#ignored_files ⇒ [String]
A globbed string or array of strings which should match the files that you want to ignore warnings on. Defaults to nil. An example would be ‘’/Pods/‘` to ignore warnings in Pods that your project uses.
33 34 35 |
# File 'lib/xcode_summary/plugin.rb', line 33 def ignored_files @ignored_files end |
#project_root ⇒ String
The project root, which will be used to make the paths relative. Defaults to ‘pwd`.
25 26 27 |
# File 'lib/xcode_summary/plugin.rb', line 25 def project_root @project_root end |
#sticky_summary ⇒ Boolean
Defines if the test summary will be sticky or not. Defaults to ‘false`.
39 40 41 |
# File 'lib/xcode_summary/plugin.rb', line 39 def sticky_summary @sticky_summary end |
#test_summary ⇒ Boolean
Defines if the build summary is shown or not. Defaults to ‘true`.
45 46 47 |
# File 'lib/xcode_summary/plugin.rb', line 45 def test_summary @test_summary end |
Instance Method Details
#report(file_path) ⇒ void
This method returns an undefined value.
Reads a file with JSON Xcode summary and reports it.
69 70 71 72 73 74 75 76 |
# File 'lib/xcode_summary/plugin.rb', line 69 def report(file_path) if File.file?(file_path) xcode_summary = JSON.parse(File.read(file_path), symbolize_names: true) format_summary(xcode_summary) else fail 'summary file not found' end end |