danger 0.7.2 ā†’ 0.7.3

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: bdced6826bdfbe8f06cdc77e9f6b58336140e17c
4
- data.tar.gz: 669ebaaf2d49f985c70a485018ff4bf6e8f4360f
3
+ metadata.gz: d97659425a77d1d4f21f22f7ba9fd43afd47d974
4
+ data.tar.gz: 4d3eb4ce159a4deb8326bebb05073e81cc91e233
5
5
  SHA512:
6
- metadata.gz: adbef18ddcb2de50eb915991a82334bf8e559c1b6af8cc00230d8038a1440e09d268f1380aff7936411b9dd6c5d26bef8ae17f10f1a09f9b5a02c42d6b096b7e
7
- data.tar.gz: c91f0a03be03e79d026b6b64c2da6bcc486eeb87883c00fe13d3869b64477bef72c121dd3b8f53c7e724fd341bd2285b884a1b2a16334148b1b960104a21e552
6
+ metadata.gz: 6ba7e1f9b4fb554dc663d81bf58b260a51914625c245ef9a30b6265f67155e1a1ba164df8c7db9a4c6895897b0761301df2bbe1f7a896bbf61dd5f6f7e70b002
7
+ data.tar.gz: bd2495aa7cc47436669f8c4d9d190a501bf7273cb53997b97f93abb1541c2eabf17e8b8906d9b2b7f8ee4f580225680243804e58776a59b642ba2c08ae0ef84f
@@ -23,7 +23,7 @@ module Danger
23
23
 
24
24
  def run
25
25
  ui = Interviewer.new
26
- ui.say "\nOK, thanks #{ENV['LOGNAME']}, grab a seat and we'll get you started.\n".yellow
26
+ ui.say "\nOK, thanks #{ENV['LOGNAME']}, have a seat and we'll get you started.\n".yellow
27
27
  ui.pause 1
28
28
 
29
29
  show_todo_state
@@ -43,11 +43,11 @@ module Danger
43
43
  end
44
44
 
45
45
  def show_todo_state
46
- ui.say "We need to do the following steps:\n"
46
+ ui.say "We need to do the following:\n"
47
47
  ui.pause 0.6
48
48
  ui.say " - [ ] Create a Dangerfile and add a few simple rules."
49
49
  ui.pause 0.6
50
- ui.say " - [#{@account_created ? 'x' : ' '}] Create a GitHub account for Danger use for messaging."
50
+ ui.say " - [#{@account_created ? 'x' : ' '}] Create a GitHub account for Danger to use, for messaging."
51
51
  ui.pause 0.6
52
52
  ui.say " - [ ] Set up an access token for Danger."
53
53
  ui.pause 0.6
@@ -71,7 +71,7 @@ module Danger
71
71
  ui.pause 2
72
72
 
73
73
  ui.say "There's a collection of small, simple ideas in here, but Danger is about being able to easily"
74
- ui.say "iterate. The power comes from you have the ability to codify fixes to some of the problems"
74
+ ui.say "iterate. The power comes from you having the ability to codify fixes for some of the problems"
75
75
  ui.say "that come up in day to day programming. It can be difficult to try and see those from day 1."
76
76
 
77
77
  ui.say "\nIf you'd like to investigate the file, and make some changes - I'll wait here,"
@@ -113,7 +113,7 @@ module Danger
113
113
  ui.say "For Open Source projects, I'd recommend giving the token the smallest scope possible."
114
114
  ui.say "This means only providing access to " + "public_repo".yellow + " in the token.\n\n"
115
115
  ui.pause 1
116
- ui.say "This token limits Danger's abilities to just to writing comments on OSS projects. I recommend"
116
+ ui.say "This token limits Danger's abilities to just writing comments on OSS projects. I recommend"
117
117
  ui.say "this because the token can quite easily be extracted from the environment via pull requests."
118
118
  ui.say "#{@bot_name} does not need admin access to your repo. So its ability to cause chaos is minimalized.\n"
119
119
 
@@ -148,7 +148,7 @@ module Danger
148
148
  ui.say "\nOK, I'll give you a moment to do this..."
149
149
  ui.wait_for_return
150
150
 
151
- ui.say "Final step: exposing the GitHub token as an environment build variable."
151
+ ui.header "Final step: exposing the GitHub token as an environment build variable."
152
152
  ui.pause 0.4
153
153
  if considered_an_oss_repo?
154
154
  ui.say "As you have an Open Source repo, this token should be considered public, otherwise you cannot"
@@ -207,7 +207,7 @@ module Danger
207
207
  # https://travis-ci.org/artsy/eigen/settings
208
208
  ui.say "In order to add an environment variable, go to:"
209
209
  ui.link "https://travis-ci.org/#{current_repo_slug}/settings"
210
- ui.say "\nThe name is " + "DANGER_GITHUB_API_TOKEN".yellow + " and the value is the GitHub Personal Acess Token."
210
+ ui.say "\nThe name is " + "DANGER_GITHUB_API_TOKEN".yellow + " and the value is the GitHub Personal Access Token."
211
211
  if @is_open_source
212
212
  ui.say "Make sure to have \"Display value in build log\" enabled."
213
213
  end
@@ -262,7 +262,7 @@ module Danger
262
262
  ui.say "\n\nšŸŽ‰"
263
263
  ui.pause 0.6
264
264
 
265
- ui.say "And you're set. Danger is a collaboration between Orta Therox, Gem 'Danger' McShane and Felix Krause."
265
+ ui.say "And you're good to go. Danger is a collaboration between Orta Therox, Gem 'Danger' McShane and Felix Krause."
266
266
  ui.say "If you like it, let others know. If you want to know more, follow " + "@orta".yellow + " and " + "@KrauseFx".yellow + " on Twitter."
267
267
  ui.say "If you don't like it, help us improve it! xxx"
268
268
  end
@@ -3,6 +3,10 @@ class String
3
3
  split('_').collect!(&:capitalize).join
4
4
  end
5
5
 
6
+ def danger_pluralize(count)
7
+ "#{count} #{self}#{'s' unless count == 1}"
8
+ end
9
+
6
10
  def danger_underscore
7
11
  self.gsub(/::/, '/').
8
12
  gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
@@ -9,8 +9,7 @@ module Danger
9
9
  # Since we have a reference to the DSL containing all the information
10
10
  # We need to redirect the self calls to the DSL
11
11
  def method_missing(method_sym, *arguments, &_block)
12
- return @dsl.send(method_sym, *arguments) if @dsl.respond_to?(method_sym)
13
- return @dsl.method_missing(method_sym, *arguments)
12
+ @dsl.send(method_sym, *arguments)
14
13
  end
15
14
 
16
15
  def run
@@ -20,7 +20,7 @@ module Danger
20
20
  end
21
21
 
22
22
  def client
23
- raise "No API given, please provide one using `DANGER_GITHUB_API_TOKEN`" if !@token && !support_tokenless_auth
23
+ raise "No API token given, please provide one using `DANGER_GITHUB_API_TOKEN`" if !@token && !support_tokenless_auth
24
24
 
25
25
  @client ||= Octokit::Client.new(
26
26
  access_token: @token
@@ -129,7 +129,7 @@ module Danger
129
129
  # use a read-only GitHub account
130
130
  if errors.count > 0
131
131
  # We need to fail the actual build here
132
- abort("\nDanger has failed this build. \nFound #{errors.count} error(s) and I don't have write access to the PR set a PR status.")
132
+ abort("\nDanger has failed this build. \nFound #{'error'.danger_pluralize(errors.count)} and I don't have write access to the PR set a PR status.")
133
133
  else
134
134
  puts message
135
135
  end
@@ -156,8 +156,8 @@ module Danger
156
156
  return "All green. #{random_compliment}"
157
157
  else
158
158
  message = "āš  "
159
- message += "#{errors.count} Error#{errors.count == 1 ? '' : 's'}. " unless errors.empty?
160
- message += "#{warnings.count} Warning#{warnings.count == 1 ? '' : 's'}. " unless warnings.empty?
159
+ message += "#{'Error'.danger_pluralize(errors.count)}. " unless errors.empty?
160
+ message += "#{'Warning'.danger_pluralize(warnings.count)}. " unless warnings.empty?
161
161
  message += "Don't worry, everything is fixable."
162
162
  return message
163
163
  end
@@ -5,10 +5,12 @@ require 'git'
5
5
  module Danger
6
6
  class GitRepo
7
7
  attr_accessor :diff
8
+ attr_accessor :log
8
9
 
9
10
  def diff_for_folder(folder, from: "master", to: 'HEAD')
10
11
  repo = Git.open folder
11
12
  self.diff = repo.diff(from, to)
13
+ self.log = repo.log.between(from, to)
12
14
  end
13
15
 
14
16
  def exec(string)
@@ -38,5 +40,9 @@ module Danger
38
40
  def insertions
39
41
  @diff.insertions
40
42
  end
43
+
44
+ def commits
45
+ log.to_a
46
+ end
41
47
  end
42
48
  end
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "0.7.2".freeze
2
+ VERSION = "0.7.3".freeze
3
3
  DESCRIPTION = "Automate your PR etiquette.".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: 0.7.2
4
+ version: 0.7.3
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-04-13 00:00:00.000000000 Z
12
+ date: 2016-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide