Module: Fusuma::Config::YAMLDuplicationChecker
- Defined in:
- lib/fusuma/config/yaml_duplication_checker.rb
Overview
ref: github.com/rubocop-hq/rubocop/blob/97e4ffc8a71e9e5239a927c6a534dfc1e0da917f/lib/rubocop/yaml_duplication_checker.rb Find duplicated keys from YAML.
Class Method Summary collapse
Class Method Details
.check(yaml_string, filename, &on_duplicated) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/fusuma/config/yaml_duplication_checker.rb', line 8 def self.check(yaml_string, filename, &on_duplicated) tree = YAML.parse(yaml_string, filename: filename) return unless tree traverse(tree, &on_duplicated) end |