aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-07-15 18:38:33 -0400
committerRalph Amissah <ralph@amissah.com>2014-07-15 18:38:33 -0400
commit7222b36020f045a039580d09e32bb1dcaeda733d (patch)
tree7fd9ac05dc694708a11a34ba778fdae11cf61c46 /lib
parentv5 v6: src_share, cosmetic code (diff)
v5 v6: src, sisupod, bring back in line
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v5/src_shared.rb16
-rw-r--r--lib/sisu/v6/src_shared.rb16
2 files changed, 18 insertions, 14 deletions
diff --git a/lib/sisu/v5/src_shared.rb b/lib/sisu/v5/src_shared.rb
index a4b3a974..03d902fd 100644
--- a/lib/sisu/v5/src_shared.rb
+++ b/lib/sisu/v5/src_shared.rb
@@ -245,7 +245,7 @@ module SiSU_Source
%{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
else
- if FileTest.file?("#{@opt.base_path}/#{f[:f]}")
+ if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}")
cpy= :no
cpy=if f[:f] =~ /^#{@opt.f_pth[:lng_is]}\// \
or f[:f] =~ /~#{@opt.f_pth[:lng_is]}\.sst/
@@ -256,12 +256,12 @@ module SiSU_Source
else :no
end
if cpy == :yes
- FileUtils::cp("#{@opt.base_path}/#{f[:f]}",
+ FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}",
"#{@path_pod[:doc]}/#{f[:n]}")
end
else
STDERR.puts \
- %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
+ %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
end
end
@@ -272,9 +272,11 @@ module SiSU_Source
SiSU_Env::InfoEnv.new.sisupod_v4(@opt)
end
def ssm_doc_import_list(f)
- if @opt.fno =~/\.ssm$/
+ if @opt.fno =~/\.ss[mi]$/
doc_import_list=[]
- doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import
+ if f =~@rgx_doc_import
+ doc_import_list << f.scan(@rgx_doc_import)
+ end
doc_import_list.flatten.each do |i|
if i =~/.ssi/
file_array=IO.readlines(i,'')
@@ -286,11 +288,11 @@ module SiSU_Source
end
def pod_source_build(file_array)
@pwd=Dir.pwd
- @rgx_doc_import_list=/^<<\s*(\S+?\.ss[ti])/
+ @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/
doc_import_list=[]
file_array.each do |f| #% work area
if f !~/^%+\s/
- if @opt.fno =~/\.ssm$/
+ if @opt.fno =~/\.ss[mi]$/
@doc_import_list << ssm_doc_import_list(f)
doc_import_list=@doc_import_list.flatten.uniq
end
diff --git a/lib/sisu/v6/src_shared.rb b/lib/sisu/v6/src_shared.rb
index cee7e1c5..495cc584 100644
--- a/lib/sisu/v6/src_shared.rb
+++ b/lib/sisu/v6/src_shared.rb
@@ -245,7 +245,7 @@ module SiSU_Source
%{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
else
- if FileTest.file?("#{@opt.base_path}/#{f[:f]}")
+ if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}")
cpy= :no
cpy=if f[:f] =~ /^#{@opt.f_pth[:lng_is]}\// \
or f[:f] =~ /~#{@opt.f_pth[:lng_is]}\.sst/
@@ -256,12 +256,12 @@ module SiSU_Source
else :no
end
if cpy == :yes
- FileUtils::cp("#{@opt.base_path}/#{f[:f]}",
+ FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}",
"#{@path_pod[:doc]}/#{f[:n]}")
end
else
STDERR.puts \
- %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
+ %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
end
end
@@ -272,9 +272,11 @@ module SiSU_Source
SiSU_Env::InfoEnv.new.sisupod_v4(@opt)
end
def ssm_doc_import_list(f)
- if @opt.fno =~/\.ssm$/
+ if @opt.fno =~/\.ss[mi]$/
doc_import_list=[]
- doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import
+ if f =~@rgx_doc_import
+ doc_import_list << f.scan(@rgx_doc_import)
+ end
doc_import_list.flatten.each do |i|
if i =~/.ssi/
file_array=IO.readlines(i,'')
@@ -286,11 +288,11 @@ module SiSU_Source
end
def pod_source_build(file_array)
@pwd=Dir.pwd
- @rgx_doc_import_list=/^<<\s*(\S+?\.ss[ti])/
+ @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/
doc_import_list=[]
file_array.each do |f| #% work area
if f !~/^%+\s/
- if @opt.fno =~/\.ssm$/
+ if @opt.fno =~/\.ss[mi]$/
@doc_import_list << ssm_doc_import_list(f)
doc_import_list=@doc_import_list.flatten.uniq
end