git-pr 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 97f85e7380c5d21763514b7f134fbdb3ab4edfab
4
- data.tar.gz: f49dd9ec88c5c315c5919cd53457fd4b3221d065
3
+ metadata.gz: a349aeee7e517bcdaf6fe93edbc0e131af4b69e6
4
+ data.tar.gz: eee98f48bad0ac912ed63e801f54f0b3b0335502
5
5
  SHA512:
6
- metadata.gz: c60cee0f39408928779a9ab1914dd09e22816f7be41f657050c63a9d9c245cb0994a145aa5940ee527fe7a94fa74489f54169df8ed8b43ce1a77c9ab0e12422f
7
- data.tar.gz: 92dace3a1b0acb054dac7e07c670f96523b4e47ed66d5aea980fa5e8e70f20558f58871def8e24a1ec52f959d2507d49722c396e377cf9f25691837883ed90b3
6
+ metadata.gz: 0687c892253a42d4d2d44be501538199ea47c58f228c52eed120a626c1359f8c8effc70e74a0e329b5396ba94cc29c036b3dad7981df9d34f139eadc0e758933
7
+ data.tar.gz: c4f73f5c9a8af5b8cdc98af12d0cc47204fadbb577fd5f45cb2afb99beb9d8f2c594864c607dfb5e7a767e4639eb543def0e2af451791cb53ffd24d067db8bc1
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.0.0-p247
1
+ ruby-2.1
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Git::Pr
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/nistude/git-pr.png?branch=master)](http://travis-ci.org/nistude/git-pr)
4
- [![Dependency Status](https://gemnasium.com/nistude/git-pr.png?travis)](https://gemnasium.com/nistude/git-pr)
5
4
  [![Code Climate](https://codeclimate.com/github/nistude/git-pr.png)](https://codeclimate.com/github/nistude/git-pr)
5
+ [![Dependency Status](https://gemnasium.com/nistude/git-pr.png?travis)](https://gemnasium.com/nistude/git-pr)
6
+ [![Gem Version](https://badge.fury.io/rb/git-pr.png)](http://badge.fury.io/rb/git-pr)
6
7
 
7
8
  `git-pr` facilitates GitHub pull requests.
8
9
 
@@ -28,11 +29,17 @@ and configure your git for github:
28
29
  $ git config --global github.user your_github_user_name
29
30
  $ git config --global github.token your_github_personal_access_token
30
31
 
32
+ To use a private GitHub Enterprise installation:
33
+
34
+ $ git config --global github.apiEndpoint https://my.server/api/v3
35
+
31
36
  ## Usage
32
37
 
33
38
  List pull requests:
34
39
 
35
40
  $ git pr list # open pull requests for the active repository
41
+ $ git pr list --all # open pull requests for all my user and
42
+ # organization repositories
36
43
 
37
44
  You can also configure repository profiles and use those to query multiple
38
45
  repositories at once:
data/git-pr.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
- spec.add_development_dependency 'pry-debugger'
22
+ spec.add_development_dependency 'pry-byebug'
23
23
  spec.add_development_dependency 'rake'
24
24
  spec.add_development_dependency 'rspec'
25
25
 
@@ -36,6 +36,10 @@ module Git
36
36
  when 'help', '-h', 'version'
37
37
  # no specific options
38
38
  when 'list'
39
+ opts.on('-a', '--all',
40
+ 'Show pull requests for all repositories') do
41
+ self.profile = :all
42
+ end
39
43
  opts.on('-m', '--mine',
40
44
  'Show only my pull requests') do
41
45
  self.mine = true
@@ -1,6 +1,10 @@
1
1
  module Git
2
2
  class Pr
3
3
  class GitProperties
4
+ def api_endpoint
5
+ `git config --get github.apiEndpoint`.chomp
6
+ end
7
+
4
8
  def api_token
5
9
  `git config --get github.token`.chomp
6
10
  end
data/lib/git/pr/github.rb CHANGED
@@ -11,12 +11,14 @@ module Git
11
11
  Octokit.configure do |c|
12
12
  c.login = @git.login
13
13
  c.password = @git.api_token
14
+ c.api_endpoint = @git.api_endpoint unless @git.api_endpoint.empty?
14
15
  end
15
16
  end
16
17
 
17
18
  def list_pull_requests(profile, mine)
18
19
  if profile
19
- repositories = @git.repository_profile(profile)
20
+ repositories = profile == :all ? all_repositories
21
+ : @git.repository_profile(profile)
20
22
  else
21
23
  repositories = [@git.repository]
22
24
  end
@@ -44,6 +46,18 @@ module Git
44
46
  message = e.message.match(/message: (.*)/)[1].sub(/ \/\/.*/, '')
45
47
  raise Failed, message
46
48
  end
49
+
50
+ private
51
+ def all_repositories
52
+ repositories = []
53
+
54
+ Octokit.organizations.map(&:login).each do |org|
55
+ repositories << Octokit.organization_repositories(org).map(&:full_name)
56
+ end
57
+ repositories << Octokit.repositories.map(&:full_name)
58
+
59
+ repositories
60
+ end
47
61
  end
48
62
  end
49
63
  end
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  class Pr
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-pr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikolay Sturm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-29 00:00:00.000000000 Z
11
+ date: 2014-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
- name: pry-debugger
28
+ name: pry-byebug
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: octokit
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.6'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.6'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: virtus
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.0'
97
97
  description: git-pr facilitates GitHub pull requests
@@ -102,11 +102,11 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - .gitignore
106
- - .rspec
107
- - .ruby-gemset
108
- - .ruby-version
109
- - .travis.yml
105
+ - ".gitignore"
106
+ - ".rspec"
107
+ - ".ruby-gemset"
108
+ - ".ruby-version"
109
+ - ".travis.yml"
110
110
  - Gemfile
111
111
  - LICENSE.txt
112
112
  - README.md
@@ -131,17 +131,17 @@ require_paths:
131
131
  - lib
132
132
  required_ruby_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - '>='
134
+ - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - '>='
139
+ - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 2.0.3
144
+ rubygems_version: 2.2.2
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: facilitates GitHub pull requests