aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
committerRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
commit05a3fd233ec1ac4475bd797449d1284f6824c005 (patch)
treefdd93c057196640ec4907f58f66cf5bc00dfbdf6 /lib/sisu/v3/sysenv.rb
parentv3: use rb1.9.2 "require_relative" syntax (diff)
v3: ruby 1.9 hash symbol syntax adopted
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb96
1 files changed, 48 insertions, 48 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index ba401cfa..dc042aad 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -269,7 +269,7 @@ module SiSU_Env
include Singleton
@@noyaml=false
@@rc,@@sisurc_path,@@vz,@@tx=nil,nil,nil,nil
- @@ad={ :promo=>nil,:promo_list=>nil,:flag_promo=>false }
+ @@ad={ promo: nil, promo_list: nil, flag_promo: false }
attr_accessor :yaml
def initialize
super()
@@ -493,7 +493,7 @@ module SiSU_Env
if FileTest.file?("#{@fn[:m]}.#{@fn[:t]}"); x << "#{@fn[:m]}.#{@fn[:t]}"
end
dir=SiSU_Env::Info_env.new(@fns)
- @m << {:m => 'sisu_manifest.html', :l => 'English' } #fix later, default language
+ @m << { m: 'sisu_manifest.html', l: 'English' } #fix later, default language
langs.each do |l|
lng=SiSU_Env::Standardise_language.new(l)
fns_c="#{@fn[:m]}~#{lng.code}.#{@fn[:t]}"
@@ -502,12 +502,12 @@ module SiSU_Env
fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_c)
lng=fn_set_lang[:l]
fn=SiSU_Env::Env_call.new(fns_c).lang(fn_set_lang[:c])
- @m << {:m => fn[:manifest], :l => lng }
+ @m << { m: fn[:manifest], l: lng }
elsif FileTest.file?(fns_l)
fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_l)
@fnl=dir.i18n.lang_filename(fn_set_lang[:c])
fn=SiSU_Env::Env_call.new(fns_l).lang(fn_set_lang[:c])
- @m << {:m => fn[:manifest], :l => lng }
+ @m << { m: fn[:manifest], l: lng }
end
end
@m.uniq!
@@ -523,48 +523,48 @@ module SiSU_Env
end
def lang(code)
@fn={
- :html => filename(code,'','.html'),
- :book_index => filename(code,'book_index','.html'),
- :concordance => filename(code,'concordance','.html'),
- :sax => filename(code,'sax','.xml'),
- :dom => filename(code,'dom','.xml'),
- :docbook => filename(code,'docbook','.xml'),
- :xhtml => filename(code,'scroll','.xhtml'),
- :pdf_l => filename(code,'','.pdf'),
- :pdf_p => filename(code,'','.pdf'),
- :pdf_l_a4 => filename(code,"a4",'.pdf'),
- :pdf_p_a4 => filename(code,"a4",'.pdf'),
- :pdf_l_a5 => filename(code,"a5",'.pdf'),
- :pdf_p_a5 => filename(code,"a5",'.pdf'),
- :pdf_l_b5 => filename(code,"b5",'.pdf'),
- :pdf_p_b5 => filename(code,"b5",'.pdf'),
- :pdf_l_letter => filename(code,"letter",'.pdf'),
- :pdf_p_letter => filename(code,"letter",'.pdf'),
- :pdf_l_legal => filename(code,"legal",'.pdf'),
- :pdf_p_legal => filename(code,"legal",'.pdf'),
- :toc => filename(code,'toc','.html'),
- :doc => filename(code,fnb,'.html'),
- :index => filename(code,'index','.html'),
- :po => filename(code,@fns,'.po'),
- :pot => filename(code,@fns,'.pot'),
- :odf => filename(code,'','.odt'),
- :epub => filename(code,'','.epub'),
- :plain => filename(code,'','.txt'),
- :manpage => filename(code,'','.1'), #fix, section number
- :wiki => filename(code,'wiki','.txt'),
- :digest => filename(code,'digest','.txt'),
- :metadata => filename(code,'metadata','.html'), #chk
- :manifest => filename(code,'manifest','.html'),
- :oai_pmh => filename(code,'oai_pmh','.xml'),
- :sitemap => filename(code,'sitemap','.xml'),
- :sitemap_touch => filename(code,"sitemap_#{fnb}",'.xml'),
- :sxs => filename(code,fnb,'.sxs.xml'),
- :sxd => filename(code,fnb,'.sxd.xml'),
- :sxn => filename(code,fnb,'.sxn.xml'),
- :sisupod => filename(nil,@fnz,''),
- :book_idx_html => filename(code,'book_index','.html'),
- :book_idx_epub => filename(code,'book_index','.xhtml'),
- :epub_concord => filename(code,'concordance','.xhtml'),
+ html: filename(code,'','.html'),
+ book_index: filename(code,'book_index','.html'),
+ concordance: filename(code,'concordance','.html'),
+ sax: filename(code,'sax','.xml'),
+ dom: filename(code,'dom','.xml'),
+ docbook: filename(code,'docbook','.xml'),
+ xhtml: filename(code,'scroll','.xhtml'),
+ pdf_l: filename(code,'','.pdf'),
+ pdf_p: filename(code,'','.pdf'),
+ pdf_l_a4: filename(code,"a4",'.pdf'),
+ pdf_p_a4: filename(code,"a4",'.pdf'),
+ pdf_l_a5: filename(code,"a5",'.pdf'),
+ pdf_p_a5: filename(code,"a5",'.pdf'),
+ pdf_l_b5: filename(code,"b5",'.pdf'),
+ pdf_p_b5: filename(code,"b5",'.pdf'),
+ pdf_l_letter: filename(code,"letter",'.pdf'),
+ pdf_p_letter: filename(code,"letter",'.pdf'),
+ pdf_l_legal: filename(code,"legal",'.pdf'),
+ pdf_p_legal: filename(code,"legal",'.pdf'),
+ toc: filename(code,'toc','.html'),
+ doc: filename(code,fnb,'.html'),
+ index: filename(code,'index','.html'),
+ po: filename(code,@fns,'.po'),
+ pot: filename(code,@fns,'.pot'),
+ odf: filename(code,'','.odt'),
+ epub: filename(code,'','.epub'),
+ plain: filename(code,'','.txt'),
+ manpage: filename(code,'','.1'), #fix, section number
+ wiki: filename(code,'wiki','.txt'),
+ digest: filename(code,'digest','.txt'),
+ metadata: filename(code,'metadata','.html'), #chk
+ manifest: filename(code,'manifest','.html'),
+ oai_pmh: filename(code,'oai_pmh','.xml'),
+ sitemap: filename(code,'sitemap','.xml'),
+ sitemap_touch: filename(code,"sitemap_#{fnb}",'.xml'),
+ sxs: filename(code,fnb,'.sxs.xml'),
+ sxd: filename(code,fnb,'.sxd.xml'),
+ sxn: filename(code,fnb,'.sxn.xml'),
+ sisupod: filename(nil,@fnz,''),
+ book_idx_html: filename(code,'book_index','.html'),
+ book_idx_epub: filename(code,'book_index','.xhtml'),
+ epub_concord: filename(code,'concordance','.xhtml'),
}
@fn
end
@@ -1043,7 +1043,7 @@ module SiSU_Env
@rc=SiSU_Env::Get_init.instance.sisu_yaml.rc
@ad=SiSU_Env::Get_init.instance.ads
@vz=SiSU_Env::Get_init.instance.skin
- @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false }
+ @flag={ ad: false, md: false, sk: false, rc: false }
def promo?
@flag[:ad]=if @md.flag_promo && @ad[:flag_promo]
@flag[:md]=true
@@ -1221,7 +1221,7 @@ WOK
def widget_static
@rc=SiSU_Env::Get_init.instance.sisu_yaml.rc
@vz=SiSU_Env::Get_init.instance.skin
- @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false }
+ @flag={ ad: false, md: false, sk: false, rc: false }
def search?
flag=if defined? @rc['search'] \
and defined? @rc['search']['sisu'] \