aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/hub.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/hub.rb')
-rw-r--r--lib/sisu/v3/hub.rb79
1 files changed, 51 insertions, 28 deletions
diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb
index d5ab7bdd..f221c9a8 100644
--- a/lib/sisu/v3/hub.rb
+++ b/lib/sisu/v3/hub.rb
@@ -64,12 +64,11 @@ module SiSU
class OptionLoopFiles
def initialize(opt)
@opt=opt
- @r=Px[:lng_lst].join('|')
+ @r=Px[:lng_lst_rgx]
end
def loop_files_on_given_option
@opt.files.each_with_index do |fno,i|
- @opt.fns=fno
- @opt.fno=fno
+ @opt.fno,@opt.fns=fno,fno
@opt.f_pth=@opt.f_pths[i]
if fno !~/\.-sst$/
@opt.pth=@opt.paths[i]
@@ -113,7 +112,7 @@ module SiSU
end
end
def manifest_on_files_translated
- r=Px[:lng_lst].join('|')
+ r=Px[:lng_lst_rgx]
number_of_files={}
@opt.files.each_with_index do |fns,i|
fn=fns.gsub(/(?:~(?:#{@r}))?\.ss[tm]$/,'')
@@ -385,14 +384,6 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
SiSU_DAL::Source.new(@opt).read
end
end
- if @opt.act[:share_source][:set]==:on
- if @opt.fno =~/\.ssm$/
- SiSU_Screen::Ansi.new(@opt.cmd,'WARNING: share text source (--source) not available for composite files (.ssm),', 'composite (.ssm) source documents may be shared as a sisupod (--sisupod) (.txz)').warn unless @opt.cmd =~/q/
- else
- requires('share_src') # -s share_src.rb
- SiSU_Markup::Source.new(@opt).read
- end
- end
if @opt.act[:qrcode][:set]==:on #% --qrcode, -Q
requires('qrcode') # -Q qrcode.rb
SiSU_QRcode::Source.new(@opt).read
@@ -468,34 +459,66 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
end
end
def post_loop_files_on_given_option_do
- if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod
- requires('sisupod_make') # -S sisupod_make.rb
+ if @opt.act[:share_source][:set]==:on \
+ or @opt.act[:sisupod][:set]==:on \
+ or @opt.act[:git][:set]==:on
begin
+ requires('shared_sisupod_source')
OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_Doc::Source.new(@opt).read
+ SiSU_Source::SiSUpodSource.new(@opt).read
+ end
+ if @opt.act[:share_source][:set]==:on
+#REDO
+ requires('share_src') # -s share_src.rb
+ begin
+ ensure
+ OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do
+ SiSU_Markup::Source.new(@opt).read
+ end
+ end
+ end
+ if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod
+ requires('sisupod_make') # -S sisupod_make.rb
+ begin
+ ensure
+ OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do
+ SiSU_Doc::Source.new(@opt).sisupod_tar_xz
+ end
+ end
+ end
+ if @opt.act[:git][:set]==:on #% --git, -g sisu git
+ requires('git') # -g git.rb
+ begin
+ OptionLoopFiles.new(@opt).loop_files_on_given_option do
+ SiSU_Git::Source.new(@opt).read
+ end
+ ensure
+ OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do
+ SiSU_Git::Source.new(@opt).git_commit
+ end
+ end
end
ensure
- OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do
- SiSU_Doc::Source.new(@opt).sisupod_tar_xz
+ path_pod=@env.processing_path.processing_sisupod(@opt).paths
+ unless @opt.cmd =~/M/
+ FileUtils::rm_rf("#{path_pod[:sisupod]}/*") if FileTest.directory?(path_pod[:sisupod])
+ #FileUtils::rm_rf("#{path_pod[:fnb]}/*") if FileTest.directory?(path_pod[:fnb])
end
end
end
- if @opt.act[:images][:set]==:on #% --images, -j
- requires('shared_images')
- OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_Images::Source.new(@opt).read # -j shared_images.rb
- end
- end
if @opt.act[:po4a][:set]==:on #% --po4a, -P
requires('po4a')
- OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_Po4a::Source.new(@opt).read # -P po4a.rb
+ begin
+ OptionLoopFiles.new(@opt).loop_files_on_given_option do
+ SiSU_Po4a::Source.new(@opt).read # -P po4a.rb
+ end
+ ensure
end
end
- if @opt.act[:git][:set]==:on #% --git, -g sisu git
- requires('git')
+ if @opt.act[:images][:set]==:on #% --images, -j
+ requires('shared_images')
OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_Git::Source.new(@opt).read # -g git.rb
+ SiSU_Images::Source.new(@opt).read # -j shared_images.rb
end
end
if @opt.cmd =~/T/ #% -T termsheet/standard form