gitx 2.13.2 → 2.13.3

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
  SHA1:
3
- metadata.gz: 16bfeebb4be9f34943f8f4021d1ad46e7300f3e7
4
- data.tar.gz: c54f875837167ec17d446ad1eddc913f5f721fc8
3
+ metadata.gz: 6879c6b0b329e85ee4fa68d2aa1ae44c95298263
4
+ data.tar.gz: da978aaaab7573d8dac8033b2b6522e362312cd6
5
5
  SHA512:
6
- metadata.gz: 3a841e4f74d84b196beab4723755861969621d5269f692b6461a35683edc134171414a79ac8225096e04cbf4df2fc53ef84d7aa5e54fc60992df8fedadf01669
7
- data.tar.gz: 086ae548dddcb3a93d473d1d134f214646890a15c5a9bb55af64a86c0e0a36d31bd84fe6a8a4d239461b604545c2ee8051e5e5827d1b8778298c649029697f6d
6
+ metadata.gz: 1a4dee3357477bf1304472c4cc2084560fcb31d00d02abdf3aabe270d92196730722d41a1806aebb38499fa2918da50aef02f320599d78fe0d8dcb844b0b5ab3
7
+ data.tar.gz: 5faca0a6beef13c58855059a5bcbe1eb9710dfdd285a52e85b91f63c8337840eba8affdf00b14588acd89f333f7e2ec7763ca43e3346d503b68d75f82c1f59bf
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
@@ -0,0 +1,12 @@
1
+ LineLength:
2
+ Max: 200
3
+
4
+ Documentation:
5
+ Enabled: false
6
+
7
+ StringLiterals:
8
+ EnforcedStyle: single_quotes
9
+
10
+ FileName:
11
+ Exclude:
12
+ - bin/*
data/Rakefile CHANGED
@@ -2,4 +2,4 @@ require 'bundler/gem_tasks'
2
2
 
3
3
  require 'rspec/core/rake_task'
4
4
  RSpec::Core::RakeTask.new('spec')
5
- task :default => :spec
5
+ task default: :spec
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/buildtag_command'
5
5
  args = ARGV.dup.unshift('buildtag')
6
6
  Gitx::Cli::BuildtagCommand.start(args)
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/cleanup_command'
5
5
  args = ARGV.dup.unshift('cleanup')
6
6
  Gitx::Cli::CleanupCommand.start(args)
7
-
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/integrate_command'
5
5
  args = ARGV.dup.unshift('integrate')
6
6
  Gitx::Cli::IntegrateCommand.start(args)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/nuke_command'
5
5
  args = ARGV.dup.unshift('nuke')
6
6
  Gitx::Cli::NukeCommand.start(args)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/release_command'
5
5
  args = ARGV.dup.unshift('release')
6
6
  Gitx::Cli::ReleaseCommand.start(args)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/review_command'
5
5
  args = ARGV.dup.unshift('review')
6
6
  Gitx::Cli::ReviewCommand.start(args)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/share_command'
5
5
  args = ARGV.dup.unshift('share')
6
6
  Gitx::Cli::ShareCommand.start(args)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/start_command'
5
5
  args = ARGV.dup.unshift('start')
6
6
  Gitx::Cli::StartCommand.start(args)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/track_command'
5
5
  args = ARGV.dup.unshift('track')
6
6
  Gitx::Cli::TrackCommand.start(args)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'gitx/cli/update_command'
5
5
  args = ARGV.dup.unshift('update')
6
6
  Gitx::Cli::UpdateCommand.start(args)
@@ -8,12 +8,12 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Gitx::VERSION
9
9
  spec.authors = ['Ryan Sonnek']
10
10
  spec.email = ['ryan.sonnek@gmail.com']
11
- spec.description = %q{Git eXtensions for improved development workflow}
12
- spec.summary = %q{Utility scripts for Git to increase productivity for common operations}
11
+ spec.description = 'Git eXtensions for improved development workflow'
12
+ spec.summary = 'Utility scripts for Git to increase productivity for common operations'
13
13
  spec.homepage = ''
14
14
  spec.license = 'MIT'
15
15
 
16
- spec.files = `git ls-files`.split($/)
16
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
@@ -34,4 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency 'coveralls'
35
35
  spec.add_development_dependency 'terminal-notifier'
36
36
  spec.add_development_dependency 'terminal-notifier-guard'
37
+ spec.add_development_dependency 'rubocop'
37
38
  end
@@ -12,7 +12,7 @@ module Gitx
12
12
 
13
13
  add_runtime_options!
14
14
 
15
- method_option :trace, :type => :boolean, :aliases => '-v'
15
+ method_option :trace, type: :boolean, aliases: '-v'
16
16
  def initialize(*args)
17
17
  super(*args)
18
18
  end
@@ -40,7 +40,7 @@ module Gitx
40
40
  end
41
41
 
42
42
  def assert_not_protected_branch!(branch, action)
43
- raise "Cannot #{action} reserved branch" if config.reserved_branch?(branch) || config.aggregate_branch?(branch)
43
+ fail "Cannot #{action} reserved branch" if config.reserved_branch?(branch) || config.aggregate_branch?(branch)
44
44
  end
45
45
 
46
46
  # helper to invoke other CLI commands
@@ -5,7 +5,6 @@ require 'gitx/cli/base_command'
5
5
  module Gitx
6
6
  module Cli
7
7
  class BuildtagCommand < BaseCommand
8
-
9
8
  desc 'buildtag', 'create a tag for the current build and push it back to origin (supports Travis CI and Codeship)'
10
9
  def buildtag
11
10
  fail 'Unknown branch. Environment variables TRAVIS_BRANCH or CI_BRANCH are required' unless branch_name
@@ -9,8 +9,8 @@ module Gitx
9
9
  class IntegrateCommand < BaseCommand
10
10
  include Gitx::Github
11
11
  desc 'integrate', 'integrate the current branch into one of the aggregate development branches (default = staging)'
12
- method_option :resume, :type => :string, :aliases => '-r', :desc => 'resume merging of feature-branch'
13
- method_option :comment, :type => :boolean, :aliases => '-c', :desc => 'add a comment to the pull request for this branch. Creates a new PR if none exists.'
12
+ method_option :resume, type: :string, aliases: '-r', desc: 'resume merging of feature-branch'
13
+ method_option :comment, type: :boolean, aliases: '-c', desc: 'add a comment to the pull request for this branch. Creates a new PR if none exists.'
14
14
  def integrate(integration_branch = 'staging')
15
15
  assert_aggregate_branch!(integration_branch)
16
16
 
@@ -20,7 +20,7 @@ module Gitx
20
20
  begin
21
21
  execute_command(UpdateCommand, :update)
22
22
  rescue
23
- fail MergeError, 'Merge Conflict Occurred. Please Merge Conflict Occurred. Please fix merge conflict and rerun the integrate command'
23
+ raise MergeError, 'Merge Conflict Occurred. Please Merge Conflict Occurred. Please fix merge conflict and rerun the integrate command'
24
24
  end
25
25
 
26
26
  integrate_branch(branch, integration_branch) unless options[:resume]
@@ -44,7 +44,7 @@ module Gitx
44
44
  begin
45
45
  run_cmd "git merge #{branch}"
46
46
  rescue
47
- fail MergeError, "Merge Conflict Occurred. Please fix merge conflict and rerun command with --resume #{branch} flag"
47
+ raise MergeError, "Merge Conflict Occurred. Please fix merge conflict and rerun command with --resume #{branch} flag"
48
48
  end
49
49
  run_cmd 'git push origin HEAD'
50
50
  end
@@ -63,7 +63,7 @@ module Gitx
63
63
  def fetch_remote_branch(target_branch)
64
64
  create_remote_branch(target_branch) unless remote_branch_exists?(target_branch)
65
65
  run_cmd 'git fetch origin'
66
- run_cmd "git branch -D #{target_branch}", :allow_failure => true
66
+ run_cmd "git branch -D #{target_branch}", allow_failure: true
67
67
  checkout_branch target_branch
68
68
  end
69
69
 
@@ -6,7 +6,7 @@ module Gitx
6
6
  module Cli
7
7
  class NukeCommand < BaseCommand
8
8
  desc 'nuke', 'nuke the specified aggregate branch and reset it to a known good state'
9
- method_option :destination, :type => :string, :aliases => '-d', :desc => 'destination branch to reset to'
9
+ method_option :destination, type: :string, aliases: '-d', desc: 'destination branch to reset to'
10
10
  def nuke(bad_branch)
11
11
  good_branch = options[:destination] || ask("What branch do you want to reset #{bad_branch} to? (default: #{bad_branch})")
12
12
  good_branch = bad_branch if good_branch.length == 0
@@ -22,8 +22,8 @@ module Gitx
22
22
  say last_known_good_tag, :green
23
23
 
24
24
  checkout_branch Gitx::BASE_BRANCH
25
- run_cmd "git branch -D #{bad_branch}", :allow_failure => true
26
- run_cmd "git push origin --delete #{bad_branch}", :allow_failure => true
25
+ run_cmd "git branch -D #{bad_branch}", allow_failure: true
26
+ run_cmd "git push origin --delete #{bad_branch}", allow_failure: true
27
27
  run_cmd "git checkout -b #{bad_branch} #{last_known_good_tag}"
28
28
  run_cmd "git push origin #{bad_branch}"
29
29
  run_cmd "git branch --set-upstream-to origin/#{bad_branch}"
@@ -39,7 +39,7 @@ module Gitx
39
39
 
40
40
  say "#{bad_branch} contains migrations that may need to be reverted. Ensure any reversable migrations are reverted on affected databases before nuking.", :red
41
41
  say 'Example commands to revert outdated migrations:'
42
- outdated_migrations.reverse.each do |migration|
42
+ outdated_migrations.reverse_each do |migration|
43
43
  version = File.basename(migration).split('_').first
44
44
  say "rake db:migrate:down VERSION=#{version}"
45
45
  end
@@ -48,7 +48,7 @@ module Gitx
48
48
 
49
49
  def current_build_tag(branch)
50
50
  last_build_tag = build_tags_for_branch(branch).last
51
- raise "No known good tag found for branch: #{branch}. Verify tag exists via `git tag -l 'build-#{branch}-*'`" unless last_build_tag
51
+ fail "No known good tag found for branch: #{branch}. Verify tag exists via `git tag -l 'build-#{branch}-*'`" unless last_build_tag
52
52
  last_build_tag
53
53
  end
54
54
 
@@ -12,7 +12,7 @@ module Gitx
12
12
  include Gitx::Github
13
13
 
14
14
  desc 'release', 'release the current branch to production'
15
- method_option :cleanup, :type => :boolean, :desc => 'cleanup merged branches after release'
15
+ method_option :cleanup, type: :boolean, desc: 'cleanup merged branches after release'
16
16
  def release(branch = nil)
17
17
  return unless yes?("Release #{current_branch.name} to production? (y/n)", :green)
18
18
 
@@ -10,34 +10,34 @@ module Gitx
10
10
 
11
11
  BUMP_COMMENT_PREFIX = '[gitx] review bump :tada:'
12
12
  BUMP_COMMENT_FOOTER = <<-EOS.dedent
13
- # Bump comments should include:
14
- # * summary of what changed
15
- #
16
- # This footer will automatically be stripped from the created comment
13
+ # Bump comments should include:
14
+ # * summary of what changed
15
+ #
16
+ # This footer will automatically be stripped from the created comment
17
17
  EOS
18
18
  APPROVAL_COMMENT_PREFIX = '[gitx] review approved :shipit:'
19
19
  APPROVAL_COMMENT_FOOTER = <<-EOS.dedent
20
- # Approval comments can include:
21
- # * feedback
22
- # * post-release follow-up items
23
- #
24
- # This footer will automatically be stripped from the created comment
20
+ # Approval comments can include:
21
+ # * feedback
22
+ # * post-release follow-up items
23
+ #
24
+ # This footer will automatically be stripped from the created comment
25
25
  EOS
26
26
  REJECTION_COMMENT_PREFIX = '[gitx] review rejected'
27
27
  REJECTION_COMMENT_FOOTER = <<-EOS.dedent
28
- # Rejection comments should include:
29
- # * feedback for fixes required before approved
30
- #
31
- # This footer will automatically be stripped from the created comment
28
+ # Rejection comments should include:
29
+ # * feedback for fixes required before approved
30
+ #
31
+ # This footer will automatically be stripped from the created comment
32
32
  EOS
33
33
 
34
34
  desc 'review', 'Create or update a pull request on github'
35
- method_option :description, :type => :string, :aliases => '-d', :desc => 'pull request description'
36
- method_option :assignee, :type => :string, :aliases => '-a', :desc => 'pull request assignee'
37
- method_option :open, :type => :boolean, :aliases => '-o', :desc => 'open the pull request in a web browser'
38
- method_option :bump, :type => :boolean, :aliases => '-b', :desc => 'bump an existing pull request by posting a comment to re-review new changes'
39
- method_option :approve, :type => :boolean, :desc => 'approve the pull request an post comment on pull request'
40
- method_option :reject, :type => :boolean, :desc => 'reject the pull request an post comment on pull request'
35
+ method_option :description, type: :string, aliases: '-d', desc: 'pull request description'
36
+ method_option :assignee, type: :string, aliases: '-a', desc: 'pull request assignee'
37
+ method_option :open, type: :boolean, aliases: '-o', desc: 'open the pull request in a web browser'
38
+ method_option :bump, type: :boolean, aliases: '-b', desc: 'bump an existing pull request by posting a comment to re-review new changes'
39
+ method_option :approve, type: :boolean, desc: 'approve the pull request an post comment on pull request'
40
+ method_option :reject, type: :boolean, desc: 'reject the pull request an post comment on pull request'
41
41
  # @see http://developer.github.com/v3/pulls/
42
42
  def review(branch = nil)
43
43
  fail 'Github authorization token not found' unless authorization_token
@@ -68,17 +68,17 @@ module Gitx
68
68
  end
69
69
 
70
70
  def bump_pull_request(pull_request)
71
- comment = comment_from_template(pull_request, BUMP_COMMENT_PREFIX, BUMP_COMMENT_FOOTER)
71
+ comment_from_template(pull_request, BUMP_COMMENT_PREFIX, BUMP_COMMENT_FOOTER)
72
72
  update_review_status(pull_request, 'pending', 'Peer review in progress')
73
73
  end
74
74
 
75
75
  def reject_pull_request(pull_request)
76
- comment = comment_from_template(pull_request, REJECTION_COMMENT_PREFIX, REJECTION_COMMENT_FOOTER)
76
+ comment_from_template(pull_request, REJECTION_COMMENT_PREFIX, REJECTION_COMMENT_FOOTER)
77
77
  update_review_status(pull_request, 'failure', 'Peer review rejected')
78
78
  end
79
79
 
80
80
  def approve_pull_request(pull_request)
81
- comment = comment_from_template(pull_request, APPROVAL_COMMENT_PREFIX, APPROVAL_COMMENT_FOOTER)
81
+ comment_from_template(pull_request, APPROVAL_COMMENT_PREFIX, APPROVAL_COMMENT_FOOTER)
82
82
  update_review_status(pull_request, 'success', 'Peer review approved')
83
83
  end
84
84
 
@@ -20,11 +20,9 @@ module Gitx
20
20
  private
21
21
 
22
22
  def update_branch(branch)
23
- begin
24
- run_cmd "git pull origin #{branch}"
25
- rescue
26
- fail MergeError, 'Merge Conflict Occurred. Please fix merge conflict and rerun the update command'
27
- end
23
+ run_cmd "git pull origin #{branch}"
24
+ rescue
25
+ raise MergeError, 'Merge Conflict Occurred. Please fix merge conflict and rerun the update command'
28
26
  end
29
27
 
30
28
  def remote_branch_exists?(branch)
@@ -4,9 +4,9 @@ class String
4
4
  indent = scan(/^[ \t]*(?=\S)/).min.size || 0
5
5
  gsub(/^[ \t]{#{indent}}/, '')
6
6
  end
7
- alias :dedent :undent
7
+ alias_method :dedent, :undent
8
8
 
9
9
  def blank?
10
- self.to_s == ''
10
+ to_s == ''
11
11
  end
12
12
  end
@@ -103,12 +103,12 @@ module Gitx
103
103
  password = ask_without_echo("Github password for #{username}: ")
104
104
  client = Octokit::Client.new(login: username, password: password)
105
105
  options = {
106
- :scopes => ['repo'],
107
- :note => github_client_name,
108
- :note_url => CLIENT_URL
106
+ scopes: ['repo'],
107
+ note: github_client_name,
108
+ note_url: CLIENT_URL
109
109
  }
110
110
  two_factor_auth_token = ask_without_echo('Github two factor authorization token (if enabled): ')
111
- options[:headers] = {'X-GitHub-OTP' => two_factor_auth_token} if two_factor_auth_token
111
+ options[:headers] = { 'X-GitHub-OTP' => two_factor_auth_token } if two_factor_auth_token
112
112
  response = client.create_authorization(options)
113
113
  response.token
114
114
  rescue Octokit::ClientError => e
@@ -122,7 +122,7 @@ module Gitx
122
122
  end
123
123
 
124
124
  def github_client
125
- @client ||= Octokit::Client.new(:access_token => authorization_token)
125
+ @client ||= Octokit::Client.new(access_token: authorization_token)
126
126
  end
127
127
 
128
128
  # @return [String] github username (ex: 'wireframe') of the current github.user
@@ -140,7 +140,7 @@ module Gitx
140
140
  # https://github.com/wireframe/gitx.git #=> wireframe/gitx
141
141
  def github_slug
142
142
  remote = repo.config['remote.origin.url']
143
- remote.to_s.gsub(/\.git$/,'').split(/[:\/]/).last(2).join('/')
143
+ remote.to_s.gsub(/\.git$/, '').split(/[:\/]/).last(2).join('/')
144
144
  end
145
145
 
146
146
  def github_organization
@@ -153,13 +153,13 @@ module Gitx
153
153
 
154
154
  def global_config
155
155
  @config ||= begin
156
- File.exists?(global_config_file) ? YAML.load_file(global_config_file) : {}
156
+ File.exist?(global_config_file) ? YAML.load_file(global_config_file) : {}
157
157
  end
158
158
  end
159
159
 
160
160
  def save_global_config(options)
161
161
  config_dir = File.dirname(global_config_file)
162
- ::FileUtils.mkdir_p(config_dir, mode: 0700) unless File.exists?(config_dir)
162
+ ::FileUtils.mkdir_p(config_dir, mode: 0700) unless File.exist?(config_dir)
163
163
 
164
164
  @config = global_config.merge(options)
165
165
  File.open(global_config_file, 'a+') do |file|
@@ -1,3 +1,3 @@
1
1
  module Gitx
2
- VERSION = '2.13.2'
2
+ VERSION = '2.13.3'
3
3
  end
@@ -21,9 +21,9 @@ describe Gitx::Cli::BaseCommand do
21
21
  describe 'with custom .gitx.yml config file' do
22
22
  let(:config) do
23
23
  {
24
- 'aggregate_branches' => %w( foo bar ),
25
- 'reserved_branches' => %w( baz qux ),
26
- 'taggable_branches' => %w( quux corge )
24
+ 'aggregate_branches' => %w( foo bar ),
25
+ 'reserved_branches' => %w( baz qux ),
26
+ 'taggable_branches' => %w( quux corge )
27
27
  }
28
28
  end
29
29
  before do
@@ -38,7 +38,7 @@ describe Gitx::Cli::IntegrateCommand do
38
38
  expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
39
39
  expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered
40
40
 
41
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
41
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
42
42
 
43
43
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
44
44
  cli.integrate
@@ -91,7 +91,7 @@ describe Gitx::Cli::IntegrateCommand do
91
91
  expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
92
92
  expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered
93
93
 
94
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
94
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
95
95
 
96
96
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
97
97
  cli.integrate
@@ -115,7 +115,7 @@ describe Gitx::Cli::IntegrateCommand do
115
115
  expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
116
116
  expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered
117
117
 
118
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
118
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
119
119
 
120
120
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
121
121
  cli.integrate 'prototype'
@@ -174,7 +174,7 @@ describe Gitx::Cli::IntegrateCommand do
174
174
  expect(cli).not_to receive(:run_cmd).with('git push origin HEAD')
175
175
  expect(cli).to receive(:run_cmd).with('git checkout feature-branch')
176
176
 
177
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
177
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
178
178
 
179
179
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
180
180
  cli.integrate
@@ -201,7 +201,7 @@ describe Gitx::Cli::IntegrateCommand do
201
201
  expect(cli).not_to receive(:run_cmd).with('git push origin HEAD')
202
202
  expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered
203
203
 
204
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
204
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
205
205
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
206
206
  cli.integrate
207
207
  end
@@ -227,7 +227,7 @@ describe Gitx::Cli::IntegrateCommand do
227
227
  expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
228
228
  expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered
229
229
 
230
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
230
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
231
231
 
232
232
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
233
233
  cli.integrate
@@ -237,8 +237,8 @@ describe Gitx::Cli::IntegrateCommand do
237
237
  should meet_expectations
238
238
  end
239
239
  it 'posts comment to pull request' do
240
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').
241
- with(body: {body: '[gitx] integrated into staging :twisted_rightwards_arrows:'})
240
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
241
+ .with(body: { body: '[gitx] integrated into staging :twisted_rightwards_arrows:' })
242
242
  end
243
243
  end
244
244
  context 'with --comment flag when a pull request doesn\'t exist for the feature-branch' do
@@ -271,8 +271,8 @@ describe Gitx::Cli::IntegrateCommand do
271
271
  expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered
272
272
  expect(cli).to receive(:run_cmd).with("git log master...feature-branch --reverse --no-merges --pretty=format:'* %s%n%b'").and_return('2013-01-01 did some stuff').ordered
273
273
 
274
- stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(:status => 201, :body => new_pull_request.to_json, :headers => {'Content-Type' => 'application/json'})
275
- stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').to_return(:status => 201)
274
+ stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(status: 201, body: new_pull_request.to_json, headers: { 'Content-Type' => 'application/json' })
275
+ stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').to_return(status: 201)
276
276
 
277
277
  VCR.use_cassette('pull_request_does_not_exist') do
278
278
  cli.integrate
@@ -282,8 +282,8 @@ describe Gitx::Cli::IntegrateCommand do
282
282
  should meet_expectations
283
283
  end
284
284
  it 'creates github comment for integration' do
285
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').
286
- with(body: {body: '[gitx] integrated into staging :twisted_rightwards_arrows:'})
285
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
286
+ .with(body: { body: '[gitx] integrated into staging :twisted_rightwards_arrows:' })
287
287
  end
288
288
  end
289
289
  end
@@ -128,7 +128,7 @@ describe Gitx::Cli::ReleaseCommand do
128
128
  expect(cli).to receive(:run_cmd).with('git merge --no-ff feature-branch').ordered
129
129
  expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
130
130
 
131
- stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(:status => 201, :body => new_pull_request.to_json, :headers => {'Content-Type' => 'application/json'})
131
+ stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(status: 201, body: new_pull_request.to_json, headers: { 'Content-Type' => 'application/json' })
132
132
  VCR.use_cassette('pull_request_does_not_exist') do
133
133
  cli.release
134
134
  end
@@ -47,7 +47,7 @@ describe Gitx::Cli::ReviewCommand do
47
47
  expect(cli).to receive(:run_cmd).with("git log master...feature-branch --reverse --no-merges --pretty=format:'* %s%n%b'").and_return("* old commit\n\n* new commit").ordered
48
48
  expect(cli).to receive(:ask_editor).with("### Changelog\n* old commit\n\n* new commit\n#{Gitx::Github::PULL_REQUEST_FOOTER}", anything).and_return('description')
49
49
 
50
- stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(:status => 201, :body => new_pull_request.to_json, :headers => {'Content-Type' => 'application/json'})
50
+ stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(status: 201, body: new_pull_request.to_json, headers: { 'Content-Type' => 'application/json' })
51
51
 
52
52
  VCR.use_cassette('pull_request_does_not_exist') do
53
53
  cli.review
@@ -82,7 +82,7 @@ describe Gitx::Cli::ReviewCommand do
82
82
  expect(cli).to receive(:run_cmd).with("git log master...feature-branch --reverse --no-merges --pretty=format:'* %s%n%b'").and_return("* old commit\n\n* new commit").ordered
83
83
  expect(cli).to receive(:ask_editor).with("### Changelog\n* old commit\n\n* new commit\n#{Gitx::Github::PULL_REQUEST_FOOTER}", anything).and_return('description')
84
84
 
85
- stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(:status => 201, :body => new_pull_request.to_json, :headers => {'Content-Type' => 'application/json'})
85
+ stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(status: 201, body: new_pull_request.to_json, headers: { 'Content-Type' => 'application/json' })
86
86
 
87
87
  VCR.use_cassette('pull_request_does_not_exist') do
88
88
  cli.review 'feature-branch'
@@ -126,7 +126,7 @@ describe Gitx::Cli::ReviewCommand do
126
126
  before do
127
127
  allow(cli).to receive(:authorization_token).and_return(authorization_token)
128
128
 
129
- stub_request(:patch, /.*api.github.com.*/).to_return(:status => 200)
129
+ stub_request(:patch, /.*api.github.com.*/).to_return(status: 200)
130
130
 
131
131
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
132
132
  cli.review
@@ -166,19 +166,19 @@ describe Gitx::Cli::ReviewCommand do
166
166
  allow(cli).to receive(:authorization_token).and_return(authorization_token)
167
167
  expect(cli).to receive(:ask_editor).and_return('comment description')
168
168
  allow(repo).to receive(:head).and_return(reference)
169
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
169
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
170
170
 
171
171
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
172
172
  cli.review
173
173
  end
174
174
  end
175
175
  it 'posts comment to github' do
176
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').
177
- with(body: {body: "[gitx] review bump :tada:\n\ncomment description"})
176
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
177
+ .with(body: { body: "[gitx] review bump :tada:\n\ncomment description" })
178
178
  end
179
179
  it 'creates pending build status for latest commit' do
180
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/statuses/e12da4').
181
- with(body: {state: 'pending', context: 'peer_review', description: 'Peer review in progress'})
180
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/statuses/e12da4')
181
+ .with(body: { state: 'pending', context: 'peer_review', description: 'Peer review in progress' })
182
182
  end
183
183
  end
184
184
  context 'when --reject flag is passed' do
@@ -193,19 +193,19 @@ describe Gitx::Cli::ReviewCommand do
193
193
  allow(cli).to receive(:authorization_token).and_return(authorization_token)
194
194
  expect(cli).to receive(:ask_editor).and_return('comment body')
195
195
  allow(repo).to receive(:head).and_return(reference)
196
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
196
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
197
197
 
198
198
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
199
199
  cli.review
200
200
  end
201
201
  end
202
202
  it 'posts comment to github' do
203
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').
204
- with(body: {body: "[gitx] review rejected\n\ncomment body"})
203
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
204
+ .with(body: { body: "[gitx] review rejected\n\ncomment body" })
205
205
  end
206
206
  it 'creates failure build status for latest commit' do
207
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/statuses/e12da4').
208
- with(body: {state: 'failure', context: 'peer_review', description: 'Peer review rejected'})
207
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/statuses/e12da4')
208
+ .with(body: { state: 'failure', context: 'peer_review', description: 'Peer review rejected' })
209
209
  end
210
210
  end
211
211
  context 'when --approve flag is passed' do
@@ -220,19 +220,19 @@ describe Gitx::Cli::ReviewCommand do
220
220
  allow(cli).to receive(:authorization_token).and_return(authorization_token)
221
221
  expect(cli).to receive(:ask_editor).and_return('comment body')
222
222
  allow(repo).to receive(:head).and_return(reference)
223
- stub_request(:post, /.*api.github.com.*/).to_return(:status => 201)
223
+ stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
224
224
 
225
225
  VCR.use_cassette('pull_request_does_exist_with_success_status') do
226
226
  cli.review
227
227
  end
228
228
  end
229
229
  it 'posts comment to github' do
230
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').
231
- with(body: {body: "[gitx] review approved :shipit:\n\ncomment body"})
230
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
231
+ .with(body: { body: "[gitx] review approved :shipit:\n\ncomment body" })
232
232
  end
233
233
  it 'creates success build status for latest commit' do
234
- expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/statuses/e12da4').
235
- with(body: {state: 'success', context: 'peer_review', description: 'Peer review approved'})
234
+ expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/statuses/e12da4')
235
+ .with(body: { state: 'success', context: 'peer_review', description: 'Peer review approved' })
236
236
  end
237
237
  end
238
238
  end
@@ -268,11 +268,11 @@ describe Gitx::Cli::ReviewCommand do
268
268
  let(:github_password) { 'secretz' }
269
269
  let(:authorization_token) { '123981239123' }
270
270
  before do
271
- stub_request(:post, 'https://ryan@codecrate.com:secretz@api.github.com/authorizations').
272
- to_return(:status => 200, :body => JSON.dump(token: authorization_token), :headers => {'Content-Type' => 'application/json'})
271
+ stub_request(:post, 'https://ryan@codecrate.com:secretz@api.github.com/authorizations')
272
+ .to_return(status: 200, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
273
273
 
274
- expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', {:echo => false}).and_return(github_password)
275
- expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', {:echo => false}).and_return(nil)
274
+ expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', echo: false).and_return(github_password)
275
+ expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', echo: false).and_return(nil)
276
276
 
277
277
  @auth_token = cli.send(:authorization_token)
278
278
  end
@@ -291,13 +291,13 @@ describe Gitx::Cli::ReviewCommand do
291
291
  let(:github_password) { 'secretz' }
292
292
  let(:authorization_token) { '123981239123' }
293
293
  before do
294
- stub_request(:post, 'https://ryan@codecrate.com:secretz@api.github.com/authorizations').
295
- to_return(:status => 401, :body => JSON.dump(token: authorization_token), :headers => {'Content-Type' => 'application/json'}).
296
- then.
297
- to_return(:status => 200, :body => JSON.dump(token: authorization_token), :headers => {'Content-Type' => 'application/json'})
294
+ stub_request(:post, 'https://ryan@codecrate.com:secretz@api.github.com/authorizations')
295
+ .to_return(status: 401, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
296
+ .then
297
+ .to_return(status: 200, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
298
298
 
299
- expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', {:echo => false}).and_return(github_password).twice
300
- expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', {:echo => false}).and_return(nil).twice
299
+ expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', echo: false).and_return(github_password).twice
300
+ expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', echo: false).and_return(nil).twice
301
301
 
302
302
  @auth_token = cli.send(:authorization_token)
303
303
  end
@@ -338,12 +338,12 @@ describe Gitx::Cli::ReviewCommand do
338
338
  let(:authorization_token) { '123981239123' }
339
339
  let(:two_factor_auth_token) { '456456' }
340
340
  before do
341
- stub_request(:post, 'https://ryan@codecrate.com:secretz@api.github.com/authorizations').
342
- with(headers: {'X-GitHub-OTP' => two_factor_auth_token}).
343
- to_return(:status => 200, :body => JSON.dump(token: authorization_token), :headers => {'Content-Type' => 'application/json'})
341
+ stub_request(:post, 'https://ryan@codecrate.com:secretz@api.github.com/authorizations')
342
+ .with(headers: { 'X-GitHub-OTP' => two_factor_auth_token })
343
+ .to_return(status: 200, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
344
344
 
345
- expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', {:echo => false}).and_return(github_password)
346
- expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', {:echo => false}).and_return(two_factor_auth_token)
345
+ expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', echo: false).and_return(github_password)
346
+ expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', echo: false).and_return(two_factor_auth_token)
347
347
 
348
348
  @auth_token = cli.send(:authorization_token)
349
349
  end
@@ -1,6 +1,6 @@
1
1
  # empty matcher to allow for mock expectations to fire
2
- RSpec::Matchers.define :meet_expectations do |expected|
3
- match do |actual|
2
+ RSpec::Matchers.define :meet_expectations do |_expected|
3
+ match do |_actual|
4
4
  # do nothing
5
5
  expect(true).to be true
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitx
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.2
4
+ version: 2.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
@@ -220,6 +220,20 @@ dependencies:
220
220
  - - ">="
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: rubocop
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
223
237
  description: Git eXtensions for improved development workflow
224
238
  email:
225
239
  - ryan.sonnek@gmail.com
@@ -238,7 +252,9 @@ extensions: []
238
252
  extra_rdoc_files: []
239
253
  files:
240
254
  - ".gitignore"
255
+ - ".hound.yml"
241
256
  - ".rspec"
257
+ - ".rubocop.yml"
242
258
  - ".ruby-version"
243
259
  - ".travis.yml"
244
260
  - CONTRIBUTING.md