Class: SiSU_Txt_rST::Source

Inherits:
Object
  • Object
show all
Includes:
SiSU_Txt_Read
Defined in:
lib/sisu/txt_rst.rb

Direct Known Subclasses

Scroll

Defined Under Namespace

Classes: Scroll

Instance Method Summary collapse

Methods included from SiSU_Txt_Read

#read_generic

Constructor Details

#initialize(opt) ⇒ Source

Returns a new instance of Source.



70
71
72
73
74
75
# File 'lib/sisu/txt_rst.rb', line 70

def initialize(opt)
  @opt=opt
  unless @opt.fns =~/(.+?)\.(?:-|ssm\.)?sst$/
    puts "#{sf} not a processed file type"
  end
end

Instance Method Details

#readObject



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/sisu/txt_rst.rb', line 76

def read
  begin
    md=SiSU_Param::Parameters.new(@opt).get
    specific={
      description:     'rST (plaintext utf-8)',
      output_path:     md.file.output_path.rst.dir,
      output_file:     md.file.base_filename.rst,
    }
    read_generic(@opt,specific)
    SiSU_Txt_rST::Source::Scroll.new(md,@ao_array,@wrap_width).songsheet
  rescue
    SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do
      __LINE__.to_s + ':' + __FILE__
    end
  ensure
  end
end