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.
Defined Under Namespace
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.
-
#inline_mode ⇒ Boolean
Defines if using inline comment or not.
-
#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.
36 37 38 |
# File 'lib/xcode_summary/plugin.rb', line 36 def ignored_files @ignored_files end |
#inline_mode ⇒ Boolean
Defines if using inline comment or not. Defaults to ‘false`.
54 55 56 |
# File 'lib/xcode_summary/plugin.rb', line 54 def inline_mode @inline_mode end |
#project_root ⇒ String
The project root, which will be used to make the paths relative. Defaults to ‘pwd`.
28 29 30 |
# File 'lib/xcode_summary/plugin.rb', line 28 def project_root @project_root end |
#sticky_summary ⇒ Boolean
Defines if the test summary will be sticky or not. Defaults to ‘false`.
42 43 44 |
# File 'lib/xcode_summary/plugin.rb', line 42 def sticky_summary @sticky_summary end |
#test_summary ⇒ Boolean
Defines if the build summary is shown or not. Defaults to ‘true`.
48 49 50 |
# File 'lib/xcode_summary/plugin.rb', line 48 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.
82 83 84 85 86 87 88 89 |
# File 'lib/xcode_summary/plugin.rb', line 82 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 |