Class: SiSU_Po4a_Project::Po4aDistClean
- Inherits:
-
Object
- Object
- SiSU_Po4a_Project::Po4aDistClean
- Includes:
- SiSU_Languages_Selected, SiSU_Response
- Defined in:
- lib/sisu/src_po4a_share.rb
Instance Method Summary collapse
-
#initialize(opt, file) ⇒ Po4aDistClean
constructor
A new instance of Po4aDistClean.
- #song ⇒ Object
Methods included from SiSU_Response
#answer?, #available_selections_, #query, #response?, #response_short, #response_strict, #selection_options, #selections_available_
Methods included from SiSU_Languages_Selected
#language, #sisu_languages_available, #source_language_selected_str, #translation_languages_available, #translation_languages_selected, #translation_languages_selected_str, #translation_languages_selected_that_are_available, #translation_languages_selected_that_are_available_str
Constructor Details
#initialize(opt, file) ⇒ Po4aDistClean
Returns a new instance of Po4aDistClean.
261 262 263 |
# File 'lib/sisu/src_po4a_share.rb', line 261 def initialize(opt,file) @opt,@file=opt,file end |
Instance Method Details
#song ⇒ Object
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/sisu/src_po4a_share.rb', line 264 def song pwd=Dir.pwd if FileTest.directory?(@file.output_path.po4a.dir) Dir.chdir(@file.output_path.po4a.dir) dirs=Dir['*/'] dirs_language=[] dirs.each do |x| dirs_language << x.gsub(/\/$/,'') end dirs_translation = \ (language.translation_languages_available & dirs_language) if dirs_translation.length > 0 puts %{remove language translation directorie(s): #{dirs_translation} in #{Dir .pwd}} ans=response?('disclean?') if ans FileUtils::rm_f(@file.base_filename.po4a_cfg) FileUtils::rm_r(dirs_translation,:force => true) #FileUtils::rm_r(language.translation_languages_available,:force => true) end end Dir.chdir(pwd) end end |