cookbook-release 1.3.0 → 1.3.1

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: 8074e7cbc294a8226c5ea6edcaf5392681f9bb57
4
- data.tar.gz: 877d487b0100d932eefbdfd15961061720fe7362
3
+ metadata.gz: d6f3d183b120b444f513d76af4570f6a36e0d0c3
4
+ data.tar.gz: edd20286cfa46e7b1ed2b66f44b93efaf990008b
5
5
  SHA512:
6
- metadata.gz: d57da52f9d03f85d6948b460fa9ba858591bce6049e891e486b71d987b9c3338d5d084a1ad16306cfd78f16a0c143928d0fb0f223660b89117cf4d0e504ad4fa
7
- data.tar.gz: ad05f19cff16844a4030ecdbaebbbfc9fcb947d911e79eacf516c579687ddf8b8713d4bf583135fab9b2884a62a57af1629eddb8bb36adc0db8fe0888000a6db
6
+ metadata.gz: 53ec75720a2382d16f865e7dd4f7fa28a815de6626d412e0f42487301067ded8822f8c63a379fc3af59fe0340ac8e5b055e4fdb59b71551619e3652142becfa2
7
+ data.tar.gz: a588a4e3c9686989f96a336a81b69379537cccb253b81e1ce0b79ab663b99d3f9dba8cd213204d83f24c63d1c07f9f649a597cd3c29cbfdd4edfb36db2f107e8
@@ -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.0'
9
+ spec.version = '1.3.1'
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'
@@ -46,14 +46,14 @@ module CookbookRelease
46
46
  end
47
47
 
48
48
  def to_s_oneline
49
- "#{self[:hash]} #{self[:author]} #{self[:subject]}"
49
+ "#{self[:hash]} #{self[:author]} <#{self[:email]}> #{self[:subject]}"
50
50
  end
51
51
 
52
52
  def to_s_html(full)
53
53
  result = []
54
54
  result << <<-EOH
55
55
  <font color=#{color.to_s}>
56
- #{self[:hash]} #{self[:author]} #{self[:subject]}
56
+ #{self[:hash]} #{self[:author]} <#{self[:email]}> #{self[:subject]}
57
57
  </font>
58
58
  EOH
59
59
  if full && self[:body]
@@ -68,7 +68,7 @@ module CookbookRelease
68
68
  end
69
69
 
70
70
  def to_s_markdown(full)
71
- result = "*#{self[:hash]}* _#{self[:author]}_ `#{self[:subject]}`"
71
+ result = "*#{self[:hash]}* _#{self[:author]} <#{self[:email]}>_ `#{self[:subject]}`"
72
72
  result << "\n```\n#{self[:body]}\n```" if full && self[:body]
73
73
  result
74
74
  end
@@ -67,6 +67,7 @@ module CookbookRelease
67
67
  message = commit.message.lines.map(&:chomp).compact.delete_if(&:empty?)
68
68
  Commit.new(
69
69
  author: commit.author.name,
70
+ email: commit.author.email,
70
71
  subject: message.delete_at(0),
71
72
  hash: short_sha ? commit.sha[0,7] : commit.sha,
72
73
  body: message.empty? ? nil : message.join("\n"),
@@ -59,14 +59,14 @@ module CookbookRelease
59
59
  puts "Suggested version: " + new_version.to_s
60
60
  puts "Commits that suggest this change:"
61
61
  reasons.each do |commit|
62
- puts "* #{commit[:hash]} #{commit[:subject]} (#{commit[:author]})"
62
+ puts "* #{commit[:hash]} #{commit[:subject]} (#{commit[:author]} <#{commit[:email]}>)"
63
63
  end
64
64
  end
65
65
 
66
66
  def display_changelog(new_version)
67
67
  puts "Changelog for #{new_version}:"
68
68
  git_changelog.each do |commit|
69
- puts "* #{commit[:hash]} #{HighLine.color(commit[:subject], commit.color)} (#{commit[:author]})"
69
+ puts "* #{commit[:hash]} #{HighLine.color(commit[:subject], commit.color)} (#{commit[:author]} <#{commit[:email]}>)"
70
70
  end
71
71
  end
72
72
 
@@ -9,8 +9,8 @@ describe CookbookRelease::Changelog do
9
9
 
10
10
  it 'colorize Risky commits in red' do
11
11
  expect(git).to receive(:compute_changelog).and_return([
12
- CookbookRelease::Commit.new(hash: '654321', subject: '[Risky] hello', author: 'John Doe'),
13
- CookbookRelease::Commit.new(hash: '123456', subject: 'hello', author: 'John Doe'),
12
+ CookbookRelease::Commit.new(hash: '654321', subject: '[Risky] hello', author: 'John Doe', email: 'j.doe@nobody.com'),
13
+ CookbookRelease::Commit.new(hash: '123456', subject: 'hello', author: 'John Doe', email: 'j.doe@nobody.com'),
14
14
  ])
15
15
  changelog = CookbookRelease::Changelog.new(git)
16
16
  expect(changelog.html).to match(/color=red((?!color=grey).)*Risky/m)
@@ -24,11 +24,12 @@ describe CookbookRelease::Changelog do
24
24
  CookbookRelease::Commit.new(
25
25
  hash: '123456',
26
26
  subject: 'hello',
27
- author: 'John Doe')
27
+ author: 'John Doe',
28
+ email: 'j.doe@nobody.com')
28
29
  ]
29
30
  )
30
31
  changelog = CookbookRelease::Changelog.new(git)
31
- expect(changelog.markdown).to eq('*123456* _John Doe_ `hello`')
32
+ expect(changelog.markdown).to eq('*123456* _John Doe <j.doe@nobody.com>_ `hello`')
32
33
  end
33
34
  it 'expand body' do
34
35
  expect(git).to receive(:compute_changelog).and_return(
@@ -37,6 +38,7 @@ describe CookbookRelease::Changelog do
37
38
  hash: '654321',
38
39
  subject: '[Risky] hello',
39
40
  author: 'John Doe',
41
+ email: 'j.doe@nobody.com',
40
42
  body: 'Some Men Just Want to Watch the World Burn')
41
43
  ]
42
44
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookbook-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux