releasetool 0.5.2 → 0.5.3

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
  SHA256:
3
- metadata.gz: '08c8874c8636651b902d877b3b7f72e92a67ae92879cc1565b9d1c8586b893fe'
4
- data.tar.gz: 295de6fe21e43b6bf21f0fc38a7f0000632dbb81b66e633b5359d5841e9be53d
3
+ metadata.gz: a6b0bf2084778fb39bcc2e7e1997069473c7fc3d72db0fbd0357e775c6226f29
4
+ data.tar.gz: 50c233e3f1efa69f4b027bd214eeebbc4504854706e81b8b3e222e77699ac370
5
5
  SHA512:
6
- metadata.gz: 07d8ee0782a15c187a2e2c0193501b3ec0049c62fc27ee13533afb86e0141f75ce1fef338ef4295ea61ecfe9c162730734602b00c4b7b52b1fe310c0e1a54c94
7
- data.tar.gz: 0f6f07235221842a7eddc75c1a30bba7bc2e2985de161dd86eda7adbf59c6e70c13902a70ef7adc0b7df5942d7e379066d46915bb1489ad2a62f18ed0dd69da8
6
+ metadata.gz: b324b29b9b5ac6f141a0853a8e8887afa788329a9a15dd5dc0030c2d3abab4751f8d67f0fccf5029a2aee56a73aa20c1882ba38fe9cae0fed6d8e0f6399a2fd7
7
+ data.tar.gz: 8c6465c57837b267999cd74b71155b7feec58fb6f2508dc7d65a44bd12aeee7d646d723c7d400e068c1a93abee7c9ff1613ac5ee0b871062f7033dcfce713d39
data/lib/releasetool.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  require "releasetool/release"
4
4
 
5
5
  module Releasetool
6
- VERSION = "0.5.2"
6
+ VERSION = "0.5.3"
7
7
  end
@@ -5,6 +5,7 @@ require "releasetool"
5
5
  require "releasetool/release"
6
6
  require "releasetool/util"
7
7
  require "releasetool/version"
8
+ require "shellwords"
8
9
 
9
10
  class Release < Thor
10
11
  include Releasetool::Util
@@ -93,7 +94,7 @@ class Release < Thor
93
94
  def tag(version = nil)
94
95
  version ||= stored_version
95
96
  last_useful_commit = guarded_capture("git log head^^..head^ --pretty=format:%s").strip.split("\n").first.strip
96
- guarded_system("git tag -a #{version} -e -m \"#{last_useful_commit}\"")
97
+ guarded_system("git tag -a #{version} -e -m #{last_useful_commit.shellescape}")
97
98
  end
98
99
 
99
100
  desc "push (NEW_VERSION)", <<-END
@@ -0,0 +1,5 @@
1
+ v0.5.3 Release Notes
2
+
3
+ *Changes since v0.5.2*
4
+
5
+ - fix tagging when last commit has quotes (#15, 16)
@@ -223,6 +223,19 @@ RSpec.describe Release, quietly: true do
223
223
  end
224
224
  end
225
225
 
226
+ describe "tag" do
227
+ let(:last_message) { "some message" }
228
+ it "calls out" do
229
+ allow(subject).to receive(:guarded_capture).with("git log head^^..head^ --pretty=format:%s").and_return "some-message"
230
+ expect(subject).to receive(:guarded_system).with("git tag -a v1.2.3 -e -m some-message")
231
+ expect(subject.tag("v1.2.3"))
232
+ end
233
+ it "escapes" do
234
+ allow(subject).to receive(:guarded_capture).with("git log head^^..head^ --pretty=format:%s").and_return 'Something new in sandwiches "aha" (#123)'
235
+ expect(subject).to receive(:guarded_system).with('git tag -a v1.2.3 -e -m Something\ new\ in\ sandwiches\ \"aha\"\ \(\#123\)')
236
+ expect(subject.tag("v1.2.3"))
237
+ end
238
+ end
226
239
  # describe 'CLI' do
227
240
  # it "should work with source and no target" do
228
241
  # puts "CLI"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releasetool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Diggins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-19 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -130,6 +130,7 @@ files:
130
130
  - release_notes/v0.5.0.md
131
131
  - release_notes/v0.5.1.md
132
132
  - release_notes/v0.5.2.md
133
+ - release_notes/v0.5.3.md
133
134
  - releasetool.gemspec
134
135
  - spec/fixtures/empty_file.rb
135
136
  - spec/fixtures/example_with_releases.tar
@@ -157,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
158
  - !ruby/object:Gem::Version
158
159
  version: '0'
159
160
  requirements: []
160
- rubygems_version: 3.2.33
161
+ rubygems_version: 3.5.13
161
162
  signing_key:
162
163
  specification_version: 4
163
164
  summary: Release management tools