aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-01-20 18:47:20 -0500
committerRalph Amissah <ralph@amissah.com>2014-01-20 18:50:04 -0500
commitee4968f54c669bf69182a10ff7fc4991b835f6a4 (patch)
tree4418abf8bd088fb4872177d0a4093e248b911d93 /lib/sisu/v4
parent v4 v5: version & changelog (& rakefile) (diff)
v4 v5: bin/sisu & some related lib changes
* good time to consider rollover: closing v4 branch, replacing it with v5 & introducing v6 for development, proposed for this release + 1
Diffstat (limited to 'lib/sisu/v4')
-rw-r--r--lib/sisu/v4/constants.rb6
-rw-r--r--lib/sisu/v4/shared_images.rb2
-rw-r--r--lib/sisu/v4/sysenv.rb37
3 files changed, 20 insertions, 25 deletions
diff --git a/lib/sisu/v4/constants.rb b/lib/sisu/v4/constants.rb
index f95b1dbd..bb90cdc8 100644
--- a/lib/sisu/v4/constants.rb
+++ b/lib/sisu/v4/constants.rb
@@ -210,7 +210,7 @@ Px={
po_subscript_o: ',{', po_subscript_c: '},',
po_hilite_o: '*{', po_hilite_c: '}*',
po_monospace_o: '#{', po_monospace_c: '}#',
- lng_lst: %w[am bg bn br ca cs cy da de el en eo es et eu fi fr ga gl he hi hr hy ia is it ja ko la lo lt lv ml mr nl nn no oc pl pt pt_BR ro ru sa se sk sl sq sr sv ta te th tk tr uk ur us vi zh],
+ lng_lst: SiSU_is[:language_list],
lv1: '*',
lv2: '=',
lv3: '=',
@@ -239,8 +239,8 @@ else
}
end
Db={
- name_prefix: "SiSU#{SiSU_version_dir}a_",
- name_prefix_db: "sisu_#{SiSU_version_dir}a_",
+ name_prefix: "SiSU#{SiSU_is[:version_dir]}a_",
+ name_prefix_db: "sisu_#{SiSU_is[:version_dir]}a_",
col_title: 800,
col_title_part: 400,
col_title_edition: 10,
diff --git a/lib/sisu/v4/shared_images.rb b/lib/sisu/v4/shared_images.rb
index ffcf880f..92f0c894 100644
--- a/lib/sisu/v4/shared_images.rb
+++ b/lib/sisu/v4/shared_images.rb
@@ -129,7 +129,7 @@ module SiSU_Images
end
def select_sisu_base
images=%w[arrow_next_red.png arrow_prev_red.png arrow_up_red.png dot_clear.png dot_white.png b_doc.png b_epub.png b_odf.png b_pdf.png b_toc.png]
- src_path="#{@env.path.share}/image"
+ src_path="#{SiSU_is[:path_base_system_data]}/image"
dest=dest_path(:image_sys)
copy(src_path,dest,images)
end
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index 341a29f7..bcd7c09d 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -104,7 +104,7 @@ module SiSU_Env
data=Config::CONFIG['datadir'] + '/doc/sisu'
m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
@stub_pwd ||=@@pwd[m,1]
- prcss_dir='_sisu_processing_' + '.' + SiSU_version_dir
+ prcss_dir='_sisu_processing_' + '.' + SiSU_is[:version_dir]
prcss_dir_tmp_root="/tmp/#{prcss_dir}"
prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}"
if @@user
@@ -282,13 +282,13 @@ module SiSU_Env
end
def rc_path_options
[
- "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_version_dir}",
+ "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_is[:version_dir]}",
"#{$sisu_document_markup_directory_base_fixed_path}/.sisu",
- "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_version_dir}",
+ "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_is[:version_dir]}",
"#{$sisu_document_markup_directory_base_fixed_path}/_sisu",
- "#{@@home}/.sisu/#{SiSU_version_dir}",
+ "#{@@home}/.sisu/#{SiSU_is[:version_dir]}",
"#{@@home}/.sisu",
- "#{@@sisu_etc}/#{SiSU_version_dir}",
+ "#{@@sisu_etc}/#{SiSU_is[:version_dir]}",
"#{@@sisu_etc}",
]
end
@@ -359,13 +359,13 @@ module SiSU_Env
tell_no_yaml='WARNING - YAML loading switched off, to enable delete the file:'
if @markup_dir_changed_
@ad_path=[
- "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_version_dir}/skin/yml",
+ "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_is[:version_dir]}/skin/yml",
"#{$sisu_document_markup_directory_base_fixed_path}/.sisu/skin/yml",
- "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_version_dir}/skin/yml",
+ "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_is[:version_dir]}/skin/yml",
"#{$sisu_document_markup_directory_base_fixed_path}/_sisu/skin/yml",
- "#{@@home}/.sisu/#{SiSU_version_dir}/skin/yml",
+ "#{@@home}/.sisu/#{SiSU_is[:version_dir]}/skin/yml",
"#{@@home}/.sisu/skin/yml",
- "#{@@sisu_etc}/#{SiSU_version_dir}/skin/yml",
+ "#{@@sisu_etc}/#{SiSU_is[:version_dir]}/skin/yml",
"#{@@sisu_etc}/skin/yml",
]
@ad_path.each do |v|
@@ -2849,7 +2849,7 @@ WOK
def odf_structure
FileUtils::rm_rf(processing_path.processing_path.odf_pth)
FileUtils::mkdir_p(processing_path.processing_path.odf_pth)
- system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{processing_path.odf_pth}")
+ system("unzip -q #{path.share}/#{SiSU_is[:version_dir]}/odf/odt.zip -d #{processing_path.odf_pth}")
end
def sisupod_gen(fns_pod)
sisupod_gen_v3(fns_pod)
@@ -3591,18 +3591,18 @@ WOK
def get_version
@version={}
@pwd=ENV['PWD']
- yst_ver=SiSU_path_specified_Version_ \
- ? SiSU_path_specified_Version_
- : "#{defaults[:sisu_share]}/#{SiSU_version_dir}/v/version.yml"
+ yst_ver=SiSU_is[:version_info_path] \
+ ? SiSU_is[:version_info_path]
+ : "#{defaults[:sisu_share]}/#{SiSU_is[:version_dir]}/v/version.yml"
lib_path=@@lib_path ? @@lib_path : `echo $RUBYLIB`.split(':')
@@lib_path ||=lib_path
if File.exist?(yst_ver)
@version=YAML::load(File::open(yst_ver)) #unless @@noyaml
end
- @version[:install_method]=if SiSU_is==:gem_install
+ @version[:install_method]=if SiSU_is[:run_from]==:gem_install
spec = Gem::Specification.find_by_name("sisu")
gem_root = spec.gem_dir
- (File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_version_dir}/,'')) == gem_root) \
+ (File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_is[:version_dir]}/,'')) == gem_root) \
? ' (ruby gem install)' : ''
else ''
end
@@ -6322,12 +6322,7 @@ WOK
cp_images(src,dest) if FileTest.directory?(src)
end
def cp_base_images #fix images
- src=if SiSU_path_base == :system_default \
- or SiSU_path_base == nil
- @env.path.share + '/image'
- else
- SiSU_path_base + '/data/sisu/image'
- end
+ src=SiSU_is[:path_base_system_data] + '/image'
dest_arr=[
"#{@env.path.webserv}/_sisu/image_sys",
"#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_sys"