about_yml 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d6255781f217e0439c558a8d73937e6157d1886
4
- data.tar.gz: 7b6074d5d16a6716efe0cb339f6c7bbde8e6f069
3
+ metadata.gz: a2c2f42bfc38bfad01b3f282ef2369d7becef08b
4
+ data.tar.gz: 9ff0b51442aeedc72b016d97b2f3a5672e1cb7a2
5
5
  SHA512:
6
- metadata.gz: f468c80bdce1059710776da06a0a442fe927ddc9d4a823ef10dd717d75247869e73af8d746bbead8f542b231d8309313065ca6f5eb43a26f1dd08d2bdb74e578
7
- data.tar.gz: 611821f5b743e6cc6ab971eb34b5b3d3349013628eef6ea88b582e1bed6203edcc704f94905918ffe8feaf44bd9f4fc85ee847ce0ab77afc1289a9a5642fc178
6
+ metadata.gz: f523e392c10f5e6fa4a94877655205568a29baf0c44e39f74b9baf2088b0bccc704e59b5c98676b1bceac552902eef06ab9dcb0724ac07b2aae52a81a30d5bac
7
+ data.tar.gz: ce220e63ea4465715f8790009e091e91ef21b19de51cc9ea4037386fb57ccbe93cbfddc2aba52d4c5a8c6ff464a2d49c14b91a8cf7f66a3902946fba7014a9eb
data/bin/about_yml_scrape CHANGED
@@ -6,7 +6,7 @@ require 'safe_yaml'
6
6
 
7
7
  USAGE = <<END_USAGE
8
8
  Usage: #{$PROGRAM_NAME} github_org [github_token] [missing_outfile] \
9
- [raw_abouts_file]
9
+ [errors_outfile] [raw_abouts_file]
10
10
 
11
11
  Scrapes the .about.yml files from an organization's GitHub repositories and
12
12
  writes their contents to standard output as YAML, categorized by visibility
@@ -21,6 +21,8 @@ where:
21
21
  defaults to $HOME/.github_token
22
22
  missing_outfile (optional) path to a file that will contain a list of repos
23
23
  that do not have .about.yml files
24
+ errors_outfile (optional) path to a file that will contain a list of repos
25
+ with unparsable .about.yml files, and the offending lines
24
26
  raw_abouts_file (optional) if the file exists, the program will read
25
27
  .about.yml data from it rather than scraping GitHub;
26
28
  otherwise, the unprocessed .about.yml data scraped from
@@ -32,7 +34,7 @@ def usage(exitstatus = 0)
32
34
  exit exitstatus
33
35
  end
34
36
 
35
- github_org, github_token, missing_outfile, raw_abouts_file = ARGV
37
+ github_org, github_token, missing_outfile, errors_outfile, raw_abouts_file = ARGV
36
38
  github_token ||= File.join(ENV['HOME'], '.github_token')
37
39
  usage 1 unless github_org && File.exist?(github_token)
38
40
 
@@ -45,6 +47,9 @@ else
45
47
  if missing_outfile
46
48
  File.write missing_outfile, fetch_results['missing'].to_yaml
47
49
  end
50
+ if errors_outfile
51
+ File.write errors_outfile, fetch_results['errors'].to_yaml
52
+ end
48
53
  end
49
54
 
50
55
  puts(%w(public private).each_with_object({}) do |scope, full_yml|
@@ -45,7 +45,7 @@ module AboutYml
45
45
  rescue StandardError => err
46
46
  $stderr.puts('Error while parsing .about.yml for ' \
47
47
  "#{repo.full_name}:\n #{err}")
48
- result['errors'] << repo.full_name
48
+ result['errors'] << {repo.full_name => err.message}
49
49
  end
50
50
  private_class_method :collect_repository_data
51
51
 
@@ -28,18 +28,19 @@
28
28
  },
29
29
  "stage": {
30
30
  "type": "string",
31
- "enum": ["discovery", "alpha", "beta", "live"],
31
+ "enum": ["discovery", "alpha", "beta", "live", "sunset", "transfer", "end"],
32
32
  "description": "Maturity stage of the project"
33
33
  },
34
- "status": {
35
- "type": "string",
36
- "enum": ["active", "deprecated"],
37
- "description": "Whether or not the project is actively maintained"
38
- },
39
34
  "description": {
40
35
  "type": "string",
41
36
  "description": "Description of the project"
42
37
  },
38
+ "tags": {
39
+ "type": "array",
40
+ "description": "Tags that describe the project or aspects of the project",
41
+ "items": {"type": "string"},
42
+ "uniqueItems": true
43
+ },
43
44
  "testable": {
44
45
  "type": "boolean",
45
46
  "default": false,
@@ -59,6 +60,14 @@
59
60
  "items": {"type": "string"},
60
61
  "uniqueItems": true
61
62
  },
63
+ "users": {
64
+ "type": "array",
65
+ "description": "Organizations or individuals who have adopted the project for their own use",
66
+ "items": {
67
+ "$ref": "#/definitions/user"
68
+ },
69
+ "uniqueItems": true
70
+ },
62
71
  "milestones": {
63
72
  "type": "array",
64
73
  "description": "Brief descriptions of significant project developments",
@@ -111,11 +120,9 @@
111
120
  },
112
121
  "contact": {
113
122
  "type": "array",
114
- "description": "Email addresses of points-of-contact",
123
+ "description": "URIs for points-of-contact",
115
124
  "items": {
116
- "type": "string",
117
- "description": "Email address",
118
- "format": "uri"
125
+ "$ref": "#/definitions/contact"
119
126
  },
120
127
  "uniqueItems": true
121
128
  }
@@ -142,6 +149,20 @@
142
149
  }
143
150
  }
144
151
  },
152
+ "user": {
153
+ "type": "object",
154
+ "description": "Organizations or individuals who have adopted the project for their own use",
155
+ "properties": {
156
+ "id": {
157
+ "type": "string",
158
+ "description": "The name of the organization or individual"
159
+ },
160
+ "url": {
161
+ "type": "string",
162
+ "description": "A URL to the user's version of the project"
163
+ }
164
+ }
165
+ },
145
166
  "service": {
146
167
  "type": "object",
147
168
  "description": "Service used to provide project status",
@@ -195,6 +216,21 @@
195
216
  "description": "Anchor text for the link"
196
217
  }
197
218
  }
219
+ },
220
+ "contact": {
221
+ "type": "object",
222
+ "description": "Link to a project contact",
223
+ "properties": {
224
+ "url": {
225
+ "type": "string",
226
+ "description": "URI for the link to ",
227
+ "format": "uri"
228
+ },
229
+ "text": {
230
+ "type": "string",
231
+ "description": "Anchor text for the link"
232
+ }
233
+ }
198
234
  }
199
235
  }
200
236
  }
@@ -1,5 +1,5 @@
1
1
  # @author Mike Bland (michael.bland@gsa.gov)
2
2
 
3
3
  module AboutYml
4
- VERSION = '0.0.2'
4
+ VERSION = '0.0.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: about_yml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Bland
8
+ - Alison Rowland
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
12
+ date: 2015-10-26 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: safe_yaml
@@ -142,6 +143,7 @@ description: The .about.yml mechanism allows an project to publish and maintain
142
143
  systems.
143
144
  email:
144
145
  - michael.bland@gsa.gov
146
+ - alisonrowland@gmail.com
145
147
  executables:
146
148
  - about_yml_generate
147
149
  - about_yml_scrape