aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/harvest_topics.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
committerRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
commit05a3fd233ec1ac4475bd797449d1284f6824c005 (patch)
treefdd93c057196640ec4907f58f66cf5bc00dfbdf6 /lib/sisu/v3/harvest_topics.rb
parentv3: use rb1.9.2 "require_relative" syntax (diff)
v3: ruby 1.9 hash symbol syntax adopted
Diffstat (limited to 'lib/sisu/v3/harvest_topics.rb')
-rw-r--r--lib/sisu/v3/harvest_topics.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sisu/v3/harvest_topics.rb b/lib/sisu/v3/harvest_topics.rb
index 11644f68..f00fb7f3 100644
--- a/lib/sisu/v3/harvest_topics.rb
+++ b/lib/sisu/v3/harvest_topics.rb
@@ -140,10 +140,10 @@ module HARVEST_topics
idxl=[]
g.each do |i|
i.strip!
- idxl << { :filename =>filename,:file =>file,:rough_idx =>i,:title =>@fulltitle,:author =>creator,:page =>page}
+ idxl << { filename: filename, file: file, rough_idx: i, title: @fulltitle, author: creator, page: page }
end
idxl
- else { :filename =>filename,:file =>file,:rough_idx =>@idx_list,:title =>@fulltitle,:author =>creator,:page =>page}
+ else { filename: filename, file: file, rough_idx: @idx_list, title: @fulltitle, author: creator, page: page }
end
else
p "missing required field in #{@filename} - [title]: <<#{@title}>>; [author]: <<#{@author_format}>>; [idx]: <<#{@idx_list}>>" if @opt.cmd.inspect =~/[VM]/
@@ -166,7 +166,7 @@ module HARVEST_topics
s=n.sub(/(.+?)(?:,.+|$)/,'\1').gsub(/\s+/,'_')
names += %{<a href="harvest_authors.html##{s}">#{n}</a>, }
end
- hash << { :filename =>idx[:filename],:file =>idx[:file],:author =>names,:title =>idx[:title],:page =>idx[:page]}
+ hash << { filename: idx[:filename], file: idx[:file], author: names, title: idx[:title], page: idx[:page] }
end
def construct_book_topic_index
idx_array=@idx_array
@@ -190,7 +190,7 @@ module HARVEST_topics
lev0.each do |lv0|
lv0=capital(lv0)
if @@the_idx_topics[lv0].class==NilClass
- @@the_idx_topics[lv0]={:md => []}
+ @@the_idx_topics[lv0]={ md: [] }
end
@lv0=lv0 if lev0.length==1
j=@@the_idx_topics[lv0][:md]
@@ -201,7 +201,7 @@ module HARVEST_topics
lev1.each do |lv1|
lv1=capital(lv1)
if @@the_idx_topics[@lv0][lv1].class==NilClass
- @@the_idx_topics[@lv0][lv1]={:md => []}
+ @@the_idx_topics[@lv0][lv1]={ md: [] }
end
@lv1=lv1 if lev1.length==1
j=@@the_idx_topics[@lv0][lv1][:md]
@@ -212,7 +212,7 @@ module HARVEST_topics
lev2.each do |lv2|
lv2=capital(lv2)
if @@the_idx_topics[@lv0][@lv1][lv2].class==NilClass
- @@the_idx_topics[@lv0][@lv1][lv2]={:md => []}
+ @@the_idx_topics[@lv0][@lv1][lv2]={ md: [] }
end
@lv2=lv2 if lev2.length==1
j=@@the_idx_topics[@lv0][@lv1][lv2][:md]
@@ -223,7 +223,7 @@ module HARVEST_topics
lev3.each do |lv3|
lv3=capital(lv3)
if @@the_idx_topics[@lv0][@lv1][@lv2][lv3].class==NilClass
- @@the_idx_topics[@lv0][@lv1][@lv2][lv3]={:md => []}
+ @@the_idx_topics[@lv0][@lv1][@lv2][lv3]={ md: [] }
end
@lv3=lv3 if lev3.length==1
j=@@the_idx_topics[@lv0][@lv1][@lv2][lv3][:md]
@@ -234,7 +234,7 @@ module HARVEST_topics
lev4.each do |lv4|
lv4=capital(lv4)
if @@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4].class==NilClass
- @@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4]={:md => []}
+ @@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4]={ md: [] }
end
@lv4=lv4 if lev4.length==1
j=@@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4][:md]