class SiSU_HarvestAuthors::Songsheet
Public Class Methods
new(opt,env)
click to toggle source
# File lib/sisu/html_harvest_authors.rb, line 60 def initialize(opt,env) @opt,@env=opt,env @file_list=opt.files end
Public Instance Methods
songsheet()
click to toggle source
# File lib/sisu/html_harvest_authors.rb, line 64 def songsheet idx_array={} @opt.f_pths.each do |y| lang_hash_file_array={} name=y[:f] filename=y[:pth] + '/' + y[:f] File.open(filename,'r') do |file| file.each_line("\n\n") do |line| if line =~/^@(?:title|creator|date):(?:\s|$)/m lang_hash_file_array[y[:lng_is]] ||= [] lang_hash_file_array[y[:lng_is]] << line elsif line =~/^@\S+?:(?:\s|$)/m \ or line =~/^(?:\s*\n|%+ )/ else break end end end lang_hash_file_array.each_pair do |lang,a| idx_array[lang] ||= [] idx_array=SiSU_HarvestAuthors::Harvest.new( @opt, @env, a, filename, name, idx_array, lang ).extract_harvest end end the_idx=SiSU_HarvestAuthors::Index.new( idx_array, @@the_idx_authors ).construct_book_author_index SiSU_HarvestAuthors::OutputIndex.new( @opt, the_idx ).html_print.html_songsheet end