mensa 0.7.1 → 0.7.2
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/.shipkit.yml +1 -1
- data/CHANGELOG.md +3 -2
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/mensa/verifier.rb +6 -4
- data/lib/mensa/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca5c6f3fab08895527058f4cbb70a55608297da85a234c2476d120be6de13882
|
|
4
|
+
data.tar.gz: f09da64e3c8dfaaf1917e1097845171aa29fab13c18285d3802278d5a7d8bfc9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f9ff2a45fd5d5784a31ee7e96d45b683bc16aecb53947eb6a942f5764d175fcbbc16303103ad3c46f71a571da8c5a8b5e8af9fa82000fdd8bbd025694108263
|
|
7
|
+
data.tar.gz: 9948a29ea8daee96c71466b33d3e63e4a7dd20496247edf36740c779cf2b2743fbfdedf92f03a391abe5d43544aa32f25825b340b6fb8a8f471bb66432107dda
|
data/.shipkit.yml
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
---
|
|
2
|
-
previous_version: 0.7.
|
|
2
|
+
previous_version: 0.7.1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.7.2
|
|
4
4
|
|
|
5
5
|
- The verifier's report only lists failures and warnings. `-v`/`--verbose` (or
|
|
6
6
|
`VERBOSE=1`) on the rake tasks, or `result.to_s(verbose: true)`, lists every
|
|
7
|
-
check
|
|
7
|
+
check, and the classes in `app/tables` that were skipped as they aren't Mensa
|
|
8
|
+
tables.
|
|
8
9
|
|
|
9
10
|
## 0.7.0
|
|
10
11
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -458,7 +458,7 @@ bin/rails "mensa:verify[inventories]" -v
|
|
|
458
458
|
```
|
|
459
459
|
|
|
460
460
|
Classes and modules that don't descend from `Mensa::Base` (e.g. helpers in
|
|
461
|
-
`app/tables`) are reported as
|
|
461
|
+
`app/tables`) are skipped, and only reported as such with `-v`.
|
|
462
462
|
|
|
463
463
|
#### From tests
|
|
464
464
|
|
data/lib/mensa/verifier.rb
CHANGED
|
@@ -95,21 +95,23 @@ module Mensa
|
|
|
95
95
|
# Context comes from USER_ID, ACCOUNT_ID and PARAMS (JSON) in +env+, and
|
|
96
96
|
# STRICT=1 makes warnings fail, used by the mensa:verify rake tasks.
|
|
97
97
|
# The reports list failures and warnings, +verbose+ (or VERBOSE=1) lists
|
|
98
|
-
# every check.
|
|
98
|
+
# every check and the classes skipped as they aren't Mensa tables.
|
|
99
99
|
def run(tables = nil, env: ENV, io: $stdout, verbose: false)
|
|
100
100
|
classes = tables.present? ? Array(tables).map { |table| resolve_table_class(table) } : table_classes
|
|
101
101
|
options = options_from_env(env)
|
|
102
102
|
verbose ||= %w[1 true yes].include?(env["VERBOSE"].to_s.downcase)
|
|
103
103
|
|
|
104
104
|
results = classes.flat_map do |klass|
|
|
105
|
-
verify(klass, **options).each
|
|
105
|
+
verify(klass, **options).each do |result|
|
|
106
|
+
io.puts(result.to_s(verbose: verbose), "") if verbose || result.mensa_table?
|
|
107
|
+
end
|
|
106
108
|
end
|
|
107
109
|
|
|
108
110
|
by_table = results.select(&:mensa_table?).group_by(&:table_class)
|
|
109
111
|
others = results.reject(&:mensa_table?)
|
|
110
|
-
if results.size > 1
|
|
112
|
+
if by_table.size > 1 || (verbose && results.size > 1)
|
|
111
113
|
passed = by_table.count { |_table, table_results| table_results.all?(&:success?) }
|
|
112
|
-
io.puts ["#{passed}/#{by_table.size} tables passed", ("#{others.size} skipped, not a Mensa::Base subclass" if others.any?)].compact.join(", ")
|
|
114
|
+
io.puts ["#{passed}/#{by_table.size} tables passed", ("#{others.size} skipped, not a Mensa::Base subclass" if verbose && others.any?)].compact.join(", ")
|
|
113
115
|
end
|
|
114
116
|
results.all?(&:success?)
|
|
115
117
|
end
|
data/lib/mensa/version.rb
CHANGED