danger 3.5.3 → 3.5.4

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: 69859c177c990bcaee0d10f8af0a64d3a2e55425
4
- data.tar.gz: 738a8057e92708fb38a925b87990896744782903
3
+ metadata.gz: 989776d07fb68d675c57bb156dcb3a5e8a42f9c1
4
+ data.tar.gz: 8c797383ea005b6c60b1896dcf1acb071dc08de7
5
5
  SHA512:
6
- metadata.gz: 3158cef1db9039f75a6e88f1d7f228f3ed2046618bd2bd1d9fb1186fa073b343b4b1c26378ec7d634f061ee7d86157e0747e3c59545c416b9d007ccdee7a086e
7
- data.tar.gz: 18f00f6ae41414d2f50dd433cc3ece132b785765323959d9c8c126648670dcd9cd0ee51242208f9adfb79586b77042fe1da49ae7f5ce79836de55fae4bdc9ba2
6
+ metadata.gz: 3a619a8989461ac9cc409610c71d0b1cd30f445c064e4c9a190a66b88bcd50bfedfce9c48fa3cbc0038257ac6ae18582ec2a52565ebca9ec0197df1c1405df47
7
+ data.tar.gz: 4d54581d81ac705ffcd9a700ebb339f61e17bef7bd612a6c99837253e91b6a5b36f91242e9f26313f6d30c099c0a7934b811dd028424c0ee7e92f458321687cb
@@ -12,16 +12,20 @@ module Danger
12
12
  def self.options
13
13
  [
14
14
  ["--clear-http-cache", "Clear the local http cache before running Danger locally."],
15
- ["--pry", "Drop into a Pry shell after evaluating the Dangerfile."]
15
+ ["--pry", "Drop into a Pry shell after evaluating the Dangerfile."],
16
+ ["--dangerfile=<path/to/dangerfile>", "The location of your Dangerfile"]
16
17
  ]
17
18
  end
18
19
 
19
20
  def initialize(argv)
20
21
  @pr_url = argv.shift_argument
21
22
  @clear_http_cache = argv.flag?("clear-http-cache", false)
23
+ dangerfile = argv.option("dangerfile", "Dangerfile")
22
24
 
23
25
  super
24
26
 
27
+ @dangerfile_path = dangerfile if File.exist?(dangerfile)
28
+
25
29
  setup_pry if should_pry?(argv)
26
30
  end
27
31
 
@@ -37,7 +37,8 @@ module Danger
37
37
  @base = argv.option("base")
38
38
  @head = argv.option("head")
39
39
  @fail_on_errors = argv.option("fail-on-errors", false)
40
- @danger_id = argv.option("danger_id", "danger")
40
+ new_comment = argv.flag?("new-comment")
41
+ @danger_id = new_comment ? Time.now.strftime("%v %H:%M:%S") : argv.option("danger_id", "danger")
41
42
  @cork = Cork::Board.new(silent: argv.option("silent", false),
42
43
  verbose: argv.option("verbose", false))
43
44
  super
@@ -56,7 +57,8 @@ module Danger
56
57
  ["--head=[master|dev|stable]", "A branch/tag/commit to use as the head"],
57
58
  ["--fail-on-errors=<true|false>", "Should always fail the build process, defaults to false"],
58
59
  ["--dangerfile=<path/to/dangerfile>", "The location of your Dangerfile"],
59
- ["--danger_id=<id>", "The identifier of this Danger instance"]
60
+ ["--danger_id=<id>", "The identifier of this Danger instance"],
61
+ ["--new-comment", "Makes the build process ignore other Danger instances, resulting in a new comment. Overrides '--danger_id'."]
60
62
  ].concat(super)
61
63
  end
62
64
 
@@ -39,7 +39,7 @@ module Danger
39
39
  self.request_source = request_source
40
40
  end
41
41
 
42
- raise_error_for_no_request_source(env, ui) unless self.request_source
42
+ raise_error_for_no_request_source(env, self.ui) unless self.request_source
43
43
  self.scm = self.request_source.scm
44
44
  end
45
45
 
@@ -38,6 +38,10 @@ module Danger
38
38
 
39
39
  def ensure_commitish_exists!(commitish)
40
40
  exec("fetch") if exec("rev-parse --quiet --verify \"#{commitish}^{commit}\"").empty?
41
+
42
+ if exec("rev-parse --quiet --verify \"#{commitish}^{commit}\"").empty?
43
+ raise_if_we_cannot_find_the_commit(commitish)
44
+ end
41
45
  end
42
46
 
43
47
  private
@@ -45,6 +49,10 @@ module Danger
45
49
  def default_env
46
50
  { "LANG" => "en_US.UTF-8" }
47
51
  end
52
+
53
+ def raise_if_we_cannot_find_the_commit(commit)
54
+ raise "Commit #{commit[0..7]} doesn't exist. Are you running `danger local/pr` against the correct repository? Also this usually happens when you rebase/reset and force-pushed."
55
+ end
48
56
  end
49
57
  end
50
58
 
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "3.5.3".freeze
2
+ VERSION = "3.5.4".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: 3.5.3
4
+ version: 3.5.4
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-10-09 00:00:00.000000000 Z
12
+ date: 2016-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide