k_ext-github 0.0.5 → 0.0.8
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/.github/workflows/main.yml +7 -11
- data/k_ext-github.gemspec +1 -0
- data/lib/k_ext/github/github_configuration.rb +42 -0
- data/lib/k_ext/github/version.rb +1 -1
- data/lib/k_ext/github.rb +2 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 307c9926733fcb3b6b43a5a5f613e4e66bd22cd8a421f264cc91f494f96face2
|
4
|
+
data.tar.gz: f99987025255cad0f76e62a679e95873c80d3dd362303634243d49b687820d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea1bf4c3d1d1fdb48e776571dafd5fd433d49afa02005d45c2635c1137b5fb6afe5a4a74944f1b90eac79f80fb4c7941750eb9222c6d47b01b29583bccfa2386
|
7
|
+
data.tar.gz: 5a1f0041d5b1a0eece0811d55746f8efc3f1ffa31ece8206de2bfe82b72e3df1e2bf5cf9842b46c0dfbe1936f9a4f5b0d22ddff67c4690c937d84c38ed9b3e95
|
data/.github/workflows/main.yml
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
1
|
+
# check https://www.githubstatus.com/ if any issues
|
3
2
|
name: Ruby
|
4
3
|
|
5
4
|
on:
|
@@ -9,22 +8,19 @@ on:
|
|
9
8
|
branches: [ master ]
|
10
9
|
|
11
10
|
jobs:
|
12
|
-
|
13
|
-
|
11
|
+
build:
|
14
12
|
runs-on: ubuntu-latest
|
15
|
-
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby: ['2.7.1']
|
16
17
|
steps:
|
17
18
|
- uses: actions/checkout@v2
|
18
19
|
- name: Set up Ruby
|
19
|
-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
20
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
21
20
|
uses: ruby/setup-ruby@v1
|
22
21
|
with:
|
23
22
|
ruby-version: 2.7.1
|
24
|
-
|
25
|
-
run: |
|
26
|
-
gem install bundler -v 2.2.5
|
27
|
-
bundle install
|
23
|
+
bundler-cache: true
|
28
24
|
- name: Run tests
|
29
25
|
run: bundle exec rspec
|
30
26
|
- name: Run rubocop
|
data/k_ext-github.gemspec
CHANGED
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.require_paths = ['lib']
|
39
39
|
# spec.extensions = ['ext/k_ext_github/extconf.rb']
|
40
40
|
|
41
|
+
spec.add_dependency 'k_config', '~> 0.0.0'
|
41
42
|
spec.add_dependency 'k_log', '~> 0.0.0'
|
42
43
|
spec.add_dependency 'k_type', '~> 0.0.0'
|
43
44
|
spec.add_dependency 'k_util', '~> 0.0.0'
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Attach configuration to the KConfig module
|
4
|
+
module KExt
|
5
|
+
module Github
|
6
|
+
# GitHub configuration extension for attachment to KConfig::Configuration
|
7
|
+
module GitHubConfigurationExtension
|
8
|
+
def github
|
9
|
+
@github ||= GitHubConfiguration.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def github_debug
|
13
|
+
github.debug
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# GitHub Configuration
|
18
|
+
class GitHubConfiguration
|
19
|
+
include KUtil::Data::InstanceVariablesToH
|
20
|
+
include KLog::Logging
|
21
|
+
|
22
|
+
attr_accessor :user
|
23
|
+
attr_accessor :personal_access_token
|
24
|
+
attr_accessor :personal_access_token_delete
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
@user = ENV['GH_USER'] || ENV['GITHUB_USER']
|
28
|
+
@personal_access_token = ENV['GITHUB_PERSONAL_ACCESS_TOKEN']
|
29
|
+
@personal_access_token_delete = ENV['GITHUB_PERSONAL_ACCESS_TOKEN_DELETE']
|
30
|
+
end
|
31
|
+
|
32
|
+
def debug
|
33
|
+
log.section_heading 'GitHub Configuration'
|
34
|
+
log.kv 'user', user
|
35
|
+
log.kv 'personal_access_token', '***'
|
36
|
+
log.kv 'personal_access_token_delete', '***'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
KConfig::Configuration.register(:github, KExt::Github::GitHubConfigurationExtension)
|
data/lib/k_ext/github/version.rb
CHANGED
data/lib/k_ext/github.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'virtus'
|
4
|
+
require 'k_config'
|
4
5
|
require 'k_log'
|
5
6
|
require 'k_util'
|
6
7
|
|
7
8
|
require 'k_ext/github/version'
|
8
9
|
require 'k_ext/github/configuration'
|
10
|
+
require 'k_ext/github/github_configuration'
|
9
11
|
require 'k_ext/github/models/hook'
|
10
12
|
require 'k_ext/github/models/owner'
|
11
13
|
require 'k_ext/github/models/repository'
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_ext-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: k_config
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.0.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: k_log
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,6 +127,7 @@ files:
|
|
113
127
|
- lib/k_ext/github.rb
|
114
128
|
- lib/k_ext/github/api.rb
|
115
129
|
- lib/k_ext/github/configuration.rb
|
130
|
+
- lib/k_ext/github/github_configuration.rb
|
116
131
|
- lib/k_ext/github/models/hook.rb
|
117
132
|
- lib/k_ext/github/models/owner.rb
|
118
133
|
- lib/k_ext/github/models/repository.rb
|