aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-10-01 13:48:00 -0400
committerRalph Amissah <ralph@amissah.com>2012-10-01 13:48:00 -0400
commit2ea56a48ef3d3d599eb71c49a74eb9affb8df9ad (patch)
treeb1ab2270dd0f236ac877171db4dcd75e119774f0 /lib
parentv3: dbi, pgsql, report need for instructions when none given (diff)
v3: sisupod source, paths fix
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/shared_sisupod_source.rb43
1 files changed, 21 insertions, 22 deletions
diff --git a/lib/sisu/v3/shared_sisupod_source.rb b/lib/sisu/v3/shared_sisupod_source.rb
index 2aff984c..18821e37 100644
--- a/lib/sisu/v3/shared_sisupod_source.rb
+++ b/lib/sisu/v3/shared_sisupod_source.rb
@@ -86,7 +86,6 @@ module SiSU_Source
image: path_pod + '/' + Gt[:image],
audio: path_pod + '/' + Gt[:audio],
video: path_pod + '/' + Gt[:video],
- conf: path_pod + '/' + Gt[:conf]
}
end
def read
@@ -107,7 +106,7 @@ module SiSU_Source
load "#{SiSU_lib}/defaults.rb"
@skin={}
skin_path = [
- "#{@env.path.pwd}/_sisu/skin",
+ "#{@opt.base_path}/_sisu/skin",
"#{@env.path.home}/.sisu/skin",
'/etc/sisu/skin',
"#{@path_pod[:pod]}/external_document/skin" #CHECK
@@ -214,7 +213,7 @@ module SiSU_Source
FileUtils::mkdir_p(@path_pod[:image])
#unattractive hard coding ... !
image_path='_sisu/image'
- images_pwd="#{@env.path.pwd}/#{image_path}"
+ images_pwd="#{@opt.base_path}/#{image_path}"
##sequence copies base images, defaults used in all html outputs
#image_source_base='/usr/share/sisu/image'
#dir_pwd=Dir.pwd
@@ -238,9 +237,9 @@ module SiSU_Source
if doc_import.length > 0 \
and @opt.fno =~/\.ssm$/
doc_import.each do |f|
- if FileTest.file?("#{@env.path.pwd}#{doc_import_dir}/#{f}")
- FileUtils::cp("#{@env.path.pwd}#{doc_import_dir}/#{f}","#{@path_pod[:doc]}/#{f}")
- else STDERR.puts %{\t*WARN* did not find image - "#{@env.path.pwd}#{doc_import_dir}/#{f}" [#{__FILE__}:#{__LINE__}]}
+ if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f}")
+ FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f}","#{@path_pod[:doc]}/#{f}")
+ else STDERR.puts %{\t*WARN* did not find image - "#{@opt.base_path}#{doc_import_dir}/#{f}" [#{__FILE__}:#{__LINE__}]}
end
end
end
@@ -253,57 +252,57 @@ module SiSU_Source
lng_f=$1
if @opt.lng == lng_f
if @opt.fno =~/\.ssm$/
- if FileTest.file?("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}")
- FileUtils::cp("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}",
+ if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}")
+ FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}",
"#{@path_pod[:doc]}/#{f[:n]}")
- else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
+ else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
else
- if FileTest.file?("#{@env.path.pwd}/#{f[:f]}")
+ if FileTest.file?("#{@opt.base_path}/#{f[:f]}")
cpy= :no
cpy=if f[:f] =~ /^#{@opt.f_pth[:lng_is]}\// \
or f[:f] =~ /~#{@opt.f_pth[:lng_is]}\.sst/
- p "#{@env.path.pwd}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
+ p "#{@opt.base_path}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
:yes
elsif f[:f] !~ /^(?:#{Px[:lng_lst_rgx]})\/|~(?:#{Px[:lng_lst_rgx]})\.sst/ \
and @opt.f_pth[:lng_is] == 'en'
- p "#{@env.path.pwd}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
+ p "#{@opt.base_path}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
:yes
else :no
end
if cpy == :yes
- FileUtils::cp("#{@env.path.pwd}/#{f[:f]}",
+ FileUtils::cp("#{@opt.base_path}/#{f[:f]}",
"#{@path_pod[:doc]}/#{f[:n]}")
end
- else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
+ else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
end
end
else
if @opt.fno =~/\.ssm$/
- if FileTest.file?("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}")
- FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}",
+ if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}")
+ FileUtils::cp_r("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}",
"#{@path_pod[:doc]}/#{f[:n]}")
- else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
+ else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
else
- if FileTest.file?("#{@env.path.pwd}/#{f[:f]}")
+ if FileTest.file?("#{@opt.base_path}/#{f[:f]}")
cpy= :no
cpy=if f[:f] =~ /^#{@opt.f_pth[:lng_is]}\// \
or f[:f] =~ /~#{@opt.f_pth[:lng_is]}\.sst/
- p "#{@env.path.pwd}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
+ p "#{@opt.base_path}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
:yes
elsif f[:f] !~ /^(?:#{Px[:lng_lst_rgx]})\/|~(?:#{Px[:lng_lst_rgx]})\.sst/ \
and @opt.f_pth[:lng_is] == 'en'
- p "#{@env.path.pwd}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
+ p "#{@opt.base_path}/#{f[:f]} --> #{@path_pod[:doc]}/#{f[:n]}"
:yes
else :no
end
if cpy == :yes
- FileUtils::cp("#{@env.path.pwd}/#{f[:f]}",
+ FileUtils::cp("#{@opt.base_path}/#{f[:f]}",
"#{@path_pod[:doc]}/#{f[:n]}")
end
- else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
+ else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]}
end
end
end