lib/webgen/path_handler/virtual.rb in webgen-1.7.2 vs lib/webgen/path_handler/virtual.rb in webgen-1.7.3
- old
+ new
@@ -2,10 +2,11 @@
require 'yaml'
require 'webgen/path'
require 'webgen/path_handler/base'
require 'webgen/path_handler/page_utils'
+require 'webgen/utils'
module Webgen
class PathHandler
# Handles files which contain specifications for "virtual" nodes, ie. nodes that don't have real
@@ -63,10 +64,10 @@
# Read all entries from all blocks and yield the found path as well as the meta info hash for
# each entry.
def read_entries(blocks)
blocks.each do |name, content|
begin
- data = YAML::load(content)
+ data = Utils.yaml_load(content)
rescue RuntimeError, ArgumentError, SyntaxError, YAML::SyntaxError => e
raise RuntimeError, "Problem parsing block '#{name}' (it needs to contain a YAML hash): #{e.message}", e.backtrace
end
raise "Structure of block '#{name}' is invalid, it has to be a Hash" unless data.kind_of?(Hash)
data.each do |key, meta_info|