BasicObject
# File lib/configcheck.rb, line 66 def add_headline(hash) hash.each do |key, subhash| subhash['headline'] = '_("' + key + '")' if KNOWN_KEYS.include?(key) end end
# File lib/configcheck.rb, line 37 def check_config() if File.exist?(PATH) hash = Hash.new hash = YAML.load(File.open(PATH)) if node_exist?(hash) #find headlines unless subnode_exist?(hash, "headline") add_headline(hash) #check label translation unless !subnode_exist?(hash, "y_label") check_label_translation(hash) end end end #save changes save_config(hash) end end
# File lib/configcheck.rb, line 72 def check_label_translation(hash) hash.each do |key, subhash| subhash['y_label'] = '_("' + subhash["y_label"] + '")' unless subhash['y_label'] =~ /^_\(\"/ && subhash["y_label"] =~ /\"\)$/ end end
# File lib/configcheck.rb, line 58 def node_exist?(hash) KNOWN_KEYS.any? { |e| hash.has_key?(e) } end
Generated with the Darkfish Rdoc Generator 2.