Module: BlacklightCql
- Defined in:
- lib/blacklight_cql.rb,
lib/blacklight_cql/engine.rb,
lib/blacklight_cql/version.rb,
lib/blacklight_cql/route_sets.rb,
app/controllers/blacklight_cql/explain_controller.rb
Defined Under Namespace
Modules: ExplainHelper, RouteSets, SolrHelperExtension, TemplateHelperExtension Classes: Engine, ExplainController
Constant Summary collapse
- VERSION =
self.version
Class Method Summary collapse
-
.escape_quotes(input) ⇒ Object
Escape single or double quote marks with backslash.
-
.solr_param_quote(val) ⇒ Object
Escapes value for Solr LocalParam.
- .version ⇒ Object
Class Method Details
.escape_quotes(input) ⇒ Object
Escape single or double quote marks with backslash
13 14 15 |
# File 'lib/blacklight_cql.rb', line 13 def self.escape_quotes(input) input.gsub("'", "\\\'").gsub('"', "\\\"") end |
.solr_param_quote(val) ⇒ Object
Escapes value for Solr LocalParam. Will wrap in quotes only if needed (if not needed, and the value turns out to have been a $param, then quotes will mess things up!), and escapes value inside quotes.
21 22 23 24 25 26 |
# File 'lib/blacklight_cql.rb', line 21 def self.solr_param_quote(val) unless val =~ /^[a-zA-Z$_\-\^]+$/ val = "'" + escape_quotes(val) + "'" end return val end |
.version ⇒ Object
3 4 5 |
# File 'lib/blacklight_cql/version.rb', line 3 def self.version @version ||= File.read(File.join(File.dirname(__FILE__), '..', '..', 'VERSION')).chomp end |