danger-SwiftInfo 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f79aa81d20b9946f3e74a5d56a4205d3226b0d723c41faa428edc214e7950c4
4
- data.tar.gz: 3b72ae88fa9f5c4d147bd503fdf0d2a2414e0c472a6794e44f78e4704867afb3
3
+ metadata.gz: ad09bccb0604f6885f6263b62e68e8321766f3d9855ea875692913acc67e5c01
4
+ data.tar.gz: '09b97e63b9180bdf6731542a36819d13ca72c0533a04b8bc5815ce5351b5d14a'
5
5
  SHA512:
6
- metadata.gz: '042798967e1704ef9153033c469a2e2a91d74c7ea8ab8d65470e3c737ee82a157c4130fac7ce2da5a6be1f5a7037f07e1adc011eb197f5d23cfd075e8e905433'
7
- data.tar.gz: 022cbea2b8a6bab044c441d01cf3bc3731d47ac60591a36e83a1cbdbf3a2315ca157ab5735a9d790d0ceb33a6f522593338869f478bd76203d8a2bb29035270b
6
+ metadata.gz: 9f20e40f9a0ee0772d8f9b2a029359f2fa3ca90e1aeff83ab6508476f078a36dc3e9826457b8d3b3e1538a6a883c3e8adf3ef58e97f00b9ba00a337b2254de3c
7
+ data.tar.gz: e6ccc788b68450fff44b0996e95c4ceb98b92eb69538f0b4511d09df7b974aca90192e3b743e4de5c4e5a46221faf5b77416fdbdc23e276efd721caeffaa653a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-SwiftInfo (0.0.3)
4
+ danger-SwiftInfo (0.0.4)
5
5
  danger-plugin-api (~> 1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,17 +1,51 @@
1
1
  # danger-SwiftInfo
2
2
 
3
- A description of danger-SwiftInfo.
3
+ A [Danger](http://danger.systems/) plugin that runs and prints [SwiftInfo](https://github.com/rockbruno/SwiftInfo) results to pull requests.
4
4
 
5
- ## Installation
5
+ Requires SwiftInfo 2.3.1 or newer.
6
6
 
7
- $ gem install danger-SwiftInfo
7
+ ### How does it look?
8
8
 
9
- ## Usage
9
+ <img src="https://i.imgur.com/8kvEx5O.png">
10
10
 
11
- Methods and attributes from this plugin are available in
12
- your `Dangerfile` under the `SwiftInfo` namespace.
11
+ ### Installation
13
12
 
14
- ## Development
13
+ Just add the gem to your Gemfile:
14
+
15
+ ```ruby
16
+ gem 'danger-SwiftInfo'
17
+ ```
18
+
19
+ ### Usage
20
+
21
+ To use this plugin, you need to modify both your Dangerfile and your SwiftInfo's Infofile.
22
+
23
+ #### Dangerfile
24
+
25
+ Call `swiftinfo.run` with the path to your SwiftInfo binary as an argument. (inside `Pods` if CocoaPods was used or just `swiftinfo` if Homebrew was used)
26
+
27
+ ```ruby
28
+ swiftinfo.run './Pods/SwiftInfo/bin/swiftinfo'
29
+ ```
30
+
31
+ #### Infofile
32
+
33
+ To print the final output to Danger, call `api.print(output)` from your Infofile.
34
+
35
+ Note that when ran from this plugin, SwiftInfo will be executed with the `-pullRequest -s` arguments which can be inspected and used as a condition. This logic is abstracted under the `isInPullRequestMode` boolean, which you can use to extract different providers in Danger runs and prevent saving the output, for example.
36
+
37
+ ```swift
38
+ if isInPullRequestMode {
39
+ // The specific Danger flow
40
+ api.print(output: output)
41
+ } else {
42
+ // The regular release flow
43
+ api.sendToSlack(output: output, webhookUrl: url)
44
+ api.save(output: output)
45
+ }
46
+ ```
47
+
48
+ ### Development
15
49
 
16
50
  1. Clone this repo
17
51
  2. Run `bundle install` to setup dependencies.
@@ -1,3 +1,3 @@
1
1
  module SwiftInfo
2
- VERSION = "0.0.3".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
data/lib/danger_plugin.rb CHANGED
@@ -6,12 +6,12 @@ module Danger
6
6
  # somewhere in your project.
7
7
  # You can detect that SwiftInfo is running specifically for Danger
8
8
  # by adding a `if isInPullRequestMode` condition in your Infofile.
9
- # You can use it to extract different rules and prevent saving the new output.
9
+ # You can use this condition to extract different rules and prevent saving the new output.
10
10
  # @example Run SwiftInfo
11
11
  #
12
- # SwiftInfo.run './Pods/SwiftInfo/bin/swiftinfo'
12
+ # swiftinfo.run './Pods/SwiftInfo/bin/swiftinfo'
13
13
  #
14
- # @see Bruno Rocha/danger-SwiftInfo
14
+ # @see rockbruno/danger-SwiftInfo
15
15
  # @tags swift, xcode, swiftinfo, ios
16
16
  #
17
17
  class DangerSwiftInfo < Plugin
@@ -20,8 +20,10 @@ module Danger
20
20
  # @return [void]
21
21
  #
22
22
  def run(path)
23
- stdout, stderr, status = Open3.capture3(path + " -pullRequest -s")
24
- message(stdout)
23
+ binPath = path
24
+ output = `#{binPath} -pullRequest -s`
25
+ html = output.sub("\n", "<br>")
26
+ message(output)
25
27
  end
26
28
 
27
29
  def self.instance_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-SwiftInfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Rocha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-19 00:00:00.000000000 Z
11
+ date: 2019-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api