spout 0.8.0.beta4 → 0.8.0.beta5
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 +1 -0
- data/lib/spout/commands/coverage.rb +2 -8
- data/lib/spout/version.rb +1 -1
- data/lib/spout/views/index.html.erb +18 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fc36d1e60674ee2067a6ae4456b4bb00352eb34
|
4
|
+
data.tar.gz: 67655d5dc2f69d095eba794a4868a0b59542e03e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dce743be43983a5594023bbb459afdbcb7bba1605f62d49a320ba0344c3f70a6a296dec0a6aff7333d3f928a6e9dc2ac11183b80fd8158bb76983c776d48b094
|
7
|
+
data.tar.gz: 8bb42025917af18b7e3253864a82bb3164c6c14c9e6bbdd5c37f0bf575b4a44c7d4be1555a58d111e33ed5fbc07d79a80f0670cc383069b9cf9fdb4715e5efcb
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
- `visit`: This variable is used to separate subject encounters in a histogram
|
7
7
|
- `charts`: Array of choices, numeric, or integer variables for charts
|
8
8
|
- The `spout pngs` command now renders the histogram form for each variable
|
9
|
+
- The `spout coverage` command now lists variables that are defined in the data dictionary and that do not exist in any CSV dataset
|
9
10
|
- **Gem Changes**
|
10
11
|
- Updated to colorize 0.7.2
|
11
12
|
- Use of Ruby 2.1.2 is now recommended
|
@@ -24,14 +24,6 @@ module Spout
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def run_coverage_report!
|
27
|
-
choice_variables = []
|
28
|
-
|
29
|
-
Dir.glob("variables/**/*.json").each do |file|
|
30
|
-
if json = JSON.parse(File.read(file)) rescue false
|
31
|
-
choice_variables << json['id'] if json['type'] == 'choices'
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
27
|
@matching_results = []
|
36
28
|
|
37
29
|
@subject_loader.all_methods.each do |method, csv_files|
|
@@ -39,6 +31,8 @@ module Spout
|
|
39
31
|
@matching_results << [ csv_files, method, scr ]
|
40
32
|
end
|
41
33
|
|
34
|
+
variable_ids = Dir.glob("variables/**/*.json").collect{ |file| file.gsub(/^(.*)\/|\.json$/, '').downcase }
|
35
|
+
@extra_variable_ids = variable_ids - @subject_loader.all_methods.keys
|
42
36
|
|
43
37
|
@matching_results.sort!{|a,b| [b[2].number_of_errors, a[0].to_s, a[1].to_s] <=> [a[2].number_of_errors, b[0].to_s, b[1].to_s]}
|
44
38
|
|
data/lib/spout/version.rb
CHANGED
@@ -75,12 +75,21 @@ tfoot td {
|
|
75
75
|
<tr>
|
76
76
|
<th>CSV</th>
|
77
77
|
<th>Coverage</th>
|
78
|
-
<th>
|
78
|
+
<th>Total</th>
|
79
79
|
<th>Columns Defined</th>
|
80
80
|
<th>Columns Missed</th>
|
81
81
|
</tr>
|
82
82
|
</thead>
|
83
83
|
<tbody>
|
84
|
+
<% if @extra_variable_ids.size > 0 %>
|
85
|
+
<tr>
|
86
|
+
<td class="text-muted">Variables Not Found in Any CSV</td>
|
87
|
+
<td></td>
|
88
|
+
<td><code class="default"><%= number_with_delimiter( @extra_variable_ids.size ) %></code></td>
|
89
|
+
<td></td>
|
90
|
+
<td></td>
|
91
|
+
</tr>
|
92
|
+
<% end %>
|
84
93
|
<% @coverage_results.each do |csv, total_column_count, mapped_column_count| %>
|
85
94
|
<tr>
|
86
95
|
<td><%= csv %></td>
|
@@ -166,6 +175,14 @@ tfoot td {
|
|
166
175
|
</tr>
|
167
176
|
</tfoot>
|
168
177
|
<tbody>
|
178
|
+
<% @extra_variable_ids.each do |variable_id| %>
|
179
|
+
<tr>
|
180
|
+
<td class="text-muted">Not in any CSV file</td>
|
181
|
+
<td><%= variable_id %></td>
|
182
|
+
<td><code class="default"><%= variable_id %>.json</code></td>
|
183
|
+
<td colspan="4" class="text-muted">Recommend to remove this variable from data dictionary as this variable does not exist in any CSV.</td>
|
184
|
+
</tr>
|
185
|
+
<% end %>
|
169
186
|
<% @matching_results.each do |csv_files, column, scr| %>
|
170
187
|
<tr>
|
171
188
|
<td>
|