cookbook-release 1.4.3 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/cookbook-release.gemspec +2 -1
- data/lib/cookbook-release/commit.rb +13 -1
- data/spec/commit_spec.rb +12 -0
- data/spec/git_spec.rb +2 -2
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d320d81b00bbc0568db5a101bf05cb341ffc23aed196a0d82a08a37c2921ccd
|
4
|
+
data.tar.gz: a66c146cce4f56369b30329f810d0de829abe85fcfe79f9760d0f445547d3a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8d578db88940e2a0552cd74a203e104693ec1377b97db12fbf29ea15aed8e58e1fb1e967bc3226a8fb45a5689c24ab69d7826fd96a6935fdfc9d908b38f540d
|
7
|
+
data.tar.gz: febc04990a5974dd9305874332443155069f3f044d562fb5297b805345554b2ba62bac2b2e389bbde73bf396b1ef49b2caceddde7ec21b3501d4202d11aed7c7
|
data/.travis.yml
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
3
|
+
- 2.4.0
|
4
4
|
deploy:
|
5
5
|
provider: rubygems
|
6
6
|
api_key:
|
7
|
-
secure:
|
7
|
+
secure: ylfB0GIaZxPfZ6/dSJIPujfSt3vxqVFg16lqTBq/2AAZ0qwKTZi9qeM/QZDLMX28vCXmTsYxHGepmyvv0PvJaKvy7E6YBzIKz1Y1vsEZFeAFrgIQq9cDvc4wIX2eFjI7N1ChyaRgi+YYK4BSVfKjYqGBfXk5Wyh7uqNEuWE7FzABV+RxXoHcNi+AhYkCX3NF80qNukXRtiB7XTQj6CP4Wd+Dm25iOUwx8/zNMce8Z8V3j2ysvR4Vtm/soDsr/+Z+27wIdP0VqwElV1FxtR9km8MIJhmzSsnzcvgqJpRmMvO6HLZFzwqnLBzCoPYJqm3K+uQSSfll5LbaNtixlBzIusgtGgm1UjQy1YDGkPexJd5K5CuC/LW78Y7Zrl3CeT34RDlICoztEjhJxFry3EvFxPT03lVQx5z5Fc55/u0hy3mBCiHbxHxAPJLMOtehfv35bzOS7Jv3+otBm/8jn9dXO2pJJdwxL9W2wrzljWkly4yemwceMvtMYf+xnf1zdTnMYoqkYGGl0KutbFL69w78w7BwTFQIhcJOO+g27C6V8vHtqU0U5JOgE/QNg3yWhzhQjgCpzQhmuO+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'
|
data/cookbook-release.gemspec
CHANGED
@@ -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.
|
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 <<
|
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)
|
data/spec/commit_spec.rb
CHANGED
@@ -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
|
data/spec/git_spec.rb
CHANGED
@@ -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.
|
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:
|
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.
|
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
|