codeinventory-github 0.1.7 → 0.1.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/README.md +21 -0
- data/lib/codeinventory/github.rb +16 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae567ad14b508b1a291ab5b3d8b66d334cdbdee5
|
4
|
+
data.tar.gz: f39d2623c74aa25a05d09e1e3665eabfe0026120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1da5d61bad9f003815162b76bd01915f6ab9e64501b268d246b4dcb4f221e2341d8ca30418e092247f1dba1698758c05bbf407f9880870f8898a495a5bd1ee06
|
7
|
+
data.tar.gz: fe3771b1b6407f6c6cac5e73a8f6321032a0e380fa7496dea9131687f815313109602d9c6df706a90ad384c80d139c6b8fd06c85291874440d81d1c178da97c7
|
data/README.md
CHANGED
@@ -101,6 +101,27 @@ organization: ABC Bureau
|
|
101
101
|
}
|
102
102
|
```
|
103
103
|
|
104
|
+
#### Excluding a repo via the metadata file
|
105
|
+
|
106
|
+
The `.codeinventory.yml` or `.codeinventory.json` file can instruct the CodeInventory tool to exclude a repository from the inventory. Use this when you have a repository that should not be included in the inventory for any reason, such as repositories that do not contain source code or contain only experimental code.
|
107
|
+
|
108
|
+
YAML (.codeinventory.yml):
|
109
|
+
|
110
|
+
```yaml
|
111
|
+
codeinventory:
|
112
|
+
exclude: true
|
113
|
+
```
|
114
|
+
|
115
|
+
JSON (.codeinventory.json):
|
116
|
+
|
117
|
+
```json
|
118
|
+
{
|
119
|
+
"codeinventory": {
|
120
|
+
"exclude": true
|
121
|
+
}
|
122
|
+
}
|
123
|
+
```
|
124
|
+
|
104
125
|
### Using overrides
|
105
126
|
|
106
127
|
You can override any of the inventory fields by passing an override hash.
|
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.8"
|
8
8
|
attr_accessor :org, :overrides, :exclude
|
9
9
|
|
10
10
|
def initialize(auth, org, overrides: {}, exclude: [])
|
@@ -21,19 +21,21 @@ module CodeInventory
|
|
21
21
|
projects = []
|
22
22
|
repos.each do |repo|
|
23
23
|
inventory_file_metadata = inventory_file(repo)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
24
|
+
unless inventory_file_metadata.dig("codeinventory", "exclude")
|
25
|
+
repo_metadata = {}
|
26
|
+
repo_metadata["name"] = name(repo, inventory_file_metadata)
|
27
|
+
repo_metadata["description"] = description(repo, inventory_file_metadata)
|
28
|
+
repo_metadata["license"] = license(repo, inventory_file_metadata)
|
29
|
+
repo_metadata["openSourceProject"] = open_source_project(repo, inventory_file_metadata)
|
30
|
+
repo_metadata["governmentWideReuseProject"] = government_wide_reuse_project(repo, inventory_file_metadata)
|
31
|
+
repo_metadata["tags"] = tags(repo, inventory_file_metadata)
|
32
|
+
repo_metadata["contact"] = { "email" => contact_email(repo, inventory_file_metadata) }
|
33
|
+
repo_metadata["repository"] = repository(repo, inventory_file_metadata)
|
34
|
+
organization = organization(repo, inventory_file_metadata)
|
35
|
+
repo_metadata["organization"] = organization(repo, inventory_file_metadata) unless organization.nil?
|
36
|
+
projects << repo_metadata
|
37
|
+
yield repo_metadata if block_given?
|
38
|
+
end
|
37
39
|
end
|
38
40
|
projects
|
39
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeinventory-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Fredrickson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|