tworingtools 1.3.1 → 1.4.0

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: 90a1bc7d807d2796539d05469cbfc08267d44cd893a8329ae9e4bb8136cfdde4
4
- data.tar.gz: dcc34f89bcfb21cfa384ce6f47ea523187894fae6f115befff262a66ca189c0d
3
+ metadata.gz: b9bc096690034b6909c1188bb8d4a9621a04108161b5da3844f20d0bdd70d7b5
4
+ data.tar.gz: 16b0cd93af5fe37b6cddb779ffbfa70faa952d5c5e113f8f6c84ddd3e88e01fa
5
5
  SHA512:
6
- metadata.gz: fe5fc725dabcfc11dd59f8d74138610a25d5f417f6e8c891eb25682c6e86f02dc0fd9d5bfdcc6dbbe0ea6ec192775ec9c973b6835352ff2941d75df518fb21bc
7
- data.tar.gz: f9ab4e4f9df84926094333840543b8aa5aa48eb14ae9cf4362edf7d2f2f955f9ebf211fdf6f16742cd4e32e868011783214f2436ecdf0a5512b5ddbc6aa5af5c
6
+ metadata.gz: 8e812c0bfc257e8a758804f1c0781996616f1a6aaed8d43fc297db0062efa429c4f3e9f21c297666fcd18c28347453d275a9e041f062585e15adeb74b65e28de
7
+ data.tar.gz: e4f4a4ac5adab4f036828f6da2f1b9fe082bac001191fed5e890e265b824ff21e88427dacab021c3c0d290354804a60378001ee6cff05df793eda7e2333d6b56
@@ -0,0 +1,64 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'open3'
4
+ require 'optparse'
5
+
6
+ podspec = ARGV[0]
7
+
8
+ # failure modes
9
+ PODSPEC_FAILED_VALIDATION = 65
10
+
11
+ options = {}
12
+ parser = OptionParser.new do |opts|
13
+ opts.banner = <<~BANNER
14
+
15
+ Usage: prerelease-podspec [options] <podspec-name> [<podspec-path>]
16
+
17
+ Branch and create/push a release candidate tag, modify the podspec to use that version tag, and try linting it.
18
+
19
+ Options:
20
+
21
+ BANNER
22
+ opts.on('-w', '--allow-warnings', 'Pass \'--allow-warnings\' to \'cocoapods spec lint\'.') do |force| options[:allow_warnings] = true end
23
+ opts.on('-v', '--verbose', 'Pass \'--verbose\' to \'cocoapods spec lint\'.') do |name| options[:verbose] = true end
24
+ opts.on('-h', '--help', 'Print this help message.') do
25
+ puts opts
26
+ exit
27
+ end
28
+ end
29
+ parser.parse!
30
+
31
+ version_file = "#{podspec}.podspec"
32
+
33
+ current_version = `vrsn --read --file #{version_file}`.strip
34
+ branch = "#{podspec}-#{current_version}-release"
35
+ `git checkout -b #{branch}`
36
+
37
+ tag_root = "#{podspec}-#{current_version}-RC"
38
+ release_candidate_number = `git tag --list | grep #{tag_root} | wc -l`.strip.to_i + 1
39
+ release_candidate_tag = "#{tag_root}#{release_candidate_number}"
40
+ `sed -i '' \"s/\\(\\.version *= *'\\).*'/\\1\"#{current_version}-RC#{release_candidate_number}\"\\'/g\" #{version_file}`
41
+ `git add #{version_file}`
42
+ `git commit --message 'TEMP: set podspec version to release candidate version'`
43
+ `git tag #{release_candidate_tag}`
44
+ `git push --tags`
45
+
46
+ puts "About to lint the podspec. This takes a while... (it is now #{Time.now})"
47
+ spec_lint_flags = Array.new
48
+ if options[:allow_warnings] != nil then
49
+ spec_lint_flags << '--allow-warnings'
50
+ end
51
+ if options[:verbose] != nil then
52
+ spec_lint_flags << '--verbose'
53
+ end
54
+ stdout, stderr, status = Open3.capture3 "rbenv exec bundle exec pod spec lint #{podspec}.podspec #{spec_lint_flags.join ' '}"
55
+
56
+ `git checkout master`
57
+ `git branch -D #{branch}`
58
+
59
+ if status != 0 then
60
+ puts "Podspec failed validation:\nstdout: #{stdout}\nstderr: #{stderr}"
61
+ exit PODSPEC_FAILED_VALIDATION
62
+ else
63
+ puts "Podspec passed validation!"
64
+ end
@@ -0,0 +1,47 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+
5
+ podspec = ARGV[0]
6
+
7
+ options = {}
8
+ parser = OptionParser.new do |opts|
9
+ opts.banner = <<~BANNER
10
+
11
+ Usage: release-podspec [options] <podspec-name> [<podspec-path>]
12
+
13
+ Form Git tags and push them to remote, then push the podspec to CocoaPods trunk.
14
+
15
+ Options:
16
+
17
+ BANNER
18
+ opts.on('-w', '--allow-warnings', 'Pass \'--allow-warnings\' to \'cocoapods spec lint\'.') do |force| options[:allow_warnings] = true end
19
+ opts.on('-v', '--verbose', 'Pass \'--verbose\' to \'cocoapods spec lint\'.') do |name| options[:verbose] = true end
20
+ opts.on('-rREPO', '--repo=REPO', 'By default, release-podspec pushed 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
21
+ opts.on('-h', '--help', 'Print this help message.') do
22
+ puts opts
23
+ exit
24
+ end
25
+ end
26
+ parser.parse!
27
+
28
+ version_file = "#{podspec}.podspec"
29
+ version = `vrsn --read --file #{version_file}`
30
+ `git tag #{podspec}-#{version.strip}`
31
+ `git push --tags`
32
+
33
+ spec_lint_flags = Array.new
34
+ if options[:allow_warnings] != nil then
35
+ spec_lint_flags << '--allow-warnings'
36
+ end
37
+ if options[:verbose] != nil then
38
+ spec_lint_flags << '--verbose'
39
+ end
40
+
41
+ repo = String.new
42
+ if options[:repo] != nil then
43
+ `rbenv exec bundle exec pod repo push #{options[:repo]} #{podspec}.podspec #{spec_lint_flags.join ' '}`
44
+ else
45
+ `rbenv exec bundle exec pod trunk push #{podspec}.podspec #{spec_lint_flags.join ' '}`
46
+ end
47
+
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ podspec = ARGV[0]
4
+
5
+ version_file = "#{podspec}.podspec"
6
+ version = `vrsn --read --file #{version_file}`.strip
7
+ tag = "#{podspec}-#{version}"
8
+ sh "git tag --delete #{tag}"
9
+ sh "git push --delete origin #{tag}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tworingtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew McKnight
@@ -47,11 +47,17 @@ executables:
47
47
  - rebuild-sims
48
48
  - sync-forks
49
49
  - changetag
50
+ - prerelease-podspec
51
+ - release-podspec
52
+ - revert-failed-release-tag
50
53
  extensions: []
51
54
  extra_rdoc_files: []
52
55
  files:
53
56
  - bin/changetag
57
+ - bin/prerelease-podspec
54
58
  - bin/rebuild-sims
59
+ - bin/release-podspec
60
+ - bin/revert-failed-release-tag
55
61
  - bin/sync-forks
56
62
  - lib/echoexec.rb
57
63
  homepage: https://github.com/TwoRingSoft/tools