aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb106
1 files changed, 74 insertions, 32 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index 09dd5d6e..23f88ad7 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -1671,19 +1671,6 @@ WOK
file=@fns.gsub(/\.ssm(?:\.sst)?/,'.ssm.sst')
"#{source_file_path}/#{file}"
end
- def read_source_file(fns)
- fns_array=if RUBY_VERSION < '1.9'
- x=unless fns =~/\.ssm.sst$/
- IO.readlines(fns,'')
- else IO.readlines("#{processing_path.composite_file}/#{fns}",'')
- end
- else #ruby version >= '1.9'
- x=unless fns =~/\.ssm.sst$/
- IO.readlines(fns,'r:utf-8')
- else IO.readlines("#{processing_path.composite_file}/#{fns}",'r:utf-8')
- end
- end
- end
def font
def texpdf
def main
@@ -1794,6 +1781,19 @@ WOK
end
self
end
+ def read_source_file(fns)
+ fns_array=if RUBY_VERSION < '1.9'
+ x=unless fns =~/\.ssm.sst$/
+ IO.readlines(fns,'')
+ else IO.readlines("#{processing_path.composite_file}/#{fns}",'')
+ end
+ else #ruby version >= '1.9'
+ x=unless fns =~/\.ssm.sst$/
+ IO.readlines(fns,'r:utf-8')
+ else IO.readlines("#{processing_path.composite_file}/#{fns}",'r:utf-8')
+ end
+ end
+ end
def path #dir
def home
@sys.home
@@ -2043,6 +2043,34 @@ WOK
? ("#{root_dir}/#{user}/#{stub_pwd}")
: ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path]
end
+ def stub_dir_orig # ends up with lang, if lang dir
+ (usr_dir?) \
+ ? ("#{root_dir}/#{user}/#{stub_pwd}")
+ : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path]
+ end
+ def processing_sisupod(opt=nil) #processing directory, used/needed for sisu work files, has sub-directories (dal,tex etc)
+ unless FileTest.directory?(root_dir)
+ FileUtils::mkdir_p(root_dir)
+ File.chmod(0777,root_dir)
+ end
+ if usr_dir?
+ processing_path_usr="#{root_dir}/#{user}"
+ FileUtils::mkdir_p(processing_path_usr) unless FileTest.directory?(processing_path_usr)
+ File.chmod(0700,processing_path_usr)
+ end
+ sisupod_processing_path=processing_path_usr + '/pods/' + opt.fno + '/sisupod'
+ FileUtils::mkdir_p(sisupod_processing_path) unless FileTest.directory?(sisupod_processing_path)
+ sisupod_processing_path_lng=if defined? opt.lng
+ sisupod_processing_path + '/doc/' + opt.lng
+ else
+ sisupod_processing_path + '/doc'
+ end
+ unless FileTest.directory?(sisupod_processing_path_lng)
+ FileUtils::mkdir_p(sisupod_processing_path_lng)
+ File.chmod(0700,sisupod_processing_path_lng)
+ end
+ sisupod_processing_path
+ end
def processing #processing directory, used/needed for sisu work files, has sub-directories (dal,tex etc)
unless FileTest.directory?(root_dir)
FileUtils::mkdir_p(root_dir)
@@ -2060,7 +2088,6 @@ WOK
path_processing.each do |v| #
processing=v
unless FileTest.directory?(processing)
- puts "a processing directory (#{processing}) is being created for use by sisu"
FileUtils::mkdir_p(processing)
File.chmod(0700,processing)
end
@@ -3537,7 +3564,8 @@ WOK
true
elsif cmd_rc[:ocn][:set]==:off
false
- elsif @md.make.ocn? ==:off
+ elsif defined? @md.make.ocn? \
+ and @md.make.ocn? ==:off
false
elsif env_rc.build.ocn? ==:off
false
@@ -3550,7 +3578,8 @@ WOK
true
elsif cmd_rc[:toc][:set]==:off
false
- elsif @md.make.toc? ==:off
+ elsif defined? @md.make.toc? \
+ and @md.make.toc? ==:off
false
elsif env_rc.build.toc? ==:off
false
@@ -3563,7 +3592,8 @@ WOK
true
elsif cmd_rc[:manifest][:set]==:off
false
- elsif @md.make.manifest? ==:off
+ elsif defined? @md.make.manifest? \
+ and @md.make.manifest? ==:off
false
elsif env_rc.build.manifest? ==:off
false
@@ -3576,7 +3606,8 @@ WOK
true
elsif cmd_rc[:links_to_manifest][:set]==:off
false
- elsif @md.make.links_to_manifest? ==:off
+ elsif defined? @md.make.links_to_manifest? \
+ and @md.make.links_to_manifest? ==:off
false
elsif env_rc.build.links_to_manifest? ==:off
false
@@ -3589,7 +3620,8 @@ WOK
true
elsif cmd_rc[:metadata][:set]==:off
false
- elsif @md.make.metadata? ==:off
+ elsif defined? @md.make.metadata? \
+ and @md.make.metadata? ==:off
false
elsif env_rc.build.metadata? ==:off
false
@@ -3604,7 +3636,8 @@ WOK
true
elsif cmd_rc[:minitoc][:set]==:off
false
- elsif @md.make.minitoc? ==:off
+ elsif defined? @md.make.minitoc? \
+ and @md.make.minitoc? ==:off
false
elsif env_rc.build.minitoc? ==:off
false
@@ -3621,8 +3654,9 @@ WOK
elsif cmd_rc[:manifest_minitoc][:set]==:off \
|| cmd_rc[:minitoc][:set]==:off
false
- elsif @md.make.manifest_minitoc? ==:off \
- || @md.make.minitoc? ==:off
+ elsif defined? @md.make.manifest_minitoc? \
+ and (@md.make.manifest_minitoc? ==:off \
+ || @md.make.minitoc? ==:off)
false
elsif env_rc.build.manifest_minitoc? ==:off \
|| env_rc.build.minitoc? ==:off
@@ -3642,8 +3676,9 @@ WOK
elsif cmd_rc[:html_minitoc][:set]==:off \
|| cmd_rc[:minitoc][:set]==:off
false
- elsif @md.make.html_minitoc? ==:off \
- || @md.make.minitoc? ==:off
+ elsif defined? @md.make.html_minitoc? \
+ and (@md.make.html_minitoc? ==:off \
+ || @md.make.minitoc? ==:off)
false
elsif env_rc.build.html_minitoc? ==:off \
|| env_rc.build.minitoc? ==:off
@@ -3659,7 +3694,8 @@ WOK
true
elsif cmd_rc[:html_top_band][:set]==:off
false
- elsif @md.make.html_top_band? ==:off
+ elsif defined? @md.make.html_top_band? \
+ and @md.make.html_top_band? ==:off
false
elsif env_rc.build.html_top_band? ==:off
false
@@ -3672,7 +3708,8 @@ WOK
true
elsif cmd_rc[:html_navigation][:set]==:off
false
- elsif @md.make.html_navigation? ==:off
+ elsif defined? @md.make.html_navigation? \
+ and @md.make.html_navigation? ==:off
false
elsif env_rc.build.html_navigation? ==:off
false
@@ -3685,7 +3722,8 @@ WOK
true
elsif cmd_rc[:html_navigation_bar][:set]==:off
false
- elsif @md.make.html_navigation_bar? ==:off
+ elsif defined? @md.make.html_navigation_bar? \
+ and @md.make.html_navigation_bar? ==:off
false
elsif env_rc.build.html_navigation_bar? ==:off
false
@@ -3698,7 +3736,8 @@ WOK
true
elsif cmd_rc[:search_form][:set]==:off
false
- elsif @md.make.search_form? ==:off
+ elsif defined? @md.make.html_search_form? \
+ and @md.make.search_form? ==:off
false
elsif env_rc.build.search_form? ==:off
false
@@ -3713,8 +3752,9 @@ WOK
elsif cmd_rc[:html_search_form][:set]==:off \
|| cmd_rc[:search_form][:set]==:off
false
- elsif @md.make.html_search_form? ==:off \
- || @md.make.search_form? ==:off
+ elsif defined? @md.make.html_search_form? \
+ and (@md.make.html_search_form? ==:off \
+ || @md.make.search_form? ==:off)
false
elsif env_rc.build.html_search_form? ==:off \
|| env_rc.build.search_form? ==:off
@@ -3730,7 +3770,8 @@ WOK
true
elsif cmd_rc[:html_right_pane][:set]==:off
false
- elsif @md.make.html_right_pane? ==:off
+ elsif defined? @md.make.html_right_pane? \
+ and @md.make.html_right_pane? ==:off
false
elsif env_rc.build.html_right_pane? ==:off
false
@@ -3743,7 +3784,8 @@ WOK
true
elsif cmd_rc[:segsubtoc][:set]==:off
false
- elsif @md.make.segsubtoc? ==:off
+ elsif defined? @md.make.segsubtoc? \
+ and @md.make.segsubtoc? ==:off
false
elsif env_rc.build.segsubtoc? ==:off
false