openstudio_measure_tester 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 0da19a77118095eef44c4e967688a5168fc95fd9ce86c93cbb5f9b7e1377c1c3
4
- data.tar.gz: 18550c876ea20bb2f3324a9ebd517f858d039b1dedd491139360016852aa0177
3
+ metadata.gz: bed1d88ea71b416d0eb6ae00a5f186400f839f9898008633e9a653b21d934203
4
+ data.tar.gz: 38407645ec5d6a52dc358483a4e8f0a5ea812dada1db1b806d60547546d102ef
5
5
  SHA512:
6
- metadata.gz: a57f5ec4e23d885192fb2a66405ab704ac77e5c09bac3ff330309395738622d74d675eac9e875485e6c8a4979dab9075bcffb41b00d43624229fc4964f2e7e86
7
- data.tar.gz: f9dd42f7805f79e88837a16857d91455b3dd0a06451e2dd11a1fceda9590b57254526d100d4bbef99ae1bcecace4cb7268d8857b91cabb378ef3c440ee118329
6
+ metadata.gz: 3432dce50e31c6758758b1e7030f32fd5da167a2d0b5348ff49134434bd01709aad90560f78dc29c7986124892e1627f248d21f2013ceed30a9b32bb344d281b
7
+ data.tar.gz: 43b8d9cfe76889d826edc8f4e9c9554685836df03706d2bf3d531ff93731cce9512a302498bb2c76c4d4ca01443a6db3836c13ff994ec2b5aa5c03910e60716f
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
+ # Version 0.2.1
2
+
3
+ * Update to SimpleCov 0.18.2
4
+ * Pessimistically version dependencies
5
+
1
6
  # Version 0.2.0
2
7
 
3
- * Remove support for Ruby 2.2.4. Use Ruby 2.5.5.
8
+ * Remove support for Ruby 2.2.4. Use Ruby ~> 2.5.x
4
9
  * Remove NREL's fork of simplecov
5
10
  * Update copyrights
6
11
  * Remove travis and leverage NREL's Jenkins CI
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # OpenStudio® Measure Tester
2
2
 
3
- [![Build Status](https://travis-ci.org/NREL/OpenStudio-measure-tester-gem.svg?branch=develop)](https://travis-ci.org/NREL/OpenStudio-measure-tester-gem)
4
3
  [![Gem Version](https://badge.fury.io/rb/openstudio_measure_tester.svg)](https://badge.fury.io/rb/openstudio_measure_tester)
5
4
 
6
5
  The OpenStudio Measure Tester is a rubygem that exposes rake tasks for testing OpenStudio measures.
@@ -71,14 +70,13 @@ The OpenStudio Measure Tester is a rubygem that exposes rake tasks for testing O
71
70
  # Testing in Docker
72
71
 
73
72
  ```bash
74
-
75
73
  apt-get update && apt-get install -y curl
76
74
  curl -sLO https://raw.githubusercontent.com/NREL/OpenStudio-server/develop/docker/deployment/scripts/install_ruby.sh
77
75
  curl -sLO https://raw.githubusercontent.com/NREL/OpenStudio-server/develop/docker/deployment/scripts/install_openstudio.sh
78
76
  chmod +x install_ruby.sh
79
77
  chmod +x install_openstudio.sh
80
- ./install_ruby.sh 2.2.4 b6eff568b48e0fda76e5a36333175df049b204e91217aa32a65153cc0cdcb761
81
- ./install_openstudio.sh 2.4.0 f58a3e1808
78
+ ./install_ruby.sh 2.5.5 28a945fdf340e6ba04fc890b98648342e3cccfd6d223a48f3810572f11b2514c
79
+ ./install_openstudio.sh 3.0.0 <tdb>
82
80
  export RUBYLIB=/usr/Ruby
83
81
  ```
84
82
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'openstudio_measure_tester'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'openstudio_measure_tester'
4
5
 
@@ -12,11 +13,11 @@ end
12
13
  begin
13
14
  runner = OpenStudioMeasureTester::Runner.new(measure_dir)
14
15
  runner.run_all(Dir.pwd)
15
- rescue StandardError => exception
16
+ rescue StandardError => e
16
17
  puts
17
18
  puts '!!!!!!!!!!!!!!!!!!!!! Error Occurred !!!!!!!!!!!!!!!!!!!!!'
18
- puts exception.message
19
- puts exception.backtrace
19
+ puts e.message
20
+ puts e.backtrace
20
21
  puts '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
21
22
  puts
22
23
  end
@@ -37,7 +37,7 @@ require 'simplecov'
37
37
 
38
38
  begin
39
39
  require 'git'
40
- rescue LoadError => error
40
+ rescue LoadError => e
41
41
  puts 'Could not load git, will not be able to report git information'
42
42
  end
43
43
 
@@ -26,7 +26,7 @@ module OpenStudioMeasureTester
26
26
  # copy over all the resource files to display the website correctly.
27
27
  resource_path = File.expand_path('../../dashboard', File.dirname(__FILE__))
28
28
  # KAF: for some reason, not overwriting the files. delete them from destination first
29
- FileUtils.remove_dir("#{save_dir}/css") if Dir.exist?"#{save_dir}/css"
29
+ FileUtils.remove_dir("#{save_dir}/css") if Dir.exist? "#{save_dir}/css"
30
30
  FileUtils.remove_dir("#{save_dir}/js") if Dir.exist? "#{save_dir}/js"
31
31
  FileUtils.cp_r("#{resource_path}/css", "#{save_dir}/css", remove_destination: true)
32
32
  FileUtils.cp_r("#{resource_path}/js", "#{save_dir}/js", remove_destination: true)
@@ -67,7 +67,7 @@ module OpenStudioMeasureTester
67
67
  json_data = JSON.parse(File.read(file), symbolize_names: true)
68
68
 
69
69
  # Test if the measure has already been parse, if so, then continue
70
- next if @measure_results.keys.include? json_data[:measure_name]
70
+ next if @measure_results.key?(json_data[:measure_name])
71
71
 
72
72
  mhash = {}
73
73
  mhash[:tested_class] = json_data[:measure_name]
@@ -98,7 +98,7 @@ module OpenStudioMeasureTester
98
98
  severity: :warning,
99
99
  file_type: :test
100
100
  }, {
101
- regex: /require .openstudio\/ruleset /,
101
+ regex: %r{require .openstudio/ruleset },
102
102
  check_type: :if_exists,
103
103
  message: "Require openstudio/ruleset/* is deprecated. Use require 'openstudio/measure/*'",
104
104
  type: :syntax,
@@ -168,10 +168,10 @@ module OpenStudioMeasureTester
168
168
  begin
169
169
  # there seems to be a race condition with the infoExtractor method
170
170
  measure_info = infoExtractor(measure, OpenStudio::Model::OptionalModel.new, OpenStudio::OptionalWorkspace.new)
171
- rescue NameError => error
172
- log_message("Unable to parse info from measure. Error: '#{error}'", :general, :error)
173
- rescue StandardError => error
174
- log_message("Unknown error extracting measure info. Error #{error}", :general, :error)
171
+ rescue NameError => e
172
+ log_message("Unable to parse info from measure. Error: '#{e}'", :general, :error)
173
+ rescue StandardError => e
174
+ log_message("Unknown error extracting measure info. Error #{e}", :general, :error)
175
175
  end
176
176
 
177
177
  measure_hash = generate_measure_hash(measure_dir, measure, measure_info)
@@ -242,7 +242,7 @@ module OpenStudioMeasureTester
242
242
  log_message(check[:message], check[:type], check[:severity])
243
243
  end
244
244
  elsif check[:check_type] == :if_missing
245
- if data !~ check[:regex]
245
+ if !data&.match?(check[:regex])
246
246
  log_message(check[:message], check[:type], check[:severity])
247
247
  end
248
248
  end
@@ -60,7 +60,7 @@ module OpenStudioMeasureTester
60
60
  if !logs.empty?
61
61
  sha = logs.first.sha
62
62
  end
63
- rescue StandardError => error
63
+ rescue StandardError => e
64
64
  puts 'Could not find .git for measure(s), will not be able to report git information'
65
65
  end
66
66
 
@@ -234,9 +234,9 @@ module OpenStudioMeasureTester
234
234
  end
235
235
  end
236
236
  end
237
- rescue StandardError => exception
237
+ rescue StandardError => e
238
238
  compatible[:compatible] = false
239
- compatible[:message] = exception.message
239
+ compatible[:message] = e.message
240
240
  end
241
241
 
242
242
  if !compatible[:compatible]
@@ -250,8 +250,8 @@ module OpenStudioMeasureTester
250
250
  load file
251
251
  compatible[:loaded] = true
252
252
  num_tests += 1
253
- rescue StandardError, LoadError => exception
254
- compatible[:load_errors] << exception.message
253
+ rescue StandardError, LoadError => e
254
+ compatible[:load_errors] << e.message
255
255
  end
256
256
 
257
257
  ensure
@@ -294,11 +294,11 @@ module OpenStudioMeasureTester
294
294
  # openstudio_measure_tester.rb file, so it will not run.
295
295
  begin
296
296
  Minitest.run ['--verbose']
297
- rescue StandardError => exception
297
+ rescue StandardError => e
298
298
  puts
299
299
  puts '!!!!!!!!!!!!!!!!!!!!! Minitest Error Occurred !!!!!!!!!!!!!!!!!!!!!'
300
- puts exception.message
301
- puts exception.backtrace
300
+ puts e.message
301
+ puts e.backtrace
302
302
  puts '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
303
303
  puts
304
304
  end
@@ -29,5 +29,5 @@
29
29
  ########################################################################################################################
30
30
 
31
31
  module OpenStudioMeasureTester
32
- VERSION = '0.2.0'
32
+ VERSION = '0.2.1'
33
33
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'openstudio_measure_tester/version'
@@ -12,10 +14,10 @@ Gem::Specification.new do |spec|
12
14
  spec.summary = 'Testing framework for OpenStudio measures'
13
15
  spec.description = 'Testing framework for OpenStudio measures'
14
16
  spec.metadata = {
15
- 'bug_tracker_uri' => 'https://github.com/NREL/OpenStudio-measure-tester-gem/issues',
16
- 'changelog_uri' => 'https://github.com/NREL/OpenStudio-measure-tester-gem/blob/develop/CHANGELOG.md',
17
- #'documentation_uri' => 'https://www.rubydoc.info/gems/openstudio_measure_tester/#{gem.version}',
18
- 'source_code_uri' => "https://github.com/NREL/OpenStudio-measure-tester-gem/tree/v#{spec.version}"
17
+ 'bug_tracker_uri' => 'https://github.com/NREL/OpenStudio-measure-tester-gem/issues',
18
+ 'changelog_uri' => 'https://github.com/NREL/OpenStudio-measure-tester-gem/blob/develop/CHANGELOG.md',
19
+ # 'documentation_uri' => 'https://www.rubydoc.info/gems/openstudio_measure_tester/#{gem.version}',
20
+ 'source_code_uri' => "https://github.com/NREL/OpenStudio-measure-tester-gem/tree/v#{spec.version}"
19
21
  }
20
22
 
21
23
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -25,23 +27,15 @@ Gem::Specification.new do |spec|
25
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
28
  spec.require_paths = ['lib']
27
29
 
28
- spec.required_ruby_version = '>= 2.5'
29
-
30
- if /^2\.5/.match(RUBY_VERSION)
31
- spec.add_dependency 'rubocop', '0.54.0'
32
- elsif /^2\.2/.match(RUBY_VERSION)
33
- spec.add_dependency 'rubocop', '0.54.0'
34
- elsif /^2\.0/.match(RUBY_VERSION)
35
- spec.add_dependency 'rainbow', '2.2.2'
36
- spec.add_dependency 'rubocop', '0.50.0'
37
- end
30
+ spec.required_ruby_version = '~> 2.5.0'
38
31
 
39
- spec.add_dependency 'git', '1.6.0'
40
- spec.add_dependency 'minitest', '5.4.3'
41
- spec.add_dependency 'minitest-reporters', '1.2.0'
42
- spec.add_dependency 'rake', '12.3.1'
43
- spec.add_dependency 'rubocop-checkstyle_formatter', '0.4'
44
- spec.add_dependency 'simplecov', '0.18.1'
32
+ spec.add_dependency 'git', '~> 1.6.0'
33
+ spec.add_dependency 'minitest', '~> 5.14.0'
34
+ spec.add_dependency 'minitest-reporters', '~> 1.4.2'
35
+ spec.add_dependency 'rake', '~> 13.0'
36
+ spec.add_dependency 'rubocop', '~> 0.80.1'
37
+ spec.add_dependency 'rubocop-checkstyle_formatter', '~> 0.4.0'
38
+ spec.add_dependency 'simplecov', '~> 0.18.2'
45
39
 
46
40
  spec.add_development_dependency 'bundler', '~> 2.1'
47
41
  spec.add_development_dependency 'rspec', '~> 3.9'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio_measure_tester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Long
@@ -11,106 +11,106 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2020-02-12 00:00:00.000000000 Z
14
+ date: 2020-03-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: rubocop
17
+ name: git
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - '='
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.54.0
22
+ version: 1.6.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '='
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 0.54.0
29
+ version: 1.6.0
30
30
  - !ruby/object:Gem::Dependency
31
- name: git
31
+ name: minitest
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - '='
34
+ - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: 1.6.0
36
+ version: 5.14.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - '='
41
+ - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: 1.6.0
43
+ version: 5.14.0
44
44
  - !ruby/object:Gem::Dependency
45
- name: minitest
45
+ name: minitest-reporters
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - '='
48
+ - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 5.4.3
50
+ version: 1.4.2
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - '='
55
+ - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: 5.4.3
57
+ version: 1.4.2
58
58
  - !ruby/object:Gem::Dependency
59
- name: minitest-reporters
59
+ name: rake
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - '='
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
- version: 1.2.0
64
+ version: '13.0'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '='
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
- version: 1.2.0
71
+ version: '13.0'
72
72
  - !ruby/object:Gem::Dependency
73
- name: rake
73
+ name: rubocop
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - '='
76
+ - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: 12.3.1
78
+ version: 0.80.1
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '='
83
+ - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: 12.3.1
85
+ version: 0.80.1
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: rubocop-checkstyle_formatter
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - '='
90
+ - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: '0.4'
92
+ version: 0.4.0
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - '='
97
+ - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '0.4'
99
+ version: 0.4.0
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: simplecov
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - '='
104
+ - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: 0.18.1
106
+ version: 0.18.2
107
107
  type: :runtime
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - '='
111
+ - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: 0.18.1
113
+ version: 0.18.2
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: bundler
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -187,16 +187,16 @@ licenses: []
187
187
  metadata:
188
188
  bug_tracker_uri: https://github.com/NREL/OpenStudio-measure-tester-gem/issues
189
189
  changelog_uri: https://github.com/NREL/OpenStudio-measure-tester-gem/blob/develop/CHANGELOG.md
190
- source_code_uri: https://github.com/NREL/OpenStudio-measure-tester-gem/tree/v0.2.0
190
+ source_code_uri: https://github.com/NREL/OpenStudio-measure-tester-gem/tree/v0.2.1
191
191
  post_install_message:
192
192
  rdoc_options: []
193
193
  require_paths:
194
194
  - lib
195
195
  required_ruby_version: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - ">="
197
+ - - "~>"
198
198
  - !ruby/object:Gem::Version
199
- version: '2.5'
199
+ version: 2.5.0
200
200
  required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  requirements:
202
202
  - - ">="