if File.exists?(File.join(git_path, MEMBERS_DB_DIR))
@db_path = File.join(git_path, MEMBERS_DB_DIR)
else
- @db_path = File.join(File.expand_path('../wiki-ca', path), MEMBERS_DB_DIR)
+ @db_path = File.join(File.expand_path('../wiki-ca', git_path), MEMBERS_DB_DIR)
end
end
@db_path
unless page_content.start_with?("---\n")
raise ArgumentError.new('content is not a proper YAML document')
end
- data = YAML.load(page_content)
+ yaml_content = /\A---\n(.*)\n---\n/m.match(page_content)[1]
+ data = YAML.load(yaml_content)
MEMBER_FIELDS.each do |field|
self[field] = data[field.to_s]
end