lib/tasks/default.rake
# Recursive validate links.  "seen" refers to a set of links already seen.
# To recurse we really want kind_of?, not is_a?, so disable rubocop rule
# rubocop:disable Style/ClassCheck
Recursive validate links.  "seen" refers to a set of links already seen.
To recurse we really want kind_of?, not is_a?, so disable rubocop rule
rubocop:disable Style/ClassCheck
Recursive validate links . " seen " refers to a set of links already seen . To recurse we really want kind_of? not is_a? so disable rubocop rule rubocop : disable Style / ClassCheck
def validate_links(translation, from, seen)
  if translation.kind_of?(Array)
    translation.each_with_index do |i, part|
      validate_links(part, from + [i], seen)
    end
  elsif translation.kind_of?(Hash)
    translation.each { |key, part| validate_links(part, from + [key], seen) }
  elsif translation.kind_of?(String) 
    validate_links_in_string(translation.to_s, from, seen)
  end
end
def validate_links ( translation , from , seen ) if translation . kind_of? ( Array ) translation . each_with_index do | i , part | validate_links ( part , from + [ i ] , seen ) end elsif translation . kind_of? ( Hash ) translation . each { | key , part | validate_links ( part , from + [ key ] , seen ) } elsif translation . kind_of? ( String ) validate_links_in_string ( translation . to_s , from , seen ) end end
Recursive validate links.
Recursive validate links .
# includes safe_html
translation
<not_specific>
from
<not_specific>
seen
<not_specific>