tworingtools 3.0.0 → 4.0.1

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: 7866367d352702c57d29d4a3ab4047cb515203315d9ca4fed738b870f1302ccb
4
- data.tar.gz: 3ef7172b8f3acb80f7bc46a646089390e214dd39409c037a165ba2b33ad07197
3
+ metadata.gz: e959ca054f860c6b68a13d6485c1fd1ce9b2186d2fe828850fbafef61135fc8b
4
+ data.tar.gz: 9e7c099aaafa9f4dcb1e4df2f4f537e68c9a0b05cd9a3c8cec089d0b4262df22
5
5
  SHA512:
6
- metadata.gz: 98f4c27f1f5f5dedf4d1bd3dfa52b59988e2aee2bd0121e455eca8c4692f82c4728c28bc63c599d376fc0796914f78e39b0f1192aae1d3f24ecfd08d2b080860
7
- data.tar.gz: a90f88aff5b56b284a83fd05913935c6db5b172110f6b6ce85badf1b0c02a052bc5fab3ac1bbb819e2d0901009c139c773f0e73db4f2d0d3ddbaf014a5005f6b
6
+ metadata.gz: 9fd5e2331f2f89cfc1083fb172fd5fbec5725d5f62f14de92a72475e76e65c9544b5ad0d3a7ccfdfab0f5a9746eea645125f0fcc91bc8c57ff2391840908253a
7
+ data.tar.gz: 0a851c08e9a3908a0990fe9a3ec827e1700ad1d8b8154d058d63c065aa346c6bf16b8b31e188acbbc3dd0be38ab3f2a0c22887e8bf9a207ae493ca4c8972019c
data/bin/bumpr CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'optparse'
4
4
  require_relative '../lib/echoexec'
5
- require_relative '../lib/error'
5
+ require_relative '../lib/errors'
6
6
  require_relative '../lib/git_check'
7
7
 
8
8
  options = {}
@@ -25,7 +25,7 @@ parser = OptionParser.new do |opts|
25
25
  end
26
26
  parser.parse!
27
27
 
28
- git_check
28
+ git_check unless options[:no_commit]
29
29
 
30
30
  component = ARGV[0]
31
31
  version_file = ARGV[1]
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'optparse'
4
4
  require_relative '../lib/echoexec'
5
- require_relative '../lib/error'
5
+ require_relative '../lib/errors'
6
6
  require_relative '../lib/git_check'
7
7
 
8
8
  options = {}
@@ -15,7 +15,7 @@ parser = OptionParser.new do |opts|
15
15
 
16
16
  For normal usage, provide the path to the changelog from which to extract release notes, and the git tag name for which you'd like to extract release notes. This pulls the relevant section from your changelog, as long as you adhere to the format described at http://keepachangelog.com/en/1.0.0/.
17
17
 
18
- Note that the specification requires using the '#' character for hierarchical organization. Conveniently, this also renders different header styles with markdown. Unfortunately, that character is used to denote comments in git tag annotations (similar to git commit messages). So, before using changetag, you must change this to a different character:
18
+ Note that the specification requires using the '#' character for hierarchical organization. Conveniently, this also renders different header styles with markdown. Unfortunately, that character is used to denote comments in git tag annotations (similar to git commit messages). So, before using changetag, you must change this to a different character:
19
19
 
20
20
  $> git config core.commentchar "@"
21
21
 
@@ -37,7 +37,7 @@ parser = OptionParser.new do |opts|
37
37
  end
38
38
  parser.parse!
39
39
 
40
- git_check
40
+ git_check unless options[:no_commit]
41
41
 
42
42
  # set valid git message comment character
43
43
 
@@ -73,9 +73,9 @@ end
73
73
  =end
74
74
 
75
75
  changelog_contents = File.open(changelog_path).readlines
76
- if options[:name] != nil then
76
+ if options[:name] != nil then
77
77
  entry_name = options[:name]
78
- else
78
+ else
79
79
  entry_name = git_tag
80
80
  end
81
81
 
@@ -20,7 +20,7 @@ parser = OptionParser.new do |opts|
20
20
  end
21
21
  parser.parse!
22
22
 
23
- git_check
23
+ git_check unless options[:no_commit]
24
24
 
25
25
  changelog_path = ARGV[0]
26
26
  version = ARGV[1]
@@ -5,7 +5,8 @@ require 'optparse'
5
5
  require_relative '../lib/git_check'
6
6
  require_relative '../lib/echoexec'
7
7
 
8
- podspec = ARGV[0]
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-name>
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
 
@@ -23,6 +24,7 @@ parser = OptionParser.new do |opts|
23
24
  BANNER
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
27
+ opts.on('-s', '--skip-tests', 'Pass \'--skip-tests\' to \'cocoapods spec lint\'.') do |skip_tests| options[:skip_tests] = true end
26
28
  opts.on('-n', '--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
27
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
28
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
@@ -33,9 +35,7 @@ parser = OptionParser.new do |opts|
33
35
  end
34
36
  parser.parse!
35
37
 
36
- git_check
37
-
38
- version_file = "#{podspec}.podspec"
38
+ git_check unless options[:no_commit]
39
39
 
40
40
  current_version = `vrsn --read --file #{version_file}`.strip
41
41
  unless options[:no_branch] then
@@ -75,7 +75,10 @@ end
75
75
  if options[:verbose] != nil then
76
76
  spec_lint_flags << '--verbose'
77
77
  end
78
- stdout, stderr, status = Open3.capture3 "rbenv exec bundle exec pod spec lint #{podspec}.podspec #{spec_lint_flags.join ' '}"
78
+ if options[:skip_tests] != nil then
79
+ spec_lint_flags << '--skip-tests'
80
+ end
81
+ stdout, stderr, status = Open3.capture3 "rbenv exec bundle exec pod spec lint #{version_file} #{spec_lint_flags.join ' '}"
79
82
 
80
83
  puts "stdout: #{stdout}"
81
84
 
@@ -6,13 +6,14 @@ require_relative '../lib/echoexec'
6
6
  require_relative '../lib/errors'
7
7
  require_relative '../lib/git_check'
8
8
 
9
- podspec = ARGV[0]
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-name>
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
 
@@ -26,20 +27,20 @@ parser = OptionParser.new do |opts|
26
27
  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
28
  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
28
29
  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
- opts.on('-h', '--help', 'Print this help message.') do
30
+ opts.on('-h', '--help', 'Print this help message.') do
30
31
  puts opts
31
32
  exit
32
33
  end
33
34
  end
34
35
  parser.parse!
35
36
 
36
- git_check
37
+ git_check unless options[:no_commit]
37
38
 
38
39
  changelog_path = 'CHANGELOG.md'
39
40
  if options[:changelog_path] != nil then
40
41
  changelog_path = options[:changelog_path]
41
42
  end
42
- version = `vrsn --read --file #{podspec}.podspec`.strip
43
+ version = `vrsn --read --file #{podspec_path}`.strip
43
44
  name_prefix = String.new
44
45
  if options[:podspec_name_in_tag] then
45
46
  name_prefix = podspec + '-'
@@ -51,7 +52,7 @@ end
51
52
  echo_and_exec "rbenv exec bundle exec changetag #{changelog_path} #{name_prefix}#{version} #{changelog_entry_name}"
52
53
  echo_and_exec 'git push --tags'
53
54
 
54
- spec_lint_flags = Array.new
55
+ spec_lint_flags = Array.new
55
56
  if options[:allow_warnings] != nil then
56
57
  spec_lint_flags << '--allow-warnings'
57
58
  end
@@ -66,7 +67,7 @@ command = String.new
66
67
  if options[:repo] != nil then
67
68
  command = "rbenv exec bundle exec pod repo push #{options[:repo]} #{spec_lint_flags.join ' '}"
68
69
  else
69
- command = "rbenv exec bundle exec pod trunk push #{podspec}.podspec #{spec_lint_flags.join ' '}"
70
+ command = "rbenv exec bundle exec pod trunk push #{podspec_path} #{spec_lint_flags.join ' '}"
70
71
  end
71
72
 
72
73
  puts command
@@ -80,4 +81,3 @@ if status != 0 then
80
81
  else
81
82
  puts "Podspec pushed successfully!"
82
83
  end
83
-
@@ -0,0 +1,8 @@
1
+ module TwoRingToolError
2
+ INVALID_CHANGELOG_PATH = 65
3
+ UNFORCED_ANNOTATION_OVERWRITE_ATTEMPT = 66
4
+ CHANGELOG_ENTRY_NOT_FOUND = 67
5
+ GIT_DIRTY_INDEX = 68
6
+ PODSPEC_PUSH_FAILED = 69
7
+ INVALID_SEMVER_COMPONENT = 70
8
+ end
@@ -0,0 +1,10 @@
1
+ require 'open3'
2
+ require_relative 'errors'
3
+
4
+ def git_check
5
+ modified_file_count, stderr, status = Open3.capture3("git status --porcelain | egrep '^(M| M)' | wc -l")
6
+ if modified_file_count.to_i > 0 then
7
+ puts 'Please commit all changes to working index before proceeding.'
8
+ exit TwoRingToolError::GIT_DIRTY_INDEX
9
+ end
10
+ end
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.0.0
4
+ version: 4.0.1
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-04-04 00:00:00.000000000 Z
11
+ date: 2020-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github_api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.18'
19
+ version: '0.19'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.18'
26
+ version: '0.19'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +72,8 @@ files:
72
72
  - bin/sync-forks
73
73
  - bin/xcsims
74
74
  - lib/echoexec.rb
75
+ - lib/errors.rb
76
+ - lib/git_check.rb
75
77
  homepage: https://github.com/TwoRingSoft/tools
76
78
  licenses:
77
79
  - MIT