lib/docman/docroot_config.rb in docman-0.0.18 vs lib/docman/docroot_config.rb in docman-0.0.19

- old
+ new

@@ -25,11 +25,11 @@ end def structure_build(path, prefix = '', parent = nil) return unless File.file? File.join(path, 'info.yaml') - children = [] + children = {} info = YAML::load_file(File.join(path, 'info.yaml')) @raw_infos[File.basename path] = YAML::load_file(File.join(path, 'info.yaml')) unless info['status'].nil? return if info['status'] == 'disabled' end @@ -38,12 +38,14 @@ info['full_path'] = path info['docroot_config'] = self info['build_path'] = prefix info['full_build_path'] = File.join(@docroot_dir, prefix) info['temp_path'] = File.join(@docroot_dir, 'tmp', info['build_path']) + info['states_path'] = File.join(@docroot_dir, 'states', info['build_path']) info['name'] = name info['parent'] = parent + info['order'] = info.has_key?('order') ? info['order'] : 10 info['children'] = children i = Docman::Info.new(info) @root = i if parent.nil? i['root'] = @root @@ -54,10 +56,10 @@ next if (entry == '..' || entry == '.') full_path = File.join(path, entry) if File.directory?(full_path) dir_hash = structure_build(full_path, prefix, i) unless dir_hash == nil - children << dir_hash + children[dir_hash['order']] = dir_hash end end end i end \ No newline at end of file