gitx 3.1.0 → 3.1.1

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
- SHA1:
3
- metadata.gz: 518a1f2e8d54caa3b1338ec0f411d70f96d87d83
4
- data.tar.gz: 7ac3a00cd9436edea5bd22745a5782226551ac19
2
+ SHA256:
3
+ metadata.gz: 671d64ce9a41a3cd6f6ee6a95601367f71148266eb357068293151ae088a0a01
4
+ data.tar.gz: 171596d5cb92650991faed668d756c0995241bf6e2d6753de2eddff5d44c876b
5
5
  SHA512:
6
- metadata.gz: 6006d6b190a47721d9cf895cbed3f5145074530b981cec2e400a445a61a402c13ff57a20e163c4c24c9e1d7581f29084d97c1014fc43cba5ee044039dddcddb0
7
- data.tar.gz: 10958f36fae8adfdc04f46a74a0431ec5b35aa4a977a11cd6354d6a27486abe8ab73b02f418d2f39caab970573e1d72559136b55b144f2af0ffc850a70b2d8d4
6
+ metadata.gz: ac7b82974e53304cab8857268a9fd54985ca5654f161413c785a99ce0de79ea046fde06a079496ad9c27bf7ee789da1c8e7d39602572ce01d0980a33fb5f649c
7
+ data.tar.gz: 5f59721f300d8f9d74c875e985a81b4dacac6c9ceb15b44609e546e0dc09b3a4fa42ff06e6c577be0d3ed5c2403def965790858b330943a794314b652da0d6b8
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.6.3
@@ -1,10 +1,9 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'gitx/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'gitx'
7
- spec.version = Gitx::VERSION
8
7
  spec.authors = ['Ryan Sonnek']
9
8
  spec.email = ['ryan.sonnek@gmail.com']
10
9
  spec.description = 'Git eXtensions for improved development workflows'
@@ -32,7 +31,7 @@ Gem::Specification.new do |spec|
32
31
  spec.add_development_dependency 'webmock'
33
32
 
34
33
  # configure gem version for continuous integration builds
35
- if ENV['TRAVIS_JOB_NUMBER']
36
- spec.version = "#{spec.version}.ci.#{ENV['TRAVIS_JOB_NUMBER']}"
37
- end
34
+ version = Gitx::VERSION
35
+ version = "#{version}.ci.#{ENV['TRAVIS_JOB_NUMBER']}" if ENV['TRAVIS_JOB_NUMBER']
36
+ spec.version = version
38
37
  end
@@ -50,7 +50,7 @@ module Gitx
50
50
  end
51
51
 
52
52
  def config
53
- @configuration ||= Gitx::Configuration.new(repo.workdir)
53
+ @config ||= Gitx::Configuration.new(repo.workdir)
54
54
  end
55
55
 
56
56
  def executor
@@ -13,6 +13,7 @@ module Gitx
13
13
  method_option :message, type: :string, aliases: '-m', desc: 'message to attach to the buildtag'
14
14
  def buildtag
15
15
  raise "Branch must be one of the supported taggable branches: #{config.taggable_branches}" unless config.taggable_branch?(branch_name)
16
+
16
17
  run_git_cmd 'tag', build_tag, '--annotate', '--message', label
17
18
  run_git_cmd 'push', 'origin', build_tag
18
19
  end
@@ -28,7 +29,7 @@ module Gitx
28
29
  end
29
30
 
30
31
  def build_tag
31
- @buildtag ||= [
32
+ @build_tag ||= [
32
33
  BUILD_TAG_PREFIX,
33
34
  branch_name,
34
35
  utc_timestamp
@@ -38,6 +38,7 @@ module Gitx
38
38
  return false if config.reserved_branches.include?(branch)
39
39
  return false if config.aggregate_branch?(branch)
40
40
  return false if config.base_branch == branch
41
+
41
42
  true
42
43
  end
43
44
 
@@ -34,6 +34,7 @@ module Gitx
34
34
 
35
35
  def pull_request_for_branch(branch)
36
36
  return nil if config.reserved_branch?(branch)
37
+
37
38
  find_or_create_pull_request(branch)
38
39
  end
39
40
 
@@ -54,11 +55,9 @@ module Gitx
54
55
  end
55
56
 
56
57
  def feature_branch_name
57
- @feature_branch ||= begin
58
+ @feature_branch_name ||= begin
58
59
  feature_branch = options[:resume] || current_branch.name
59
- until local_branch_exists?(feature_branch)
60
- feature_branch = ask("#{feature_branch} does not exist. Please select one of the available local branches: #{local_branches}")
61
- end
60
+ feature_branch = ask("#{feature_branch} does not exist. Please select one of the available local branches: #{local_branches}") until local_branch_exists?(feature_branch)
62
61
  feature_branch
63
62
  end
64
63
  end
@@ -14,6 +14,7 @@ module Gitx
14
14
 
15
15
  last_known_good_tag = current_build_tag(good_branch)
16
16
  return unless yes?("Reset #{bad_branch} to #{last_known_good_tag}? (y/n)", :green)
17
+
17
18
  assert_aggregate_branch!(bad_branch)
18
19
  return if migrations_need_to_be_reverted?(bad_branch, last_known_good_tag)
19
20
 
@@ -34,6 +35,7 @@ module Gitx
34
35
 
35
36
  def migrations_need_to_be_reverted?(bad_branch, last_known_good_tag)
36
37
  return false unless File.exist?('db/migrate')
38
+
37
39
  outdated_migrations = run_git_cmd('diff', "#{last_known_good_tag}...#{bad_branch}", '--name-only', 'db/migrate').split
38
40
  return false if outdated_migrations.empty?
39
41
 
@@ -49,6 +51,7 @@ module Gitx
49
51
  def current_build_tag(branch)
50
52
  last_build_tag = build_tags_for_branch(branch).last
51
53
  raise "No known good tag found for branch: #{branch}. Verify tag exists via `git tag -l`" unless last_build_tag
54
+
52
55
  last_build_tag
53
56
  end
54
57
 
@@ -11,9 +11,10 @@ module Gitx
11
11
  desc 'release', 'release the current branch to production'
12
12
  method_option :cleanup, type: :boolean, desc: 'cleanup merged branches after release'
13
13
  def release(branch = nil)
14
- return unless yes?("Release #{current_branch.name} to #{config.base_branch}? (y/n)", :green)
15
-
16
14
  branch ||= current_branch.name
15
+
16
+ return unless yes?("Release #{branch} to #{config.base_branch}? (y/n)", :green)
17
+
17
18
  assert_not_protected_branch!(branch, 'release')
18
19
  checkout_branch(branch)
19
20
  run_git_cmd 'update'
@@ -6,14 +6,12 @@ module Gitx
6
6
  module Cli
7
7
  class StartCommand < BaseCommand
8
8
  EXAMPLE_BRANCH_NAMES = %w[api-fix-invalid-auth desktop-cleanup-avatar-markup share-form-add-edit-link].freeze
9
- VALID_BRANCH_NAME_REGEX = /^[A-Za-z0-9\-_]+$/
9
+ VALID_BRANCH_NAME_REGEX = /^[A-Za-z0-9\-_]+$/.freeze
10
10
 
11
11
  desc 'start', 'start a new git branch with latest changes from master'
12
12
  method_option :issue, type: :string, aliases: '-i', desc: 'Issue identifier'
13
13
  def start(branch_name = nil)
14
- until valid_new_branch_name?(branch_name)
15
- branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})")
16
- end
14
+ branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})") until valid_new_branch_name?(branch_name)
17
15
 
18
16
  checkout_branch config.base_branch
19
17
  run_git_cmd 'pull'
@@ -35,12 +33,13 @@ module Gitx
35
33
 
36
34
  def valid_new_branch_name?(branch)
37
35
  return false if repo_branches.include?(branch)
36
+
38
37
  Rugged::Reference.valid_name?("refs/heads/#{branch}")
39
38
  end
40
39
 
41
40
  # get list of local and remote branches
42
41
  def repo_branches
43
- @branch_names ||= repo.branches.each_name.map do |branch|
42
+ @repo_branches ||= repo.branches.each_name.map do |branch|
44
43
  branch.gsub('origin/', '')
45
44
  end
46
45
  end
@@ -15,6 +15,7 @@ module Gitx
15
15
  loop do
16
16
  line = stdout_err.gets
17
17
  break unless line
18
+
18
19
  output << line
19
20
  yield line if block_given?
20
21
  end
@@ -124,7 +124,7 @@ module Gitx
124
124
  end
125
125
 
126
126
  def github_client
127
- @client ||= Octokit::Client.new(access_token: authorization_token)
127
+ @github_client ||= Octokit::Client.new(access_token: authorization_token)
128
128
  end
129
129
 
130
130
  # @return [String] github username (ex: 'wireframe') of the current github.user
@@ -132,6 +132,7 @@ module Gitx
132
132
  def username
133
133
  username = repo.config['github.user']
134
134
  raise "Github user not configured. Run: `git config --global github.user 'me@email.com'`" unless username
135
+
135
136
  username
136
137
  end
137
138
 
@@ -154,7 +155,7 @@ module Gitx
154
155
  end
155
156
 
156
157
  def global_config
157
- @config ||= begin
158
+ @global_config ||= begin
158
159
  File.exist?(global_config_file) ? YAML.load_file(global_config_file) : {}
159
160
  end
160
161
  end
@@ -1,3 +1,3 @@
1
1
  module Gitx
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitx
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2019-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -281,8 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  - !ruby/object:Gem::Version
282
282
  version: '0'
283
283
  requirements: []
284
- rubyforge_project:
285
- rubygems_version: 2.6.6
284
+ rubygems_version: 3.0.3
286
285
  signing_key:
287
286
  specification_version: 4
288
287
  summary: Utility scripts for Git to increase productivity for common operations