danger 3.4.0 → 3.4.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de42011bfb76e71cb7b4a3307648b54695b9b725
|
4
|
+
data.tar.gz: 06eb74831ab383be09312427e072f9d49096089d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8ce21aa3ad48d64b7ac92623ec924220f05a98ff3a80dd8a41fa5354d92296625f00ab0796396d7c06882cbff5147cd62af5f802499c1a192ca04a796c64f29
|
7
|
+
data.tar.gz: 907dd19d7d3c044fe7f6c6e30dfbec053864de5b412e92bdbe7ebd05d29726d87c67f2de0c448f6c4e77bb6dfaf9a146a801adc4d03aefb3b09c9325b6dbb78c
|
@@ -15,6 +15,16 @@ module Danger
|
|
15
15
|
local_ci_source(env).validates_as_pr?(env)
|
16
16
|
end
|
17
17
|
|
18
|
+
# @return [String] danger's default head branch
|
19
|
+
def self.danger_head_branch
|
20
|
+
"danger_head".freeze
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [String] danger's default base branch
|
24
|
+
def self.danger_base_branch
|
25
|
+
"danger_base".freeze
|
26
|
+
end
|
27
|
+
|
18
28
|
def initialize(env, ui)
|
19
29
|
ci_klass = self.class.local_ci_source(env)
|
20
30
|
self.ci_source = ci_klass.new(env)
|
@@ -53,20 +63,12 @@ module Danger
|
|
53
63
|
end
|
54
64
|
end
|
55
65
|
|
56
|
-
def meta_info_for_base
|
57
|
-
scm.exec("--no-pager log #{EnvironmentManager.danger_base_branch} -n1")
|
58
|
-
end
|
59
|
-
|
60
66
|
def meta_info_for_head
|
61
67
|
scm.exec("--no-pager log #{EnvironmentManager.danger_head_branch} -n1")
|
62
68
|
end
|
63
69
|
|
64
|
-
def
|
65
|
-
"
|
66
|
-
end
|
67
|
-
|
68
|
-
def self.danger_base_branch
|
69
|
-
"danger_base"
|
70
|
+
def meta_info_for_base
|
71
|
+
scm.exec("--no-pager log #{EnvironmentManager.danger_base_branch} -n1")
|
70
72
|
end
|
71
73
|
|
72
74
|
def raise_error_for_no_request_source(env, ui)
|
@@ -29,6 +29,10 @@ module Danger
|
|
29
29
|
#
|
30
30
|
# danger.import_dangerfile(gitlab: "ruby-grape/danger")
|
31
31
|
#
|
32
|
+
# @example Run a Dangerfile from inside a repo branch and path
|
33
|
+
#
|
34
|
+
# danger.import_dangerfile(github: "ruby-grape/danger", branch: "custom", path: "path/to/Dangerfile")
|
35
|
+
#
|
32
36
|
# @see danger/danger
|
33
37
|
# @tags core, plugins
|
34
38
|
|
@@ -73,7 +77,7 @@ module Danger
|
|
73
77
|
import_dangerfile_from_github(opts)
|
74
78
|
elsif opts.kind_of?(Hash)
|
75
79
|
if opts.key?(:github) || opts.key?(:gitlab)
|
76
|
-
import_dangerfile_from_github(opts[:github] || opts[:gitlab])
|
80
|
+
import_dangerfile_from_github(opts[:github] || opts[:gitlab], opts[:branch], opts[:path])
|
77
81
|
elsif opts.key?(:path)
|
78
82
|
import_dangerfile_from_path(opts[:path])
|
79
83
|
elsif opts.key?(:gem)
|
@@ -141,12 +145,16 @@ module Danger
|
|
141
145
|
#
|
142
146
|
# @param [String] slug
|
143
147
|
# A slug that represents the repo where the Dangerfile is.
|
148
|
+
# @param [String] branch
|
149
|
+
# A branch from repo where the Dangerfile is.
|
150
|
+
# @param [String] path
|
151
|
+
# The path at the repo where Dangerfile is.
|
144
152
|
# @return [void]
|
145
153
|
#
|
146
|
-
def import_dangerfile_from_github(slug)
|
154
|
+
def import_dangerfile_from_github(slug, branch = nil, path = nil)
|
147
155
|
raise "`import_dangerfile_from_github` requires a string" unless slug.kind_of?(String)
|
148
156
|
org, repo = slug.split("/")
|
149
|
-
download_url = env.request_source.file_url(organisation: org, repository: repo, branch: "master", path: "Dangerfile")
|
157
|
+
download_url = env.request_source.file_url(organisation: org, repository: repo, branch: branch || "master", path: path || "Dangerfile")
|
150
158
|
local_path = download(download_url)
|
151
159
|
@dangerfile.parse(Pathname.new(local_path))
|
152
160
|
end
|
@@ -208,7 +216,7 @@ module Danger
|
|
208
216
|
def validate_file_contains_plugin!(file)
|
209
217
|
content = IO.read(file)
|
210
218
|
|
211
|
-
if content.scan(/class\s+(?<plugin_class>[\w]+)\s+<\s+Plugin/i).empty?
|
219
|
+
if content.scan(/class\s+(?<plugin_class>[\w]+)\s+<\s+((Danger::)?Plugin)/i).empty?
|
212
220
|
raise("#{file} doesn't contain any valid danger plugin.")
|
213
221
|
end
|
214
222
|
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: 3.4.
|
4
|
+
version: 3.4.1
|
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-09-
|
12
|
+
date: 2016-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|
@@ -459,7 +459,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
459
459
|
version: '0'
|
460
460
|
requirements: []
|
461
461
|
rubyforge_project:
|
462
|
-
rubygems_version: 2.
|
462
|
+
rubygems_version: 2.6.4
|
463
463
|
signing_key:
|
464
464
|
specification_version: 4
|
465
465
|
summary: Like Unit Tests, but for your Team Culture.
|