aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-11-05 23:04:30 -0500
committerRalph Amissah <ralph@amissah.com>2012-11-05 23:04:30 -0500
commit60149df7574c90622ddf28d648d2429891bf84f2 (patch)
tree41c99025323d5411533a8e6d9a478b081b622d11 /lib/sisu/v4/sysenv.rb
parentv4: param, common independent document @make: header file (diff)
v4: sisupod, use common make instruction header for documents
* sisupod make instruction header file, write & read * sisu config file names placed in constants
Diffstat (limited to 'lib/sisu/v4/sysenv.rb')
-rw-r--r--lib/sisu/v4/sysenv.rb69
1 files changed, 62 insertions, 7 deletions
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index 22a520f6..f1dfdb16 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -295,19 +295,28 @@ module SiSU_Env
]
end
def sisu_document_make
+ def makefile_name
+ S_CONF[:header_make]
+ end
def makefile
#if @markup_dir_changed_
rc_path_options.each do |v|
- f='sisu_document_make'
- if FileTest.exist?("#{v}/#{f}")
- @@sisu_make_path=v
- sisu_doc_makefile=IO.read("#{@@sisu_make_path}/#{f}", mode: 'r:utf-8')
- @@sisu_doc_makefile=sisu_doc_makefile.split(/\s*\n\s*\n/m)
+ if FileTest.exist?("#{v}/#{makefile_name}")
+ @sisu_make_path=v
break
end
end
#end
- @@sisu_doc_makefile
+ @sisu_make_file_path=@sisu_make_path \
+ ? "#{@sisu_make_path}/#{makefile_name}"
+ : nil
+ end
+ def makefile_read
+ if makefile
+ sisu_doc_makefile=IO.read(makefile, mode: 'r:utf-8')
+ @sisu_doc_makefile=sisu_doc_makefile.split(/\s*\n\s*\n/m)
+ end
+ @sisu_doc_makefile
end
self
end
@@ -321,7 +330,7 @@ module SiSU_Env
@@noyaml=true
break
else
- f='sisurc.yml'
+ f=S_CONF[:rc_yml]
if FileTest.exist?("#{v}/#{f}")
require 'yaml'
@@sisurc_path=v
@@ -1131,6 +1140,52 @@ module SiSU_Env
def stub_pod
@stub_pod
end
+ def sisupod_v4(opt)
+ #processing_path.processing
+ # sisupod
+ # doc/
+ # manifest.txt
+ # en/content.sst [file content]
+ # fr/content.sst
+ # _sisu
+ # sisu_document_make
+ # image@ (ln -s ../../image)
+ # audio@ (ln -s ../../audio)
+ # video@ (ln -s ../../video)
+ # image/ [all images for specific document gathered here]
+ # audio/
+ # video/
+ spp="#{processing_path.processing}/#{Gt[:sisupod]}"
+ sppc="#{spp}/doc/_sisu"
+ lng_dirs=[]
+ if FileTest.directory?(spp) \
+ or FileTest.file?(spp)
+ FileUtils::rm_rf(spp)
+ end
+ paths=[]
+ flv=SiSU_Env::EnvCall.new(opt.fns).document_language_versions_found
+ flv[:f].each {|l| lng_dirs << l[:l] }
+ lng_dirs.uniq.each do |lng|
+ paths << "#{spp}/doc/#{lng}"
+ end
+ paths \
+ << "#{spp}/image"
+ #<< "#{spp}/audio" \
+ #<< "#{spp}/video" \
+ paths.each do |x|
+ unless FileTest.directory?(x)
+ FileUtils::mkdir_p(x)
+ end
+ end
+ if FileTest.directory?(sppc)
+ pwd=Dir.pwd
+ Dir.chdir(sppc)
+ FileUtils::ln_s('../../image', 'image')
+ #FileUtils::ln_s('../../audio', 'audio')
+ #FileUtils::ln_s('../../video', 'video')
+ Dir.chdir(pwd)
+ end
+ end
def sisupod_v3(opt)
#processing_path.processing
# sisupod