pairing_matrix 2.2 → 2.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: 2bc6f132a4599b75f2fd0aaf4fa182a184b77921
4
- data.tar.gz: 764be9f4d5b27b53916f05f0c815bb3af1d8c1ae
3
+ metadata.gz: 24815eea652dd6a9d7d1f62332b4ffed2466dc51
4
+ data.tar.gz: 4307fdc039681b5239a3617a9ff7948167b294f6
5
5
  SHA512:
6
- metadata.gz: 36883e28711dc4a2f6aac128a6fdece23cda51a849eddbed1a0fdf8614858cddefa8fc5086b4d4b3fba485e44a6574683aef1762bde05b2f1900099a4721f79a
7
- data.tar.gz: 3ed8e52d880d28feda01184377923398a42fd2d4afe3a4e00ec9acb7433badde181c7362ea7014300a21e69c6b8f0dcf5b88c242dd1d9e35063a90d1c2b99a3e
6
+ metadata.gz: 49797662441633cf1d789eba302d0f1c5f5f8f8794fd0780498edb67fc47ceb271cd8530fd21a4ea00a1434243d66990e8d1b267d610d50b0f02301b76cfc3a7
7
+ data.tar.gz: 83abc81fff0cf1ca25928b3b343596f1c08c0691f57808ede5839a13e3d18fa03fc1d84f826daf1190d512ad1d88c19ecee492e74f17d18af33286ff64491531
data/README.md CHANGED
@@ -43,6 +43,12 @@ github_repos:
43
43
  - github_username/my_private_repo
44
44
  ```
45
45
 
46
+ #### github_url:
47
+ Add github url if you are using github enterprise. This entry can be skipped if you are using github.com.
48
+ Mention the API endpoint.
49
+
50
+ example: http://github.mycompany.com/api/v3/
51
+
46
52
  #### authors_regex:
47
53
  This regex is used to extract dev names from the commit message. You can verify your regex in irb console using the below command. If your regex is correct it will return an array of dev names.
48
54
 
@@ -95,6 +101,16 @@ github_repos:
95
101
  - github_username/my_public_repo2
96
102
  ```
97
103
 
104
+ ### Fetching data from github enterprise
105
+
106
+ ```yml
107
+ github_url: http://git.mycompany.com/api/v3/
108
+ authors_regex: ^.*\[([\w]*)(?:\/)?([\w]*)\].*$
109
+ github_repos:
110
+ - github_username/repo1
111
+ - github_username/repo2
112
+ ```
113
+
98
114
  ## Contributing
99
115
 
100
116
  1. Fork it ( https://github.com/ajitsing/pairing_matrix/fork )
@@ -1,12 +1,13 @@
1
1
  module PairingMatrix
2
2
  class Config
3
- attr_reader :repos, :authors_regex, :github_access_token, :github_repos
3
+ attr_reader :repos, :authors_regex, :github_access_token, :github_repos, :github_url
4
4
 
5
- def initialize(repos, authors_regex, github_access_token, github_repos)
5
+ def initialize(repos, authors_regex, github_access_token, github_repos, github_url)
6
6
  @repos = repos
7
7
  @authors_regex = authors_regex
8
8
  @github_access_token = github_access_token
9
9
  @github_repos = github_repos
10
+ @github_url = github_url
10
11
  end
11
12
 
12
13
  def fetch_from_github?
@@ -16,5 +17,9 @@ module PairingMatrix
16
17
  def has_github_access_token?
17
18
  !@github_access_token.nil? && !@github_access_token.empty?
18
19
  end
20
+
21
+ def github_enterprise?
22
+ !@github_url.nil? && !@github_url.empty?
23
+ end
19
24
  end
20
25
  end
@@ -13,7 +13,8 @@ module PairingMatrix
13
13
  raw_config['repos'],
14
14
  raw_config['authors_regex'],
15
15
  raw_config['github_access_token'],
16
- raw_config['github_repos']
16
+ raw_config['github_repos'],
17
+ raw_config['github_url']
17
18
  )
18
19
  end
19
20
  end
@@ -36,6 +36,7 @@ module PairingMatrix
36
36
  end
37
37
 
38
38
  def github_client
39
+ Octokit.configure {|c| c.api_endpoint = @config.github_url} if @config.github_enterprise?
39
40
  if @config.has_github_access_token?
40
41
  Octokit::Client.new(:access_token => @config.github_access_token)
41
42
  else
@@ -37,5 +37,9 @@ module PairingMatrix
37
37
  get '/matrix' do
38
38
  File.read(File.join(File.dirname(__FILE__), 'public/index.html'))
39
39
  end
40
+
41
+ get '/' do
42
+ redirect '/matrix'
43
+ end
40
44
  end
41
45
  end
@@ -1,3 +1,3 @@
1
1
  module PairingMatrix
2
- VERSION = '2.2'
2
+ VERSION = '2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pairing_matrix
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.2'
4
+ version: '2.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ajit Singh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-05 00:00:00.000000000 Z
11
+ date: 2018-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.13
131
+ rubygems_version: 2.5.2
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Draw pairing matrix from given repos and configurations