Class: PolishGeeks::DevTools::Commands::YmlParser
- Defined in:
- lib/polish_geeks/dev_tools/commands/yml_parser.rb
Overview
Verifying parameters in example YAML config files
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#error_message ⇒ String
Error message.
-
#execute ⇒ Array
Executes this command.
-
#label ⇒ String
Label with this validator description.
-
#valid? ⇒ Boolean
have not nil value.
Methods inherited from Base
Instance Method Details
#error_message ⇒ String
Returns error message.
31 32 33 34 35 |
# File 'lib/polish_geeks/dev_tools/commands/yml_parser.rb', line 31 def err = 'Following yml files have nil as a value:' @output.each { |row| err << file_error(row) } err << "\n" end |
#execute ⇒ Array
Executes this command
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/polish_geeks/dev_tools/commands/yml_parser.rb', line 10 def execute @output = [] Dir[config_path].each do |file| parsed_file = parse_yaml(file) nil_params = check_params(parsed_file) next if nil_params.empty? @output << { file: file, lines: nil_params } end @output end |
#label ⇒ String
Returns label with this validator description.
26 27 28 |
# File 'lib/polish_geeks/dev_tools/commands/yml_parser.rb', line 26 def label 'Yaml parser' end |
#valid? ⇒ Boolean
have not nil value
39 40 41 |
# File 'lib/polish_geeks/dev_tools/commands/yml_parser.rb', line 39 def valid? @output.empty? end |