aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/param.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/param.rb
parentv3: use rb1.9.2 "require_relative" syntax (diff)
v3: ruby 1.9 hash symbol syntax adopted
Diffstat (limited to 'lib/sisu/v3/param.rb')
-rw-r--r--lib/sisu/v3/param.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb
index 5d4c3daa..67716685 100644
--- a/lib/sisu/v3/param.rb
+++ b/lib/sisu/v3/param.rb
@@ -67,7 +67,7 @@ module SiSU_Param
@@date=SiSU_Env::Info_date.new
@@symlnk=Create_system_link.new
@@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=nil
- @doc={ :initialise=>nil,:markup=>'',:lnks=>'',:stmp=>'',:req=>{} }
+ @doc={ initialise: nil, markup: '', lnks: '', stmp: '', req: {} }
@@yaml=@@yamladdr=nil
@@trigger=nil
@@lv,@@flag={},{}
@@ -184,13 +184,13 @@ module SiSU_Param
authors.each_with_index do |a,i|
b=((a =~/\s*\|\s*/) ? (a.split(/\|/)) : [a])
if b[0] =~/"(.+?)"/
- @name_a_h << { :the => $1 }
+ @name_a_h << { the: $1 }
else
x=b[0].scan(/[^,]+/)
if x.length==1
- @name_a_h << { :the => x[0].strip }
+ @name_a_h << { the: x[0].strip }
elsif x.length==2
- @name_a_h << { :the => x[0].strip, :others => x[1].strip }
+ @name_a_h << { the: x[0].strip, others: x[1].strip }
else #p x.length
end
end
@@ -214,7 +214,7 @@ module SiSU_Param
"#{a[:the].strip}" + z
end
end
- {:name_a_h =>@name_a_h,:name_str =>name_str}
+ { name_a_h: @name_a_h, name_str: name_str }
else nil
end
end
@@ -664,7 +664,7 @@ module SiSU_Param
page_new=x[/(:?[\dA-C],?)+/] if x=~/new|clear/
page_break=x[/(:?[\dA-C],?)+/] if x =~/break/
end
- {:page_new =>page_new, :page_break =>page_break}
+ { page_new: page_new, page_break: page_break }
end
def language
l=if @h['language'] && (@h['language']=~/\S{2,}/)
@@ -682,7 +682,7 @@ module SiSU_Param
m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided
rgx='\b(' + m + ')\b'
y=((x =~/i/) ? (/#{rgx}/i) : (/#{rgx}/))
- { :str =>'\b(?:' + m + ')\b', :regx => y }
+ { str: '\b(?:' + m + ')\b', regx: y }
else nil
end
z
@@ -695,7 +695,7 @@ module SiSU_Param
m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided
rgx='\b(' + m + ')\b'
y=((x =~/i/) ? (/#{rgx}/i) : (/#{rgx}/))
- { :str =>'\b(?:' + m + ')\b', :regx => y }
+ { str: '\b(?:' + m + ')\b', regx: y }
else nil
end
z
@@ -827,7 +827,7 @@ module SiSU_Param
end
end
class Instructions
- @doc={ :lv=>[] }
+ @doc={ lv: [] }
@doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','',''
@@publisher='SiSU scribe'
attr_accessor :cmd,:make,:mod,:env,:path,:file,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_publisher,:contributor,:date,:date_created,:date_issued,:date_available,:date_valid,:date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:type,:format,:identifier,:source,:language,:language_original,:relation,:coverage,:rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:num_top,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:markup_version,:markup_declared,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,:links,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:en,:notes,:dgst,:dgst_skin,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy
@@ -865,7 +865,7 @@ module SiSU_Param
def extract
@user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD']
@programs,@wc,@language,@language_original={},{},{},{}
- @en={ :sum=>0,:mark=>0,:note=>0,:mismatch=>0 }
+ @en={ sum: 0, mark: 0, note: 0, mismatch: 0 }
@prog=SiSU_Env::Info_settings.new
@sys=SiSU_Env::System_call.new
@env=SiSU_Env::Info_env.new(@fns) #watch
@@ -1253,7 +1253,7 @@ module SiSU_Param
@fnl=@env.i18n.lang_filename(fn_set_lang[:c])
@flv.each do |l|
lang=SiSU_Env::Standardise_language.new.file_to_language(l)
- c={ :a=>'',:b=>'',:c=>'' }
+ c={ a: '', b: '', c: '' }
if @fnl[:pre] =~/\S/; c[:a]="#{lang[:c]}."
elsif @fnl[:mid] =~/\S/; c[:b]=".#{lang[:c]}"
elsif @fnl[:post] =~/\S/; c[:c]=".#{lang[:c]}"
@@ -1390,9 +1390,9 @@ module SiSU_Param
@@symlnk=SiSU_Env::Create_system_link.new
@@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=nil
@doc={
- :initialise=>nil,
- :markup=>'',:lnks=>'',:stmp=>'',:prefix_a=>'',:prefix_b=>'',
- :req=>{}
+ initialise: nil,
+ markup: '', lnks: '', stmp: '', prefix_a: '', prefix_b: '',
+ req: {}
}
@@yaml=@@yamladdr=nil
@@flag={}