urbanopt-geojson 0.2.0.pre2 → 0.3.1
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 +5 -5
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +61 -0
- data/Gemfile +0 -3
- data/Rakefile +1 -1
- data/docs/package-lock.json +15 -15
- data/docs/package.json +3 -1
- data/lib/measures/.rubocop.yml +1 -1
- data/lib/measures/urban_geometry_creation/README.md +1 -1
- data/lib/measures/urban_geometry_creation/measure.rb +4 -0
- data/lib/measures/urban_geometry_creation/measure.xml +17 -20
- data/lib/measures/urban_geometry_creation_zoning/README.md +1 -1
- data/lib/measures/urban_geometry_creation_zoning/measure.rb +6 -3
- data/lib/measures/urban_geometry_creation_zoning/measure.xml +15 -18
- data/lib/urbanopt/geojson/building.rb +22 -19
- data/lib/urbanopt/geojson/feature.rb +37 -1
- data/lib/urbanopt/geojson/geo_file.rb +39 -39
- data/lib/urbanopt/geojson/helper.rb +12 -5
- data/lib/urbanopt/geojson/mapper_classes.rb +46 -46
- data/lib/urbanopt/geojson/model.rb +2 -3
- data/lib/urbanopt/geojson/schema/building_properties.json +244 -77
- data/lib/urbanopt/geojson/schema/electrical_connector_properties.json +8 -8
- data/lib/urbanopt/geojson/schema/electrical_junction_properties.json +4 -5
- data/lib/urbanopt/geojson/schema/thermal_connector_properties.json +1 -1
- data/lib/urbanopt/geojson/schema/thermal_junction_properties.json +1 -1
- data/lib/urbanopt/geojson/update_areas.rb +1 -1
- data/lib/urbanopt/geojson/validate_geojson.rb +2 -0
- data/lib/urbanopt/geojson/version.rb +1 -1
- data/lib/urbanopt/geojson/workflows/building.osw.out +4 -4
- data/urbanopt-geojson-gem.gemspec +9 -13
- metadata +21 -41
- data/lib/change_log.rb +0 -147
- data/lib/measures/urban_geometry_creation/tests/nrel_stm_footprints.geojson +0 -3238
- data/lib/measures/urban_geometry_creation/tests/shadowed_tests.rb +0 -80
- data/lib/measures/urban_geometry_creation/tests/urban_geometry_creation_test.rb +0 -139
- data/lib/measures/urban_geometry_creation_zoning/tests/nrel_stm_footprints.geojson +0 -3238
- data/lib/measures/urban_geometry_creation_zoning/tests/urban_geometry_creation_zoning_test.rb +0 -139
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"id": "http://json-schema.org/openstudio-urban-modeling/
|
4
|
-
"title": "URBANopt Electrical
|
5
|
-
"description": "Schema for an URBANopt Electrical
|
3
|
+
"id": "http://json-schema.org/openstudio-urban-modeling/electrical_connector_properties.json#",
|
4
|
+
"title": "URBANopt Electrical Connector",
|
5
|
+
"description": "Schema for an URBANopt Electrical Connector object",
|
6
6
|
"type": "object",
|
7
7
|
"properties": {
|
8
8
|
"id": {
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"description": "Type of feature.",
|
18
18
|
"type": "string",
|
19
19
|
"enum": [
|
20
|
-
"
|
20
|
+
"ElectricalConnector"
|
21
21
|
]
|
22
22
|
},
|
23
23
|
"source_name": {
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"description": "Total length (ft) of the line, generated on export.",
|
47
47
|
"type": "number"
|
48
48
|
},
|
49
|
-
"
|
49
|
+
"startJunctionId": {
|
50
50
|
"description": "Id of the junction that this line starts at.",
|
51
51
|
"type": "string"
|
52
52
|
},
|
@@ -67,7 +67,7 @@
|
|
67
67
|
"type": "string"
|
68
68
|
}
|
69
69
|
},
|
70
|
-
"
|
70
|
+
"endJunctionId": {
|
71
71
|
"description": "Id of the junction that this line ends at.",
|
72
72
|
"type": "string"
|
73
73
|
},
|
@@ -79,8 +79,8 @@
|
|
79
79
|
"type",
|
80
80
|
"id",
|
81
81
|
"connector_type",
|
82
|
-
"
|
83
|
-
"
|
82
|
+
"startJunctionId",
|
83
|
+
"endJunctionId"
|
84
84
|
],
|
85
85
|
"additionalProperties": false,
|
86
86
|
"definitions": {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"id": "http://json-schema.org/openstudio-urban-modeling/
|
3
|
+
"id": "http://json-schema.org/openstudio-urban-modeling/electrical_junction_properties.json#",
|
4
4
|
"title": "URBANopt Electrical Junction",
|
5
5
|
"description": "Schema for an URBANopt Electrical Junction object",
|
6
6
|
"type": "object",
|
@@ -35,11 +35,11 @@
|
|
35
35
|
"connector_type": {
|
36
36
|
"$ref": "#/definitions/ElectricalJunctionType"
|
37
37
|
},
|
38
|
-
"
|
38
|
+
"buildingId": {
|
39
39
|
"description": "Id of building if this junction is inside a building.",
|
40
40
|
"type": "string"
|
41
41
|
},
|
42
|
-
"
|
42
|
+
"DSId": {
|
43
43
|
"description": "Id of district system if this junction is inside a district system.",
|
44
44
|
"type": "string"
|
45
45
|
},
|
@@ -49,8 +49,7 @@
|
|
49
49
|
},
|
50
50
|
"required": [
|
51
51
|
"type",
|
52
|
-
"id"
|
53
|
-
"connector_type"
|
52
|
+
"id"
|
54
53
|
],
|
55
54
|
"additionalProperties": false,
|
56
55
|
"definitions": {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"id": "http://json-schema.org/openstudio-urban-modeling/
|
3
|
+
"id": "http://json-schema.org/openstudio-urban-modeling/thermal_connector_properties.json#",
|
4
4
|
"title": "URBANopt Thermal Connector",
|
5
5
|
"description": "Schema for an URBANopt Thermal Connector object",
|
6
6
|
"type": "object",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"id": "http://json-schema.org/openstudio-urban-modeling/
|
3
|
+
"id": "http://json-schema.org/openstudio-urban-modeling/thermal_junction_properties.json#",
|
4
4
|
"title": "URBANopt Thermal Junction",
|
5
5
|
"description": "Schema for an URBANopt Thermal Junction object",
|
6
6
|
"type": "object",
|
@@ -97,6 +97,6 @@ geojson[:features].each do |feature|
|
|
97
97
|
# std::vector<Point3d> toLocalCartesian(const std::vector<PointLatLon>& points) const;
|
98
98
|
end
|
99
99
|
|
100
|
-
File.open(ARGV[0], 'w') do |file|
|
100
|
+
File.open(ARGV[0], 'w') do |file| # rubocop:disable Lint/ShadowingOuterLocalVariable
|
101
101
|
file << JSON.pretty_generate(geojson)
|
102
102
|
end
|
@@ -133,7 +133,9 @@ Dir.glob('denver_district*.geojson').each do |p|
|
|
133
133
|
end
|
134
134
|
|
135
135
|
all_errors[p][-1].concat(errors)
|
136
|
+
# rubocop:disable Lint/RescueException
|
136
137
|
rescue Exception => e
|
138
|
+
# rubocop:enable Lint/RescueException
|
137
139
|
all_errors[p][-1] << "Error '#{e.message}' occurred: "
|
138
140
|
all_errors[p][-1] << e.backtrace.to_s
|
139
141
|
end
|
@@ -899,7 +899,7 @@
|
|
899
899
|
"default_value": "Inferred",
|
900
900
|
"choice_values": [
|
901
901
|
"Inferred",
|
902
|
-
"
|
902
|
+
"VRF",
|
903
903
|
"PTAC with hot water heat",
|
904
904
|
"PTAC with gas coil heat",
|
905
905
|
"PTAC with electric baseboard heat",
|
@@ -955,7 +955,7 @@
|
|
955
955
|
],
|
956
956
|
"choice_display_names": [
|
957
957
|
"Inferred",
|
958
|
-
"
|
958
|
+
"VRF",
|
959
959
|
"PTAC with hot water heat",
|
960
960
|
"PTAC with gas coil heat",
|
961
961
|
"PTAC with electric baseboard heat",
|
@@ -1511,7 +1511,7 @@
|
|
1511
1511
|
"default_value": "Inferred",
|
1512
1512
|
"choice_values": [
|
1513
1513
|
"Inferred",
|
1514
|
-
"
|
1514
|
+
"VRF",
|
1515
1515
|
"PTAC with hot water heat",
|
1516
1516
|
"PTAC with gas coil heat",
|
1517
1517
|
"PTAC with electric baseboard heat",
|
@@ -1567,7 +1567,7 @@
|
|
1567
1567
|
],
|
1568
1568
|
"choice_display_names": [
|
1569
1569
|
"Inferred",
|
1570
|
-
"
|
1570
|
+
"VRF",
|
1571
1571
|
"PTAC with hot water heat",
|
1572
1572
|
"PTAC with gas coil heat",
|
1573
1573
|
"PTAC with electric baseboard heat",
|
@@ -11,32 +11,28 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = 'Library and measures to translate URBANopt GeoJSON format to OpenStudio'
|
13
13
|
spec.description = 'Library and measures to translate URBANopt GeoJSON format to OpenStudio'
|
14
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
15
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
-
end
|
17
14
|
spec.homepage = 'https://github.com/urbanopt/urbanopt-geojson-gem'
|
18
15
|
|
19
16
|
# Specify which files should be added to the gem when it is released.
|
20
17
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
18
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
22
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|lib.measures.*tests|spec|features)/}) }
|
23
20
|
end
|
24
21
|
spec.bindir = 'exe'
|
25
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
23
|
spec.require_paths = ['lib']
|
27
24
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
spec.add_development_dependency '
|
32
|
-
spec.add_development_dependency '
|
33
|
-
spec.add_development_dependency 'rspec', '3.7.0'
|
25
|
+
spec.required_ruby_version = '~> 2.5.0'
|
26
|
+
|
27
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
28
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
29
|
+
spec.add_development_dependency 'rspec', '~> 3.7'
|
34
30
|
|
35
31
|
# lock the version of these dependencies due to using older version of Ruby.
|
36
|
-
spec.add_dependency 'public_suffix', '3.1.1'
|
32
|
+
# spec.add_dependency 'public_suffix', '3.1.1'
|
37
33
|
|
38
34
|
# other dependencies
|
39
35
|
spec.add_dependency 'json-schema'
|
40
|
-
spec.add_dependency 'openstudio-extension', '~> 0.
|
41
|
-
spec.add_dependency 'urbanopt-core', '~> 0.
|
36
|
+
spec.add_dependency 'openstudio-extension', '~> 0.2.3'
|
37
|
+
spec.add_dependency 'urbanopt-core', '~> 0.3.0'
|
42
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urbanopt-geojson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanushree Charan
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-08-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -18,56 +18,42 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1
|
21
|
+
version: '2.1'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '1
|
28
|
+
version: '2.1'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
35
|
+
version: '13.0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
42
|
+
version: '13.0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rspec
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 3.7
|
49
|
+
version: '3.7'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: 3.7.0
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: public_suffix
|
59
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - '='
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: 3.1.1
|
64
|
-
type: :runtime
|
65
|
-
prerelease: false
|
66
|
-
version_requirements: !ruby/object:Gem::Requirement
|
67
|
-
requirements:
|
68
|
-
- - '='
|
54
|
+
- - "~>"
|
69
55
|
- !ruby/object:Gem::Version
|
70
|
-
version: 3.
|
56
|
+
version: '3.7'
|
71
57
|
- !ruby/object:Gem::Dependency
|
72
58
|
name: json-schema
|
73
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,28 +74,28 @@ dependencies:
|
|
88
74
|
requirements:
|
89
75
|
- - "~>"
|
90
76
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.
|
77
|
+
version: 0.2.3
|
92
78
|
type: :runtime
|
93
79
|
prerelease: false
|
94
80
|
version_requirements: !ruby/object:Gem::Requirement
|
95
81
|
requirements:
|
96
82
|
- - "~>"
|
97
83
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.
|
84
|
+
version: 0.2.3
|
99
85
|
- !ruby/object:Gem::Dependency
|
100
86
|
name: urbanopt-core
|
101
87
|
requirement: !ruby/object:Gem::Requirement
|
102
88
|
requirements:
|
103
89
|
- - "~>"
|
104
90
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.
|
91
|
+
version: 0.3.0
|
106
92
|
type: :runtime
|
107
93
|
prerelease: false
|
108
94
|
version_requirements: !ruby/object:Gem::Requirement
|
109
95
|
requirements:
|
110
96
|
- - "~>"
|
111
97
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.
|
98
|
+
version: 0.3.0
|
113
99
|
description: Library and measures to translate URBANopt GeoJSON format to OpenStudio
|
114
100
|
email:
|
115
101
|
- tanushree.charan@nrel.gov
|
@@ -169,23 +155,17 @@ files:
|
|
169
155
|
- docs/schemas/site-properties.md
|
170
156
|
- docs/schemas/thermal-connector-properties.md
|
171
157
|
- docs/schemas/thermal-junction-properties.md
|
172
|
-
- lib/change_log.rb
|
173
158
|
- lib/measures/.rubocop.yml
|
174
159
|
- lib/measures/urban_geometry_creation/LICENSE.md
|
175
160
|
- lib/measures/urban_geometry_creation/README.md
|
176
161
|
- lib/measures/urban_geometry_creation/README.md.erb
|
177
162
|
- lib/measures/urban_geometry_creation/measure.rb
|
178
163
|
- lib/measures/urban_geometry_creation/measure.xml
|
179
|
-
- lib/measures/urban_geometry_creation/tests/nrel_stm_footprints.geojson
|
180
|
-
- lib/measures/urban_geometry_creation/tests/shadowed_tests.rb
|
181
|
-
- lib/measures/urban_geometry_creation/tests/urban_geometry_creation_test.rb
|
182
164
|
- lib/measures/urban_geometry_creation_zoning/LICENSE.md
|
183
165
|
- lib/measures/urban_geometry_creation_zoning/README.md
|
184
166
|
- lib/measures/urban_geometry_creation_zoning/README.md.erb
|
185
167
|
- lib/measures/urban_geometry_creation_zoning/measure.rb
|
186
168
|
- lib/measures/urban_geometry_creation_zoning/measure.xml
|
187
|
-
- lib/measures/urban_geometry_creation_zoning/tests/nrel_stm_footprints.geojson
|
188
|
-
- lib/measures/urban_geometry_creation_zoning/tests/urban_geometry_creation_zoning_test.rb
|
189
169
|
- lib/urbanopt-geojson.rb
|
190
170
|
- lib/urbanopt/geojson.rb
|
191
171
|
- lib/urbanopt/geojson/building.rb
|
@@ -227,17 +207,17 @@ require_paths:
|
|
227
207
|
- lib
|
228
208
|
required_ruby_version: !ruby/object:Gem::Requirement
|
229
209
|
requirements:
|
230
|
-
- - "
|
210
|
+
- - "~>"
|
231
211
|
- !ruby/object:Gem::Version
|
232
|
-
version:
|
212
|
+
version: 2.5.0
|
233
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
214
|
requirements:
|
235
|
-
- - "
|
215
|
+
- - ">="
|
236
216
|
- !ruby/object:Gem::Version
|
237
|
-
version:
|
217
|
+
version: '0'
|
238
218
|
requirements: []
|
239
219
|
rubyforge_project:
|
240
|
-
rubygems_version: 2.
|
220
|
+
rubygems_version: 2.7.6
|
241
221
|
signing_key:
|
242
222
|
specification_version: 4
|
243
223
|
summary: Library and measures to translate URBANopt GeoJSON format to OpenStudio
|
data/lib/change_log.rb
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'github_api'
|
4
|
-
require 'date'
|
5
|
-
require 'optparse'
|
6
|
-
require 'optparse/date'
|
7
|
-
|
8
|
-
# Instructions:
|
9
|
-
# Get a token from github's settings (https://github.com/settings/tokens)
|
10
|
-
#
|
11
|
-
# Example:
|
12
|
-
# ruby change_log.rb -t abcdefghijklmnopqrstuvwxyz -s 2017-09-06
|
13
|
-
#
|
14
|
-
|
15
|
-
options = {}
|
16
|
-
OptionParser.new do |opts|
|
17
|
-
opts.banner = "Usage: change_log.rb [options]\n" +
|
18
|
-
"Prints New, Open, Closed Issues, and number of accepted PRs"
|
19
|
-
opts.separator ""
|
20
|
-
|
21
|
-
# defaults, go back 90 days
|
22
|
-
options[:start_date] = Date.today - 90
|
23
|
-
options[:end_date] = Date.today
|
24
|
-
|
25
|
-
opts.on('-s', '--start-date [DATE]', Date, 'Start of data (e.g. 2017-09-06)') do |v|
|
26
|
-
options[:start_date] = v
|
27
|
-
end
|
28
|
-
opts.on('-e', '--end-date [DATE]', Date, 'End of data (e.g. 2017-09-13)') do |v|
|
29
|
-
options[:end_date] = v
|
30
|
-
end
|
31
|
-
opts.on('-t', '--token [String]', String, 'Github API Token') do |v|
|
32
|
-
options[:token] = v
|
33
|
-
end
|
34
|
-
end.parse!
|
35
|
-
|
36
|
-
# Convert dates to time objects
|
37
|
-
options[:start_date] = Time.parse(options[:start_date].to_s)
|
38
|
-
options[:end_date] = Time.parse(options[:end_date].to_s)
|
39
|
-
puts options
|
40
|
-
|
41
|
-
### Repository options
|
42
|
-
repo_owner = 'URBANopt'
|
43
|
-
repo = 'urbanopt-geojson-gem'
|
44
|
-
|
45
|
-
github = Github.new
|
46
|
-
if options[:token]
|
47
|
-
puts 'Using github token'
|
48
|
-
github = Github.new oauth_token: options[:token]
|
49
|
-
end
|
50
|
-
|
51
|
-
total_open_issues = []
|
52
|
-
total_open_pull_requests = []
|
53
|
-
new_issues = []
|
54
|
-
closed_issues = []
|
55
|
-
accepted_pull_requests = []
|
56
|
-
|
57
|
-
def get_num(issue)
|
58
|
-
issue.html_url.split('/')[-1].to_i
|
59
|
-
end
|
60
|
-
|
61
|
-
def get_issue_num(issue)
|
62
|
-
"\##{get_num(issue)}"
|
63
|
-
end
|
64
|
-
|
65
|
-
def get_html_url(issue)
|
66
|
-
issue.html_url
|
67
|
-
end
|
68
|
-
|
69
|
-
def get_title(issue)
|
70
|
-
issue.title
|
71
|
-
end
|
72
|
-
|
73
|
-
def print_issue(issue)
|
74
|
-
is_feature = false
|
75
|
-
issue.labels.each { |label| is_feature = true if label.name == 'Feature Request' }
|
76
|
-
|
77
|
-
if is_feature
|
78
|
-
"- Improved [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
|
79
|
-
else
|
80
|
-
"- Fixed [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
# Process Open Issues
|
85
|
-
results = -1
|
86
|
-
page = 1
|
87
|
-
while results != 0
|
88
|
-
resp = github.issues.list user: repo_owner, repo: repo, sort: 'created', direction: 'asc',
|
89
|
-
state: 'open', per_page: 100, page: page
|
90
|
-
results = resp.length
|
91
|
-
resp.env[:body].each do |issue, _index|
|
92
|
-
created = Time.parse(issue.created_at)
|
93
|
-
if !issue.key?(:pull_request)
|
94
|
-
total_open_issues << issue
|
95
|
-
if created >= options[:start_date] && created <= options[:end_date]
|
96
|
-
new_issues << issue
|
97
|
-
end
|
98
|
-
else
|
99
|
-
total_open_pull_requests << issue
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
page += 1
|
104
|
-
end
|
105
|
-
|
106
|
-
# Process Closed Issues
|
107
|
-
results = -1
|
108
|
-
page = 1
|
109
|
-
while results != 0
|
110
|
-
resp = github.issues.list user: repo_owner, repo: repo, sort: 'created', direction: 'asc',
|
111
|
-
state: 'closed', per_page: 100, page: page
|
112
|
-
results = resp.length
|
113
|
-
resp.env[:body].each do |issue, _index|
|
114
|
-
created = Time.parse(issue.created_at)
|
115
|
-
closed = Time.parse(issue.closed_at)
|
116
|
-
if !issue.key?(:pull_request)
|
117
|
-
if created >= options[:start_date] && created <= options[:end_date]
|
118
|
-
new_issues << issue
|
119
|
-
end
|
120
|
-
if closed >= options[:start_date] && closed <= options[:end_date]
|
121
|
-
closed_issues << issue
|
122
|
-
end
|
123
|
-
elsif closed >= options[:start_date] && closed <= options[:end_date]
|
124
|
-
accepted_pull_requests << issue
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
page += 1
|
129
|
-
end
|
130
|
-
|
131
|
-
closed_issues.sort! { |x, y| get_num(x) <=> get_num(y) }
|
132
|
-
new_issues.sort! { |x, y| get_num(x) <=> get_num(y) }
|
133
|
-
accepted_pull_requests.sort! { |x, y| get_num(x) <=> get_num(y) }
|
134
|
-
total_open_pull_requests.sort! { |x, y| get_num(x) <=> get_num(y) }
|
135
|
-
|
136
|
-
puts "Total Open Issues: #{total_open_issues.length}"
|
137
|
-
puts "Total Open Pull Requests: #{total_open_pull_requests.length}"
|
138
|
-
puts "\nDate Range: #{options[:start_date].strftime('%m/%d/%y')} - #{options[:end_date].strftime('%m/%d/%y')}:"
|
139
|
-
puts "\nNew Issues: #{new_issues.length} (" + new_issues.map { |issue| get_issue_num(issue) }.join(', ') + ')'
|
140
|
-
|
141
|
-
puts "\nClosed Issues: #{closed_issues.length}"
|
142
|
-
closed_issues.each { |issue| puts print_issue(issue) }
|
143
|
-
|
144
|
-
puts "\nAccepted Pull Requests: #{accepted_pull_requests.length}"
|
145
|
-
accepted_pull_requests.each { |issue| puts print_issue(issue) }
|
146
|
-
|
147
|
-
puts "\nAll Open Issues: #{total_open_issues.length} (" + total_open_issues.map { |issue| get_issue_num(issue) }.join(', ') + ')'
|