tworingtools 2.1.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bumpr +4 -12
- data/bin/changetag +7 -9
- data/bin/clean-rc-tags +1 -1
- data/bin/migrate-changelog +3 -3
- data/bin/prerelease-podspec +3 -0
- data/bin/release-podspec +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7866367d352702c57d29d4a3ab4047cb515203315d9ca4fed738b870f1302ccb
|
4
|
+
data.tar.gz: 3ef7172b8f3acb80f7bc46a646089390e214dd39409c037a165ba2b33ad07197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98f4c27f1f5f5dedf4d1bd3dfa52b59988e2aee2bd0121e455eca8c4692f82c4728c28bc63c599d376fc0796914f78e39b0f1192aae1d3f24ecfd08d2b080860
|
7
|
+
data.tar.gz: a90f88aff5b56b284a83fd05913935c6db5b172110f6b6ce85badf1b0c02a052bc5fab3ac1bbb819e2d0901009c139c773f0e73db4f2d0d3ddbaf014a5005f6b
|
data/bin/bumpr
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'open3'
|
4
3
|
require 'optparse'
|
5
4
|
require_relative '../lib/echoexec'
|
5
|
+
require_relative '../lib/error'
|
6
|
+
require_relative '../lib/git_check'
|
6
7
|
|
7
8
|
options = {}
|
8
9
|
parser = OptionParser.new do |opts|
|
@@ -24,12 +25,7 @@ parser = OptionParser.new do |opts|
|
|
24
25
|
end
|
25
26
|
parser.parse!
|
26
27
|
|
27
|
-
|
28
|
-
modified_file_count, stderr, status = Open3.capture3("git status --porcelain | egrep '^(M| M)' | wc -l")
|
29
|
-
if modified_file_count.to_i > 0 then
|
30
|
-
echo_and_exec 'git stash'
|
31
|
-
end
|
32
|
-
end
|
28
|
+
git_check
|
33
29
|
|
34
30
|
component = ARGV[0]
|
35
31
|
version_file = ARGV[1]
|
@@ -44,7 +40,7 @@ argument = {
|
|
44
40
|
|
45
41
|
if argument == nil then
|
46
42
|
puts 'Unrecognized version component.'
|
47
|
-
exit
|
43
|
+
exit TwoRingToolError::INVALID_SEMVER_COMPONENT
|
48
44
|
end
|
49
45
|
|
50
46
|
command = "vrsn #{argument} --file #{version_file}"
|
@@ -54,8 +50,4 @@ stdout, stderr, status = Open3.capture3(command)
|
|
54
50
|
unless options[:no_commit] then
|
55
51
|
echo_and_exec "git add #{version_file}"
|
56
52
|
echo_and_exec "git commit --message \"#{stdout}\""
|
57
|
-
|
58
|
-
if modified_file_count.to_i > 0 then
|
59
|
-
echo_and_exec "git stash pop"
|
60
|
-
end
|
61
53
|
end
|
data/bin/changetag
CHANGED
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'optparse'
|
4
4
|
require_relative '../lib/echoexec'
|
5
|
-
|
6
|
-
|
7
|
-
ILLEGAL_COMMENT_CHAR = 65
|
8
|
-
INVALID_CHANGELOG_PATH = 66
|
9
|
-
UNFORCED_ANNOTATION_OVERWRITE_ATTEMPT = 67
|
10
|
-
CHANGELOG_ENTRY_NOT_FOUND = 68
|
5
|
+
require_relative '../lib/error'
|
6
|
+
require_relative '../lib/git_check'
|
11
7
|
|
12
8
|
options = {}
|
13
9
|
parser = OptionParser.new do |opts|
|
@@ -41,6 +37,8 @@ parser = OptionParser.new do |opts|
|
|
41
37
|
end
|
42
38
|
parser.parse!
|
43
39
|
|
40
|
+
git_check
|
41
|
+
|
44
42
|
# set valid git message comment character
|
45
43
|
|
46
44
|
echo_and_exec "git config core.commentchar '@'"
|
@@ -50,7 +48,7 @@ echo_and_exec "git config core.commentchar '@'"
|
|
50
48
|
changelog_path = ARGV[0]
|
51
49
|
unless File.file?(changelog_path) then
|
52
50
|
puts "The path '#{changelog_path}' does not point to a valid file."
|
53
|
-
exit INVALID_CHANGELOG_PATH
|
51
|
+
exit TwoRingToolError::INVALID_CHANGELOG_PATH
|
54
52
|
end
|
55
53
|
|
56
54
|
git_tag = ARGV[1]
|
@@ -58,7 +56,7 @@ current_git_tag_annotation = `git tag -n #{git_tag}`.strip
|
|
58
56
|
git_tag_exists = current_git_tag_annotation != ''
|
59
57
|
if git_tag_exists and current_git_tag_annotation != git_tag and options[:force] != true then
|
60
58
|
puts "The tag #{git_tag} already has an annotation. To overwrite it, call changetag with the -f/--force option."
|
61
|
-
exit UNFORCED_ANNOTATION_OVERWRITE_ATTEMPT
|
59
|
+
exit TwoRingToolError::UNFORCED_ANNOTATION_OVERWRITE_ATTEMPT
|
62
60
|
end
|
63
61
|
|
64
62
|
# Extract the relevant section from the changelog, which should have the following format: (square brackets should be present, chevrons are to denote content descriptions)
|
@@ -92,7 +90,7 @@ end
|
|
92
90
|
|
93
91
|
if entry_start_idx == -1 then
|
94
92
|
puts "Could not find an entry in the changelog named '#{entry_name}'."
|
95
|
-
exit CHANGELOG_ENTRY_NOT_FOUND
|
93
|
+
exit TwoRingToolError::CHANGELOG_ENTRY_NOT_FOUND
|
96
94
|
end
|
97
95
|
|
98
96
|
entry_end_idx = -1
|
data/bin/clean-rc-tags
CHANGED
@@ -2,4 +2,4 @@
|
|
2
2
|
#
|
3
3
|
# Deletes any release candidate tags leftover after prerelease testing.
|
4
4
|
|
5
|
-
`git tag --list | grep '
|
5
|
+
`git tag --list | grep '\\\-RC[0-9]\\\+' | xargs -tI @ bash -c \"git tag --delete @ && git push --delete origin @\"`
|
data/bin/migrate-changelog
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'optparse'
|
4
4
|
require_relative '../lib/echoexec'
|
5
|
+
require_relative '../lib/git_check'
|
5
6
|
|
6
7
|
options = {}
|
7
8
|
parser = OptionParser.new do |opts|
|
@@ -19,13 +20,13 @@ parser = OptionParser.new do |opts|
|
|
19
20
|
end
|
20
21
|
parser.parse!
|
21
22
|
|
23
|
+
git_check
|
24
|
+
|
22
25
|
changelog_path = ARGV[0]
|
23
26
|
version = ARGV[1]
|
24
27
|
|
25
28
|
new_entry = "\n\#\# [#{version}] #{Time.now.strftime("%Y-%m-%d")}\n"
|
26
29
|
|
27
|
-
`git stash`
|
28
|
-
|
29
30
|
# read in the changelog file contents
|
30
31
|
changelog_contents = File.open(changelog_path).readlines
|
31
32
|
|
@@ -40,4 +41,3 @@ end
|
|
40
41
|
|
41
42
|
`git add #{changelog_path}`
|
42
43
|
`git commit --message "chore(changelog): moved Unreleased entries to #{version}"`
|
43
|
-
`git stash pop`
|
data/bin/prerelease-podspec
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'open3'
|
4
4
|
require 'optparse'
|
5
|
+
require_relative '../lib/git_check'
|
5
6
|
require_relative '../lib/echoexec'
|
6
7
|
|
7
8
|
podspec = ARGV[0]
|
@@ -32,6 +33,8 @@ parser = OptionParser.new do |opts|
|
|
32
33
|
end
|
33
34
|
parser.parse!
|
34
35
|
|
36
|
+
git_check
|
37
|
+
|
35
38
|
version_file = "#{podspec}.podspec"
|
36
39
|
|
37
40
|
current_version = `vrsn --read --file #{version_file}`.strip
|
data/bin/release-podspec
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
require 'open3'
|
4
4
|
require 'optparse'
|
5
5
|
require_relative '../lib/echoexec'
|
6
|
+
require_relative '../lib/errors'
|
7
|
+
require_relative '../lib/git_check'
|
6
8
|
|
7
9
|
podspec = ARGV[0]
|
8
10
|
|
@@ -31,6 +33,8 @@ parser = OptionParser.new do |opts|
|
|
31
33
|
end
|
32
34
|
parser.parse!
|
33
35
|
|
36
|
+
git_check
|
37
|
+
|
34
38
|
changelog_path = 'CHANGELOG.md'
|
35
39
|
if options[:changelog_path] != nil then
|
36
40
|
changelog_path = options[:changelog_path]
|
@@ -72,7 +76,7 @@ puts stdout
|
|
72
76
|
|
73
77
|
if status != 0 then
|
74
78
|
puts "Podspec push failed:\nstderr: #{stderr}"
|
75
|
-
exit
|
79
|
+
exit TwoRingToolError::PODSPEC_PUSH_FAILED
|
76
80
|
else
|
77
81
|
puts "Podspec pushed successfully!"
|
78
82
|
end
|