aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/current/hub_options.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2015-04-19 14:44:38 -0400
committerRalph Amissah <ralph@amissah.com>2015-05-01 18:49:40 -0400
commit1323f18af45ea0d3aaef5cd9ead0efb5de8b9729 (patch)
treee1abd6d04547c269666f276d8bdb24afa9d7dfee /lib/sisu/current/hub_options.rb
parentsetup.rb s/Config/RbConfig/ (diff)
c<-d: sync, roll develop into current dir branch (5==6)
* two dir branches, same library contents (v5 synced & updated with v6)
Diffstat (limited to 'lib/sisu/current/hub_options.rb')
-rw-r--r--lib/sisu/current/hub_options.rb81
1 files changed, 68 insertions, 13 deletions
diff --git a/lib/sisu/current/hub_options.rb b/lib/sisu/current/hub_options.rb
index 8a9af156..c36ba4c9 100644
--- a/lib/sisu/current/hub_options.rb
+++ b/lib/sisu/current/hub_options.rb
@@ -175,8 +175,8 @@ module SiSU_Commandline
@make_instructions_pod=nil
init
end
- def sisu_run_from?
- @sisu_run_from
+ def sisu_called_from?
+ @call_path
end
def sisu_bin_filepath?
@sisu_run_from
@@ -184,6 +184,9 @@ module SiSU_Commandline
def sisu_install_type?
@sisu_install_type
end
+ def sisu_lib_dir?
+ File.dirname(__FILE__)
+ end
def sisu_data_dir?
env=RbConfig::CONFIG
if sisu_install_type? ==:full_path_to_sisu_bin_in_sisu_dir_tree
@@ -275,17 +278,15 @@ module SiSU_Commandline
end
end
def init_selected_lang_dirs(a)
- @z=[]
- a.each do |y|
+ @z=a.each.map do |y|
if y =~/^#{lng_base}\/(\S+?\.ss[tm])$/
@fn=$1
- @z << y
+ y
elsif y =~/^#{@lang_regx}\/?$/
- @z << "#{y}/#{@fn}"
- else @z << y
+ "#{y}/#{@fn}"
+ else y
end
end
- @z
end
def init
a=@a
@@ -640,7 +641,7 @@ module SiSU_Commandline
if ch =~/N/ then select_arr << '--digests'
ch=ch.gsub(/[N]/,'')
end
- if ch =~/P/ then select_arr << '--po4a'
+ if ch =~/P/ then select_arr << '--po4a-sst'
ch=ch.gsub(/[P]/,'')
end
if ch =~/d/ then select_arr << '--sqlite'
@@ -1176,6 +1177,10 @@ module SiSU_Commandline
=~/"--rst"|"--rest"|"--restructuredtext"/) \
? { bool: true, set: :on }
: { bool: false, set: :na }
+ act[:txt_orgmode]=(select_arr.inspect \
+ =~/"--org"|"--orgmode"/) \
+ ? { bool: true, set: :on }
+ : { bool: false, set: :na }
act[:manpage]=(select_arr.inspect \
=~/"--manpage"|"--man"/) \
? { bool: true, set: :on }
@@ -1323,10 +1328,56 @@ module SiSU_Commandline
=~/"--harvest"/) \
? { bool: true, set: :on }
: { bool: false, set: :na }
- act[:po4a]=(select_arr.inspect \
- =~/"--po4a"|"--pot?"/) \
+ act[:po4a_sstm]=(select_arr.inspect \
+ =~/"--po4a-ss[tm]"/) \
+ ? { bool: true, set: :on }
+ : { bool: false, set: :na }
+ act[:po4a_sst_ao_sst]=(select_arr.inspect \
+ =~/"--po4a-ao(?:-ss[tm])?"/) \
+ ? { bool: true, set: :on }
+ : { bool: false, set: :na }
+ act[:po4a_shelf]=(select_arr.inspect \
+ =~/"--po4a-shelf"|"--pot?-shelf"/) \
? { bool: true, set: :on }
: { bool: false, set: :na }
+ if act[:po4a_shelf][:set]==:on \
+ or act[:po4a_sst_ao_sst][:set]==:on \
+ or act[:po4a_sstm][:set]==:on
+ act[:po4a_lang]=if select_arr.inspect \
+ =~/"--(?:trans|init)-([a-z]{2}):((?:(?:[a-z]{2}\b),?)+)/
+ lng_src,lng_trn=$1,$2.split(',')
+ { bool: true, set: :on, src: lng_src, trn: lng_trn }
+ elsif select_arr.inspect \
+ =~/"--trans"/
+ { bool: true, set: :on }
+ { bool: true, set: :on, src: 'en', trn: [] }
+ else
+ { bool: false, set: :na }
+ end
+ act[:po4a_lang_trans]=if select_arr.inspect \
+ =~/"--trans-([a-z]{2}):((?:(?:[a-z]{2}\b),?)+)/
+ lng_src,lng_trn=$1,$2.split(',')
+ { bool: true, set: :on, src: lng_src, trn: lng_trn }
+ elsif select_arr.inspect \
+ =~/"--trans"/
+ { bool: true, set: :on }
+ { bool: true, set: :on, src: 'en', trn: [] }
+ else
+ { bool: false, set: :na }
+ end
+ act[:po4a_lang_init]=if select_arr.inspect \
+ =~/"--init-([a-z]{2}):((?:(?:[a-z]{2}\b),?)+)/
+ lng_src,lng_trn=$1,$2.split(',')
+ { bool: true, set: :on, src: lng_src, trn: lng_trn }
+ else
+ { bool: false, set: :na }
+ end
+ else
+ act[:po4a_lang_trans]= \
+ { bool: false, set: :na }
+ act[:po4a_lang_init]= \
+ { bool: false, set: :na }
+ end
act[:git]=(select_arr.inspect \
=~/"--git"/) \
? { bool: true, set: :on }
@@ -1433,6 +1484,7 @@ module SiSU_Commandline
|| act[:txt_asciidoc][:set]==:on \
|| act[:txt_markdown][:set]==:on \
|| act[:txt_rst][:set]==:on \
+ || act[:txt_orgmode][:set]==:on \
|| act[:xhtml][:set]==:on \
|| act[:epub][:set]==:on \
|| act[:html][:set]==:on \
@@ -1446,8 +1498,9 @@ module SiSU_Commandline
|| act[:pdf_p][:set]==:on \
|| act[:pdf_l][:set]==:on \
|| act[:qrcode][:set]==:on \
- || act[:share_source][:set]==:on \
|| act[:sisupod][:set]==:on \
+ || act[:share_source][:set]==:on \
+ || act[:po4a_sstm][:set]==:on \
|| act[:concordance][:set]==:on \
|| act[:sqlite_discrete][:set]==:on \
|| act[:sqlite_import][:set]==:on \
@@ -1481,6 +1534,7 @@ module SiSU_Commandline
|| act[:txt_asciidoc][:set]==:on \
|| act[:txt_markdown][:set]==:on \
|| act[:txt_rst][:set]==:on \
+ || act[:txt_orgmode][:set]==:on \
|| act[:xhtml][:set]==:on \
|| act[:epub][:set]==:on \
|| act[:html][:set]==:on \
@@ -1494,8 +1548,9 @@ module SiSU_Commandline
|| act[:pdf_p][:set]==:on \
|| act[:pdf_l][:set]==:on \
|| act[:qrcode][:set]==:on \
- || act[:share_source][:set]==:on \
|| act[:sisupod][:set]==:on \
+ || act[:share_source][:set]==:on \
+ || act[:po4a_sstm][:set]==:on \
|| act[:concordance][:set]==:on \
|| act[:xml_dom][:set]==:on \
|| act[:xml_sax][:set]==:on \