diff options
author | Ralph Amissah <ralph@amissah.com> | 2010-05-03 19:14:10 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2010-05-03 19:14:10 -0400 |
commit | 65124198251d6e0ac59294f76c30644ad4fac6d5 (patch) | |
tree | dc50da8382c66172f740cd233517c7f7243be23e /lib/sisu/v2/urls.rb | |
parent | debian/changelog (2.3.1-1) (diff) | |
parent | update: changelog, version (2.3.2) (diff) |
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib/sisu/v2/urls.rb')
-rw-r--r-- | lib/sisu/v2/urls.rb | 159 |
1 files changed, 79 insertions, 80 deletions
diff --git a/lib/sisu/v2/urls.rb b/lib/sisu/v2/urls.rb index a08df9de..917b6fec 100644 --- a/lib/sisu/v2/urls.rb +++ b/lib/sisu/v2/urls.rb @@ -124,7 +124,7 @@ module SiSU_urls def songsheet begin urls_all if @opt.cmd=~/U/ - urls_select if @opt.cmd=~/[uvVM]/ + urls_select unless @opt.cmd=~/q/ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure end @@ -140,8 +140,7 @@ module SiSU_urls if x =~/^m/ \ and @opt.cmd=~/m/ \ and x=~/^[#{opt.cmd}]/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.dal}/#{@opt.fns}.meta") - tell.maintenance unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.dal}/#{@opt.fns}.meta").maintenance if @opt.cmd =~/[MVv]/ end if x=~/^([hHw])/ \ and @opt.cmd=~/[hHw]/ \ @@ -155,11 +154,13 @@ module SiSU_urls and x=~/^[#{@opt.cmd}]/ tool=@prog.pdf_viewer fns=@opt.fns.gsub(/~/,'-') - tell=if y =~/landscape/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.landscape.tex") - else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.tex") + unless @opt.cmd =~/q/ + tell=if y =~/landscape/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.landscape.tex") + else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.tex") + end + tell.maintenance if @opt.cmd =~/[MVv]/ end - tell.maintenance unless @opt.cmd =~/q/ end if x=~/^o/ \ and @opt.cmd=~/o/ \ @@ -169,92 +170,88 @@ module SiSU_urls if x=~/^e/ \ and @opt.cmd=~/e/ \ and x=~/^[#{@opt.cmd}]/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.epub}/OPS/toc.xhtml") - tell.maintenance unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.epub}/OPS/toc.xhtml").maintenance if @opt.cmd =~/[MVv]/ end if x !~/^[me]/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{tool} #{@env.path.output}/#{@fnb}/#{y}") - tell.maintenance unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{tool} #{@env.path.output}/#{@fnb}/#{y}").maintenance if @opt.cmd =~/[MVv]/ end @opt.cmd.gsub!(/#{m}/,'') end end def urls_select - tell=SiSU_Screen::Ansi.new(@opt.cmd,"URLs") - tell.grey_title_hi unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}") - tell.flow unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + i="(output manifest) #{@env.url.output_tell}/#{@fnb}/sisu_manifest.html" + @opt.cmd=~/[MVvz]/ \ + ? SiSU_Screen::Ansi.new(@opt.cmd,'URLs').grey_title_hi \ + : SiSU_Screen::Ansi.new(@opt.cmd,'URL',i).green_title_hi + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}").flow if @opt.cmd =~/[MVv]/ + end m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @pwd_stub="#{@env.url.output_tell}"[m,1] - @u.each do |x,y| - if @opt.fns =~ @m_regular - if x=~/^([abchHNopwxXyY])/ \ - and @opt.cmd=~/[abchHNopwxXyY]/ \ - and x=~/^[#{@opt.cmd}]/ - m=$1 - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/#{m}/,'') - end - if x=~/^I/ \ - and @opt.cmd =~/I/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') - end - if x=~/^D/ \ - and @opt.cmd =~/D/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}",y) - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/D[iu]/,'') - end - if x=~/^d/ \ - and @opt.cmd =~/d/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI sqlite","sqlite3 #{@env.path.output}/sisu_sqlite.db", "#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/d[iu]/,'') - end - if x=~/^e/ \ - and @opt.cmd =~/e/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.epub_viewer} #{@env.path.output}/epub/#{y}") - tell.result unless @opt.cmd =~/q/ - end - if x=~/^i/ \ - and @opt.cmd =~/i/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_generator} #{@env.path.manpage}/#{@fnb}.1 |most") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') - end - if x=~/^P/ \ - and @opt.cmd =~/P/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} Profile","#{@pwd_stub}::#{@opt.fns}",y) - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/P/,'') - end - if x=~/^s/ \ - and @opt.cmd =~/s/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/src/#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') - end - if x=~/^S/ \ - and @opt.cmd =~/[sS]/ - zipfile=if @opt.fns =~/\.ssm\.sst$/; y.gsub(/(?:\~\S{2,3})?(\.ssm\.sst\.zip)$/,'.ssm.zip') - else y.gsub(/(?:\~\S{2,3})?(\.sst\.zip)$/,'\1') + unless @opt.cmd =~/q/ + @u.each do |x,y| + if @opt.fns =~ @m_regular + if @opt.cmd =~/[MVv]/ + if x=~/^([abchHNopwxXyY])/ \ + and @opt.cmd=~/[abchHNopwxXyY]/ \ + and x=~/^[#{@opt.cmd}]/ + m=$1 + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}").result + @opt.cmd.gsub!(/#{m}/,'') + end + if x=~/^I/ \ + and @opt.cmd =~/I/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -").result + @opt.cmd.gsub!(/I/,'') + end + if x=~/^D/ \ + and @opt.cmd =~/D/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}",y).result + @opt.cmd.gsub!(/D[iu]/,'') + end + if x=~/^d/ \ + and @opt.cmd =~/d/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI sqlite","sqlite3 #{@env.path.output}/sisu_sqlite.db", "#{y}").result + @opt.cmd.gsub!(/d[iu]/,'') + end + if x=~/^e/ \ + and @opt.cmd =~/e/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.epub_viewer} #{@env.path.output}/epub/#{y}").result + end + if x=~/^i/ \ + and @opt.cmd =~/i/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_generator} #{@env.path.manpage}/#{@fnb}.1 |most").result + @opt.cmd.gsub!(/I/,'') + end + if x=~/^P/ \ + and @opt.cmd =~/P/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} Profile","#{@pwd_stub}::#{@opt.fns}",y).result + @opt.cmd.gsub!(/P/,'') + end + if x=~/^s/ \ + and @opt.cmd =~/s/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/src/#{y}").result + @opt.cmd.gsub!(/I/,'') + end + if x=~/^S/ \ + and @opt.cmd =~/[sS]/ + zipfile=if @opt.fns =~/\.ssm\.sst$/; y.gsub(/(?:\~\S{2,3})?(\.ssm\.sst\.zip)$/,'.ssm.zip') + else y.gsub(/(?:\~\S{2,3})?(\.sst\.zip)$/,'\1') + end + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/pod/#{y}").result + @opt.cmd.gsub!(/I/,'') + end end - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/pod/#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') + urls_maintenance(@opt,x,y) if @opt.cmd =~/[MV]/ end - urls_maintenance(@opt,x,y) if @opt.cmd =~/[MV]/ end end end def urls_all - tell=SiSU_Screen::Ansi.new(@opt.cmd,'URLs') - tell.grey_title_hi unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}") - tell.flow unless @opt.cmd =~/q/ + if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,'URLs').grey_title_hi + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}").flow + end @u.each do |x,y| tell=case x when /^m/ @@ -271,8 +268,10 @@ module SiSU_urls when /^i/ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_generator} #{@env.path.manpage}/#{@fnb}.1 |most") end - tellx.result if tellx - tell.result if tell + if @opt.cmd =~/[MVv]/ + tellx.result if tellx + tell.result if tell + end tellx=nil end end |