Class: SiSU_Create_File::CreateFile

Inherits:
SiSU_Info_Env::InfoEnv show all
Defined in:
lib/sisu/se_file_op.rb

Overview

se_info_env.rb

Direct Known Subclasses

SiSU_Env::CreateFile

Instance Attribute Summary

Attributes inherited from SiSU_Info_Env::InfoEnv

#base_markup_dir_stub, #env, #etc, #filename, #flv, #fnb, #fnn, #fnt, #home, #hostname, #processing, #processing_git, #rc, #stub_pwd, #stub_src, #sys, #user, #webserv_host_cgi, #webserv_path, #webserv_port_cgi, #www, #yamlrc_dir

Attributes inherited from SiSU_Env_Call::EnvCall

#ad, #fnb, #fnn, #fnt, #fnv, #fnz, #rc

Instance Method Summary collapse

Methods inherited from SiSU_Info_Env::InfoEnv

#ao, #arch, #asciidoc_ocn?, #bin, #build, #cgi, #cgi_sample_search_form_name, #cjk, #cjk_ja, #cjk_ko, #cjk_zh, #composite_file, #concord_max, #console_web_browser, #console_www_browser, #current_document, #defaults, #digest, #digest_conf?, #dir_url, #docbook_viewer, #encoding, #epub_bld, #epub_cp_images, #epub_viewer, #feed, #feed_home, #fictionbook_viewer, #file_encoding, #font, #git, #host, #html, #html_minitoc?, #html_navigation?, #html_navigation_bar?, #html_quick_ref?, #html_right_pane?, #html_scroll_1, #html_scroll_2, #html_search_form?, #html_seg_1, #html_seg_2, #html_seg_title_banner?, #html_top_band?, #i18n, #image_external, #image_source, #image_source_include, #image_source_include_local, #image_source_include_remote, #image_source_sisu_includes, #images, #images_epub, #images_external, #images_local, #landscape, #lang_filename, #language, #language_default_set, #length, #links_to_manifest?, #listed?, #local, #locale, #localhost, #lout, #main, #make, #man, #manifest?, #manifest_minitoc?, #manpage, #manpage_generator, #manpage_viewer, #markdown_ocn?, #markup_emphasis, #metadata?, #minitoc?, #mono, #ocn?, #odf, #odf_pth, #odf_viewer, #odt, #odt_bld, #odt_ocn?, #omit_list, #orgmode_ocn?, #output, #output_tell, #papersize, #path, #path_rel_links, #paths, #pattern, #pdf, #pdf_viewer, #pdflatex, #php, #plaintext_ocn?, #plaintext_wrap, #po, #port, #portrait, #postgresql, #pot, #processing_base_tmp, #processing_path, #processing_sisupod, #program, #promo?, #pwd, #rbver, #read_source_file, #read_source_file_array, #read_source_file_string, #remote, #rexml, #rmagick, #root, #root_dir, #rst_ocn?, #sample_data, #sample_search_form_title, #sans, #scripts, #search?, #search_action, #search_fixed?, #search_form, #search_form?, #search_form_static, #segsubtoc?, #serif, #share, #sisupod_gen, #sisupod_gen_v2, #sisupod_gen_v3, #sisupod_v2, #sisupod_v3, #sisupod_v4, #sisurc_path, #sitearch, #size, #source_file_path, #source_file_processing_array, #source_file_with_path, #sql, #sqlite, #src_pod, #src_txt, #stub_dir, #stub_dir_orig, #stub_epub, #stub_md_harvest, #stub_pod, #style, #tex, #texi, #texinfo, #texpdf, #texpdf_hyperlinks, #text_editor, #textile_ocn?, #tidy, #tmp_root_dir, #toc?, #tune, #txt, #type, #url, #usr_dir?, #wc, #web_browser, #webrick, #webrick_port, #webserv, #webserv_base, #webserv_base_cgi, #webserv_cgi, #webserv_dir, #webserv_files_from_db, #webserv_host_base, #webserv_image, #webserv_map_pwd, #webserv_stub_ensure, #widget, #widget_static, #www_browser, #xml_docbook_ocn?, #xml_editor, #xml_fictionbook_ocn?, #xml_scaffold_ocn?, #xml_viewer, #yamlrc

Methods inherited from SiSU_Env_Call::EnvCall

#by?, #by_filename?, #by_filetype?, #by_language_code?, #default_language?, #document_language_versions_found, #dump?, #filename, #lang, #mono_multi_lingual?, #multilingual?, #output_dir_structure, #published_manifests?, #redirect?

Constructor Details

#initialize(fns) ⇒ CreateFile

todo unify with FileOp



2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
# File 'lib/sisu/se_file_op.rb', line 2672

def initialize(fns)
  begin
    super(fns)
    @env=SiSU_Env::InfoEnv.new(fns)
  rescue
    SiSU_Screen::Ansi.new('',$!,$@).rescue do
      __LINE__.to_s + ':' + __FILE__
    end
  ensure
  end
end

Instance Method Details

#epubObject



2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
# File 'lib/sisu/se_file_op.rb', line 2740

def epub
  @pth=@env.processing_path.epub
  def xhtml_index
    fn=@pth + '/' \
    + Ep[:d_oebps] + '/index.xhtml'
    File.new(fn,'w+')
  end
  def xhtml_cover_image
    fn=@pth + '/' \
    + Ep[:d_oebps] + '/cover_image.xhtml'
    File.new(fn,'w+')
  end
  def xhtml_segtoc
    fn=@pth + '/' \
    + Ep[:d_oebps] + '/toc.xhtml'
    File.new(fn,'w+')
  end
  def mimetype  #fixed application/epub+zip ~/grotto/theatre/dbld/builds/epub_sample/mimetype
    File.new("#{@pth}/mimetype",'w')
  end
  def  #variable matadata ~/grotto/theatre/dbld/builds/epub_sample/metadata.opf
    fn=@pth + '/' \
    + Ep[:d_oebps] + '/' \
    + Ep[:f_opf]
    File.new(fn,'w')
  end
  def toc_ncx  #variable toc ~/grotto/theatre/dbld/builds/epub_sample/toc.ncx
    fn=@pth + '/' \
    + Ep[:d_oebps] + '/' \
    + Ep[:f_ncx]
    File.new(fn,'w')
  end
  def metainf_cont #variable content ~/grotto/theatre/dbld/builds/epub_sample/META-INF/container.xml
    fn=@pth + '/META-INF/container.xml'
    File.new(fn,'w')
  end
  def xhtml_css #fixed epub xhtml css
    fn=@pth + '/' \
    + Ep[:d_oebps] + '/css/xhtml.css'
    File.new(fn,'w')
  end
  self
end

#file_debugObject



2705
2706
2707
2708
2709
# File 'lib/sisu/se_file_op.rb', line 2705

def file_debug
  fn=@env.processing_path.ao + '/' \
  + @fns + '.debug.txt'
  File.new(fn,'w+')
end

#file_errorObject



2696
2697
2698
2699
# File 'lib/sisu/se_file_op.rb', line 2696

def file_error
  fn='/tmp/errorlog.sisu'
  File.new(fn,'w+')
end

#file_generic(output_file = '') ⇒ Object



2690
2691
2692
2693
2694
2695
# File 'lib/sisu/se_file_op.rb', line 2690

def file_generic(output_file='')
  fn=@env.path.output + '/' \
  + @fnb + '/' \
  + output_file
  File.new(fn,'w+')
end

#file_metaObject



2711
2712
2713
2714
2715
# File 'lib/sisu/se_file_op.rb', line 2711

def file_meta
  fn=@env.processing_path.ao + '/' \
  + @fns + '.meta'
  File.new(fn,'w+')
end

#file_meta_idx_htmlObject



2716
2717
2718
2719
2720
# File 'lib/sisu/se_file_op.rb', line 2716

def file_meta_idx_html
  fn=@env.processing_path.ao + '/' \
  + @fns + '.idx.html'
  File.new(fn,'w+')
end

#file_noteObject



2723
2724
2725
2726
2727
# File 'lib/sisu/se_file_op.rb', line 2723

def file_note
  fn=Dir.pwd + '/' \
  + @fns + '.fn'
  File.new(fn,'w+')
end

#file_rssObject



2736
2737
2738
2739
# File 'lib/sisu/se_file_op.rb', line 2736

def file_rss
  fn='./semantic.xml'
  File.new(fn,'w+')
end

#file_semanticObject



2732
2733
2734
2735
# File 'lib/sisu/se_file_op.rb', line 2732

def file_semantic
  fn='./semantic.yaml'
  File.new(fn,'w+')
end

#file_texinfoObject



2783
2784
2785
2786
2787
# File 'lib/sisu/se_file_op.rb', line 2783

def file_texinfo
  fn=@env.processing_path.texinfo + '/' \
  + @fnb + '.texinfo'
  File.new(fn,'w+')
end

#file_txtObject



2700
2701
2702
2703
2704
# File 'lib/sisu/se_file_op.rb', line 2700

def file_txt
  fn=@env.processing_path.ao + '/' \
  + @fns + '.txt'
  File.new(fn,'w+')
end

#html_rootObject



2683
2684
2685
# File 'lib/sisu/se_file_op.rb', line 2683

def html_root
  #@env.path.output
end

#metaObject



2728
2729
2730
2731
# File 'lib/sisu/se_file_op.rb', line 2728

def meta
  @env.processing_path.ao + '/' \
  + @fns + '.meta'
end

#metadataObject

variable matadata ~/grotto/theatre/dbld/builds/epub_sample/metadata.opf



2760
2761
2762
2763
2764
2765
# File 'lib/sisu/se_file_op.rb', line 2760

def  #variable matadata ~/grotto/theatre/dbld/builds/epub_sample/metadata.opf
  fn=@pth + '/' \
  + Ep[:d_oebps] + '/' \
  + Ep[:f_opf]
  File.new(fn,'w')
end

#metainf_contObject

variable content ~/grotto/theatre/dbld/builds/epub_sample/META-INF/container.xml



2772
2773
2774
2775
# File 'lib/sisu/se_file_op.rb', line 2772

def metainf_cont #variable content ~/grotto/theatre/dbld/builds/epub_sample/META-INF/container.xml
  fn=@pth + '/META-INF/container.xml'
  File.new(fn,'w')
end

#metaverseObject



2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
# File 'lib/sisu/se_file_op.rb', line 2710

def metaverse
  def file_meta
    fn=@env.processing_path.ao + '/' \
    + @fns + '.meta'
    File.new(fn,'w+')
  end
  def file_meta_idx_html
    fn=@env.processing_path.ao + '/' \
    + @fns + '.idx.html'
    File.new(fn,'w+')
  end
  self
end

#mimetypeObject

fixed application/epub+zip ~/grotto/theatre/dbld/builds/epub_sample/mimetype



2757
2758
2759
# File 'lib/sisu/se_file_op.rb', line 2757

def mimetype  #fixed application/epub+zip ~/grotto/theatre/dbld/builds/epub_sample/mimetype
  File.new("#{@pth}/mimetype",'w')
end

#mkdir_pdfObject



2686
2687
2688
2689
# File 'lib/sisu/se_file_op.rb', line 2686

def mkdir_pdf
  Dir.mkdir(@env.processing_path.tex) \
    unless FileTest.directory?(@env.processing_path.tex)
end

#toc_ncxObject

variable toc ~/grotto/theatre/dbld/builds/epub_sample/toc.ncx



2766
2767
2768
2769
2770
2771
# File 'lib/sisu/se_file_op.rb', line 2766

def toc_ncx  #variable toc ~/grotto/theatre/dbld/builds/epub_sample/toc.ncx
  fn=@pth + '/' \
  + Ep[:d_oebps] + '/' \
  + Ep[:f_ncx]
  File.new(fn,'w')
end

#xhtml_cover_imageObject



2747
2748
2749
2750
2751
# File 'lib/sisu/se_file_op.rb', line 2747

def xhtml_cover_image
  fn=@pth + '/' \
  + Ep[:d_oebps] + '/cover_image.xhtml'
  File.new(fn,'w+')
end

#xhtml_cssObject

fixed epub xhtml css



2776
2777
2778
2779
2780
# File 'lib/sisu/se_file_op.rb', line 2776

def xhtml_css #fixed epub xhtml css
  fn=@pth + '/' \
  + Ep[:d_oebps] + '/css/xhtml.css'
  File.new(fn,'w')
end

#xhtml_indexObject



2742
2743
2744
2745
2746
# File 'lib/sisu/se_file_op.rb', line 2742

def xhtml_index
  fn=@pth + '/' \
  + Ep[:d_oebps] + '/index.xhtml'
  File.new(fn,'w+')
end

#xhtml_segtocObject



2752
2753
2754
2755
2756
# File 'lib/sisu/se_file_op.rb', line 2752

def xhtml_segtoc
  fn=@pth + '/' \
  + Ep[:d_oebps] + '/toc.xhtml'
  File.new(fn,'w+')
end