aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/urls.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-10-15 19:27:16 +0100
committerRalph Amissah <ralph@amissah.com>2007-10-15 19:27:16 +0100
commite1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 (patch)
tree6ffe3ae1b2453578a032ce053934a31f980645e9 /lib/sisu/v0/urls.rb
parentregex matching of images, (and rearrangement of conditionals) (diff)
mostly the arrangement of conditionals
Diffstat (limited to 'lib/sisu/v0/urls.rb')
-rw-r--r--lib/sisu/v0/urls.rb43
1 files changed, 31 insertions, 12 deletions
diff --git a/lib/sisu/v0/urls.rb b/lib/sisu/v0/urls.rb
index cfe242b3..b9b1e0ec 100644
--- a/lib/sisu/v0/urls.rb
+++ b/lib/sisu/v0/urls.rb
@@ -139,20 +139,29 @@ module SiSU_urls
end
end
def urls_maintenance(opt,x,y)
- if x=~/^([abchHmNopwxXy])/ and opt.cmd =~/[abchHmNopwxXy]/ and x=~/^[#{opt.cmd}]/
+ if x=~/^([abchHmNopwxXy])/ \
+ and opt.cmd =~/[abchHmNopwxXy]/ \
+ and x=~/^[#{opt.cmd}]/
m=$1
f=y
tool=@editor
- if x =~/^m/ and @opt.cmd=~/m/ and x=~/^[#{opt.cmd}]/ and @opt.cmd =~/M/
+ if x =~/^m/ \
+ and @opt.cmd=~/m/ \
+ and x=~/^[#{opt.cmd}]/ \
+ and @opt.cmd =~/M/
tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@editor #{@env.path.dal}/#{@opt.fns}.meta")
tell.maintenance unless @opt.cmd =~/q/
end
- if x=~/^([hHw])/ and @opt.cmd=~/[hHw]/ and x=~/^[#{@opt.cmd}]/
+ if x=~/^([hHw])/ \
+ and @opt.cmd=~/[hHw]/ \
+ and x=~/^[#{@opt.cmd}]/
f=if x !~/segmented/; "#{y}.html"
else "#{y}.index.html"
end
end
- if x=~/^p/ and @opt.cmd=~/p/ and x=~/^[#{@opt.cmd}]/
+ if x=~/^p/ \
+ and @opt.cmd=~/p/ \
+ and x=~/^[#{@opt.cmd}]/
tool=@pdf_viewer
if opt.cmd =~/M/
fns=@opt.fns.gsub(/~/,'-')
@@ -163,7 +172,9 @@ module SiSU_urls
tell.maintenance unless @opt.cmd =~/q/
end
end
- if x=~/^o/ and @opt.cmd=~/o/ and x=~/^[#{@opt.cmd}]/
+ if x=~/^o/ \
+ and @opt.cmd=~/o/ \
+ and x=~/^[#{@opt.cmd}]/
tool=@odf_viewer
end
#if x=~/^i/ and @opt.cmd=~/i/ and x=~/^[#{@opt.cmd}]/
@@ -185,38 +196,46 @@ module SiSU_urls
@pwd_stub="#@webserv_url"[m,1]
@u.each do |x,y|
if @opt.fns =~ @m_regular
- if x=~/^([abchHNopwxXyY])/ and @opt.cmd=~/[abchHNopwxXyY]/ and x=~/^[#{@opt.cmd}]/
+ if x=~/^([abchHNopwxXyY])/ \
+ and @opt.cmd=~/[abchHNopwxXyY]/ \
+ and x=~/^[#{@opt.cmd}]/
m=$1
tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/#@fnb/#{y}")
tell.result unless @opt.cmd =~/q/
@opt.cmd.gsub!(/#{m}/,'')
end
- if x=~/^I/ and @opt.cmd =~/I/
+ if x=~/^I/ \
+ and @opt.cmd =~/I/
tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@path.path.texinfo}; pinfo ./#@fnb.#{y}; cd -")
tell.result unless @opt.cmd =~/q/
@opt.cmd.gsub!(/I/,'')
end
- if x=~/^D/ and @opt.cmd =~/D/
+ 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/
+ if x=~/^d/ \
+ and @opt.cmd =~/d/
tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI sqlite","sqlite #{@env.path.output}/sisu_sqlite.db", "#{y}")
tell.result unless @opt.cmd =~/q/
@opt.cmd.gsub!(/d[iu]/,'')
end
- if x=~/^i/ and @opt.cmd =~/i/
+ if x=~/^i/ \
+ and @opt.cmd =~/i/
tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@manpage_gen #{@path.path.manpage}/#@fnb.1 |most")
tell.result unless @opt.cmd =~/q/
@opt.cmd.gsub!(/I/,'')
end
- if x=~/^P/ and @opt.cmd =~/P/
+ if x=~/^P/ \
+ and @opt.cmd =~/P/
tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} Psql","#@pwd_stub::#{@opt.fns}",y)
tell.result unless @opt.cmd =~/q/
@opt.cmd.gsub!(/P[iu]/,'')
end
- if x=~/^[sS]/ and @opt.cmd =~/[sS]/
+ if x=~/^[sS]/ \
+ 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