aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/se_info_env.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v6/se_info_env.rb')
-rw-r--r--lib/sisu/v6/se_info_env.rb46
1 files changed, 27 insertions, 19 deletions
diff --git a/lib/sisu/v6/se_info_env.rb b/lib/sisu/v6/se_info_env.rb
index 17cdf3b3..a03c7d65 100644
--- a/lib/sisu/v6/se_info_env.rb
+++ b/lib/sisu/v6/se_info_env.rb
@@ -79,7 +79,7 @@ module SiSU_Info_Env
rescue LoadError
SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname or fileutils NOT FOUND (LoadError)')
end
- attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:base_markup_dir_stub,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir
+ attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:base_markup_dir_stub,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir
@@image_flag,@@local_image=true,true #warning on @@image_flag
@@fb,@@man_path=nil,nil
def initialize(fns='',md=nil)
@@ -108,6 +108,8 @@ module SiSU_Info_Env
@stub_src= @base_markup_dir_stub + '/src'
@stub_pod= @base_markup_dir_stub + '/pod'
@stub_epub= @base_markup_dir_stub + '/epub'
+ m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
+ @stub_pwd=@@pwd[m,1] || '' #; p __LINE__; #p @pwd; #p m; #p @stub_pwd
pt=Pathname.new(Dir.pwd)
stub=if output_dir_structure.by_language_code?
r=Px[:lng_lst_rgx]
@@ -189,6 +191,9 @@ module SiSU_Info_Env
@@current_document||=Dir.pwd
@@current_document
end
+ def stub_pwd #200412
+ @stub_pwd
+ end
def base_markup_dir_stub
@base_markup_dir_stub
end
@@ -1063,6 +1068,9 @@ WOK
def pwd
@sys.pwd
end
+ def stub_pwd
+ @stub_pwd
+ end
def base_markup_dir_stub
@base_markup_dir_stub
end
@@ -1298,13 +1306,13 @@ WOK
end
def stub_dir
(usr_dir?) \
- ? ("#{root_dir}/#{user}/#{base_markup_dir_stub}")
- : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path]
+ ? ("#{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}/#{base_markup_dir_stub}")
- : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path]
+ ? ("#{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 (ao,tex etc)
@opt=opt
@@ -1542,21 +1550,21 @@ WOK
"http://#{@sys.hostname}"
end
def dir_url
- "file://#{path.webserv}/#{base_markup_dir_stub}"
+ "file://#{path.webserv}/#{stub_pwd}"
end
def localhost
- "http://localhost/#{base_markup_dir_stub}"
+ "http://localhost/#{stub_pwd}"
end
def local
- "http://#{hostname}/#{@base_markup_dir_stub}"
+ "http://#{hostname}/#{@stub_pwd}"
end
def root
if defined? @rc['webserv']['url_root'] \
and @rc['webserv']['url_root'] =~/https?:\/\//
- "#{@rc['webserv']['url_root']}/#{@base_markup_dir_stub}"
+ "#{@rc['webserv']['url_root']}/#{@stub_pwd}"
elsif defined? @rc['webserv']['url_root'] \
and @rc['webserv']['url_root'] =~/localhost/
- "http://localhost/#{@base_markup_dir_stub}"
+ "http://localhost/#{@stub_pwd}"
else "file://#{path.output}"
end
end
@@ -1607,20 +1615,20 @@ WOK
if port.webserv_port_cgi
http + @rc['webserv_cgi']['host'] + ':' \
+ port.webserv_port_cgi + '/' \
- + @base_markup_dir_stub
+ + @stub_pwd
else
http + @rc['webserv_cgi']['host'] + '/' \
- + @base_markup_dir_stub
+ + @stub_pwd
end
else
http=((webserv_host_base=~/https?:\/\//) ? '' : 'http://')
if port.webserv_port_cgi(opt)
http + webserv_host_base + ':' \
+ port.webserv_port_cgi(opt) + '/'\
- + @base_markup_dir_stub
+ + @stub_pwd
else
http + webserv_host_base + '/' \
- + @base_markup_dir_stub
+ + @stub_pwd
end
end
http=http.strip
@@ -1676,7 +1684,7 @@ WOK
path.webserv + '/' \
+ @base_markup_dir_stub.
gsub(/#{path.webserv_dir}/,
- "#{url.hostname}/#{@base_markup_dir_stub}")
+ "#{url.hostname}/#{@stub_pwd}")
elsif defined? @rc['webserv']['webrick_url'] \
and @rc['webserv']['webrick_url']==false
'file://' + path.webserv
@@ -1690,7 +1698,7 @@ WOK
if path.webserv_dir \
and path.webserv =~ /#{path.webserv_dir}/ #revisit
path.webserv + '/' \
- + @base_markup_dir_stub.
+ + @stub_pwd.
gsub(/#{path.webserv_dir}/,
"#{url.hostname}")
elsif defined? @rc['webserv']['webrick_url'] \
@@ -1756,8 +1764,8 @@ WOK
when /^filesystem(?:_url)?/ then url.dir_url
when /^remote(?:_webserv)?/ then url.remote
when /^(?:webserv|local_webserv)/ then url.local
- when /^local(:\d+)/ then url.hostname + $1 + '/' + base_markup_dir_stub
- when /^localhost(:\d+)/ then url.localhost + $1 + '/' + base_markup_dir_stub
+ when /^local(:\d+)/ then url.hostname + $1 + '/' + stub_pwd
+ when /^localhost(:\d+)/ then url.localhost + $1 + '/' + stub_pwd
when /^localhost/ then url.localhost
when /^webrick/ then url.webrick
when /^path/ then url.webserv_map_pwd
@@ -1791,7 +1799,7 @@ WOK
if @@image_flag
images=Dir.glob("#{image_external}/*.{png,jpg,gif}")
pth=path.webserv + '/' \
- + @base_markup_dir_stub
+ + @stub_pwd
FileUtils::mkdir_p("#{pth}/_sisu/image_external") \
unless FileTest.directory?("#{pth}/_sisu/image_external")
images.each { |i| File.install(i,"#{pth}/#{i}") } \