danger 4.1.1 → 4.2.0

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: 4d780dce52f7c2746c3303d1b56f41a520704d74
4
- data.tar.gz: 45b108576534f124be9cc4deaf940a266853f01f
3
+ metadata.gz: 39f7e0e319a1ff47514b465c8b6af97f7efa451a
4
+ data.tar.gz: 8df633306a3819e57789498649890ba1865b9dc3
5
5
  SHA512:
6
- metadata.gz: a5524a3d5fa8020512b803f21afa95346cef0ea403fcfdcf1a4b6183ad26b817dc2173604464512a53e09f41c780bedf3844cbf1b20cbf89419a435aba544f3b
7
- data.tar.gz: bc275d9b16c3cdaa1828ab2c47ac1e51debfc56b80a81ee15ad889d6081551d1e08501ebfff27f56d0dfaf201912542b557c1429d5fa3ac6c76ac7f36a56cec0
6
+ metadata.gz: b6382beb8f067502934f803a008a06b8348e23da486672ee887592e6516d11cc9d18de738e3e05138173a64d0f50e241ac616c6c8a3994e293dc9616d07cdac1
7
+ data.tar.gz: f6e34348e7da47556d61ac7d50f4eeed2732fa7b6bf2ad6fb10db42482b2424001d946f8c7eba3aac429c930d58d6ab1bd76a69521740ae0e04563c0b995921c
data/lib/danger.rb CHANGED
@@ -7,7 +7,7 @@ require "danger/core_ext/string"
7
7
  require "danger/danger_core/executor"
8
8
 
9
9
  require "claide"
10
- require "colored"
10
+ require "colored2"
11
11
  require "pathname"
12
12
  require "terminal-table"
13
13
  require "cork"
@@ -1,3 +1,9 @@
1
+ <!--
2
+ <%- @tables.each do |table| -%>
3
+ <%= pluralize(table[:name], table[:count]) %><%= ": #{truncate(table[:content].first.message)}" if table[:count] > 0 %>
4
+ <%- end -%>
5
+ <%= pluralize("Markdown", @markdowns.size) %>
6
+ --!>
1
7
  <%- @tables.each do |table| -%>
2
8
  <%- if table[:content].any? || table[:resolved].any? -%>
3
9
  <table>
@@ -6,7 +12,7 @@
6
12
  <th width="50"></th>
7
13
  <th width="100%" data-danger-table="true" data-kind="<%= table[:name] %>">
8
14
  <%- if table[:count] > 0 -%>
9
- <%= table[:count] %> <%= table[:name] %><%= "s" unless table[:count] == 1 %>
15
+ <%= pluralize(table[:name], table[:count]) %>
10
16
  <%- else -%>
11
17
  :white_check_mark: <%= random_compliment %>
12
18
  <%- end -%>
@@ -12,4 +12,9 @@ class String
12
12
  tr("-".freeze, "_".freeze).
13
13
  downcase
14
14
  end
15
+
16
+ # @return [String] truncates string with ellipsis when exceeding the limit
17
+ def danger_truncate(limit)
18
+ length > limit ? "#{self[0...limit]}..." : self
19
+ end
15
20
  end
@@ -171,6 +171,15 @@ module Danger
171
171
 
172
172
  return NEW_REGEX.match(table)
173
173
  end
174
+
175
+ def pluralize(string, count)
176
+ string.danger_pluralize(count)
177
+ end
178
+
179
+ def truncate(string)
180
+ max_message_length = 30
181
+ string.danger_truncate(max_message_length)
182
+ end
174
183
  end
175
184
  end
176
185
  end
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "4.1.1".freeze
2
+ VERSION = "4.2.0".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: 4.1.1
4
+ version: 4.2.0
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: 2017-01-27 00:00:00.000000000 Z
12
+ date: 2017-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide
@@ -54,19 +54,19 @@ dependencies:
54
54
  - !ruby/object:Gem::Version
55
55
  version: '1'
56
56
  - !ruby/object:Gem::Dependency
57
- name: colored
57
+ name: colored2
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '1.2'
62
+ version: '3.1'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '1.2'
69
+ version: '3.1'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: faraday
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -462,7 +462,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
462
462
  version: '0'
463
463
  requirements: []
464
464
  rubyforge_project:
465
- rubygems_version: 2.5.1
465
+ rubygems_version: 2.2.2
466
466
  signing_key:
467
467
  specification_version: 4
468
468
  summary: Like Unit Tests, but for your Team Culture.