whatsup_github 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/linters/.ruby-lint.yml +11 -0
- data/.github/workflows/linter.yml +48 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/lib/whatsup_github/client.rb +40 -0
- data/lib/whatsup_github/pulls.rb +2 -10
- data/lib/whatsup_github/row_collector.rb +5 -2
- data/lib/whatsup_github/version.rb +1 -1
- metadata +6 -4
- data/lib/whatsup_github/members.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47baad7941df565f9c94827246aac88071c87bda1a975500e7365f0e225ec558
|
4
|
+
data.tar.gz: de4dc002c57c8a5cf7adb7a440ece5cbd135ba0941b450c3406308838a492ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83358141ba037b13e106d49e9d1bf23c22b2f41ddada945e87c8e3a5319c9f26e664f67e3db68a27799786f866d93b634cf6f9949ef3e0266a91dd2bfa65d3d6
|
7
|
+
data.tar.gz: 55babd4c4a276620f8c4ba198c1e6cd0e40eabc9385b674d6567d6f4607be2bb8b2ba19fa25164fae49c5f327f5b52dae55022f7defc09c6f93f3d1a3f8ec1b1
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
###########################
|
3
|
+
###########################
|
4
|
+
## Linter GitHub Actions ##
|
5
|
+
###########################
|
6
|
+
###########################
|
7
|
+
name: Lint Code Base
|
8
|
+
|
9
|
+
#
|
10
|
+
# Documentation:
|
11
|
+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
12
|
+
#
|
13
|
+
|
14
|
+
###################################
|
15
|
+
# Start the job on a pull request #
|
16
|
+
###################################
|
17
|
+
on:
|
18
|
+
pull_request
|
19
|
+
|
20
|
+
###############
|
21
|
+
# Set the Job #
|
22
|
+
###############
|
23
|
+
jobs:
|
24
|
+
super-lint:
|
25
|
+
# Set the agent to run on
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
|
28
|
+
##################
|
29
|
+
# Load all steps #
|
30
|
+
##################
|
31
|
+
steps:
|
32
|
+
##########################
|
33
|
+
# Checkout the code base #
|
34
|
+
##########################
|
35
|
+
- name: Checkout Code
|
36
|
+
uses: actions/checkout@v2
|
37
|
+
with:
|
38
|
+
# Full git history is needed to get a proper list of changed files within `super-linter`
|
39
|
+
fetch-depth: 0
|
40
|
+
|
41
|
+
################################
|
42
|
+
# Run Linter against code base #
|
43
|
+
################################
|
44
|
+
- name: Lint Code Base
|
45
|
+
uses: github/super-linter@v3
|
46
|
+
env:
|
47
|
+
VALIDATE_ALL_CODEBASE: false
|
48
|
+
DEFAULT_BRANCH: main
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'singleton'
|
4
|
+
|
5
|
+
# Client authorization
|
6
|
+
module WhatsupGithub
|
7
|
+
# Create a singleton object for Client.
|
8
|
+
# Authorize with a GitHub token from $WHATSUP_GITHUB_ACCESS_TOKEN if available
|
9
|
+
# Otherwise, use credentials from ~/.netrc
|
10
|
+
# Otherwise, continue as a Guest
|
11
|
+
class Client
|
12
|
+
include Singleton
|
13
|
+
|
14
|
+
WHATSUP_GITHUB_ACCESS_TOKEN = ENV['WHATSUP_GITHUB_ACCESS_TOKEN']
|
15
|
+
private_constant :WHATSUP_GITHUB_ACCESS_TOKEN
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
@client =
|
19
|
+
if WHATSUP_GITHUB_ACCESS_TOKEN
|
20
|
+
Octokit::Client.new(access_token: WHATSUP_GITHUB_ACCESS_TOKEN)
|
21
|
+
elsif File.exist? "#{ENV['HOME']}/.netrc"
|
22
|
+
Octokit::Client.new(netrc: true)
|
23
|
+
else
|
24
|
+
Octokit::Client.new
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def search_issues(query)
|
29
|
+
@client.search_issues(query)
|
30
|
+
end
|
31
|
+
|
32
|
+
def pull_request(repo, number)
|
33
|
+
@client.pull_request(repo, number)
|
34
|
+
end
|
35
|
+
|
36
|
+
def org_members(org)
|
37
|
+
@client.org_members(org)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/whatsup_github/pulls.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'octokit'
|
4
4
|
require_relative 'config_reader'
|
5
|
+
require_relative 'client'
|
5
6
|
|
6
7
|
module WhatsupGithub
|
7
8
|
# Gets issues found on GitHub by query
|
@@ -51,16 +52,7 @@ module WhatsupGithub
|
|
51
52
|
# Otherwise, use credentials from ~/.netrc
|
52
53
|
# Otherwise, continue as a Guest
|
53
54
|
def client
|
54
|
-
|
55
|
-
|
56
|
-
@client =
|
57
|
-
if ENV['WHATSUP_GITHUB_ACCESS_TOKEN']
|
58
|
-
Octokit::Client.new(access_token: ENV['WHATSUP_GITHUB_ACCESS_TOKEN'])
|
59
|
-
elsif File.exist? "#{ENV['HOME']}/.netrc"
|
60
|
-
Octokit::Client.new(netrc: true)
|
61
|
-
else
|
62
|
-
Octokit::Client.new
|
63
|
-
end
|
55
|
+
Client.instance
|
64
56
|
end
|
65
57
|
|
66
58
|
def search_issues(label)
|
@@ -3,7 +3,6 @@
|
|
3
3
|
require_relative 'row'
|
4
4
|
require_relative 'pulls'
|
5
5
|
require_relative 'config_reader'
|
6
|
-
require_relative 'members'
|
7
6
|
|
8
7
|
module WhatsupGithub
|
9
8
|
# Creates Row objects for the future table
|
@@ -82,7 +81,7 @@ module WhatsupGithub
|
|
82
81
|
def load_members
|
83
82
|
return if @members
|
84
83
|
|
85
|
-
@members =
|
84
|
+
@members = client.org_members(config.membership)
|
86
85
|
end
|
87
86
|
|
88
87
|
def member_logins
|
@@ -93,5 +92,9 @@ module WhatsupGithub
|
|
93
92
|
def config
|
94
93
|
Config.instance
|
95
94
|
end
|
95
|
+
|
96
|
+
def client
|
97
|
+
Client.instance
|
98
|
+
end
|
96
99
|
end
|
97
100
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatsup_github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dima Shevtsov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: netrc
|
@@ -144,6 +144,8 @@ executables:
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
+
- ".github/linters/.ruby-lint.yml"
|
148
|
+
- ".github/workflows/linter.yml"
|
147
149
|
- ".gitignore"
|
148
150
|
- ".rspec"
|
149
151
|
- ".ruby-version"
|
@@ -160,9 +162,9 @@ files:
|
|
160
162
|
- lib/template/.whatsup.yml
|
161
163
|
- lib/whatsup_github.rb
|
162
164
|
- lib/whatsup_github/cli.rb
|
165
|
+
- lib/whatsup_github/client.rb
|
163
166
|
- lib/whatsup_github/config_reader.rb
|
164
167
|
- lib/whatsup_github/generator.rb
|
165
|
-
- lib/whatsup_github/members.rb
|
166
168
|
- lib/whatsup_github/pulls.rb
|
167
169
|
- lib/whatsup_github/row.rb
|
168
170
|
- lib/whatsup_github/row_collector.rb
|
@@ -193,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
195
|
- !ruby/object:Gem::Version
|
194
196
|
version: '0'
|
195
197
|
requirements: []
|
196
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.0.9
|
197
199
|
signing_key:
|
198
200
|
specification_version: 4
|
199
201
|
summary: Collect info from GitHub pull requests.
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module WhatsupGithub
|
4
|
-
# Members of an organization
|
5
|
-
class Members
|
6
|
-
def initialize(org)
|
7
|
-
@org = org
|
8
|
-
end
|
9
|
-
|
10
|
-
def client
|
11
|
-
Octokit::Client.new(netrc: true)
|
12
|
-
end
|
13
|
-
|
14
|
-
def members
|
15
|
-
client.org_members @org
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|