danger 4.3.2 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/danger/commands/runner.rb +1 -1
- data/lib/danger/danger_core/dangerfile.rb +1 -1
- data/lib/danger/danger_core/plugins/dangerfile_danger_plugin.rb +1 -1
- data/lib/danger/danger_core/plugins/dangerfile_github_plugin.rb +1 -1
- data/lib/danger/danger_core/plugins/dangerfile_gitlab_plugin.rb +1 -1
- data/lib/danger/request_sources/github/github.rb +12 -2
- data/lib/danger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac8016ce34c94a5e3ab531f39da5d552677ea816
|
4
|
+
data.tar.gz: 98ec9232cc83c5378e07bb7e91ca3cda5a8ab896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3771c0464943b15a140c27c4ee7b70a414670ea88f779002fd433cda04b8cd5ce78dbe6a7824457425872e40f2e0e21aac3f78b4004fb5d1426d01c4989a92b
|
7
|
+
data.tar.gz: ef2ff358cc4841a44b03f0762c0cb997452c36f6ac19df2b8bb37c8e42e15b51c19ec05f2b8afce34bb725d70c1c9405de4be45caca5016f53e39b6d89bb7c3c
|
@@ -212,7 +212,7 @@ module Danger
|
|
212
212
|
return if (violations[:errors] + violations[:warnings] + violations[:messages] + status[:markdowns]).count.zero?
|
213
213
|
|
214
214
|
ui.section("Results:") do
|
215
|
-
%i
|
215
|
+
%i[errors warnings messages].each do |key|
|
216
216
|
formatted = key.to_s.capitalize + ":"
|
217
217
|
title = case key
|
218
218
|
when :errors
|
@@ -154,7 +154,7 @@ module Danger
|
|
154
154
|
def import_dangerfile_from_github(slug, branch = nil, path = nil)
|
155
155
|
raise "`import_dangerfile_from_github` requires a string" unless slug.kind_of?(String)
|
156
156
|
org, repo = slug.split("/")
|
157
|
-
download_url = env.request_source.file_url(organisation: org, repository: repo, branch: branch
|
157
|
+
download_url = env.request_source.file_url(organisation: org, repository: repo, branch: branch, path: path || "Dangerfile")
|
158
158
|
local_path = download(download_url)
|
159
159
|
@dangerfile.parse(Pathname.new(local_path))
|
160
160
|
end
|
@@ -234,7 +234,7 @@ module Danger
|
|
234
234
|
@github.dismiss_out_of_range_messages = dismiss == true
|
235
235
|
end
|
236
236
|
|
237
|
-
%i
|
237
|
+
%i[title body author labels json].each do |suffix|
|
238
238
|
alias_method "mr_#{suffix}".to_sym, "pr_#{suffix}".to_sym
|
239
239
|
end
|
240
240
|
|
@@ -207,7 +207,7 @@ module Danger
|
|
207
207
|
paths.first(paths.count - 1).join(", ") + " & " + paths.last
|
208
208
|
end
|
209
209
|
|
210
|
-
%i
|
210
|
+
%i[title body author labels json diff].each do |suffix|
|
211
211
|
alias_method "pr_#{suffix}".to_sym, "mr_#{suffix}".to_sym
|
212
212
|
end
|
213
213
|
|
@@ -416,9 +416,19 @@ module Danger
|
|
416
416
|
end
|
417
417
|
|
418
418
|
# @return [String] A URL to the specific file, ready to be downloaded
|
419
|
-
def file_url(organisation: nil, repository: nil, branch:
|
419
|
+
def file_url(organisation: nil, repository: nil, branch: nil, path: nil)
|
420
420
|
organisation ||= self.organisation
|
421
|
-
|
421
|
+
|
422
|
+
return @download_url unless @download_url.nil?
|
423
|
+
begin
|
424
|
+
# Retrieve the download URL (default branch on nil param)
|
425
|
+
contents = client.contents("#{organisation}/#{repository}", path: path, ref: branch)
|
426
|
+
@download_url = contents["download_url"]
|
427
|
+
rescue Octokit::ClientError
|
428
|
+
# Fallback to github.com
|
429
|
+
branch ||= "master"
|
430
|
+
@download_url = "https://raw.githubusercontent.com/#{organisation}/#{repository}/#{branch}/#{path}"
|
431
|
+
end
|
422
432
|
end
|
423
433
|
end
|
424
434
|
end
|
data/lib/danger/version.rb
CHANGED
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: 4.3.
|
4
|
+
version: 4.3.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: 2017-
|
12
|
+
date: 2017-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|