urbanopt-cli 0.3.0.pre1 → 0.3.0
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/CHANGELOG.md +8 -2
- data/Gemfile +4 -3
- data/Rakefile +6 -0
- data/developer_nrel_key.rb +1 -0
- data/example_files/Gemfile +21 -26
- data/example_files/mappers/Baseline.rb +1 -0
- data/example_files/mappers/HighEfficiency.rb +1 -0
- data/lib/uo_cli.rb +1 -2
- data/lib/uo_cli/version.rb +2 -1
- data/uo_cli.gemspec +3 -6
- metadata +16 -18
- data/lib/change_log.rb +0 -152
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b94efb3b879736fb2ae42066df09074df251a867bc9a6e5445176b22f8f6f98
|
|
4
|
+
data.tar.gz: 66675088de2f51c32e75412b96ba1668a413237cfab5dfa7393770c2d5f6af87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50315f0fc6c9e65046f64d8e32d24fdd33ead8c6ae26e2269c148caf98c75f034ddf4d3c9b6c359d5c9aba8aa8b7b36e32aaffa0924274a5e2ab54424330540b
|
|
7
|
+
data.tar.gz: de80f0f613d5fd773e521b0c423a9bdcf647d9bd87b7d2d64c5963b3870f0f6eb2030e5ab9cbfed12a49e0ef1ed226f271efd25bfd4e46f8758293ecade93e43
|
data/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## Version 0.3.0
|
|
3
|
+
## Version 0.3.0
|
|
4
4
|
|
|
5
|
-
Date Range: 04/23/20 - 05/20
|
|
5
|
+
Date Range: 04/23/20 - 06/05/20
|
|
6
|
+
|
|
7
|
+
- Fixed [#96]( https://github.com/urbanopt/urbanopt-cli/issues/96 ), Better error checking
|
|
8
|
+
- Fixed [#99]( https://github.com/urbanopt/urbanopt-cli/issues/99 ), CLI complexity is hindering usage
|
|
9
|
+
- Fixed [#100]( https://github.com/urbanopt/urbanopt-cli/issues/100 ), REopt gem is used even for non-reopt simulations and post-processing
|
|
10
|
+
- Fixed [#102]( https://github.com/urbanopt/urbanopt-cli/issues/102 ), Update change_log functionality
|
|
11
|
+
- Fixed [#103]( https://github.com/urbanopt/urbanopt-cli/issues/103 ), Update CLI to work with OS 3.0
|
|
6
12
|
|
|
7
13
|
Update to OpenStudio 3.x and Ruby 2.5.x
|
|
8
14
|
|
data/Gemfile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
source 'http://rubygems.org'
|
|
2
3
|
|
|
3
4
|
# Specify dependencies in uo_cli.gemspec
|
|
@@ -38,7 +39,7 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
|
|
|
38
39
|
# elsif allow_local
|
|
39
40
|
# gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
|
|
40
41
|
# else
|
|
41
|
-
# gem 'urbanopt-scenario', '0.
|
|
42
|
+
# gem 'urbanopt-scenario', '0.3.0'
|
|
42
43
|
# # temporary
|
|
43
44
|
# # gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
|
|
44
45
|
# end
|
|
@@ -49,7 +50,7 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
|
|
|
49
50
|
# elsif allow_local
|
|
50
51
|
# gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
|
|
51
52
|
# else
|
|
52
|
-
# gem 'urbanopt-geojson', '0.
|
|
53
|
+
# gem 'urbanopt-geojson', '0.3.0'
|
|
53
54
|
# # temporary
|
|
54
55
|
# # gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
|
|
55
56
|
# end
|
|
@@ -59,5 +60,5 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
|
|
|
59
60
|
# elsif allow_local
|
|
60
61
|
# gem 'urbanopt-reopt', github: 'URBANopt/urbanopt-reopt-gem', branch: 'develop'
|
|
61
62
|
# else
|
|
62
|
-
# gem 'urbanopt-reopt', '0.
|
|
63
|
+
# gem 'urbanopt-reopt', '0.3.0'
|
|
63
64
|
# end
|
data/Rakefile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
require 'bundler/gem_tasks'
|
|
2
3
|
require 'rspec/core/rake_task'
|
|
3
4
|
require 'rubocop/rake_task'
|
|
@@ -5,4 +6,9 @@ require 'rubocop/rake_task'
|
|
|
5
6
|
RSpec::Core::RakeTask.new(:spec)
|
|
6
7
|
RuboCop::RakeTask.new
|
|
7
8
|
|
|
9
|
+
# Load in the rake tasks from the base openstudio-extension gem
|
|
10
|
+
require 'openstudio/extension/rake_task'
|
|
11
|
+
os_extension = OpenStudio::Extension::RakeTask.new
|
|
12
|
+
os_extension.set_extension_class(OpenStudio::Extension::Extension, 'urbanopt/urbanopt-cli')
|
|
13
|
+
|
|
8
14
|
task default: :spec
|
data/developer_nrel_key.rb
CHANGED
data/example_files/Gemfile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
source 'http://rubygems.org'
|
|
2
3
|
|
|
3
4
|
ruby '~> 2.5.0'
|
|
@@ -10,50 +11,44 @@ ruby '~> 2.5.0'
|
|
|
10
11
|
# checkout the latest version (develop) from github.
|
|
11
12
|
allow_local = ENV['FAVOR_LOCAL_GEMS']
|
|
12
13
|
|
|
13
|
-
# Uncomment the extension,
|
|
14
|
+
# Uncomment the extension, core gems if you need to test local development versions. Otherwise
|
|
14
15
|
# these are included in the model articulation and urbanopt gems
|
|
15
16
|
#
|
|
16
17
|
# if allow_local && File.exist?('../OpenStudio-extension-gem')
|
|
17
18
|
# gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
|
|
18
19
|
# elsif allow_local
|
|
19
|
-
# gem 'openstudio-extension', github: 'NREL/
|
|
20
|
+
# gem 'openstudio-extension', github: 'NREL/openstudio-extension-gem', branch: 'develop'
|
|
20
21
|
# end
|
|
21
|
-
|
|
22
|
-
# if allow_local && File.exist?('../openstudio-common-measures-gem')
|
|
23
|
-
# gem 'openstudio-common-measures', path: '../openstudio-common-measures-gem'
|
|
24
|
-
# elsif allow_local
|
|
25
|
-
# gem 'openstudio-common-measures', github: 'NREL/openstudio-common-measures-gem', branch: 'develop'
|
|
26
|
-
# end
|
|
27
|
-
#
|
|
22
|
+
|
|
28
23
|
# if allow_local && File.exist?('../urbanopt-core-gem')
|
|
29
24
|
# gem 'urbanopt-core', path: '../urbanopt-core-gem'
|
|
30
25
|
# elsif allow_local
|
|
31
|
-
#
|
|
26
|
+
# gem 'urbanopt-core', github: 'URBANopt/urbanopt-core-gem', branch: 'develop'
|
|
32
27
|
# end
|
|
33
28
|
#
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
# gem 'openstudio-model-articulation', path: '../openstudio-model-articulation-gem'
|
|
43
|
-
# elsif allow_local
|
|
44
|
-
# gem 'openstudio-model-articulation', github: 'NREL/openstudio-model-articulation-gem', branch: 'develop'
|
|
45
|
-
# else
|
|
46
|
-
# gem 'openstudio-model-articulation', '0.1.0'
|
|
47
|
-
# end
|
|
30
|
+
if allow_local && File.exist?('../openstudio-common-measures-gem')
|
|
31
|
+
gem 'openstudio-common-measures', path: '../openstudio-common-measures-gem'
|
|
32
|
+
elsif allow_local
|
|
33
|
+
gem 'openstudio-common-measures', github: 'NREL/openstudio-common-measures-gem', branch: 'develop'
|
|
34
|
+
else
|
|
35
|
+
gem 'openstudio-common-measures', '~> 0.2.0'
|
|
36
|
+
end
|
|
48
37
|
|
|
49
|
-
|
|
38
|
+
if allow_local && File.exist?('../openstudio-model-articulation-gem')
|
|
39
|
+
gem 'openstudio-model-articulation', path: '../openstudio-model-articulation-gem'
|
|
40
|
+
elsif allow_local
|
|
41
|
+
gem 'openstudio-model-articulation', github: 'NREL/openstudio-model-articulation-gem', branch: 'develop'
|
|
42
|
+
else
|
|
43
|
+
gem 'openstudio-model-articulation', '~> 0.2.0'
|
|
44
|
+
end
|
|
50
45
|
|
|
51
46
|
if allow_local && File.exist?('../urbanopt-scenario-gem')
|
|
52
47
|
gem 'urbanopt-scenario', path: '../urbanopt-scenario-gem'
|
|
53
48
|
elsif allow_local
|
|
54
49
|
gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
|
|
55
50
|
else
|
|
56
|
-
gem 'urbanopt-scenario', '0.3.0
|
|
51
|
+
gem 'urbanopt-scenario', '~> 0.3.0'
|
|
57
52
|
end
|
|
58
53
|
|
|
59
54
|
if allow_local && File.exist?('../urbanopt-geojson-gem')
|
|
@@ -61,5 +56,5 @@ if allow_local && File.exist?('../urbanopt-geojson-gem')
|
|
|
61
56
|
elsif allow_local
|
|
62
57
|
gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
|
|
63
58
|
else
|
|
64
|
-
gem 'urbanopt-geojson', '0.3.0
|
|
59
|
+
gem 'urbanopt-geojson', '~> 0.3.0'
|
|
65
60
|
end
|
data/lib/uo_cli.rb
CHANGED
|
@@ -287,8 +287,7 @@ module URBANopt
|
|
|
287
287
|
|
|
288
288
|
config_file = 'https://raw.githubusercontent.com/urbanopt/urbanopt-cli/master/example_files/runner.conf'
|
|
289
289
|
example_feature_file = 'https://raw.githubusercontent.com/urbanopt/urbanopt-cli/master/example_files/example_project.json'
|
|
290
|
-
|
|
291
|
-
example_gem_file = 'https://raw.githubusercontent.com/urbanopt/urbanopt-cli/openstudio-3.x/example_files/Gemfile'
|
|
290
|
+
example_gem_file = 'https://raw.githubusercontent.com/urbanopt/urbanopt-cli/master/example_files/Gemfile'
|
|
292
291
|
remote_weather_files = [
|
|
293
292
|
'https://raw.githubusercontent.com/urbanopt/urbanopt-cli/master/example_files/weather/USA_NY_Buffalo-Greater.Buffalo.Intl.AP.725280_TMY3.epw',
|
|
294
293
|
'https://raw.githubusercontent.com/urbanopt/urbanopt-cli/master/example_files/weather/USA_NY_Buffalo-Greater.Buffalo.Intl.AP.725280_TMY3.ddy',
|
data/lib/uo_cli/version.rb
CHANGED
data/uo_cli.gemspec
CHANGED
|
@@ -31,14 +31,11 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
spec.require_paths = ['lib']
|
|
32
32
|
spec.required_ruby_version = '~> 2.5.0'
|
|
33
33
|
|
|
34
|
-
# use specific versions of these dependencies while using Ruby 2.2
|
|
35
|
-
#spec.add_development_dependency 'rack', '2.1.2'
|
|
36
|
-
|
|
37
34
|
# use specific versions of urbanopt and openstudio dependencies while under heavy development
|
|
38
35
|
spec.add_dependency 'optimist'
|
|
39
|
-
spec.add_dependency 'urbanopt-geojson', '0.3.0
|
|
40
|
-
spec.add_dependency 'urbanopt-reopt', '0.3.0
|
|
41
|
-
spec.add_dependency 'urbanopt-scenario', '0.3.0
|
|
36
|
+
spec.add_dependency 'urbanopt-geojson', '~> 0.3.0'
|
|
37
|
+
spec.add_dependency 'urbanopt-reopt', '~> 0.3.0'
|
|
38
|
+
spec.add_dependency 'urbanopt-scenario', '~> 0.3.0'
|
|
42
39
|
|
|
43
40
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
|
44
41
|
spec.add_development_dependency 'rake', '~> 13.0'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: urbanopt-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.0
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan Moore
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-06-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: optimist
|
|
@@ -28,44 +28,44 @@ dependencies:
|
|
|
28
28
|
name: urbanopt-geojson
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 0.3.0
|
|
33
|
+
version: 0.3.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 0.3.0
|
|
40
|
+
version: 0.3.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: urbanopt-reopt
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 0.3.0
|
|
47
|
+
version: 0.3.0
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 0.3.0
|
|
54
|
+
version: 0.3.0
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: urbanopt-scenario
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 0.3.0
|
|
61
|
+
version: 0.3.0
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 0.3.0
|
|
68
|
+
version: 0.3.0
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: bundler
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -136,7 +136,6 @@ files:
|
|
|
136
136
|
- ".gitignore"
|
|
137
137
|
- ".rspec"
|
|
138
138
|
- ".rubocop.yml"
|
|
139
|
-
- ".ruby-version"
|
|
140
139
|
- CHANGELOG.md
|
|
141
140
|
- CONTRIBUTING.md
|
|
142
141
|
- Gemfile
|
|
@@ -162,7 +161,6 @@ files:
|
|
|
162
161
|
- example_files/weather/USA_NY_Buffalo-Greater.Buffalo.Intl.AP.725280_TMY3.ddy
|
|
163
162
|
- example_files/weather/USA_NY_Buffalo-Greater.Buffalo.Intl.AP.725280_TMY3.epw
|
|
164
163
|
- example_files/weather/USA_NY_Buffalo-Greater.Buffalo.Intl.AP.725280_TMY3.stat
|
|
165
|
-
- lib/change_log.rb
|
|
166
164
|
- lib/uo_cli.rb
|
|
167
165
|
- lib/uo_cli/version.rb
|
|
168
166
|
- uo_cli.gemspec
|
|
@@ -182,9 +180,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
182
180
|
version: 2.5.0
|
|
183
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
182
|
requirements:
|
|
185
|
-
- - "
|
|
183
|
+
- - ">="
|
|
186
184
|
- !ruby/object:Gem::Version
|
|
187
|
-
version:
|
|
185
|
+
version: '0'
|
|
188
186
|
requirements: []
|
|
189
187
|
rubygems_version: 3.1.2
|
|
190
188
|
signing_key:
|
data/lib/change_log.rb
DELETED
|
@@ -1,152 +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
|
-
# For security, set your token as an env variable. This script is prepared for one called GITHUB_CHANGELOG_TOKEN
|
|
11
|
-
#
|
|
12
|
-
# Example:
|
|
13
|
-
# ruby change_log.rb -t abcdefghijklmnopqrstuvwxyz -s 2017-09-06
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
options = {}
|
|
17
|
-
OptionParser.new do |opts|
|
|
18
|
-
opts.banner = "Usage: change_log.rb [options]\n" \
|
|
19
|
-
'Prints New, Open, Closed Issues, and number of accepted PRs'
|
|
20
|
-
opts.separator ''
|
|
21
|
-
|
|
22
|
-
# defaults, go back 90 days
|
|
23
|
-
options[:start_date] = Date.today - 90
|
|
24
|
-
# Add one day to end date to make it inclusive of current day.
|
|
25
|
-
options[:end_date] = Date.today + 1
|
|
26
|
-
|
|
27
|
-
opts.on('-s', '--start-date [DATE]', Date, 'Start of data (e.g. 2017-09-06)') do |v|
|
|
28
|
-
options[:start_date] = v
|
|
29
|
-
end
|
|
30
|
-
opts.on('-e', '--end-date [DATE]', Date, 'End of data (e.g. 2017-09-13)') do |v|
|
|
31
|
-
options[:end_date] = v
|
|
32
|
-
end
|
|
33
|
-
opts.on('-t', '--token [String]', String, 'Github API Token') do |v|
|
|
34
|
-
options[:token] = v
|
|
35
|
-
end
|
|
36
|
-
end.parse!
|
|
37
|
-
|
|
38
|
-
# Convert dates to time objects
|
|
39
|
-
options[:start_date] = Time.parse(options[:start_date].to_s)
|
|
40
|
-
options[:end_date] = Time.parse(options[:end_date].to_s)
|
|
41
|
-
puts options
|
|
42
|
-
|
|
43
|
-
### Repository options
|
|
44
|
-
repo_owner = 'URBANopt'
|
|
45
|
-
repo = 'uo-cli'
|
|
46
|
-
|
|
47
|
-
github = Github.new
|
|
48
|
-
if options[:token]
|
|
49
|
-
puts 'Using github token'
|
|
50
|
-
github = Github.new oauth_token: options[:token]
|
|
51
|
-
elsif ENV['GITHUB_CHANGELOG_TOKEN']
|
|
52
|
-
puts 'Using Github token from user environment'
|
|
53
|
-
github = Github.new oauth_token: ENV['GITHUB_CHANGELOG_TOKEN']
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
total_open_issues = []
|
|
57
|
-
total_open_pull_requests = []
|
|
58
|
-
new_issues = []
|
|
59
|
-
closed_issues = []
|
|
60
|
-
accepted_pull_requests = []
|
|
61
|
-
|
|
62
|
-
def get_num(issue)
|
|
63
|
-
issue.html_url.split('/')[-1].to_i
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def get_issue_num(issue)
|
|
67
|
-
"\##{get_num(issue)}"
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def get_html_url(issue)
|
|
71
|
-
issue.html_url
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def get_title(issue)
|
|
75
|
-
issue.title
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def print_issue(issue)
|
|
79
|
-
is_feature = false
|
|
80
|
-
issue.labels.each { |label| is_feature = true if label.name == 'Feature Request' }
|
|
81
|
-
|
|
82
|
-
if is_feature
|
|
83
|
-
"- Improved [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
|
|
84
|
-
else
|
|
85
|
-
"- Fixed [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
# Process Open Issues
|
|
90
|
-
results = -1
|
|
91
|
-
page = 1
|
|
92
|
-
while results != 0
|
|
93
|
-
resp = github.issues.list user: repo_owner, repo: repo, sort: 'created', direction: 'asc',
|
|
94
|
-
state: 'open', per_page: 100, page: page
|
|
95
|
-
results = resp.length
|
|
96
|
-
resp.env[:body].each do |issue, _index|
|
|
97
|
-
created = Time.parse(issue.created_at)
|
|
98
|
-
if !issue.key?(:pull_request)
|
|
99
|
-
total_open_issues << issue
|
|
100
|
-
if created >= options[:start_date] && created <= options[:end_date]
|
|
101
|
-
new_issues << issue
|
|
102
|
-
end
|
|
103
|
-
else
|
|
104
|
-
total_open_pull_requests << issue
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
page += 1
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
# Process Closed Issues
|
|
112
|
-
results = -1
|
|
113
|
-
page = 1
|
|
114
|
-
while results != 0
|
|
115
|
-
resp = github.issues.list user: repo_owner, repo: repo, sort: 'created', direction: 'asc',
|
|
116
|
-
state: 'closed', per_page: 100, page: page
|
|
117
|
-
results = resp.length
|
|
118
|
-
resp.env[:body].each do |issue, _index|
|
|
119
|
-
created = Time.parse(issue.created_at)
|
|
120
|
-
closed = Time.parse(issue.closed_at)
|
|
121
|
-
if !issue.key?(:pull_request)
|
|
122
|
-
if created >= options[:start_date] && created <= options[:end_date]
|
|
123
|
-
new_issues << issue
|
|
124
|
-
end
|
|
125
|
-
if closed >= options[:start_date] && closed <= options[:end_date]
|
|
126
|
-
closed_issues << issue
|
|
127
|
-
end
|
|
128
|
-
elsif closed >= options[:start_date] && closed <= options[:end_date]
|
|
129
|
-
accepted_pull_requests << issue
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
page += 1
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
closed_issues.sort! { |x, y| get_num(x) <=> get_num(y) }
|
|
137
|
-
new_issues.sort! { |x, y| get_num(x) <=> get_num(y) }
|
|
138
|
-
accepted_pull_requests.sort! { |x, y| get_num(x) <=> get_num(y) }
|
|
139
|
-
total_open_pull_requests.sort! { |x, y| get_num(x) <=> get_num(y) }
|
|
140
|
-
|
|
141
|
-
puts "Total Open Issues: #{total_open_issues.length}"
|
|
142
|
-
puts "Total Open Pull Requests: #{total_open_pull_requests.length}"
|
|
143
|
-
puts "\nDate Range: #{options[:start_date].strftime('%m/%d/%y')} - #{options[:end_date].strftime('%m/%d/%y')}:"
|
|
144
|
-
puts "\nNew Issues: #{new_issues.length} (" + new_issues.map { |issue| get_issue_num(issue) }.join(', ') + ')'
|
|
145
|
-
|
|
146
|
-
puts "\nClosed Issues: #{closed_issues.length}"
|
|
147
|
-
closed_issues.each { |issue| puts print_issue(issue) }
|
|
148
|
-
|
|
149
|
-
puts "\nAccepted Pull Requests: #{accepted_pull_requests.length}"
|
|
150
|
-
accepted_pull_requests.each { |issue| puts print_issue(issue) }
|
|
151
|
-
|
|
152
|
-
puts "\nAll Open Issues: #{total_open_issues.length} (" + total_open_issues.map { |issue| get_issue_num(issue) }.join(', ') + ')'
|