class SiSU_XML_Fictionbook::Source

Public Class Methods

new(opt) click to toggle source
# File lib/sisu/xml_fictionbook2.rb, line 66
def initialize(opt)
  @opt=opt
  @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt)
end

Public Instance Methods

read() click to toggle source
# File lib/sisu/xml_fictionbook2.rb, line 70
def read
  begin
    @md,@ao_array=@particulars.md,@particulars.ao_array
    @env=@particulars.env
    report
    SiSU_XML_Fictionbook::Source::Scroll.new(@ao_array,@md).songsheet
  rescue
    SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do
      __LINE__.to_s + ':' + __FILE__
    end
  ensure
    Dir.chdir(@opt.f_pth[:pth])
  end
end

Private Instance Methods

report() click to toggle source
# File lib/sisu/xml_fictionbook2.rb, line 85
def report
  unless @opt.act[:quiet][:set]==:on
    tool=(@opt.act[:verbose][:set]==:on \
    || @opt.act[:verbose_plus][:set]==:on \
    || @opt.act[:maintenance][:set]==:on) \
    ? "#{@env.program.fictionbook_viewer} #{@md.file.output_path.xml_fictionbook.dir}/#{@md.file.base_filename.xml_fictionbook}"
    : "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"
    (@opt.act[:verbose][:set]==:on \
    || @opt.act[:verbose_plus][:set]==:on \
    || @opt.act[:maintenance][:set]==:on) \
    ? SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        'Fictionbook',
        tool
      ).green_hi_blue
    : SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        'Fictionbook',
        tool
      ).green_title_hi
    if (@opt.act[:verbose_plus][:set]==:on \
    || @opt.act[:maintenance][:set]==:on)
      SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        @opt.fns,
        "#{@md.file.output_path.xml_fictionbook.dir}/#{@md.file.base_filename.xml_fictionbook}"
      ).flow
    end
  end
end