Class: SiSU_ConvertFootnotes::Source

Inherits:
Instantiate show all
Defined in:
lib/sisu/sst_do_inline_footnotes.rb

Constant Summary collapse

@@ao_array =
[]
@@fns =
nil

Instance Attribute Summary

Attributes inherited from SiSU_Param::Parameters::Instructions

#abstract, #ad_alt, #ad_began, #ad_home, #ad_png, #ad_url, #audio, #author, #author_copymark, #author_home, #author_nationality, #author_title, #authors, #authorship, #base_program, #bold_match_list, #book_idx, #classify, #cls_dewey, #cls_isbn, #cls_loc, #cls_pg, #comments, #concord_make, #contact, #contributor, #cover_image, #coverage, #creator, #current_publisher, #daisy, #date, #date_added_to_site, #date_available, #date_available_scheme, #date_created, #date_created_scheme, #date_issued, #date_issued_scheme, #date_modified, #date_modified_scheme, #date_scheme, #date_translated, #date_valid, #date_valid_scheme, #description, #dgst, #digitized_by, #dir_lout, #dir_out, #dir_tex, #doc_css, #ec, #emphasis_set_to, #en, #env, #file, #file_encoding, #file_type, #filesize, #firstseg, #flag_auto_biblio, #flag_auto_endnotes, #flag_biblio, #flag_endnotes, #flag_glossary, #flag_promo, #flag_separate_endnotes, #flag_separate_endnotes_make, #flag_tables, #flv, #fn, #fnb, #fnl, #fnn, #fno, #fns, #fnstex, #fnt, #fnz, #footer_links, #format, #full_title, #generated, #heading_seg_first, #heading_seg_first_flag, #home, #home_button_image, #home_button_links, #hostname, #html_title, #i18n, #icon, #identifier, #illustrator, #image, #information, #italics_match_list, #keywords, #lang, #lang_code_insert, #language, #language_original, #links, #lnk, #locale, #lv0, #lv1, #lv2, #lv3, #lv4, #lv5, #lv6, #lvs, #make, #man_section, #markup, #markup_instruction, #notes, #num_top, #ocn, #opt, #original, #pagebreak, #pageline, #pagenew, #papersize, #papersize_array, #path, #pdf, #prefix_a, #prefix_b, #prepared_by, #programs, #project_details, #promo, #publisher, #pwd, #relation, #rights, #ruby_version, #sc_date, #sc_filename, #sc_info, #sc_number, #sc_time, #seg_autoname_safe, #seg_names, #sem_tag, #set_header_title, #set_heading_seg, #set_heading_top, #sfx_src, #sisu, #source, #stmp, #stmpd, #subject, #substitution_match_list, #subtitle, #subtitle_tex, #suffix, #tag_array, #tags, #title, #toc, #toc_lev_limit, #topic_register, #topic_register_array, #translator, #txt_path, #type, #user, #vocabulary, #wc_bytes, #wc_lines, #wc_words, #writing_focus, #yaml, #yamladdr

Instance Method Summary collapse

Methods inherited from SiSU_Param::Parameters::Instructions

#extract

Constructor Details

#initialize(opt) ⇒ Source

Returns a new instance of Source.



80
81
82
83
84
85
# File 'lib/sisu/sst_do_inline_footnotes.rb', line 80

def initialize(opt)
  @opt=opt
  @@fns||@opt.fns
  @my_make=SiSU_Env::CreateFile.new(@opt.fns)
  @fnm=SiSU_Env::InfoFile.new(@opt.fns).marshal.ao_content
end

Instance Method Details

#getObject

reads ao, unless does not exist then creates first



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/sisu/sst_do_inline_footnotes.rb', line 99

def get                                                                      #reads ao, unless does not exist then creates first
  begin
    ao=[]
    unless @@fns==@opt.fns
      @@fns=@opt.fns
      @@ao_array=[]
    end
    ao=(@@ao_array.empty?) \
    ? read_fnm
    : @@ao_array.dup #check
  rescue
    SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do
      __LINE__.to_s + ':' + __FILE__
    end
  ensure
    Instantiate.new
  end
end

#readObject

creates ao



86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/sisu/sst_do_inline_footnotes.rb', line 86

def read                                                                     #creates ao
  begin
    @@ao_array=[]
    @@fns=@opt.fns
    create_ao
  rescue
    SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do
      __LINE__.to_s + ':' + __FILE__
    end
  ensure
    Instantiate.new
  end
end