tworingtools 3.1.0 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/prerelease-podspec +16 -8
- data/bin/release-podspec +23 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d572bbbaf9d0cfe054678d11b46de1e9a15f01fad9758178f214b76e56199d9f
|
4
|
+
data.tar.gz: be7c5b255b83ee2db03e556eb44d2f163badea2fbaa4b0d82d05b16a66630e8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97d3914b21dcccaf2f2e1f261a3c1a217fdc6a30263a32b8ce905d1e9d5a0e2fe78764abd289309c87c9f995ed870650c97e1334a5c23d3965541ddac4f627ef
|
7
|
+
data.tar.gz: c0fcd5ddb92eda302ff0a77fe394e0d85144c689765c664cc4eea8baa18b801885f64017ad5e7bcb218540559c51ebcec7a59ca8e31c4fd32fa4a04c56bd02dd
|
data/bin/prerelease-podspec
CHANGED
@@ -5,7 +5,8 @@ require 'optparse'
|
|
5
5
|
require_relative '../lib/git_check'
|
6
6
|
require_relative '../lib/echoexec'
|
7
7
|
|
8
|
-
|
8
|
+
version_file = ARGV[0]
|
9
|
+
podspec = version_file.split('/')[-1].split('.podspec')[0]
|
9
10
|
|
10
11
|
# failure modes
|
11
12
|
PODSPEC_FAILED_VALIDATION = 65
|
@@ -14,7 +15,7 @@ options = {}
|
|
14
15
|
parser = OptionParser.new do |opts|
|
15
16
|
opts.banner = <<~BANNER
|
16
17
|
|
17
|
-
Usage: prerelease-podspec [options] <podspec-
|
18
|
+
Usage: prerelease-podspec [options] <podspec-path>
|
18
19
|
|
19
20
|
Branch and create/push a release candidate tag, modify the podspec to use that version tag, and try linting it.
|
20
21
|
|
@@ -24,9 +25,11 @@ parser = OptionParser.new do |opts|
|
|
24
25
|
opts.on('-w', '--allow-warnings', 'Pass \'--allow-warnings\' to \'cocoapods spec lint\'.') do |force| options[:allow_warnings] = true end
|
25
26
|
opts.on('-v', '--verbose', 'Pass \'--verbose\' to \'cocoapods spec lint\'.') do |name| options[:verbose] = true end
|
26
27
|
opts.on('-s', '--skip-tests', 'Pass \'--skip-tests\' to \'cocoapods spec lint\'.') do |skip_tests| options[:skip_tests] = true end
|
27
|
-
opts.on('-
|
28
|
+
opts.on('-p', '--podspec-name-in-tag', 'When forming the tag name for a release candidate, prefix the podspec‘s name to the version string. Helps when you have multiple podspecs in a repository and tag versions for each.') do |podspec_name_in_tag| options[:podspec_name_in_tag] = true end
|
28
29
|
opts.on('-n', '--no-branch', 'Make any changes on the current branch instead of creating a temporary new branch.') do |no_branch| options[:no_branch] = true end
|
29
30
|
opts.on('-cCHANGELOG', '--changelog=CHANGELOG', 'Location of a CHANGELOG document adhering to https://keepachangelog.com/en/1.0.0/ whose version entry should be extracted into an annotated tag for this release candidate.') do |changelog| options[:changelog] = changelog end
|
31
|
+
opts.on('-tTAG', '--tag=TAG', 'Override for the name of the git tag to form. If set, --podspec-name-in-tag is ignored.') do |tag| options[:tag] = tag end
|
32
|
+
opts.on('-rRC', '--release-candidate=RC', 'Override for the release candidate number, which is otherwise formulated by counting the previous amount of tags with the same version number and incrementing by one.') do |rc| options[:rc] = rc end
|
30
33
|
opts.on('-h', '--help', 'Print this help message.') do
|
31
34
|
puts opts
|
32
35
|
exit
|
@@ -36,8 +39,6 @@ parser.parse!
|
|
36
39
|
|
37
40
|
git_check unless options[:no_commit]
|
38
41
|
|
39
|
-
version_file = "#{podspec}.podspec"
|
40
|
-
|
41
42
|
current_version = `vrsn --read --file #{version_file}`.strip
|
42
43
|
unless options[:no_branch] then
|
43
44
|
branch = "#{podspec}-#{current_version}-release"
|
@@ -45,11 +46,18 @@ unless options[:no_branch] then
|
|
45
46
|
end
|
46
47
|
|
47
48
|
version_root = "#{current_version}-RC"
|
48
|
-
release_candidate_number =
|
49
|
+
release_candidate_number = String.new
|
50
|
+
if options[:rc] then
|
51
|
+
release_candidate_number = options[:rc]
|
52
|
+
else
|
53
|
+
release_candidate_number = `git tag --list | grep #{version_root} | wc -l`.strip.to_i + 1
|
54
|
+
end
|
49
55
|
release_candidate_version = "#{version_root}#{release_candidate_number}"
|
50
56
|
|
51
57
|
tag_value = String.new
|
52
|
-
if options[:
|
58
|
+
if options[:tag] then
|
59
|
+
tag_value = options[:tag]
|
60
|
+
elsif options[:podspec_name_in_tag] then
|
53
61
|
tag_value = "#{podspec}-#{release_candidate_version}"
|
54
62
|
else
|
55
63
|
tag_value = "#{release_candidate_version}"
|
@@ -79,7 +87,7 @@ end
|
|
79
87
|
if options[:skip_tests] != nil then
|
80
88
|
spec_lint_flags << '--skip-tests'
|
81
89
|
end
|
82
|
-
stdout, stderr, status = Open3.capture3 "rbenv exec bundle exec pod spec lint #{
|
90
|
+
stdout, stderr, status = Open3.capture3 "rbenv exec bundle exec pod spec lint #{version_file} #{spec_lint_flags.join ' '}"
|
83
91
|
|
84
92
|
puts "stdout: #{stdout}"
|
85
93
|
|
data/bin/release-podspec
CHANGED
@@ -6,13 +6,14 @@ require_relative '../lib/echoexec'
|
|
6
6
|
require_relative '../lib/errors'
|
7
7
|
require_relative '../lib/git_check'
|
8
8
|
|
9
|
-
|
9
|
+
podspec_path = ARGV[0]
|
10
|
+
podspec = podspec_path.split('/')[-1].split('.podspec')[0]
|
10
11
|
|
11
12
|
options = {}
|
12
13
|
parser = OptionParser.new do |opts|
|
13
14
|
opts.banner = <<~BANNER
|
14
15
|
|
15
|
-
Usage: release-podspec [options] <podspec-
|
16
|
+
Usage: release-podspec [options] <podspec-path>
|
16
17
|
|
17
18
|
Form Git tags and push them to remote, then push the podspec to CocoaPods trunk.
|
18
19
|
|
@@ -21,10 +22,12 @@ parser = OptionParser.new do |opts|
|
|
21
22
|
BANNER
|
22
23
|
opts.on('-w', '--allow-warnings', 'Pass \'--allow-warnings\' to \'cocoapods spec lint\'.') do |force| options[:allow_warnings] = true end
|
23
24
|
opts.on('-s', '--skip-tests', 'Pass \'--skip-tests\' to \'cocoapods spec lint\'.') do |skip_tests| options[:skip_tests] = true end
|
24
|
-
opts.on('-
|
25
|
+
opts.on('-p', '--podspec-name-in-tag', 'When forming the tag name for a release candidate, prefix the podspec‘s name to the version string. Helps when you have multiple podspecs in a repository and tag versions for each.') do |podspec_name_in_tag| options[:podspec_name_in_tag] = true end
|
26
|
+
opts.on('-n', '--no-changelog', 'Skip operations that would normally update a CHANGELOG.md.') do |skip_changelog| options[:skip_changelog] = true end
|
25
27
|
opts.on('-v', '--verbose', 'Pass \'--verbose\' to \'cocoapods spec lint\'.') do |name| options[:verbose] = true end
|
26
28
|
opts.on('-rREPO', '--repo=REPO', 'By default, release-podspec pushes the podspec to CocoaPods trunk. By supplying this argument, instead of \`pod trunk push\`, \`pod repo push\` is used instead.') do |repo| options[:repo] = repo end
|
27
29
|
opts.on('-cCHANGELOG_PATH', '--changelog-path=CHANGELOG_PATH', 'By default, release-podspec looks for //CHANGELOG.md. You can specify another location with this option.') do |changelog_path| options[:changelog_path] = changelog_path end
|
30
|
+
opts.on('-tTAG', '--tag=TAG', 'Override for the name of the git tag to form. If set, --podspec-name-in-tag is ignored.') do |tag| options[:tag] = tag end
|
28
31
|
opts.on('--e', '--changelog-entry=CHANGELOG_ENTRY', 'The name of the changelog entry, if it differs from the tag name.') do |changelog_entry_name_override| options[:changelog_entry_name_override] = changelog_entry_name_override end
|
29
32
|
opts.on('-h', '--help', 'Print this help message.') do
|
30
33
|
puts opts
|
@@ -39,16 +42,24 @@ changelog_path = 'CHANGELOG.md'
|
|
39
42
|
if options[:changelog_path] != nil then
|
40
43
|
changelog_path = options[:changelog_path]
|
41
44
|
end
|
42
|
-
version = `vrsn --read --file #{
|
43
|
-
|
44
|
-
if options[:
|
45
|
-
|
45
|
+
version = `vrsn --read --file #{podspec_path}`.strip
|
46
|
+
tag_value = String.new
|
47
|
+
if options[:tag] then
|
48
|
+
tag_value = options[:tag]
|
49
|
+
elsif options[:podspec_name_in_tag] then
|
50
|
+
tag_value = podspec + '-' + version
|
51
|
+
else
|
52
|
+
tag_value = version
|
46
53
|
end
|
47
|
-
|
48
|
-
|
49
|
-
|
54
|
+
if options[:skip_changelog] then
|
55
|
+
changelog_entry_name = String.new
|
56
|
+
if options[:changelog_entry_name_override] != nil then
|
57
|
+
changelog_entry_name = "--name " + options[:changelog_entry_name_override]
|
58
|
+
end
|
59
|
+
echo_and_exec "rbenv exec bundle exec changetag #{changelog_path} #{tag_value} #{changelog_entry_name}"
|
60
|
+
else
|
61
|
+
echo_and_exec "git tag #{tag_value}"
|
50
62
|
end
|
51
|
-
echo_and_exec "rbenv exec bundle exec changetag #{changelog_path} #{name_prefix}#{version} #{changelog_entry_name}"
|
52
63
|
echo_and_exec 'git push --tags'
|
53
64
|
|
54
65
|
spec_lint_flags = Array.new
|
@@ -66,7 +77,7 @@ command = String.new
|
|
66
77
|
if options[:repo] != nil then
|
67
78
|
command = "rbenv exec bundle exec pod repo push #{options[:repo]} #{spec_lint_flags.join ' '}"
|
68
79
|
else
|
69
|
-
command = "rbenv exec bundle exec pod trunk push #{
|
80
|
+
command = "rbenv exec bundle exec pod trunk push #{podspec_path} #{spec_lint_flags.join ' '}"
|
70
81
|
end
|
71
82
|
|
72
83
|
puts command
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tworingtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew McKnight
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github_api
|