Class: SiSU_Markup::Source_Po4a
Instance Method Summary
collapse
#directories, #image_extraction, #images_extract, #language_versions
#composite_and_imported_filenames_array, #extract_filenames, #insert_filename?, #inserts_array
Constructor Details
#initialize(opt, build = nil, place = nil) ⇒ Source_Po4a
Returns a new instance of Source_Po4a.
64
65
66
67
68
69
|
# File 'lib/sisu/src_po4a_sstm.rb', line 64
def initialize(opt,build=nil,place=nil)
super(opt,build,place)
@opt=opt
md=SiSU_Param::Parameters.new(opt).get
@file=SiSU_Env::FileOp.new(md,opt.fno)
end
|
Instance Method Details
#dir_mk(dir) ⇒ Object
70
71
72
73
74
|
# File 'lib/sisu/src_po4a_sstm.rb', line 70
def dir_mk(dir)
unless FileTest.directory?(dir)
FileUtils::mkdir_p(dir)
end
end
|
#language ⇒ Object
79
80
81
82
83
84
85
86
|
# File 'lib/sisu/src_po4a_sstm.rb', line 79
def language
def source_language_selected_str
@opt.act[:po4a_lang][:src] \
? @opt.act[:po4a_lang][:src]
: 'en'
end
self
end
|
#make_paths ⇒ Object
75
76
77
78
|
# File 'lib/sisu/src_po4a_sstm.rb', line 75
def make_paths
dir_mk(@file.output_path.pot.dir)
dir_mk(@file.output_path.po.dir)
end
|
#read ⇒ Object
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# File 'lib/sisu/src_po4a_sstm.rb', line 87
def read
unless @opt.act[:quiet][:set]==:on
(@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],
'Share document markup text source',
@opt.fns
).cyan_hi_blue
: SiSU_Screen::Ansi.new(
@opt.act[:color_state][:set],
'Share document markup text source',
@opt.fns
).cyan_title_hi
end
make_paths
if FileTest.directory?(@path_pod[:fnb])
FileUtils::mkdir_p(@file.output_path.src.dir) \
unless FileTest.directory?(@file.output_path.src.dir)
v=(@opt.act[:maintenance][:set]==:on) \
? 'v' : ''
system(%{
#rsync -a#{v} #{@path_pod[:fnb]}/sisupod/doc/* #{@file.output_path.po4a.dir}
rsync -a#{v} #{@path_pod[:fnb]}/sisupod/doc/#{language.source_language_selected_str}* #{@file.output_path.po4a.dir}
chbk=`pwd`
cd #{@file.output_path.sisupod.dir}
for I in `find -type d` ; do chmod 755 $I ; done
for I in `find -type f` ; do chmod 644 $I ; done
cd ${chbk}
})
md=SiSU_Param::Parameters.new(@opt).get
file=SiSU_Env::FileOp.new(md)
SiSU_Po4a_Project::Po4aCfg.new(@opt,file).song
SiSU_Po4a_Project::Po4aProject.new(@opt,file).song
else
if (@opt.act[:verbose][:set]==:on \
|| @opt.act[:verbose_plus][:set]==:on \
|| @opt.act[:maintenance][:set]==:on)
SiSU_Screen::Ansi.new(
'',
"#{@opt.fno} not available"
).blue_tab
end
end
end
|
#source_language_selected_str ⇒ Object
80
81
82
83
84
|
# File 'lib/sisu/src_po4a_sstm.rb', line 80
def source_language_selected_str
@opt.act[:po4a_lang][:src] \
? @opt.act[:po4a_lang][:src]
: 'en'
end
|