cookbook-release 1.4.3 → 1.4.5

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
  SHA256:
3
- metadata.gz: d48e42c04f5d4ac5f465c53eebb18921398ba5212f39cf0fa6207e6377e3b162
4
- data.tar.gz: 684da15c491938a19b473ddcd997d428830631c11a0a174b70dcf02bf1dbba9d
3
+ metadata.gz: 1d320d81b00bbc0568db5a101bf05cb341ffc23aed196a0d82a08a37c2921ccd
4
+ data.tar.gz: a66c146cce4f56369b30329f810d0de829abe85fcfe79f9760d0f445547d3a65
5
5
  SHA512:
6
- metadata.gz: 2a2455d339262c0e83172ee37af3ff81f224139915022a97dcbbbac2ea8d8b45e754af7dcf7a913c612418d63614848ce7c0fc6d957bddddb77cb01515f66eef
7
- data.tar.gz: 4fd577bd939752c1ddf96d003f9c521b2c186b2e3ce9333046cfb1a0d5c2c3c8b0e2415d26aa4183955ed1ab0625559755e1b13cc783099224985cb3b4a2d528
6
+ metadata.gz: a8d578db88940e2a0552cd74a203e104693ec1377b97db12fbf29ea15aed8e58e1fb1e967bc3226a8fb45a5689c24ab69d7826fd96a6935fdfc9d908b38f540d
7
+ data.tar.gz: febc04990a5974dd9305874332443155069f3f044d562fb5297b805345554b2ba62bac2b2e389bbde73bf396b1ef49b2caceddde7ec21b3501d4202d11aed7c7
@@ -1,11 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4
3
+ - 2.4.0
4
4
  deploy:
5
5
  provider: rubygems
6
6
  api_key:
7
- secure: nrEzm2dqWjyaa5ewApSonF+2D+y3PYwt9xaQC04d1NtbhQYyzX6wti3oatpMJI2gkcuuLjKrNHH/aLbKOGv7+Jj5BUJGOLixxhRdJyLWde/6cKCYVgIYPxeUtSJrRgyHAS2o8TDPjhWCT5oRwSkmhd+5D2JKjVqAycetbIzKWWvqScO09z0bF66bbKSfO1s44JwK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O+Bcs3Jq2T/OcqTfwM6gufNe+Gq2TdEfeH5Y0WcRtTKJBVVQ4XWFtgONE1C1hNBFLyh7GNZDQQVYBT3c/MXeV5Q++rVJYOdSrw=
8
8
  gem: cookbook-release
9
9
  on:
10
10
  tags: true
11
11
  repo: criteo/cookbook-release
12
+ skip_cleanup: 'true'
@@ -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.4.3'
9
+ spec.version = '1.4.5'
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'
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'mixlib-shellout'
25
25
  spec.add_dependency 'chef', '>= 12.18.31'
26
26
  spec.add_dependency 'git-ng' # see https://github.com/schacon/ruby-git/issues/307
27
+ spec.add_dependency 'unicode-emoji'
27
28
 
28
29
 
29
30
  spec.add_development_dependency 'rspec'
@@ -1,3 +1,6 @@
1
+ require 'forwardable'
2
+ require 'unicode/emoji'
3
+
1
4
  module CookbookRelease
2
5
  class Commit
3
6
  extend Forwardable
@@ -79,11 +82,20 @@ module CookbookRelease
79
82
  else
80
83
  result << "_#{self[:author]} <#{self[:email]}>_"
81
84
  end
82
- result << " `#{self[:subject]}`"
85
+ result << ' '
86
+ result << backtick_string(self[:subject])
83
87
  result << "\n```\n#{strip_change_id(self[:body])}```" if full && self[:body]
84
88
  result
85
89
  end
86
90
 
91
+ def backtick_string(input)
92
+ s = input.gsub(/( )?(#{Unicode::Emoji::REGEX})( )?/, '` \2 `')
93
+ .gsub(/( )?``( )?/, '')
94
+ s += '`' unless s =~ /`$/
95
+ s = '`' + s unless s =~ /^`/
96
+ s
97
+ end
98
+
87
99
  private
88
100
 
89
101
  def strip_change_id(body)
@@ -23,4 +23,16 @@ describe CookbookRelease::Commit do
23
23
  expect(minor_change) .not_to be_patch
24
24
  end
25
25
  end
26
+
27
+ describe '.to_s_markdown' do
28
+ it 'surrounds subject with backticks' do
29
+ commit = CookbookRelease::Commit.new(subject: 'This is a fix', hash: 'abcdef', author: 'Linus', email: 'linus@linux.org')
30
+ expect(commit.to_s_markdown(false)).to match(/`#{commit[:subject]}`/)
31
+ end
32
+
33
+ it 'properly handle emojis' do
34
+ commit = CookbookRelease::Commit.new(subject: 'This is a fix 🔧 and I love 🪐🚀', hash: 'abcdef', author: 'Linus', email: 'linus@linux.org')
35
+ expect(commit.to_s_markdown(false)).to match(/`This is a fix` 🔧 `and I love` 🪐🚀/)
36
+ end
37
+ end
26
38
  end
@@ -150,8 +150,8 @@ git tag 12.34.56
150
150
 
151
151
  it 'parse correctly commits' do
152
152
  cmds = <<-EOH
153
- git commit --allow-empty -m "subject" -m "body" -m "line2"
154
- git commit --allow-empty -m "without body"
153
+ git commit --allow-empty --no-verify -m "subject" -m "body" -m "line2"
154
+ git commit --allow-empty --no-verify -m "without body"
155
155
  EOH
156
156
  cmds.split("\n").each do |cmd|
157
157
  cmd = Mixlib::ShellOut.new(cmd)
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.4.3
4
+ version: 1.4.5
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: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: unicode-emoji
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -181,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
195
  version: '0'
182
196
  requirements: []
183
197
  rubyforge_project:
184
- rubygems_version: 2.7.6
198
+ rubygems_version: 2.7.7
185
199
  signing_key:
186
200
  specification_version: 4
187
201
  summary: Provide primitives (and rake tasks) to release a cookbook