gh_coab 0.1.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25df3d014958ba15317f16e7e9bfcc5096cfdec5766f54aed282d0d26df89d32
4
- data.tar.gz: 128bb9a219f9579766f592734c5fc0baaf281f208452b96da3f5e6828a375cb4
3
+ metadata.gz: a25fa8b28a96b85a5f97858c7b8a5e08f01ec457416d0e538357d60e1541a54b
4
+ data.tar.gz: beac387ea06182f391494580e0f53aa1af883fd177a33fdaaf81051f783d80f2
5
5
  SHA512:
6
- metadata.gz: e69ebc0ec3f0170fda882bff6f723da5066b0b123105f84dce1ca2fe4185a58ee9ce18f0e6d7ba6cb136f10009517346137e7d778b03bd3c6d839cdd4143f4f9
7
- data.tar.gz: 1fdcd02d10c18cf627d32a6f7ca51eb826e9ebc670817897fa02849078cf2205672777570b2c79e9510b30bc38c230fb59c456d1a3169d6a4db5f5d875d9b476
6
+ metadata.gz: 704fa839d3c918cd3ae215978fe8cbdbebb40fcb51efc86ef1d3a042a332c843458d93adf612e78d5ce152aa965329394f6eade9d4c6e0a6eebedf9b44aa0b73
7
+ data.tar.gz: b7ba49355b63dd218f6bc3a1cb48b030dcf4843eae7405e93a39cf283f354daf58c830f56a8c6864ff62f24f4b711f96c721db7c0c907a45eea3ff3b0a44a8a4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gh_coab (0.1.0)
4
+ gh_coab (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GhCoab
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
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.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - george kosmopoulos
@@ -10,7 +10,9 @@ 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
18
  executables:
@@ -34,13 +36,13 @@ files:
34
36
  - lib/gh_coab/gh_service.rb
35
37
  - lib/gh_coab/version.rb
36
38
  - sig/gh_coab.rbs
37
- homepage: https://www.github.com/gkosmo/coab
39
+ homepage: https://www.github.com/gkosmo/gh_coab
38
40
  licenses:
39
41
  - MIT
40
42
  metadata:
41
- homepage_uri: https://www.github.com/gkosmo/coab
42
- source_code_uri: https://www.github.com/gkosmo/coab
43
- changelog_uri: https://www.github.com/gkosmo/coab
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
44
46
  post_install_message:
45
47
  rdoc_options: []
46
48
  require_paths: