aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/hub.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/hub.rb')
-rw-r--r--lib/sisu/v0/hub.rb25
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb
index 12e477c0..52937b8e 100644
--- a/lib/sisu/v0/hub.rb
+++ b/lib/sisu/v0/hub.rb
@@ -152,7 +152,10 @@ module SiSU
when /^odf$/; SiSU_ODF::Source.new(@opt).read # -o
when /^xml_md_oai_pmh_dc$/; SiSU_XML_metadata::OAI_PMH.new(@opt).read # -O
when /^texpdf$/; SiSU_TeX::Source.new(@opt).read # -p
+ when /^manpage$/; SiSU_manpage::Source.new(@opt).read # -i
when /^texinfo$/; SiSU_TexInfo::Source.new(@opt).read # -I
+ #when /^plaintext_exp$/; SiSU_Plaintext_exp::Source.new(@opt).read # -j
+ #when /^manpage_exp$/; SiSU_manpage_exp::Source.new(@opt).read # -J
#when /^docbook$/; SiSU_Docbook::Source.new(@opt).read # -B
when /^html$/; SiSU_HTML::Source.new(@opt).read # -h -H
when /^xml$/; SiSU_XML_SAX::Source.new(@opt).read # -x
@@ -287,7 +290,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
def actions
if @opt.mod.inspect =~/--convert|--to|--from/; require "#{SiSU_lib}/sst_convert_markup"
end
- if @opt.cmd =~/([AabCcDdEeFfgGHhIiLMmNnOoprRSsTtQqUuVvwWXxYyZ_0-9])/ and
+ if @opt.cmd =~/([AabCcDdEeFfgGHhIiJjLMmNnOopQqrRSsTtUuVvwWXxYyZ_0-9])/ and
@opt.cmd =~/^-/ and
@opt.mod.inspect !~/--(?:sitemaps|query|identify)/ or
@opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ #and
@@ -296,7 +299,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
flag=SiSU_Env::Info_processing_flag.new
extra=''
if @opt.cmd !~/[mn]/
- extra+=if @opt.cmd =~/[abeghHhINOoptTwXxz]/ and @opt.cmd !~/[mn]/; 'm' #% add dal
+ extra+=if @opt.cmd =~/[abeghHhIiJjNOoptTwXxz]/ and @opt.cmd !~/[mn]/; 'm' #% add dal
elsif ((@opt.cmd =~/[Dd]/ or (@opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/)) \
and @opt.mod.inspect !~/(?:remove|(?:(?:re)?create(?:all)?|dropall|drop)$)/) \
and @opt.cmd !~/[mn]/
@@ -305,7 +308,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
end
end
if @opt.cmd !~/y/
- extra+=if @opt.cmd =~/[abehHhINopsSstwXxz]/ and @opt.cmd !~/y/; 'y' #% add manifest
+ extra+=if @opt.cmd =~/[abehHhIiJjNopsSstwXxz]/ and @opt.cmd !~/y/; 'y' #% add manifest
elsif (@opt.cmd =~/[Dd]/ or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/) and @opt.files[0] !~/^remove$/ and @opt.cmd !~/y/; 'y' #% add manifest
else ''
end
@@ -375,8 +378,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
path_image='./_sisu/processing/external_document/image'
path_skin='./_sisu/processing/external_document/skin/doc'
@get_s,@get_p=[],[]
- re_s=/(http:\/\/\S+?\.sst)/
- re_p=/(http:\/\/\S+?(?:\/sisupod(?:\.zip)?|\.ssp))/
+ re_s=/((?:https?|file):\/\/\S+?\.sst)/
+ re_p=/((?:https?|file):\/\/\S+?(?:\/sisupod(?:\.zip)?|\.ssp))/
@opt.files.each do |fns|
if fns =~re_s
@get_s << re_s.match(fns)[1] if re_s
@@ -396,10 +399,10 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
threads << Thread.new(requested_page) do |url|
open(url) do |f|
raise "#{url} not found" unless f
- re_fnb=/(http:\/\/[^\/ ]+?\/[^\/ ]+?)\/\S+?\/([^\/]+?)\.ss(t)/ #revisit and remove DO
+ re_fnb=/((?:https?|file):\/\/[^\/ ]+?\/[^\/ ]+?)\/\S+?\/([^\/]+?)\.ss(t)/ #revisit and remove DO
base_uri,fnb,instr=re_fnb.match(url)[1..3] if re_fnb
imagedir= base_uri + '/_sisu/image_local' #check on
- doc_skin_dir = /(http:\/\/\S+?)\/[^\/]+?\.sst$/.match(url).captures.join + '/_sisu/skin/doc'
+ doc_skin_dir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.sst$/.match(url).captures.join + '/_sisu/skin/doc'
#"Got file, and ready to process: #{fnb}.t#{instr}"
downloaded_file=File.new("#{fnb}.-sst",'w+')
images=SiSU_Assemble::Remote_image.new.image(imagedir)
@@ -445,7 +448,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
retry unless @retry_count > 1
ensure
end
- @opt.files=@opt.files.collect {|x| x=x.gsub(/http:\/\/\S+\/(\S+)\.sst/,'\1.-sst') }
+ @opt.files=@opt.files.collect {|x| x=x.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst/,'\1.-sst') }
end
if @opt.cmd=~/m/; op('dal','dal') #% -m dal
end
@@ -496,8 +499,14 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
end
if @opt.cmd =~/p/; op('texpdf','LaTeX pdf') #% -p latex/ texpdf
end
+ if @opt.cmd =~/i/; op('manpage','manpage') #% -i manpage
+ end
if @opt.cmd =~/I/; op('texinfo','TeX Info') #% -I texinfo (i taken by db import)
end
+ #if @opt.cmd =~/j/; op('plaintext_exp','plaintext exp') #% -j plaintext
+ #end
+ #if @opt.cmd =~/J/; op('manpage_exp','manpage exp') #% -J manpage
+ #end
if @opt.cmd =~/D/ or @opt.mod.inspect =~/--pgsql/; op('dbi','postgresql') #% -D DB postgresql
end
if @opt.cmd =~/d/ or @opt.mod.inspect =~/--sqlite/; op('dbi','sqlite') #% -d DB sqlite