about_yml 0.0.4 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2c2f42bfc38bfad01b3f282ef2369d7becef08b
4
- data.tar.gz: 9ff0b51442aeedc72b016d97b2f3a5672e1cb7a2
3
+ metadata.gz: a3434a081c8ba183825647058a87aa9670f1f446
4
+ data.tar.gz: d48fc5b2f4d6b04272231be66f8306abbd66fa6c
5
5
  SHA512:
6
- metadata.gz: f523e392c10f5e6fa4a94877655205568a29baf0c44e39f74b9baf2088b0bccc704e59b5c98676b1bceac552902eef06ab9dcb0724ac07b2aae52a81a30d5bac
7
- data.tar.gz: ce220e63ea4465715f8790009e091e91ef21b19de51cc9ea4037386fb57ccbe93cbfddc2aba52d4c5a8c6ff464a2d49c14b91a8cf7f66a3902946fba7014a9eb
6
+ metadata.gz: c6629fe23082244cae129a1700ee8faf886cf22ad6858c3f5fb0556577cf224ac99203cd03dc2b522f98b76c4afa776db209dd8a39d33d6a111f22c8912bb00c
7
+ data.tar.gz: f1e1ca7bdca399056a1f07716e35726be7000994968544d2d9eea20bfa08384ef3facf1dd7c3ad2d65dba474f05d309e776eecfef97e13810a0ff56524559372
@@ -6,15 +6,16 @@ require 'safe_yaml'
6
6
 
7
7
  def usage(exitstatus = 0)
8
8
  (exitstatus == 0 ? $stdout : $stderr).puts <<END_USAGE
9
- #{$PROGRAM_NAME} path_to_about_file [...]
9
+ #{$PROGRAM_NAME} [path_to_about_file] [...]
10
10
 
11
- Validates .about.yml file contents. Prints nothing on success; prints errors
12
- to standard error.
11
+ Validates .about.yml file contents. Assumes file in current directory
12
+ unless path specified. Prints nothing on success; prints errors to
13
+ standard error.
13
14
  END_USAGE
14
15
  exit exitstatus
15
16
  end
16
17
 
17
- usage 1 if ARGV.empty?
18
+ ARGV << '.about.yml' if ARGV.empty?
18
19
  ARGV.each { |f| abort "#{f} does not exist" unless File.exist? f }
19
20
 
20
21
  exitstatus = 0
@@ -36,16 +36,28 @@ module AboutYml
36
36
  SafeYAML.load Base64.decode64(about['content'])
37
37
  end
38
38
 
39
+ def self.write_error(err, repo, result)
40
+ $stderr.puts('Error while parsing .about.yml for ' \
41
+ "#{repo.full_name}:\n #{err}")
42
+ result['errors'] << { repo.full_name => err.message }
43
+ end
44
+
45
+ def self.add_github_metadata(result, repo)
46
+ result['github'] = {
47
+ 'name' => repo.full_name,
48
+ 'description' => repo.description,
49
+ }
50
+ end
51
+
39
52
  def self.collect_repository_data(repo, client, result)
40
53
  collection = (repo.private == true) ? 'private' : 'public'
41
54
  repo_name = repo.full_name
42
55
  result[collection][repo_name] = fetch_file_contents client, repo_name
56
+ add_github_metadata result[collection][repo_name], repo
43
57
  rescue Octokit::NotFound
44
58
  result['missing'] << repo.full_name
45
59
  rescue StandardError => err
46
- $stderr.puts('Error while parsing .about.yml for ' \
47
- "#{repo.full_name}:\n #{err}")
48
- result['errors'] << {repo.full_name => err.message}
60
+ write_error err, repo, result
49
61
  end
50
62
  private_class_method :collect_repository_data
51
63
 
@@ -44,7 +44,7 @@
44
44
  "testable": {
45
45
  "type": "boolean",
46
46
  "default": false,
47
- "description": "Should be 'true' if the project has a continuous build"
47
+ "description": "Should this repo have automated tests? If so, set to `true`."
48
48
  },
49
49
  "team": {
50
50
  "type": "array",
@@ -128,7 +128,7 @@
128
128
  }
129
129
  },
130
130
  "required": [
131
- "name", "full_name", "stage", "team", "licenses", "owner_type", "status", "testable"
131
+ "name", "full_name", "stage", "team", "licenses", "owner_type", "testable"
132
132
  ],
133
133
  "definitions": {
134
134
  "person": {
@@ -223,7 +223,7 @@
223
223
  "properties": {
224
224
  "url": {
225
225
  "type": "string",
226
- "description": "URI for the link to ",
226
+ "description": "URL for the link",
227
227
  "format": "uri"
228
228
  },
229
229
  "text": {
@@ -1,5 +1,5 @@
1
1
  # @author Mike Bland (michael.bland@gsa.gov)
2
2
 
3
3
  module AboutYml
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: about_yml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Bland
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-26 00:00:00.000000000 Z
12
+ date: 2015-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: safe_yaml