Class: SiSU_Doc::Source
- Inherits:
-
SiSU_Source::SiSUpodSource
- Object
- SiSU_Source::SiSUpodSource
- SiSU_Doc::Source
- Defined in:
- lib/sisu/src_sisupod_make.rb
Instance Method Summary collapse
-
#initialize(opt, build = nil, place = nil) ⇒ Source
constructor
A new instance of Source.
- #sisupod_tar_xz ⇒ Object
Methods inherited from SiSU_Source::SiSUpodSource
#directories, #image_extraction, #images_extract, #language_versions, #read
Methods included from SiSU_Composite_Doc_Utils
#composite_and_imported_filenames_array, #extract_filenames, #insert_filename?, #inserts_array
Constructor Details
#initialize(opt, build = nil, place = nil) ⇒ Source
Returns a new instance of Source.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/sisu/src_sisupod_make.rb', line 64 def initialize(opt,build=nil,place=nil) super(opt,build,place) @zipfile=@opt.fno.gsub(/(?:\~\S{2,3})?(\.ss[tm])$/,'\1') unless @opt.act[:quiet][:set]==:on pthinfo="#{@file.output_path.sisupod.dir}/#{@zipfile}.txz" (@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], 'Assemble source for sisu document', "#{@opt.fns} -> file://#{pthinfo}" ).cyan_hi_blue : SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'Assemble source for sisu document', pthinfo ).cyan_title_hi end end |
Instance Method Details
#sisupod_tar_xz ⇒ Object
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 118 |
# File 'lib/sisu/src_sisupod_make.rb', line 84 def sisupod_tar_xz begin FileUtils::mkdir_p(@file.output_path.sisupod.dir) \ unless FileTest.directory?(@file.output_path.sisupod.dir) tree=((@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ && SiSU_Env::SystemCall.new.program_found?('tree')) \ ? 'tree sisupod' : '' if FileTest.directory?(@path_pod[:fnb]) Dir.chdir(@path_pod[:fnb]) system(%{ #{tree} tar -cJf #{@zipfile}.txz sisupod #echo "#{@file.place_file.sisupod.dir}" }) FileUtils::mv("#{@zipfile}.txz",@file.place_file.sisupod.dir) Dir.chdir(@env.path.pwd) if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new('',"#{@opt.fns}.txz").blue_tab end else if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new('',"#{@opt.fns}.txz not built").blue_tab end end rescue ensure end end |