thegarage-gitx 2.1.1 → 2.2.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 +4 -4
- data/.gitignore +3 -0
- data/README.md +8 -2
- data/bin/git-review +5 -0
- data/bin/git-reviewrequest +5 -3
- data/lib/thegarage/gitx/cli/{review_request_command.rb → review_command.rb} +3 -3
- data/lib/thegarage/gitx/version.rb +1 -1
- data/spec/thegarage/gitx/cli/{review_request_command_spec.rb → review_command_spec.rb} +9 -9
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 152c875f8eb8b86aad9094c529e6e547137a2212
|
4
|
+
data.tar.gz: 9f3db5ede9c825be43ca41b136ae2df7ed9dd29c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30e2e170892d5d28f703defed75a891bc0ce2c66b76901e8f2e443727c18eabf4cd567f131a5812a95150c8f02c226e4f099caf6f651a6a5d8cc3609c64f111d
|
7
|
+
data.tar.gz: 47c016b57019b11d853a5c7f6695cac46bf72025d9ca4fdee0553c7f605a327f829d0d813704d762d7a57d7b0961f7c0b79d9602a8bc20e529a098700f7930ec
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -26,9 +26,15 @@ update the local feature branch with latest remote changes plus upstream release
|
|
26
26
|
|
27
27
|
integrate the current feature branch into an aggregate branch (ex: prototype, staging)
|
28
28
|
|
29
|
-
## git
|
29
|
+
## git review
|
30
|
+
|
31
|
+
create a pull request on github for peer review of the current branch. This command is re-runnable
|
32
|
+
in order to re-assign pull requests.
|
33
|
+
|
34
|
+
options:
|
35
|
+
* `--assign` or `-a` = assign pull request to github user
|
36
|
+
* `--open` or `-o` = open pull request in default web browser.
|
30
37
|
|
31
|
-
create a pull request on github for peer review of the current branch.
|
32
38
|
|
33
39
|
## git release
|
34
40
|
|
data/bin/git-review
ADDED
data/bin/git-reviewrequest
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
puts 'WARNING: git reviewrequest has been deprecated. use `git review` instead'
|
4
|
+
|
5
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'thegarage/gitx/cli', 'review_command.rb')
|
6
|
+
args = ARGV.dup.unshift('review')
|
7
|
+
Thegarage::Gitx::Cli::ReviewCommand.start(args)
|
@@ -8,7 +8,7 @@ require 'rest_client'
|
|
8
8
|
module Thegarage
|
9
9
|
module Gitx
|
10
10
|
module Cli
|
11
|
-
class
|
11
|
+
class ReviewCommand < BaseCommand
|
12
12
|
CLIENT_URL = 'https://github.com/thegarage/thegarage-gitx'
|
13
13
|
PULL_REQUEST_FOOTER = <<-EOS.dedent
|
14
14
|
# Pull Request Protips(tm):
|
@@ -19,12 +19,12 @@ module Thegarage
|
|
19
19
|
# This footer will automatically be stripped from the pull request description
|
20
20
|
EOS
|
21
21
|
|
22
|
-
desc "
|
22
|
+
desc "review", "Create or update a pull request on github"
|
23
23
|
method_option :description, :type => :string, :aliases => '-d', :desc => 'pull request description'
|
24
24
|
method_option :assignee, :type => :string, :aliases => '-a', :desc => 'pull request assignee'
|
25
25
|
method_option :open, :type => :boolean, :aliases => '-o', :desc => 'open the pull request in a web browser'
|
26
26
|
# @see http://developer.github.com/v3/pulls/
|
27
|
-
def
|
27
|
+
def review
|
28
28
|
fail 'Github authorization token not found' unless authorization_token
|
29
29
|
|
30
30
|
branch = current_branch.name
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'thegarage/gitx/cli/
|
2
|
+
require 'thegarage/gitx/cli/review_command'
|
3
3
|
|
4
|
-
describe Thegarage::Gitx::Cli::
|
4
|
+
describe Thegarage::Gitx::Cli::ReviewCommand do
|
5
5
|
let(:args) { [] }
|
6
6
|
let(:options) { {} }
|
7
7
|
let(:config) do
|
@@ -9,7 +9,7 @@ describe Thegarage::Gitx::Cli::ReviewRequestCommand do
|
|
9
9
|
pretend: true
|
10
10
|
}
|
11
11
|
end
|
12
|
-
let(:cli) { Thegarage::Gitx::Cli::
|
12
|
+
let(:cli) { Thegarage::Gitx::Cli::ReviewCommand.new(args, options, config) }
|
13
13
|
let(:repo) { double('fake repo', config: repo_config) }
|
14
14
|
let(:repo_config) do
|
15
15
|
{
|
@@ -23,7 +23,7 @@ describe Thegarage::Gitx::Cli::ReviewRequestCommand do
|
|
23
23
|
allow(cli).to receive(:current_branch).and_return(branch)
|
24
24
|
end
|
25
25
|
|
26
|
-
describe '#
|
26
|
+
describe '#review' do
|
27
27
|
let(:pull_request) do
|
28
28
|
{
|
29
29
|
'html_url' => 'https://path/to/new/pull/request',
|
@@ -43,7 +43,7 @@ describe Thegarage::Gitx::Cli::ReviewRequestCommand do
|
|
43
43
|
expect(cli).to receive(:find_pull_request).and_return(nil)
|
44
44
|
expect(cli).to receive(:create_pull_request).and_return(pull_request)
|
45
45
|
expect(cli).to receive(:run_cmd).with("git log master...feature-branch --no-merges --pretty=format:'* %s%n%b'").and_return("2013-01-01 did some stuff").ordered
|
46
|
-
cli.
|
46
|
+
cli.review
|
47
47
|
end
|
48
48
|
it 'creates github pull request' do
|
49
49
|
should meet_expectations
|
@@ -56,7 +56,7 @@ describe Thegarage::Gitx::Cli::ReviewRequestCommand do
|
|
56
56
|
let(:authorization_token) { nil }
|
57
57
|
it do
|
58
58
|
expect(cli).to receive(:authorization_token).and_return(authorization_token)
|
59
|
-
expect { cli.
|
59
|
+
expect { cli.review }.to raise_error(/token not found/)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
context 'when pull request already exists' do
|
@@ -66,7 +66,7 @@ describe Thegarage::Gitx::Cli::ReviewRequestCommand do
|
|
66
66
|
expect(cli).to receive(:find_pull_request).and_return(pull_request)
|
67
67
|
expect(cli).to_not receive(:create_pull_request)
|
68
68
|
|
69
|
-
cli.
|
69
|
+
cli.review
|
70
70
|
end
|
71
71
|
it 'does not create new pull request' do
|
72
72
|
should meet_expectations
|
@@ -84,7 +84,7 @@ describe Thegarage::Gitx::Cli::ReviewRequestCommand do
|
|
84
84
|
expect(cli).to receive(:find_pull_request).and_return(pull_request)
|
85
85
|
expect(cli).to receive(:assign_pull_request)
|
86
86
|
|
87
|
-
cli.
|
87
|
+
cli.review
|
88
88
|
end
|
89
89
|
it 'calls assign_pull_request method' do
|
90
90
|
should meet_expectations
|
@@ -101,7 +101,7 @@ describe Thegarage::Gitx::Cli::ReviewRequestCommand do
|
|
101
101
|
expect(cli).to receive(:authorization_token).and_return(authorization_token)
|
102
102
|
expect(cli).to receive(:find_pull_request).and_return(pull_request)
|
103
103
|
expect(cli).to receive(:run_cmd).with("open #{pull_request['html_url']}").ordered
|
104
|
-
cli.
|
104
|
+
cli.review
|
105
105
|
end
|
106
106
|
it 'runs open command with pull request url' do
|
107
107
|
should meet_expectations
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thegarage-gitx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
@@ -187,6 +187,7 @@ executables:
|
|
187
187
|
- git-integrate
|
188
188
|
- git-nuke
|
189
189
|
- git-release
|
190
|
+
- git-review
|
190
191
|
- git-reviewrequest
|
191
192
|
- git-share
|
192
193
|
- git-start
|
@@ -211,6 +212,7 @@ files:
|
|
211
212
|
- bin/git-integrate
|
212
213
|
- bin/git-nuke
|
213
214
|
- bin/git-release
|
215
|
+
- bin/git-review
|
214
216
|
- bin/git-reviewrequest
|
215
217
|
- bin/git-share
|
216
218
|
- bin/git-start
|
@@ -224,7 +226,7 @@ files:
|
|
224
226
|
- lib/thegarage/gitx/cli/integrate_command.rb
|
225
227
|
- lib/thegarage/gitx/cli/nuke_command.rb
|
226
228
|
- lib/thegarage/gitx/cli/release_command.rb
|
227
|
-
- lib/thegarage/gitx/cli/
|
229
|
+
- lib/thegarage/gitx/cli/review_command.rb
|
228
230
|
- lib/thegarage/gitx/cli/share_command.rb
|
229
231
|
- lib/thegarage/gitx/cli/start_command.rb
|
230
232
|
- lib/thegarage/gitx/cli/track_command.rb
|
@@ -239,7 +241,7 @@ files:
|
|
239
241
|
- spec/thegarage/gitx/cli/integrate_command_spec.rb
|
240
242
|
- spec/thegarage/gitx/cli/nuke_command_spec.rb
|
241
243
|
- spec/thegarage/gitx/cli/release_command_spec.rb
|
242
|
-
- spec/thegarage/gitx/cli/
|
244
|
+
- spec/thegarage/gitx/cli/review_command_spec.rb
|
243
245
|
- spec/thegarage/gitx/cli/share_command_spec.rb
|
244
246
|
- spec/thegarage/gitx/cli/start_command_spec.rb
|
245
247
|
- spec/thegarage/gitx/cli/track_command_spec.rb
|
@@ -277,7 +279,7 @@ test_files:
|
|
277
279
|
- spec/thegarage/gitx/cli/integrate_command_spec.rb
|
278
280
|
- spec/thegarage/gitx/cli/nuke_command_spec.rb
|
279
281
|
- spec/thegarage/gitx/cli/release_command_spec.rb
|
280
|
-
- spec/thegarage/gitx/cli/
|
282
|
+
- spec/thegarage/gitx/cli/review_command_spec.rb
|
281
283
|
- spec/thegarage/gitx/cli/share_command_spec.rb
|
282
284
|
- spec/thegarage/gitx/cli/start_command_spec.rb
|
283
285
|
- spec/thegarage/gitx/cli/track_command_spec.rb
|