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: d067c562d43578651a43d425217f20956ea7b858
4
- data.tar.gz: aeafb99774bdf963f6d19b31fc62cfd1dc777aef
3
+ metadata.gz: 425637f7294e3fd9e2faadf544bac23836819512
4
+ data.tar.gz: 9250fe70a52d1b3110a84dd5465afc50f53d7f5f
5
5
  SHA512:
6
- metadata.gz: 56441fecbe0d64456a7b33f6485e454801d1d6618b1c1dfc2a8d27adc797e437df1c01af0a8f6a48c29ed797ddbfdabf873a445907b74c3c1df017d1147bc80d
7
- data.tar.gz: ff3be7ffe9b5cce3b7a4434cae8ee7474b9a5d882d248532b646938a697c568b71c1508b0fb14d7c139ee3c4454f8b8c933a447bd813392fa203bc40e43007a7
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: true) do |http|
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: true) do |http|
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: true) do |http|
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
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "5.0.1".freeze
2
+ VERSION = "5.0.2".freeze
3
3
  DESCRIPTION = "Like Unit Tests, but for your Team Culture.".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: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox