danger 5.10.1 → 5.10.2
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/ci_source/jenkins.rb +28 -7
- data/lib/danger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0965f3f24397615223b0f7902793a060291402040a1cce4842d8415b5cbf21c
|
4
|
+
data.tar.gz: f92dc1a2fa9b0a42e07f8da9fe82a81c9492b77044edb897f6fa967fbf5794b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da63efdd814dab639212e648968b6a88f8e845901e0ed25412e6b7fe7420137909ea67543abb6e017c32663f415f08ac9c53cc23ef7be9418c288b973d69a457
|
7
|
+
data.tar.gz: b8b180acc53aa2fe5e3458c54d51de47af0813f38e0589469904117d9d19bfec7bf2240c35e7c5b791e2261fc774b7898b79b72b178ec0afe182d78a0911365a
|
@@ -78,14 +78,35 @@ module Danger
|
|
78
78
|
|
79
79
|
self.repo_url = self.class.repo_url(env)
|
80
80
|
self.pull_request_id = self.class.pull_request_id(env)
|
81
|
+
self.repo_slug = self.class.repo_slug(self.repo_url)
|
82
|
+
end
|
81
83
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
def self.repo_slug(repo_url)
|
85
|
+
slug = self.slug_ssh(repo_url)
|
86
|
+
slug = self.slug_http(repo_url) unless slug
|
87
|
+
slug = self.slug_bitbucket(repo_url) unless slug
|
88
|
+
slug = self.slug_fallback(repo_url) unless slug
|
89
|
+
return slug.gsub(/\.git$/, "") unless slug.nil?
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.slug_bitbucket(repo_url)
|
93
|
+
repo_matches = repo_url.match(%r{(?:[\/:])projects\/([^\/.]+)\/repos\/([^\/.]+)})
|
94
|
+
return "#{repo_matches[1]}/#{repo_matches[2]}" if repo_matches
|
95
|
+
end
|
96
|
+
|
97
|
+
def self.slug_ssh(repo_url)
|
98
|
+
repo_matches = repo_url.match(%r{^git@.+:(.+)})
|
99
|
+
return repo_matches[1] if repo_matches
|
100
|
+
end
|
101
|
+
|
102
|
+
def self.slug_http(repo_url)
|
103
|
+
repo_matches = repo_url.match(%r{^https?.+(?>\.\w*\d*\/)(.+.git$)})
|
104
|
+
return repo_matches[1] if repo_matches
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.slug_fallback(repo_url)
|
108
|
+
repo_matches = repo_url.match(%r{([\/:])([^\/]+\/[^\/]+)$})
|
109
|
+
return repo_matches[2]
|
89
110
|
end
|
90
111
|
|
91
112
|
def self.pull_request_id(env)
|
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: 5.10.
|
4
|
+
version: 5.10.2
|
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: 2018-12-
|
12
|
+
date: 2018-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|