spout 0.8.0.beta4 → 0.8.0.beta5

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
  SHA1:
3
- metadata.gz: 943e84dc07cf30abc5e8defcc39291ccfafaf82b
4
- data.tar.gz: 5d973d72c849c354f78f782542b6f5e894e083e8
3
+ metadata.gz: 1fc36d1e60674ee2067a6ae4456b4bb00352eb34
4
+ data.tar.gz: 67655d5dc2f69d095eba794a4868a0b59542e03e
5
5
  SHA512:
6
- metadata.gz: d2bf8cfc62e50a719f9b361f55d6c4711823689cff6320d6d017a3e9a19ab116f711f97d2a0718889727126f74eb4ccd3a6e03318f3c52c7fcb72611a45add48
7
- data.tar.gz: 688211ddff1209e84a75d0309216e63f9e43c7bdfbad4cdaf60e378b781c752d6ad0a8aab5b3ebc10d9e5ce3a323077b8f768d98e2adf1413a8abfee3aed6893
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
@@ -3,7 +3,7 @@ module Spout
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
5
  TINY = 0
6
- BUILD = "beta4" # nil, "pre", "rc", "rc2"
6
+ BUILD = "beta5" # nil, "pre", "rc", "rc2"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
9
9
  end
@@ -75,12 +75,21 @@ tfoot td {
75
75
  <tr>
76
76
  <th>CSV</th>
77
77
  <th>Coverage</th>
78
- <th>Columns</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>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.beta4
4
+ version: 0.8.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Remo Mueller