Class: Danger::DangerSwiftInfo

Inherits:
Plugin
  • Object
show all
Defined in:
lib/SwiftInfo/plugin.rb

Overview

Runs SwiftInfo and prints the results to the pull request. You must have [SwiftInfo](github.com/rockbruno/SwiftInfo) installed somewhere in your project. You can detect that SwiftInfo is running specifically for Danger by adding a ‘if isInPullRequestMode` condition in your Infofile. You can use it to extract different rules and prevent saving the new output.

Examples:

Run SwiftInfo


SwiftInfo.run './Pods/SwiftInfo/bin/swiftinfo'

See Also:

  • Rocha/danger-SwiftInfo

Instance Method Summary collapse

Instance Method Details

#run(path) ⇒ void

This method returns an undefined value.

Run SwiftInfo and print the results to the PR.

Parameters:

  • path (String)

    Path to the SwiftInfo binary.



22
23
24
25
# File 'lib/SwiftInfo/plugin.rb', line 22

def run(path)
    stdout, stderr, status = Open3.capture3(path + " -pullRequest -s")
    message(stdout)
end