Class: Danger::DangerSwiftInfo

Inherits:
Plugin
  • Object
show all
Defined in:
lib/danger_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 this condition to extract different rules and prevent saving the new output.

Examples:

Run SwiftInfo


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

See Also:

  • rockbruno/danger-SwiftInfo

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instance_nameObject



29
30
31
# File 'lib/danger_plugin.rb', line 29

def self.instance_name
    "swiftinfo"
end

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
26
27
# File 'lib/danger_plugin.rb', line 22

def run(path)
    binPath = path
    output = `#{binPath} -pullRequest -s`
    html = output.sub("\n", "<br>")
    message(output)
end