Sha256: 6ca45846efcba9c43ce7a8bb126c95057d7ce14ea2cc05cea268ae9ff81216c2
Contents?: true
Size: 452 Bytes
Versions: 4
Compression:
Stored size: 452 Bytes
Contents
require 'yaml' def report(result_set) t = {} result_set.each_with_object(t['en'] = {}) do |result, t| keys = result.filename.gsub(%r{^app/views/}, '').gsub(/(\.html)?\.haml$/, '').split('/') t = keys.inject(t) { |t, key| t[key] ||= {} } key = "L#{result.node.line}" unless t.key?(key) t[key] = result.text next end key << "-1" key.next! while t.key?(key) t[key] = result.text end puts t.to_yaml end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
haml_i18n_lint-0.12.0 | examples/output_yaml.rb |
haml_i18n_lint-0.11.0 | examples/output_yaml.rb |
haml_i18n_lint-0.10.0 | examples/output_yaml.rb |
haml_i18n_lint-0.9.0 | examples/output_yaml.rb |