Class: SiSU_Concordance::Source
- Inherits:
-
Object
- Object
- SiSU_Concordance::Source
- Defined in:
- lib/sisu/html_concordance.rb
Defined Under Namespace
Classes: DocTitle, Word, Words
Instance Method Summary collapse
-
#initialize(opt) ⇒ Source
constructor
A new instance of Source.
- #read ⇒ Object
Constructor Details
#initialize(opt) ⇒ Source
Returns a new instance of Source.
64 65 66 67 |
# File 'lib/sisu/html_concordance.rb', line 64 def initialize(opt) @opt=opt @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) end |
Instance Method Details
#read ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/sisu/html_concordance.rb', line 68 def read begin @env,@md=@particulars.env,@particulars.md @env.url.output_tell unless @md.opt.act[:quiet][:set]==:on tool=(@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) \ ? "#{@env.program.web_browser} #{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}" : "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}" (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) \ ? SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], "Concordance", tool ).green_hi_blue : SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'Concordance', tool ).green_title_hi end wordmax=@env.concord_max unless @md.wc_words.nil? if @md.wc_words < wordmax SiSU_Concordance::Source::Words.new(@particulars).songsheet else SiSU_Screen::Ansi.new( @md.opt.act[:color_state][:set], "concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})" ).warn unless @md.opt.act[:quiet][:set]==:on end else SiSU_Screen::Ansi.new( @md.opt.act[:color_state][:set], "wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words" ).warn unless @md.opt.act[:quiet][:set]==:on SiSU_Concordance::Source::Words.new(@particulars).songsheet end rescue SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure SiSU_Env::CreateSite.new(@opt).cp_css Dir.chdir(@opt.f_pth[:pth]) end end |