danger 3.0.2 → 3.0.3

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
  SHA1:
3
- metadata.gz: c1cd1e958df7f1f9cd250b787aa5d85622dc454c
4
- data.tar.gz: 4188fcbeaf0d8724b14ba675acf939eeddcccda9
3
+ metadata.gz: 1bdf784866d4e556b6e665ae22edc46048983f26
4
+ data.tar.gz: d4e01b88a5b73d250a194cb98ada8f361c4b20ae
5
5
  SHA512:
6
- metadata.gz: c5a00b519f6f820f0c6e40b3f44e2198e2affb5f4e8eed01b02a8d68303bb6c0bf71f04c533be2ea59da9386629e42de228abfcea7612df25ba17abd42077ab8
7
- data.tar.gz: 5fe87a8daeef371ee6a5f435a510223d862a60c603ec7e3fb8034f1a767cef87d6331f7154d16acb0ca0b32d32f1b95891bd5938d910b86e755511faed7e9ea3
6
+ metadata.gz: 463ee74a57de4fdf20387f988da779668a6adced5c8785ec2723e83cf3cbc88f990e4dea7767f8c4559286be4253718a1bab0fdb61003be0229b64b005e764f0
7
+ data.tar.gz: 6c73599cbc71be47bd903336cb5a106b5d8932544188ef30b6d93853ddf0ec515f08fc867c4efeda734acad5b0dd363e0fd4e6fd92ef0dabebc14e1cf72972a4
@@ -50,8 +50,8 @@ module Danger
50
50
  end
51
51
 
52
52
  def self.pull_request_id(env)
53
- if env["ghprPullId"]
54
- env["ghprPullId"]
53
+ if env["ghprbPullId"]
54
+ env["ghprbPullId"]
55
55
  else
56
56
  env["gitlabMergeRequestId"]
57
57
  end
@@ -109,6 +109,15 @@ module Danger
109
109
  @gitlab.mr_json.labels
110
110
  end
111
111
 
112
+ # @!group MR Content
113
+ # The unified diff produced by GitLab for this PR
114
+ # see [Unified diff](https://en.wikipedia.org/wiki/Diff_utility#Unified_format)
115
+ # @return [String]
116
+ #
117
+ def mr_diff
118
+ @gitlab.mr_diff
119
+ end
120
+
112
121
  # @!group MR Commit Metadata
113
122
  # The branch to which the MR is going to be merged into
114
123
  # @return [String]
@@ -177,7 +186,7 @@ module Danger
177
186
  paths.first(paths.count - 1).join(", ") + " & " + paths.last
178
187
  end
179
188
 
180
- [:title, :body, :author, :labels, :json].each do |suffix|
189
+ [:title, :body, :author, :labels, :json, :diff].each do |suffix|
181
190
  alias_method "pr_#{suffix}".to_sym, "mr_#{suffix}".to_sym
182
191
  end
183
192
 
@@ -50,6 +50,11 @@ module Danger
50
50
  .map { |comment| Comment.from_gitlab(comment) }
51
51
  end
52
52
 
53
+ def mr_diff
54
+ @mr_diff ||= client.merge_request_changes(escaped_ci_slug, ci_source.pull_request_id)
55
+ .changes.map { |change| change["diff"] }.join("\n")
56
+ end
57
+
53
58
  def escaped_ci_slug
54
59
  @escaped_ci_slug ||= CGI.escape(ci_source.repo_slug)
55
60
  end
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "3.0.2".freeze
2
+ VERSION = "3.0.3".freeze
3
3
  DESCRIPTION = "Automate your PR etiquette.".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-22 00:00:00.000000000 Z
12
+ date: 2016-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide