tworingtools 5.0.0 → 6.2.0

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: 8a9c273d420e81312cd78a3cfb16705daa66c66cb88333b028a99aeead328b57
4
- data.tar.gz: bf970bd1d1613d2667f7d5279ec35c5d1bc0ea68b51d07d80bb4246491706320
3
+ metadata.gz: d2409b0f5d3957d1c4ca4c2c754174a93c802b193994f137480e1e6448f0d233
4
+ data.tar.gz: 344037994226cac7ed21f59672360ccc160ea110602f35af0b98038847cd4f5a
5
5
  SHA512:
6
- metadata.gz: e1acd45a72627aa1c61876360907b65715d55afe06c4c398d711476bc06e79baeb806475c1b46e739cecb57f5a13014273f423ff1d3b0d009987dc5e97143dfd
7
- data.tar.gz: 6160816443577623849b42d6cd0972b6314dc523bbcdc2295d9501c4d80f6bc1e124831f9aad4d61d27f81dcda68b8bae358869d50f1d4479d06aeedcbc1bb91
6
+ metadata.gz: 0e59c558135996bc8cdd57031f01b6c7c34aa8968bd068c8796d309e69000871cbd087373e5ce8fd4cd7dc0cc0e0fef609f5acf16a8e523f591bbab6a7f15f6e
7
+ data.tar.gz: 026e3c1c66a2b84c65d0845b743b82072a40bc8224396c96d506e41b8a43c0b90f071060d2b2045f3e0711ba10642ad309d89b79b330f7cc74394ce007ead10f
data/bin/bumpr CHANGED
@@ -54,5 +54,5 @@ stdout, stderr, status = Open3.capture3(command)
54
54
 
55
55
  unless options[:no_commit] then
56
56
  echo_and_exec "git add #{version_file}"
57
- echo_and_exec "git commit --message \"#{stdout}\""
57
+ echo_and_exec "git commit --message \"chore: #{stdout}\""
58
58
  end
data/bin/release-podspec CHANGED
@@ -1,4 +1,5 @@
1
1
  #! /usr/bin/env ruby
2
+ # coding: utf-8
2
3
 
3
4
  require 'open3'
4
5
  require 'optparse'
@@ -26,6 +27,7 @@ parser = OptionParser.new do |opts|
26
27
  opts.on('-n', '--no-changelog', 'Skip operations that would normally update a CHANGELOG.md.') do |skip_changelog| options[:skip_changelog] = true end
27
28
  opts.on('-v', '--verbose', 'Pass \'--verbose\' to \'cocoapods spec lint\'.') do |name| options[:verbose] = true end
28
29
  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
30
+ opts.on('-k', '--also-push-to-trunk', 'When pushing to a private repo, also push to trunk afterwards. Ignored if not using --repo.') do |also_push_to_trunk| options[:also_push_to_trunk] = true end
29
31
  opts.on('-cCHANGELOG_PATH', '--changelog-path=CHANGELOG_PATH', '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. 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
32
  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
31
33
  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
@@ -77,21 +79,26 @@ if options[:skip_import_validation] then
77
79
  spec_lint_flags << '--skip-import-validation'
78
80
  end
79
81
 
80
- command = String.new
81
- if options[:repo] != nil then
82
- command = "rbenv exec bundle exec pod repo push #{options[:repo]} #{spec_lint_flags.join ' '} #{podspec_path}"
83
- else
84
- command = "rbenv exec bundle exec pod trunk push #{podspec_path} #{spec_lint_flags.join ' '}"
85
- end
82
+ def execute_command command
83
+ puts command
84
+ stdout, stderr, status = Open3.capture3 command
86
85
 
87
- puts command
88
- stdout, stderr, status = Open3.capture3 command
86
+ puts stdout
89
87
 
90
- puts stdout
88
+ if status != 0 then
89
+ puts "Podspec push failed:\nstderr: #{stderr}"
90
+ exit TwoRingToolError::PODSPEC_PUSH_FAILED
91
+ else
92
+ puts "Podspec pushed successfully!"
93
+ end
94
+ end
91
95
 
92
- if status != 0 then
93
- puts "Podspec push failed:\nstderr: #{stderr}"
94
- exit TwoRingToolError::PODSPEC_PUSH_FAILED
96
+ command = String.new
97
+ if options[:repo] != nil then
98
+ execute_command "rbenv exec bundle exec pod repo push #{options[:repo]} #{spec_lint_flags.join ' '} #{podspec_path}"
99
+ if options[:also_push_to_trunk] then
100
+ execute_command "rbenv exec bundle exec pod trunk push #{podspec_path} #{spec_lint_flags.join ' '}"
101
+ end
95
102
  else
96
- puts "Podspec pushed successfully!"
103
+ execute_command "rbenv exec bundle exec pod trunk push #{podspec_path} #{spec_lint_flags.join ' '}"
97
104
  end
@@ -6,15 +6,11 @@ require 'optparse'
6
6
  require_relative '../lib/echoexec'
7
7
  require_relative '../lib/git_helpers'
8
8
 
9
- # failure modes
10
- FURTHER_REQUESTS_REQUIRE_TOKEN = 65
11
- MISSING_REQUIRED_CREDENTIALS = 66
12
-
13
9
  options = {}
14
10
  parser = OptionParser.new do |opts|
15
11
  opts.banner = <<~BANNER
16
12
 
17
- Usage: sync-git [options] <directory>
13
+ Usage: sync-git-remotes [options] <directory>
18
14
 
19
15
  For each of your GitHub forks, clone your forked version, then go in and add a remote
20
16
  to the upstream version, and set up local tracking branches for both remotes' default
@@ -23,25 +19,11 @@ parser = OptionParser.new do |opts|
23
19
  <directory> is the path containing the directories holding your forks, and/or
24
20
  to where those you don't yet have should be cloned.
25
21
 
26
- Examples:
27
-
28
- sync-git -u/--username <user> -p/--password <pass> [-o/--one-time-pw <otp>] .
29
- sync-git -u/--username <user> -t/--token <token> .
30
- sync-git -u/--username <user> -t/--token -n/--repo-name that-one-repo-I-forked <token> .
31
-
32
- If you already have a Personal Access Token, provide it in the second form.
33
- Otherwise, use the first form, which will register a new token for you named
34
- “sync-git”. Then use that to invoke the program again. This is because
35
- requests using basic authentication (user/pass) are too rate limited.
36
-
37
22
  Options:
38
23
 
39
24
  BANNER
40
25
 
41
- opts.on('-uUSERNAME', '--username=USERNAME', 'GitHub username. Required for all invocations.') do |user| options[:username] = user end
42
- opts.on('-tTOKEN', '--token=TOKEN', 'GitHub personal access token. The primary way to use this program.') do |t| options[:token] = t end
43
- opts.on('-pPASSWORD', '--password=PASSWORD', 'GitHub password.') do |pass| options[:password] = pass end
44
- opts.on('-oOTP', '--one-time-pw=OTP', 'GitHub 2FA token, if you have it enabled.') do |otp| options[:otp] = otp end
26
+ opts.on('-tTOKEN', '--token=TOKEN', 'GitHub personal access token.') do |t| options[:token] = t end
45
27
  opts.on('-rREPO', '--repo-name=REPO', 'The name of a particular repository to sync.') do |repo| options[:repo] = repo end
46
28
  opts.on('-v', '--verbose', 'Enable verbose logging.') do options[:verbose] = true end
47
29
  end
@@ -53,30 +35,6 @@ github = nil
53
35
  if nil != options[:token] then
54
36
  github = Octokit::Client.new(:access_token => options[:token])
55
37
  puts 'Running with provided token...'
56
- elsif nil != options[:username] && nil != options[:password]
57
- github = Octokit::Client.new \
58
- :login => options[:username],
59
- :password => options[:password]
60
-
61
- headers = Hash.new
62
- if nil != options[:otp] then
63
- headers['X-GitHub-OTP'] = options[:otp]
64
- end
65
-
66
- token = github.create_authorization \
67
- :scopes => ["user"],
68
- :note => "sync-git",
69
- :headers => headers
70
-
71
- puts "Created new token, use it to call sync-git again:"
72
- puts
73
- puts "\tsync-git -u #{user} -t #{token.token}"
74
- puts
75
- exit FURTHER_REQUESTS_REQUIRE_TOKEN
76
- else
77
- puts "Must provide either a username/token or username/password/otp combination to authenticate."
78
- puts parser
79
- exit MISSING_REQUIRED_CREDENTIALS
80
38
  end
81
39
 
82
40
  github.auto_paginate = true
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: 5.0.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew McKnight
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '2.1'
41
41
  description: |2
42
42
  - xcsims: Delete all simulators and recreate one for each compatible platform and device type pairing.
43
- - sync-git: Make sure all your GitHub repos are cloned into a given directory and keep them synced with upstream. Forks are maintained with a remote for both the fork and upstream, both remotes' default branches are tracked in local counterparts, and the upstream default branch is also pushed to the fork.
43
+ - sync-git-remotes: Make sure all your GitHub repos are cloned into a given directory and keep them synced with upstream. Forks are maintained with a remote for both the fork and upstream, both remotes' default branches are tracked in local counterparts, and the upstream default branch is also pushed to the fork.
44
44
  - changetag: Extract changelog entries to write into git tag annotation messages.
45
45
  - prerelease-podspec: Branch and create/push a release candidate tag, modify the podspec to use that version tag, and try linting it.
46
46
  - release-podspec: Create a tag with the version and push it to repo origin, push podspec to CocoaPods trunk.
@@ -52,7 +52,7 @@ email: andrew@tworingsoft.com
52
52
  executables:
53
53
  - clean-rc-tags
54
54
  - xcsims
55
- - sync-git
55
+ - sync-git-remotes
56
56
  - changetag
57
57
  - prerelease-podspec
58
58
  - release-podspec
@@ -69,7 +69,7 @@ files:
69
69
  - bin/prerelease-podspec
70
70
  - bin/release-podspec
71
71
  - bin/revert-failed-release-tag
72
- - bin/sync-git
72
+ - bin/sync-git-remotes
73
73
  - bin/xcsims
74
74
  - lib/echoexec.rb
75
75
  - lib/errors.rb
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.0.3
97
+ rubygems_version: 3.0.3.1
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: A collection of command line tools.