cookbook-release 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a78f98f8853456cf0d3ea62cef2c86fdda3456e8
4
- data.tar.gz: 38c4f32b1bc3cd2458392c89a36216a5bbf1d167
3
+ metadata.gz: ef411df78e2425fbcb6f48fab32e57bcbebacabc
4
+ data.tar.gz: 91665c7ad89ba2fa63a8f586298214edbe8efc91
5
5
  SHA512:
6
- metadata.gz: da37a0b7ae9830a2b3107fa36f7a053e346d19b78588330a144f68df54c3096030f36036e50dc4880debb5c80c623976985786072a336a471094fa80d34e968f
7
- data.tar.gz: 53449f3851c961863cb73e40ba360f8c1833ba528b484d28819fb37d892b7877a617159bbd7b00c8d84d2c77ce1209fe0321e8e754476fff2ae64c01720e422d
6
+ metadata.gz: 4fa616dc27a0e09e72c1ce1a4c85dc9462ccfedaa771e36267ef3013434da2b8b347ecce296af6c6d340e7ff5eefcb46da9f5e784ec9c469b57ea85aeb825b80
7
+ data.tar.gz: 95fdeae091d01fb3db067cf525cc7beb3cc1c55c2cf0517b360b2e719549dd0be950f703ba063f550e911db795693129ed4ac8f263cff0c8df0e228533a30dd7
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.0
3
+ - 2.4.0
4
4
  deploy:
5
5
  provider: rubygems
6
6
  api_key:
@@ -6,7 +6,7 @@ require 'English'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'cookbook-release'
9
- spec.version = '1.3.2'
9
+ spec.version = '1.3.4'
10
10
  spec.authors = ['Grégoire Seux']
11
11
  spec.email = 'g.seux@criteo.com'
12
12
  spec.summary = 'Provide primitives (and rake tasks) to release a cookbook'
@@ -68,7 +68,14 @@ module CookbookRelease
68
68
  end
69
69
 
70
70
  def to_s_markdown(full)
71
- result = "*#{self[:hash]}* _#{self[:author]} <#{self[:email]}>_ `#{self[:subject]}`"
71
+ result = "*#{self[:hash]}* "
72
+ if self[:subject] =~ /risky|breaking/i
73
+ slack_user = self[:email].split('@')[0]
74
+ result << "@#{slack_user}"
75
+ else
76
+ result << "_#{self[:author]} <#{self[:email]}>_"
77
+ end
78
+ result << " `#{self[:subject]}`"
72
79
  result << "\n```\n#{self[:body]}\n```" if full && self[:body]
73
80
  result
74
81
  end
@@ -31,8 +31,8 @@ describe CookbookRelease::Changelog do
31
31
  changelog = CookbookRelease::Changelog.new(git)
32
32
  expect(changelog.markdown).to eq('*123456* _John Doe <j.doe@nobody.com>_ `hello`')
33
33
  end
34
- it 'expand body' do
35
- expect(git).to receive(:compute_changelog).and_return(
34
+ context 'risky commit' do
35
+ let(:commit) do
36
36
  [
37
37
  CookbookRelease::Commit.new(
38
38
  hash: '654321',
@@ -41,9 +41,19 @@ describe CookbookRelease::Changelog do
41
41
  email: 'j.doe@nobody.com',
42
42
  body: 'Some Men Just Want to Watch the World Burn')
43
43
  ]
44
- )
45
- changelog = CookbookRelease::Changelog.new(git, expand_risky: true)
46
- expect(changelog.markdown).to include("\n```\nSome Men Just Want")
44
+ end
45
+
46
+ it 'expands the body' do
47
+ expect(git).to receive(:compute_changelog).and_return(commit)
48
+ changelog = CookbookRelease::Changelog.new(git, expand_risky: true)
49
+ expect(changelog.markdown).to include("\n```\nSome Men Just Want")
50
+ end
51
+
52
+ it 'mentions the author' do
53
+ expect(git).to receive(:compute_changelog).and_return(commit)
54
+ changelog = CookbookRelease::Changelog.new(git, expand_risky: true)
55
+ expect(changelog.markdown).to start_with('*654321* @j.doe `[Risky] hello`')
56
+ end
47
57
  end
48
58
  end
49
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookbook-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-03 00:00:00.000000000 Z
11
+ date: 2017-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic