codeinventory-github 0.1.4 → 0.1.5
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/lib/codeinventory/github.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02802dc7fb8c385b6cb0b6d30163d73c0bfaa8fa
|
4
|
+
data.tar.gz: 6918b6d73f47332d5c7290f7123e443ae18ba8b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be73013bb3f565e3b5ac727b40ee27854f6748db6625a6b12cf3ce50fd624171f174746356044bfcd06ebbf83435377453c7e62d8c8a8711c473dbbcfd3db74c
|
7
|
+
data.tar.gz: 230aaf458f045db3e4fd16501fe6e84cb8a27e9a2e644d6ded1d9933f08d292282d451af19286d5a9c753b529166c65128f1bfe911a9346c46483d71d6b16c73
|
data/lib/codeinventory/github.rb
CHANGED
@@ -4,7 +4,7 @@ require "base64"
|
|
4
4
|
|
5
5
|
module CodeInventory
|
6
6
|
class GitHub
|
7
|
-
VERSION = "0.1.
|
7
|
+
VERSION = "0.1.5"
|
8
8
|
attr_accessor :org, :overrides, :exclude
|
9
9
|
|
10
10
|
def initialize(auth, org, overrides: {}, exclude: [])
|
@@ -39,6 +39,8 @@ module CodeInventory
|
|
39
39
|
|
40
40
|
# Checks if the repo has an inventory file. If so, loads its metadata.
|
41
41
|
def inventory_file(repo)
|
42
|
+
metadata = {}
|
43
|
+
return metadata if repo[:size] == 0 # Empty repo
|
42
44
|
filenames = [ ".codeinventory.yml", "codeinventory.yml", ".codeinventory.json", "codeinventory.json"]
|
43
45
|
repo_contents = client.contents(repo[:full_name], path: "/")
|
44
46
|
inventory_file = repo_contents.select { |file| filenames.include? file[:name] }.first
|
@@ -53,7 +55,7 @@ module CodeInventory
|
|
53
55
|
metadata = JSON.parse(raw_content)
|
54
56
|
end
|
55
57
|
end
|
56
|
-
metadata
|
58
|
+
metadata
|
57
59
|
end
|
58
60
|
|
59
61
|
# Provides a value for the name field.
|