From 7305d5a3ee6b5b3349b7fcce795a90afcd7e1ba4 Mon Sep 17 00:00:00 2001 From: takahashim Date: Sat, 12 Apr 2014 16:34:16 +0900 Subject: [PATCH] allow same @s in one document (remove warning) --- ChangeLog | 4 ++++ lib/review/book/index.rb | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index af91be529..cc6f07c50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Apr 12 16:31:11 2014 Masayoshi Takahashi + + * lib/review/book/index.rb: allow same @s in one document (remove warning) + Thu Apr 3 19:03:03 2014 Kenshi Muto * change all .yaml to .yml. (#244) diff --git a/lib/review/book/index.rb b/lib/review/book/index.rb index d605ff004..39cf0eb2e 100644 --- a/lib/review/book/index.rb +++ b/lib/review/book/index.rb @@ -210,6 +210,23 @@ def find_pathes(id) end class IconIndex < ImageIndex + def initialize(items, chapid, basedir, types) + @items = items + @index = {} + items.each do |i| + ## warn "warning: duplicate ID: #{i.id} (#{i})" unless @index[i.id].nil? + @index[i.id] = i + end + items.each do |i| + i.index = self + end + @chapid = chapid + @basedir = basedir + @types = types + + @@entries ||= get_entries + end + def IconIndex.parse(src, *args) items = [] seq = 1