aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/cgi_sqlite.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-01-23 21:42:25 -0500
committerRalph Amissah <ralph@amissah.com>2012-01-23 21:42:27 -0500
commit21f5e220b738add01c19c2b15a76f2d240b2c0d5 (patch)
tree287dac6e47cab1da0d0567e9dc79683bc8d757b0 /lib/sisu/v3dv/cgi_sqlite.rb
parentv3dv: call most methods by full name (include associated module & class names) (diff)
v3dv: replace use of most ruby exclamation (!) method actionssisu_3.1.12
Diffstat (limited to 'lib/sisu/v3dv/cgi_sqlite.rb')
-rw-r--r--lib/sisu/v3dv/cgi_sqlite.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sisu/v3dv/cgi_sqlite.rb b/lib/sisu/v3dv/cgi_sqlite.rb
index 166bda77..31ba44c4 100644
--- a/lib/sisu/v3dv/cgi_sqlite.rb
+++ b/lib/sisu/v3dv/cgi_sqlite.rb
@@ -78,7 +78,7 @@ module SiSU_CGI_SQLite
end
end
end
- serve.sort!
+ serve=serve.sort
f1,f2,f3='','',''
serve.each do |x|
f1 << %{ <option value="#{Db[:name_prefix]}#{x}">#{x}</option>\n}
@@ -148,8 +148,8 @@ module SiSU_CGI_SQLite
elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q)
end
search_construct=[]
- unescaped_search.gsub!(/\s*(AND|OR)\s*/,"%' \) \\1 #{@l} LIKE \( '%")
- unescaped_search.gsub!(/(.+)/,"#{@l} LIKE \( '%\\1%' \)")
+ unescaped_search=unescaped_search.gsub(/\s*(AND|OR)\s*/,"%' \) \\1 #{@l} LIKE \( '%").
+ gsub(/(.+)/,"#{@l} LIKE \( '%\\1%' \)")
search_construct << unescaped_search
search_construct=search_construct.join(' ')
search[:search] << search_construct
@@ -165,11 +165,11 @@ module SiSU_CGI_SQLite
<<-'WOK_SQL'
@search_text,@search_endnotes='',''
search[:text].flatten.each {|x| @search_text << "#{x} AND " }
- @search_text=@search_text.gsub!(/AND\s+$/m,'')
- @search_text.gsub!(/(doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)')
+ @search_text=@search_text.gsub(/AND\s+$/m,'').
+ gsub(/(doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)')
search[:endnotes].flatten.each {|x| @search_endnotes << "#{x} AND " }
- @search_endnotes=@search_endnotes.gsub!(/AND\s+$/m,'')
- @search_endnotes.gsub!(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)')
+ @search_endnotes=@search_endnotes.gsub(/AND\s+$/m,'').
+ gsub(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)')
end
WOK_SQL
end