Module: ConsistencyCheck
- Defined in:
- lib/consistency_check.rb,
lib/consistency_check/version.rb,
lib/generators/consistency_check/install/install_generator.rb
Defined Under Namespace
Modules: Generators
Constant Summary collapse
- VERSION =
"0.1.2"
Class Method Summary collapse
Class Method Details
.run_all ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/consistency_check.rb', line 4 def run_all ConsistencyCheck::Definitions.methods(false).map do |method| puts "Running #{method}..." violations = ConsistencyCheck::Definitions.send method max_shown_violations = 5 first_violations_ids = violations.take(max_shown_violations).map(&:id).join(',') optional_ellipsis = violations.to_a.count > max_shown_violations ? '...' : '' result = violations.empty? ? 'OK' : "FAIL (#{violations.to_a.count} violations: #{first_violations_ids}#{optional_ellipsis})" ConsistencyCheckResult.new(name: method.to_s.camelcase, violations: violations.to_a.count, result: result) end end |