openstudio_measure_tester 0.1.6 → 0.1.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 873523e54e5442f1468b7398b0dff3e773fbe280
|
4
|
+
data.tar.gz: 04e7b34c93d47e3af0554718bfaf52a8b97e4bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d5ee8f5ee06c1c06cca5768e280cc0bead1fae7e3bbb85410e7c5d5256bc3bf1dd681a8cae61ee1ea7b1d258d37652fbe28113b5557967d5db136b958cdf0a
|
7
|
+
data.tar.gz: b11fef30aed043abec4a4ea1931620ad8249df59e490870e17f8c13df7bbd5910203f7197b969ac51fcca48ded5dfd3e7263d860757c6c76749f1e7f2b08a870
|
data/CHANGELOG.md
CHANGED
@@ -65,7 +65,7 @@ module OpenStudioMeasureTester
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def parse_results
|
68
|
-
Dir[
|
68
|
+
Dir[File.join(@path_to_results,'rubocop-results.xml')].each do |file|
|
69
69
|
puts "Parsing Rubocop report #{file}"
|
70
70
|
|
71
71
|
measure_names = []
|
@@ -76,13 +76,22 @@ module OpenStudioMeasureTester
|
|
76
76
|
puts "Finished reading #{file}"
|
77
77
|
|
78
78
|
# Go through the XML and find all the measure names first
|
79
|
-
doc.elements.each('file') do |rc_file|
|
79
|
+
doc.elements.each('//checkstyle/file') do |rc_file|
|
80
80
|
@total_files += 1
|
81
81
|
measure_name = rc_file.attributes['name']
|
82
82
|
if measure_name
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
# If the user runs the tests from within the directory (where the measure.rb) file exists, then the
|
84
|
+
# measure name is not included in the XML. Therefore, the measure_name will need to be abstracted by
|
85
|
+
# the name of the directory relative to where the test_results are.
|
86
|
+
if measure_name.include? File::SEPARATOR
|
87
|
+
parts = measure_name.split(File::SEPARATOR)
|
88
|
+
if parts.last == 'measure.rb'
|
89
|
+
measure_names << parts[-2]
|
90
|
+
end
|
91
|
+
elsif measure_name == 'measure.rb'
|
92
|
+
# the measure name must be extracted from the directory
|
93
|
+
parts = file.split(File::SEPARATOR)
|
94
|
+
measure_names << parts[-4]
|
86
95
|
end
|
87
96
|
end
|
88
97
|
end
|
@@ -99,12 +108,21 @@ module OpenStudioMeasureTester
|
|
99
108
|
mhash['files'] = []
|
100
109
|
|
101
110
|
cn = ''
|
102
|
-
doc.elements.each('file') do |rc_file|
|
103
|
-
|
111
|
+
doc.elements.each('//checkstyle/file') do |rc_file|
|
112
|
+
# Allow processing when the file is just the measure.rb
|
113
|
+
if rc_file.attributes['name'] != 'measure.rb'
|
114
|
+
if !rc_file.attributes['name'].include? measure_name
|
115
|
+
next
|
116
|
+
end
|
117
|
+
end
|
104
118
|
|
105
119
|
# Save off the file information
|
106
120
|
fhash = {}
|
107
|
-
|
121
|
+
if rc_file.attributes['name'].include? File::SEPARATOR
|
122
|
+
fhash['file_name'] = rc_file.attributes['name'].split(File::SEPARATOR)[-1]
|
123
|
+
else
|
124
|
+
fhash['file_name'] = rc_file.attributes['name']
|
125
|
+
end
|
108
126
|
fhash['violations'] = []
|
109
127
|
|
110
128
|
# get the class name out of the measure file! wow, okay... sure why not.
|
@@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
if /^2\.2/.match(RUBY_VERSION)
|
26
26
|
spec.add_dependency 'rubocop', '0.54.0'
|
27
27
|
elsif /^2\.0/.match(RUBY_VERSION)
|
28
|
-
spec.add_dependency 'nokogiri', '1.6.8'
|
29
28
|
spec.add_dependency 'rainbow', '2.2.2'
|
30
29
|
spec.add_dependency 'rubocop', '0.50.0'
|
31
30
|
end
|
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.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Long
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-12-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|