danger 5.0.1 → 5.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 425637f7294e3fd9e2faadf544bac23836819512
|
4
|
+
data.tar.gz: 9250fe70a52d1b3110a84dd5465afc50f53d7f5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f24879a6fa89e79ecb6e9ae7cfcbd406adc49e436b8de4c0a4025dbb4a12b558e9b4c4d02d876672ac0e094c20d90227169c10809e0302f827d2845e81a8e83c
|
7
|
+
data.tar.gz: f6a9bcfe12d71aa93c44ac8559447e79ec0a961294e57437f14cced51d3ed1b92ac601e504d85e54cb36c2dc7c4a1aa20e48c874372bc1cd4d375ba25de56505
|
@@ -112,7 +112,7 @@ module Danger
|
|
112
112
|
# @return [Git::Diff::DiffFile] from the gem `git`
|
113
113
|
#
|
114
114
|
def diff_for_file(file)
|
115
|
-
modified_files.include?(file) ? @git.diff[file] : nil
|
115
|
+
(added_files + modified_files).include?(file) ? @git.diff[file] : nil
|
116
116
|
end
|
117
117
|
|
118
118
|
# @!group Git Metadata
|
@@ -54,10 +54,14 @@ module Danger
|
|
54
54
|
|
55
55
|
private
|
56
56
|
|
57
|
+
def use_ssl
|
58
|
+
return self.pr_api_endpoint.include? "https://"
|
59
|
+
end
|
60
|
+
|
57
61
|
def fetch_json(uri)
|
58
62
|
req = Net::HTTP::Get.new(uri.request_uri, { "Content-Type" => "application/json" })
|
59
63
|
req.basic_auth @username, @password
|
60
|
-
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl:
|
64
|
+
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: use_ssl) do |http|
|
61
65
|
http.request(req)
|
62
66
|
end
|
63
67
|
JSON.parse(res.body, symbolize_names: true)
|
@@ -68,7 +72,7 @@ module Danger
|
|
68
72
|
req.basic_auth @username, @password
|
69
73
|
req.body = body
|
70
74
|
|
71
|
-
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl:
|
75
|
+
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: use_ssl) do |http|
|
72
76
|
http.request(req)
|
73
77
|
end
|
74
78
|
|
@@ -83,7 +87,7 @@ module Danger
|
|
83
87
|
def delete(uri)
|
84
88
|
req = Net::HTTP::Delete.new(uri.request_uri, { "Content-Type" => "application/json" })
|
85
89
|
req.basic_auth @username, @password
|
86
|
-
Net::HTTP.start(uri.hostname, uri.port, use_ssl:
|
90
|
+
Net::HTTP.start(uri.hostname, uri.port, use_ssl: use_ssl) do |http|
|
87
91
|
http.request(req)
|
88
92
|
end
|
89
93
|
end
|
data/lib/danger/version.rb
CHANGED