gh_coab 0.1.0 → 0.1.3
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/Gemfile.lock +1 -1
- data/exe/gh_coab +12 -0
- data/lib/gh_coab/gh_coab.rb +2 -0
- data/lib/gh_coab/gh_service.rb +1 -1
- data/lib/gh_coab/version.rb +1 -1
- data/lib/gh_coab.rb +3 -4
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a25fa8b28a96b85a5f97858c7b8a5e08f01ec457416d0e538357d60e1541a54b
|
4
|
+
data.tar.gz: beac387ea06182f391494580e0f53aa1af883fd177a33fdaaf81051f783d80f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 704fa839d3c918cd3ae215978fe8cbdbebb40fcb51efc86ef1d3a042a332c843458d93adf612e78d5ce152aa965329394f6eade9d4c6e0a6eebedf9b44aa0b73
|
7
|
+
data.tar.gz: b7ba49355b63dd218f6bc3a1cb48b030dcf4843eae7405e93a39cf283f354daf58c830f56a8c6864ff62f24f4b711f96c721db7c0c907a45eea3ff3b0a44a8a4
|
data/Gemfile.lock
CHANGED
data/exe/gh_coab
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "gh_coab"
|
6
|
+
|
7
|
+
GhCoab::CLI.start
|
8
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
+
# with your gem easier. You can also use a different console, if you like.
|
10
|
+
|
11
|
+
# require "irb"
|
12
|
+
# IRB.start(__FILE__)
|
data/lib/gh_coab/gh_coab.rb
CHANGED
@@ -5,6 +5,8 @@ module GhCoab
|
|
5
5
|
def self.write_coab(username)
|
6
6
|
name = service.get_name(username)
|
7
7
|
emails = service.get_emails(username)
|
8
|
+
emails.select! { |email| email[:name].downcase == name.downcase && !email[:email].nil? }
|
9
|
+
emails = emails.map { |email| email[:email] }
|
8
10
|
coabs = emails.map do |email|
|
9
11
|
"#{COAB}#{name} <#{email}>"
|
10
12
|
end
|
data/lib/gh_coab/gh_service.rb
CHANGED
@@ -14,7 +14,7 @@ class GhService
|
|
14
14
|
response.map do |event|
|
15
15
|
next if event.dig(:payload, :commits).nil?
|
16
16
|
event[:payload][:commits].map do |commit|
|
17
|
-
commit[:author][:email]
|
17
|
+
{name: commit[:author][:name], email: commit[:author][:email]}
|
18
18
|
end
|
19
19
|
end.flatten.uniq.compact
|
20
20
|
end
|
data/lib/gh_coab/version.rb
CHANGED
data/lib/gh_coab.rb
CHANGED
@@ -9,16 +9,15 @@ module GhCoab
|
|
9
9
|
|
10
10
|
class CLI < Thor
|
11
11
|
desc "show <GH_USERNAME>", "Displays the co-author name and emails"
|
12
|
-
|
12
|
+
|
13
13
|
option :username, aliases: "-u", required: true, type: :string
|
14
|
-
|
15
|
-
|
14
|
+
|
16
15
|
def show
|
17
16
|
GhCoab.write_coab(options[:username])
|
18
17
|
end
|
19
18
|
desc "s <GH_USERNAME>", "Displays the co-author name and emails"
|
20
19
|
option :username, aliases: "-u", required: true, type: :string
|
21
20
|
|
22
|
-
alias_method :s, :show
|
21
|
+
alias_method :s, :show
|
23
22
|
end
|
24
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gh_coab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- george kosmopoulos
|
@@ -10,10 +10,13 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2023-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Get co-authors from github
|
13
|
+
description: "Get co-authors from github \n in your terminal type gh_coab s -u <github_username>
|
14
|
+
\n or gh_coab show -u <github_username> \n and you will get the message you need
|
15
|
+
to add to your commit message to add co-authors"
|
14
16
|
email:
|
15
17
|
- gkosmo1@hotmail.com
|
16
|
-
executables:
|
18
|
+
executables:
|
19
|
+
- gh_coab
|
17
20
|
extensions: []
|
18
21
|
extra_rdoc_files: []
|
19
22
|
files:
|
@@ -26,19 +29,20 @@ files:
|
|
26
29
|
- LICENSE.txt
|
27
30
|
- README.md
|
28
31
|
- Rakefile
|
32
|
+
- exe/gh_coab
|
29
33
|
- lib/gh_coab.rb
|
30
34
|
- lib/gh_coab/gh_client.rb
|
31
35
|
- lib/gh_coab/gh_coab.rb
|
32
36
|
- lib/gh_coab/gh_service.rb
|
33
37
|
- lib/gh_coab/version.rb
|
34
38
|
- sig/gh_coab.rbs
|
35
|
-
homepage: https://www.github.com/gkosmo/
|
39
|
+
homepage: https://www.github.com/gkosmo/gh_coab
|
36
40
|
licenses:
|
37
41
|
- MIT
|
38
42
|
metadata:
|
39
|
-
homepage_uri: https://www.github.com/gkosmo/
|
40
|
-
source_code_uri: https://www.github.com/gkosmo/
|
41
|
-
changelog_uri: https://www.github.com/gkosmo/
|
43
|
+
homepage_uri: https://www.github.com/gkosmo/gh_coab
|
44
|
+
source_code_uri: https://www.github.com/gkosmo/gh_coab
|
45
|
+
changelog_uri: https://www.github.com/gkosmo/gh_coab
|
42
46
|
post_install_message:
|
43
47
|
rdoc_options: []
|
44
48
|
require_paths:
|