Module: Checky::Validators::Verbose
- Defined in:
- lib/checky/validators/verbose.rb
Class Method Summary collapse
- .build_message(mod, key) ⇒ Object
- .display_message(mod, key) ⇒ Object
- .format_message(message, key) ⇒ Object
- .result_message(key) ⇒ Object
Instance Method Summary collapse
-
#after ⇒ Object
:reek:ManualDispatch.
Class Method Details
.build_message(mod, key) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/checky/validators/verbose.rb', line 24 def (mod, key) value = storage.send(key) # :nocov: = begin mod. rescue NoMethodError "Checking #{key} (#{value})" end # :nocov: (, key) end |
.display_message(mod, key) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/checky/validators/verbose.rb', line 17 def (mod, key) result = storage.checky_results[key] stream = result ? $stdout : $stderr stream.puts("#{(mod, key)} #{(key)}") end |
.format_message(message, key) ⇒ Object
37 38 39 40 41 |
# File 'lib/checky/validators/verbose.rb', line 37 def (, key) key_size = key.to_s.size "#{[0..(65 - key_size)].ljust(67 - key_size, '.')}[#{key.capitalize}]" end |
Instance Method Details
#after ⇒ Object
:reek:ManualDispatch
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/checky/validators/verbose.rb', line 6 def after storage.to_h.keys.each do |key| next if key.to_s.start_with?('checky_') mod = Object.const_get("Checky::Validators::#{String(key).classify}") next unless mod.respond_to?(:check) (mod, key) end end |