<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,5 @@
 Copyright (c) 2008 Willem van Bergen
- 
+
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
 &quot;Software&quot;), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@ without limitation the rights to use, copy, modify, merge, publish,
 distribute, sublicense, and/or sell copies of the Software, and to
 permit persons to whom the Software is furnished to do so, subject to
 the following conditions:
- 
+
 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.
- 
+
 THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</diff>
      <filename>LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 = Scoped search
 
-The &lt;b&gt;scoped_search&lt;/b&gt; Rails plugin makes it easy to search your ActiveRecord models. Searching is 
+The &lt;b&gt;scoped_search&lt;/b&gt; Rails plugin makes it easy to search your ActiveRecord models. Searching is
 performed using a query string, which should be passed to the named_scope &lt;tt&gt;search_for&lt;/tt&gt;. Based on
 a definition in what fields to look, it will build query conditions and return those as a named scope.
 
@@ -10,7 +10,7 @@ The recommended method to enable scoped_search in your project is adding the sco
 
   Rails::Initializer.run do |config|
     ...
-    config.gem 'wvanbergen-scoped_search', :lib =&gt; 'scoped_search', 
+    config.gem 'wvanbergen-scoped_search', :lib =&gt; 'scoped_search',
                    :source =&gt; 'http://gems.github.com/'
   end
 
@@ -31,7 +31,7 @@ Scoped search requires you to define the fields you want to search in:
 For more information about options and using fields from relations, see the project
 wiki on search definitions: http://wiki.github.com/wvanbergen/scoped_search/search-definition
 
-Now, the &lt;b&gt;search_for&lt;/b&gt; scope is available for queries. You should pass a query string to the scope. 
+Now, the &lt;b&gt;search_for&lt;/b&gt; scope is available for queries. You should pass a query string to the scope.
 This can be empty or nil, in which case all no search conditions are set (and all records will be returned).
 
   User.search_for('my search string').each { |user| ... }
@@ -57,7 +57,7 @@ words::         require every word to be present, e.g.: &lt;tt&gt;some search keywords
 
 phrases::       use quotes for multi-word phrases, e.g. &lt;tt&gt;&quot;police car&quot;&lt;/tt&gt;
 
-negation::      look for &quot;everything but&quot;, e.g. &lt;tt&gt;police -uniform&lt;/tt&gt;, &lt;tt&gt;-&quot;police car&quot;&lt;/tt&gt;, 
+negation::      look for &quot;everything but&quot;, e.g. &lt;tt&gt;police -uniform&lt;/tt&gt;, &lt;tt&gt;-&quot;police car&quot;&lt;/tt&gt;,
                 &lt;tt&gt;police NOT car&lt;/tt&gt;
 
 logical keywords:: make logical constructs using AND, OR, &amp;&amp;, ||, &amp;, | operators, e.g.
@@ -90,5 +90,5 @@ For more info, see the the project wiki: http://wiki.github.com/wvanbergen/scope
 
 == License
 
-This plugin is released under the MIT license. Please contact weshays (http://github.com/weshays) 
+This plugin is released under the MIT license. Please contact weshays (http://github.com/weshays)
 or wvanbergen (http://github.com/wvanbergen) for any questions.</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,10 @@
 module ScopedSearch
-      
+
+  # The ClassMethods module will be included into the ActiveRecord::Base class to add
+  # the ActiveRecord::Base.scoped_search method and the ActiveRecord::Base.search_for
+  # named scope.
   module ClassMethods
-    
+
     # Export the scoped_search method fo defining the search options.
     # This method will create a definition instance for the class if it does not yet exist,
     # and use the object as block argument and retun value.
@@ -16,35 +19,50 @@ module ScopedSearch
       end
       return @scoped_search
     end
-
   end
-  
+
+  # The BackwardsCompatibility module can be included into ActiveRecord::Base to provide
+  # a search field definition syntax that is compatible with scoped_seach 1.x
+  #
+  # Currently, it is included into ActiveRecord::Base by default, but this may change in
+  # the future. So, please uodate to the newer syntax as soon as possible.
   module BackwardsCompatibility
+
     # Defines fields to search on using a syntax compatible with scoped_search 1.2
     def searchable_on(*fields)
-      
+
       options = fields.last.kind_of?(Hash) ? fields.pop : {}
       # TODO: handle options?
-      
-      fields.each do |field| 
+
+      fields.each do |field|
         if relation = self.reflections.keys.detect { |relation| field.to_s =~ Regexp.new(&quot;^#{relation}_(\\w+)$&quot;) }
-          scoped_search(:in =&gt; relation, :on =&gt; $1.to_sym) 
+          scoped_search(:in =&gt; relation, :on =&gt; $1.to_sym)
         else
           scoped_search(:on =&gt; field)
         end
       end
-    end    
+    end
   end
-  
+
+  # The default ScopedSearch exception class.
   class Exception &lt; StandardError
   end
 
+  # The default exception class that is raised when there is something
+  # wrong with the scoped_search definition call.
+  #
+  # You usually do not want to catch this exception, but fix the faulty
+  # scoped_search method call.
   class DefinitionError &lt; ScopedSearch::Exception
   end
-  
+
+  # The default exception class that is raised when there is a problem
+  # with parsing or interpreting a search query.
+  #
+  # You may want to catch this exception and handle this gracefully.
   class QueryNotSupported &lt; ScopedSearch::Exception
   end
-  
+
 end
 
 # Load all lib files</diff>
      <filename>lib/scoped_search.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,41 +1,51 @@
-module ScopedSearch
-  module Adapter
+# The ScopedSearch::Adapter module contains adapters for the different
+# database backends that can be used, to ensure that the experience on
+# DBMSs are compatible.
+module ScopedSearch::Adapter
+
+  # Loads the appropriate database adapter for scoped search given the
+  # current database connection, and calls its setup method to adapt
+  # things as needed.
+  def self.setup(connection)
+    adapter = connection.class.name.split('::').last
+    const_get(adapter).setup(connection) if const_defined?(adapter)
+  end
+
+  # The MySQL adapter changes the equals operator to make sure it is
+  # case sensitive, whatever column collation is used.
+  module MysqlAdapter
 
     def self.setup(connection)
-      adapter = connection.class.name.split('::').last
-      const_get(adapter).setup(connection) if const_defined?(adapter)
+      ScopedSearch::Definition::Field.send :include, FieldInstanceMethods
     end
 
-    module MysqlAdapter
+    module FieldInstanceMethods
 
-      def self.setup(connection)
-        ScopedSearch::Definition::Field.send :include, FieldInstanceMethods
-      end
+      # Monkey patch Field#to_sql method to ensure that comparisons using :eq / :ne
+      # are case sensitive by adding a BINARY operator in front of the field name.
+      def to_sql(operator = nil, &amp;block)
+
+        # Normal implementation
+        yield(:include, relation) if relation
+        field_name = definition.klass.connection.quote_table_name(klass.table_name) + &quot;.&quot; +
+            definition.klass.connection.quote_column_name(field)
 
-      module FieldInstanceMethods
-        
-        # Monkey patch Field#to_sql method to ensure that comparisons using :eq / :ne
-        # are case sensitive by adding a BINARY operator in front of the field name.
-        def to_sql(operator = nil, &amp;block)
-          
-          # Normal implementation
-          yield(:include, relation) if relation
-          field_name = definition.klass.connection.quote_table_name(klass.table_name) + &quot;.&quot; + 
-              definition.klass.connection.quote_column_name(field)
-
-          # Add BINARY operator if the field is textual and = or &lt;&gt; is used.
-          field_name = &quot;BINARY #{field_name}&quot; if textual? &amp;&amp; [:ne, :eq].include?(operator)
-          return field_name
-        end
+        # Add BINARY operator if the field is textual and = or &lt;&gt; is used.
+        field_name = &quot;BINARY #{field_name}&quot; if textual? &amp;&amp; [:ne, :eq].include?(operator)
+        return field_name
       end
-      
     end
-    
-    module PostgreSQLAdapter      
-      def self.setup(connection)
-        ScopedSearch::QueryBuilder::SQL_OPERATORS[:like] = 'ILIKE'
-        ScopedSearch::QueryBuilder::SQL_OPERATORS[:unlike] = 'NOT ILIKE'
-      end
+
+  end
+
+  # The PostgreSQL adapter uses the ILKE operator instead of the LIKE operator that
+  # is used by default, to make sure that queries are case-insensitive.
+  module PostgreSQLAdapter
+
+    # Change the LIKE operator to ILIKE.
+    def self.setup(connection)
+      ScopedSearch::QueryBuilder::SQL_OPERATORS[:like] = 'ILIKE'
+      ScopedSearch::QueryBuilder::SQL_OPERATORS[:unlike] = 'NOT ILIKE'
     end
   end
 end</diff>
      <filename>lib/scoped_search/adapters.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,23 @@
 module ScopedSearch
-  
+
+  # The ScopedSearch definition class defines on what fields should be search
+  # in the model in what cases
+  #
+  # A definition can be created by calling the &lt;tt&gt;scoped_search&lt;/tt&gt; method on
+  # an ActiveRecord-based class, so you should not create an instance of this
+  # class yourself.
   class Definition
-    
+
+    # The Field class specifies a field of a model that is available for searching,
+    # in what cases this field should be searched and its default search behavior.
+    #
+    # Instances of this class are created when calling scoped_search in your model
+    # class, so you should not create instances of this class yourself.
     class Field
-      
+
       attr_reader :definition, :field, :only_explicit, :relation
-      
+
+      # The ActiveRecord-based class that belongs to this field.
       def klass
         if relation
           definition.klass.reflections[relation].klass
@@ -13,36 +25,43 @@ module ScopedSearch
           definition.klass
         end
       end
-      
-      # Find the relevant column definition in the AR class
+
+      # Returns the ActiveRecord column definition that corresponds to this field.
       def column
         klass.columns_hash[field.to_s]
       end
-      
+
+      # Returns the column type of this field.
       def type
         column.type
       end
-      
+
+      # Returns true if this field is a datetime-like column
       def datetime?
         [:datetime, :time, :timestamp].include?(type)
       end
-      
+
+      # Returns true if this field is a date-like column
       def date?
         type == :date
       end
-      
+
+      # Returns true if this field is a date or datetime-like column.
       def temporal?
         datetime? || date?
       end
-      
+
+      # Returns true if this field is numerical.
+      # Numerical means either integer, floating point or fixed point.
       def numerical?
         [:integer, :double, :float, :decimal].include?(type)
       end
-      
+
+      # Returns true if this is a textual column.
       def textual?
         [:string, :text].include?(type)
       end
-      
+
       # Returns the default search operator for this field.
       def default_operator
         @default_operator ||= case type
@@ -51,6 +70,8 @@ module ScopedSearch
         end
       end
 
+      # Initializes a Field instance given the definition passed to the
+      # scoped_search call on the ActiveRecord-based model class.
       def initialize(definition, options = {})
         @definition = definition
         case options
@@ -64,59 +85,67 @@ module ScopedSearch
           @only_explicit    = !!options[:only_explicit]
           @default_operator = options[:default_operator] if options.has_key?(:default_operator)
         end
-        
+
         # Store this field is the field array
         definition.fields[@field] ||= self
         definition.unique_fields   &lt;&lt; self
-        
+
         # Store definition for alias / aliases as well
         definition.fields[options[:alias]] ||= self                    if options[:alias]
-        options[:aliases].each { |al| definition.fields[al] ||= self } if options[:aliases]        
+        options[:aliases].each { |al| definition.fields[al] ||= self } if options[:aliases]
       end
     end
-    
+
     attr_reader :klass, :fields, :unique_fields
-    
+
+    # Initializes a ScopedSearch definition instance.
+    # This method will also setup a database adapter and create the :search_for
+    # named scope if it does not yet exist.
     def initialize(klass)
       @klass         = klass
       @fields        = {}
       @unique_fields = []
-      
+
       setup_adapter!        unless klass.connection.nil?
       register_named_scope! unless klass.respond_to?(:search_for)
     end
-    
-    NUMBER_REGXP    = /^\-?\d+(\.\d+)?$/
-    
+
+    NUMERICAL_REGXP = /^\-?\d+(\.\d+)?$/
+
+    # Returns a list of appropriate fields to search in given a search keyword and operator.
     def default_fields_for(value, operator = nil)
-      # Use the value to detect
+
       column_types  = []
       column_types += [:string, :text]                      if [nil, :like, :unlike, :ne, :eq].include?(operator)
-      column_types += [:integer, :double, :float, :decimal] if value =~ NUMBER_REGXP
+      column_types += [:integer, :double, :float, :decimal] if value =~ NUMERICAL_REGXP
       column_types += [:datetime, :date, :timestamp]        if ScopedSearch::QueryBuilder.parse_temporal(value)
 
       default_fields.select { |field| column_types.include?(field.type) }
     end
-    
+
+    # Returns a list of fields that should be searched on by default.
+    #
+    # Every field will show up in this method's result, except for fields for
+    # which the only_explicit parameter is set to true.
     def default_fields
       unique_fields.reject { |field| field.only_explicit }
     end
-    
+
+    # Defines a new search field for this search definition.
     def define(options)
       Field.new(self, options)
     end
-        
+
     protected
-    
-    # Registers the search_for named scope within the class
+
+    # Registers the search_for named scope within the class that is used for searching.
     def register_named_scope! # :nodoc
       @klass.named_scope(:search_for, lambda { |*args| ScopedSearch::QueryBuilder.build_query(args[1] || self, args[0]) })
     end
-    
+
+    # Installs the database adapter based on the current database connection.
     def setup_adapter!
       ScopedSearch::Adapter.setup(@klass.connection)
     end
-    
   end
-  
-end
\ No newline at end of file
+end</diff>
      <filename>lib/scoped_search/definition.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,20 @@
 module ScopedSearch
 
+  # The QueryBuilder class builds an SQL query based on aquery string that is
+  # provided to the search_for named scope. It uses a SearchDefinition instance
+  # to shape the query.
   class QueryBuilder
-    
+
     attr_reader :ast, :definition
-    
-    # Creates a find parameter hash given a class, and query string.
-    def self.build_query(definition, query) 
-      # Return all record when an empty search string is given
+
+    # Creates a find parameter hash that can be passed to ActiveRecord::Base#find,
+    # given a search definition and query string. This method is called from the
+    # search_for named scope.
+    #
+    # This method will parse the query string and build an SQL query using the search
+    # query. It will return an ampty hash if the search query is empty, in which case
+    # the scope call will simply return all records.
+    def self.build_query(definition, query)
       if query.kind_of?(ScopedSearch::QueryLanguage::AST::Node)
         return self.new(definition, query).build_find_params
       elsif query.kind_of?(String)
@@ -22,15 +30,16 @@ module ScopedSearch
     def initialize(definition, ast)
       @definition, @ast = definition, ast
     end
-    
-    # Actually builds the find parameters
+
+    # Actually builds the find parameters hash that should be used in the search_for
+    # named scope.
     def build_find_params
       parameters = []
       includes   = []
-      
+
       # Build SQL WHERE clause using the AST
       sql = @ast.to_sql(definition) do |notification, value|
-        
+
         # Handle the notifications encountered during the SQL generation:
         # Store the parameters, includes, etc so that they can be added to
         # the find-hash later on.
@@ -40,7 +49,7 @@ module ScopedSearch
         else raise ScopedSearch::QueryNotSupported, &quot;Cannot handle #{notification.inspect}: #{value.inspect}&quot;
         end
       end
-      
+
       # Build hash for ActiveRecord::Base#find for the named scope
       find_attributes = {}
       find_attributes[:conditions] = [sql] + parameters unless sql.nil?
@@ -48,31 +57,42 @@ module ScopedSearch
       # p find_attributes # Uncomment for debugging
       return find_attributes
     end
-    
-    SQL_OPERATORS = { :eq =&gt;'=', :ne =&gt; '&lt;&gt;',
-      :like =&gt; 'LIKE', :unlike =&gt; 'NOT LIKE',
-      :gt =&gt; '&gt;', :lt =&gt;'&lt;', :lte =&gt; '&lt;=', :gte =&gt; '&gt;=' }
-    
-    # Return the SQL operator to use
+
+    # A hash that maps the operators of the query language with the corresponding SQL operator.
+    SQL_OPERATORS = { :eq =&gt;'=',  :ne =&gt; '&lt;&gt;', :like =&gt; 'LIKE', :unlike =&gt; 'NOT LIKE',
+                      :gt =&gt; '&gt;', :lt =&gt;'&lt;',   :lte =&gt; '&lt;=',    :gte =&gt; '&gt;=' }
+
+    # Return the SQL operator to use given an operator symbol and field definition.
+    #
+    # By default, it will simply look up the correct SQL operator in the SQL_OPERATORS
+    # hash, but this can be overrided by a database adapter.
     def self.sql_operator(operator, field)
       SQL_OPERATORS[operator]
     end
 
     # Perform a comparison between a field and a Date(Time) value.
-    # Makes sure the date is valid and adjust the comparison in
-    # some cases to return more logical results
-    def self.datetime_test(field, operator, value, &amp;block)
-      
+    #
+    # This function makes sure the date is valid and adjust the comparison in
+    # some cases to return more logical results.
+    #
+    # This function needs a block that can be used to pass other information about the query
+    # (parameters that should be escaped, includes) to the query builder.
+    #
+    # &lt;tt&gt;field&lt;/tt&gt;:: The field to test.
+    # &lt;tt&gt;operator&lt;/tt&gt;:: The operator used for comparison.
+    # &lt;tt&gt;value&lt;/tt&gt;:: The value to compare the field with.
+    def self.datetime_test(field, operator, value, &amp;block) # :yields: finder_option_type, value
+
       # Parse the value as a date/time and ignore invalid timestamps
       timestamp = parse_temporal(value)
-      return nil unless timestamp 
-      timestamp = Date.parse(timestamp.strftime('%Y-%m-%d')) if field.date?      
-      
+      return nil unless timestamp
+      timestamp = Date.parse(timestamp.strftime('%Y-%m-%d')) if field.date?
+
       # Check for the case that a date-only value is given as search keyword,
       # but the field is of datetime type. Change the comparison to return
       # more logical results.
       if timestamp.day_fraction == 0 &amp;&amp; field.datetime?
-        
+
         if [:eq, :ne].include?(operator)
           # Instead of looking for an exact (non-)match, look for dates that
           # fall inside/outside the range of timestamps of that day.
@@ -81,28 +101,35 @@ module ScopedSearch
           negate    = (operator == :ne) ? 'NOT' : ''
           field_sql = field.to_sql(operator, &amp;block)
           return &quot;#{negate}(#{field_sql} &gt;= ? AND #{field_sql} &lt; ?)&quot;
-          
+
         elsif operator == :gt
           # Make sure timestamps on the given date are not included in the results
           # by moving the date to the next day.
           timestamp += 1
           operator = :gte
-          
+
         elsif operator == :lte
-          # Make sure the timestamps of the given date are included by moving the 
+          # Make sure the timestamps of the given date are included by moving the
           # date to the next date.
           timestamp += 1
           operator = :lt
         end
       end
-    
+
       # Yield the timestamp and return the SQL test
       yield(:parameter, timestamp)
       &quot;#{field.to_sql(operator, &amp;block)} #{self.sql_operator(operator, field)} ?&quot;
     end
-    
+
     # Generates a simple SQL test expression, for a field and value using an operator.
-    def self.sql_test(field, operator, value, &amp;block)
+    #
+    # This function needs a block that can be used to pass other information about the query
+    # (parameters that should be escaped, includes) to the query builder.
+    #
+    # &lt;tt&gt;field&lt;/tt&gt;:: The field to test.
+    # &lt;tt&gt;operator&lt;/tt&gt;:: The operator used for comparison.
+    # &lt;tt&gt;value&lt;/tt&gt;:: The value to compare the field with.
+    def self.sql_test(field, operator, value, &amp;block) # :yields: finder_option_type, value
       if [:like, :unlike].include?(operator) &amp;&amp; value !~ /^\%/ &amp;&amp; value !~ /\%$/
         yield(:parameter, &quot;%#{value}%&quot;)
         return &quot;#{field.to_sql(operator, &amp;block)} #{self.sql_operator(operator, field)} ?&quot;
@@ -113,26 +140,32 @@ module ScopedSearch
         return &quot;#{field.to_sql(operator, &amp;block)} #{self.sql_operator(operator, field)} ?&quot;
       end
     end
-    
+
     # Try to parse a string as a datetime.
     def self.parse_temporal(value)
       DateTime.parse(value, true) rescue nil
     end
 
+    # This module gets included into the Field class to add SQL generation.
     module Field
-      
+
       # Return an SQL representation for this field. Also make sure that
       # the relation which includes the search field is included in the
       # SQL query.
-      def to_sql(operator = nil, &amp;block)
+      #
+      # This function may yield an :include that should be used in the
+      # ActiveRecord::Base#find call, to make sure that the field is avalable
+      # for the SQL query.
+      def to_sql(operator = nil, &amp;block) # :yields: finder_option_type, value
         yield(:include, relation) if relation
-        definition.klass.connection.quote_table_name(klass.table_name) + &quot;.&quot; + 
+        definition.klass.connection.quote_table_name(klass.table_name) + &quot;.&quot; +
             definition.klass.connection.quote_column_name(field)
       end
     end
 
+    # This module contains modules for every AST::Node class to add SQL generation.
     module AST
-      
+
       # Defines the to_sql method for AST LeadNodes
       module LeafNode
         def to_sql(definition, &amp;block)
@@ -143,47 +176,47 @@ module ScopedSearch
           &quot;(#{fragments.join(' OR ')})&quot;
         end
       end
-      
+
       # Defines the to_sql method for AST operator nodes
       module OperatorNode
-            
-        # Returns a NOT(...)  SQL fragment that negates the current AST node's children  
+
+        # Returns a NOT(...)  SQL fragment that negates the current AST node's children
         def to_not_sql(definition, &amp;block)
           &quot;(NOT(#{rhs.to_sql(definition, &amp;block)}) OR #{rhs.to_sql(definition, &amp;block)} IS NULL)&quot;
         end
-        
-        # Returns a IS (NOT) NULL SQL fragment
+
+        # Returns an IS (NOT) NULL SQL fragment
         def to_null_sql(definition, &amp;block)
-          field = definition.fields[rhs.value.to_sym]  
+          field = definition.fields[rhs.value.to_sym]
           raise ScopedSearch::QueryNotSupported, &quot;Field '#{rhs.value}' not recognized for searching!&quot; unless field
-          
+
           case operator
             when :null    then &quot;#{field.to_sql(&amp;block)} IS NULL&quot;
             when :notnull then &quot;#{field.to_sql(&amp;block)} IS NOT NULL&quot;
           end
         end
-        
+
         # No explicit field name given, run the operator on all default fields
         def to_default_fields_sql(definition, &amp;block)
-          raise ScopedSearch::QueryNotSupported, &quot;Value not a leaf node&quot; unless rhs.kind_of?(ScopedSearch::QueryLanguage::AST::LeafNode)          
-          
+          raise ScopedSearch::QueryNotSupported, &quot;Value not a leaf node&quot; unless rhs.kind_of?(ScopedSearch::QueryLanguage::AST::LeafNode)
+
           # Search keywords found without context, just search on all the default fields
           fragments = definition.default_fields_for(rhs.value, operator).map { |field|
             ScopedSearch::QueryBuilder.sql_test(field, operator, rhs.value, &amp;block) }.compact
           fragments.empty? ? nil : &quot;(#{fragments.join(' OR ')})&quot;
         end
-        
+
         # Explicit field name given, run the operator on the specified field only
         def to_single_field_sql(definition, &amp;block)
           raise ScopedSearch::QueryNotSupported, &quot;Field name not a leaf node&quot; unless lhs.kind_of?(ScopedSearch::QueryLanguage::AST::LeafNode)
           raise ScopedSearch::QueryNotSupported, &quot;Value not a leaf node&quot;      unless rhs.kind_of?(ScopedSearch::QueryLanguage::AST::LeafNode)
-          
+
           # Search only on the given field.
           field = definition.fields[lhs.value.to_sym]
           raise ScopedSearch::QueryNotSupported, &quot;Field '#{lhs.value}' not recognized for searching!&quot; unless field
           ScopedSearch::QueryBuilder.sql_test(field, operator, rhs.value, &amp;block)
         end
-        
+
         # Convert this AST node to an SQL fragment.
         def to_sql(definition, &amp;block)
           if operator == :not &amp;&amp; children.length == 1
@@ -191,27 +224,30 @@ module ScopedSearch
           elsif [:null, :notnull].include?(operator)
             to_null_sql(definition, &amp;block)
           elsif children.length == 1
-            to_default_fields_sql(definition, &amp;block)            
+            to_default_fields_sql(definition, &amp;block)
           elsif children.length == 2
             to_single_field_sql(definition, &amp;block)
           else
             raise ScopedSearch::QueryNotSupported, &quot;Don't know how to handle this operator node: #{operator.inspect} with #{children.inspect}!&quot;
           end
-        end 
+        end
       end
-      
+
       # Defines the to_sql method for AST AND/OR operators
       module LogicalOperatorNode
         def to_sql(definition, &amp;block)
           fragments = children.map { |c| c.to_sql(definition, &amp;block) }.compact
           fragments.empty? ? nil : &quot;(#{fragments.join(&quot; #{operator.to_s.upcase} &quot;)})&quot;
-        end 
-      end      
+        end
+      end
     end
   end
 
+  # Include the modu;es into the corresponding classes
+  # to add SQL generation capabilities to them.
+
   Definition::Field.send(:include, QueryBuilder::Field)
   QueryLanguage::AST::LeafNode.send(:include, QueryBuilder::AST::LeafNode)
   QueryLanguage::AST::OperatorNode.send(:include, QueryBuilder::AST::OperatorNode)
-  QueryLanguage::AST::LogicalOperatorNode.send(:include, QueryBuilder::AST::LogicalOperatorNode)  
+  QueryLanguage::AST::LogicalOperatorNode.send(:include, QueryBuilder::AST::LogicalOperatorNode)
 end</diff>
      <filename>lib/scoped_search/query_builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,26 +4,34 @@ module ScopedSearch::QueryLanguage
   require 'scoped_search/query_language/tokenizer'
   require 'scoped_search/query_language/parser'
 
-  class Compiler 
+  # The Compiler class can compile a query string into an Abstract Syntax Tree,
+  # which in turn is used to build the SQL query.
+  #
+  # This class inclused the Tokenizer module to transform the query stream into
+  # a stream of tokens, and includes the Parser module that will transform the
+  # stream of tokens into an Abstract Syntax Tree (AST).
+  class Compiler
 
     include Tokenizer
     include Parser
     include Enumerable
-    
-    def initialize(str)
+
+    def initialize(str) # :nodoc:
       @str = str
     end
-    
+
+    # Parser a query string to return an abstract syntax tree.
     def self.parse(str)
       compiler = self.new(str)
       compiler.parse
     end
-    
+
+    # Tokenizes a query string to return a stream of tokens.
     def self.tokenize(str)
       compiler = self.new(str)
       compiler.tokenize
     end
-        
+
   end
 end
 </diff>
      <filename>lib/scoped_search/query_language.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module ScopedSearch::QueryLanguage::AST
-  
+
   # Constructs an AST from an array notation.
-  def self.from_array(arg) 
+  def self.from_array(arg)
     if arg.kind_of?(Array)
       operator = arg.shift
       case operator
@@ -16,46 +16,46 @@ module ScopedSearch::QueryLanguage::AST
       return LeafNode.new(arg)
     end
   end
-  
+
   # Base AST node class. Instances of this class are used to represent an abstract syntax tree.
   # This syntax tree is created by the ScopedSearch::QueryLanguage parser and visited by the
   # ScopedSearch::QueryBuilder to create SQL query conditions.
   class Node
-    
+
     def inspect # :nodoc
       &quot;&lt;AST::#{self.class.to_s.split('::').last} #{self.to_a.inspect}&gt;&quot;
     end
-    
+
     # Tree simplification. By default, do nothing and return the node as is.
-    def simplify 
+    def simplify
       return self
     end
-    
+
     def compatible_with(node) # :nodoc
-      false  
-    end 
+      false
+    end
   end
-  
+
   # AST lead node. This node represents leafs in the AST and can represent
-  # either a search phrase or a search field name. 
+  # either a search phrase or a search field name.
   class LeafNode &lt; Node
     attr_reader :value
-   
+
     def initialize(value) # :nodoc
       @value = value
     end
-     
-    # Return an array representation for the node     
+
+    # Return an array representation for the node
     def to_a
       value
     end
-    
+
     def eql?(node) # :nodoc
       node.kind_of?(LeafNode) &amp;&amp; node.value == value
     end
   end
 
-  # AST class for representing operators in the query. An operator node has an operator 
+  # AST class for representing operators in the query. An operator node has an operator
   # and operands that are represented as AST child nodes. Usually, operator nodes have
   # one or two children.
   # For logical operators, a distinct subclass exists to implement some tree
@@ -63,67 +63,67 @@ module ScopedSearch::QueryLanguage::AST
   class OperatorNode &lt; Node
     attr_reader :operator
     attr_reader :children
-     
+
     def initialize(operator, children) # :nodoc
       @operator = operator
       @children = children
     end
-    
-    # Tree simplicication: returns itself after simpifying its children 
+
+    # Tree simplicication: returns itself after simpifying its children
     def simplify
       @children = children.map { |c| c.simplify }
       return self
     end
-    
-    # Return an array representation for the node 
+
+    # Return an array representation for the node
     def to_a
       [@operator] + @children.map { |c| c.to_a }
     end
-    
+
     def eql?(node) # :nodoc
       node.kind_of?(OperatorNode) &amp;&amp; node.operator == operator &amp;&amp; node.children.eql?(children)
     end
-    
+
     # Return the left-hand side (LHS) operand for this operator.
     def lhs
       raise ScopedSearch::Exception, &quot;Operator does not have a LHS&quot; if prefix?
       raise ScopedSearch::Exception, &quot;Operators with more than 2 children do not have LHS/RHS&quot; if children.length &gt; 2
       children[0]
-    end       
-    
-    # Return the right-hand side (RHS) operand for this operator.    
+    end
+
+    # Return the right-hand side (RHS) operand for this operator.
     def rhs
-      raise ScopedSearch::Exception, &quot;Operators with more than 2 children do not have LHS/RHS&quot; if children.length &gt; 2      
+      raise ScopedSearch::Exception, &quot;Operators with more than 2 children do not have LHS/RHS&quot; if children.length &gt; 2
       children.length == 1 ? children[0] : children[1]
     end
-    
+
     # Returns true if this is an infix operator
     def infix?
       children.length &gt; 1
     end
-    
+
     # Returns true if this is a prefix operator
     def prefix?
       children.length == 1
     end
-    
+
     # Returns a child node by index, starting with 0.
     def [](child_nr)
       children[child_nr]
     end
-    
+
   end
-  
+
   # AST class for representing AND or OR constructs.
   # Logical constructs can be simplified resulting in a less complex AST.
   class LogicalOperatorNode &lt; OperatorNode
-   
+
     # Checks whether another node is comparable so that it can be used for tree simplification.
     # A node can only be simplified if the logical operator is equal.
     def compatible_with(node)
       node.kind_of?(LogicalOperatorNode) &amp;&amp; node.operator == self.operator
     end
-   
+
     # Simplifies nested AND and OR constructs to single constructs with multiple arguments:
     # e.g. (a AND (b AND c)) -&gt; (a AND b AND c)
     def simplify
@@ -134,7 +134,7 @@ module ScopedSearch::QueryLanguage::AST
       else
         # nested AND or OR constructs can be combined into one construct
         @children = children.map { |c| c.simplify }.map { |c| self.compatible_with(c) ? c.children : c }.flatten
-        return self  
+        return self
       end
     end
   end</diff>
      <filename>lib/scoped_search/query_language/ast.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,34 @@
+# The Parser module adss methods to the query language compiler that transform a string
+# into an abstract syntax tree, which can be used for query generation.
+#
+# This module depends on the tokeinzer module to transform the string into a stream
+# of tokens, which is more appropriate for parsing. The parser itself is a LL(1)
+# recursive descent parser.
 module ScopedSearch::QueryLanguage::Parser
 
   DEFAULT_SEQUENCE_OPERATOR = :and
-  
+
   LOGICAL_INFIX_OPERATORS  = [:and, :or]
   LOGICAL_PREFIX_OPERATORS = [:not]
   NULL_PREFIX_OPERATORS    = [:null, :notnull]
   COMPARISON_OPERATORS = [:eq, :ne, :gt, :gte, :lt, :lte, :like, :unlike]
   ALL_INFIX_OPERATORS = LOGICAL_INFIX_OPERATORS + COMPARISON_OPERATORS
   ALL_PREFIX_OPERATORS = LOGICAL_PREFIX_OPERATORS + COMPARISON_OPERATORS + NULL_PREFIX_OPERATORS
-  
+
   # Start the parsing process by parsing an expression sequence
   def parse
-    @tokens = tokenize   
+    @tokens = tokenize
     parse_expression_sequence(true).simplify
   end
 
   # Parses a sequence of expressions
   def parse_expression_sequence(initial = false)
     expressions = []
-    next_token if !initial &amp;&amp; peek_token == :lparen # skip staring :lparen    
+    next_token if !initial &amp;&amp; peek_token == :lparen # skip staring :lparen
     expressions &lt;&lt; parse_logical_expression until peek_token.nil? || peek_token == :rparen
     next_token if !initial &amp;&amp; peek_token == :rparen # skip final :rparen
     return ScopedSearch::QueryLanguage::AST::LogicalOperatorNode.new(DEFAULT_SEQUENCE_OPERATOR, expressions)
   end
-  
 
   # Parses a logical expression.
   def parse_logical_expression
@@ -42,34 +47,34 @@ module ScopedSearch::QueryLanguage::Parser
     else
       lhs
     end
-  end  
-  
+  end
+
   # Parses a NOT expression
   def parse_logical_not_expression
     next_token # = skip NOT operator
     negated_expression = case peek_token
-      when :not;    parse_logical_not_expression 
+      when :not;    parse_logical_not_expression
       when :lparen; parse_expression_sequence
       else          parse_comparison
     end
     return ScopedSearch::QueryLanguage::AST::OperatorNode.new(:not, [negated_expression])
   end
-  
+
   # Parses a set? or null? expression
   def parse_null_expression
     return ScopedSearch::QueryLanguage::AST::OperatorNode.new(next_token, [parse_value])
   end
-  
+
   # Parses a comparison
   def parse_comparison
-    next_token if peek_token == :comma # skip comma      
+    next_token if peek_token == :comma # skip comma
     return (String === peek_token) ? parse_infix_comparison : parse_prefix_comparison
   end
-  
+
   # Parses a prefix comparison, i.e. without an explicit field: &lt;operator&gt; &lt;value&gt;
   def parse_prefix_comparison
     return ScopedSearch::QueryLanguage::AST::OperatorNode.new(next_token, [parse_value])
-  end  
+  end
 
   # Parses an infix expression, i.e. &lt;field&gt; &lt;operator&gt; &lt;value&gt;
   def parse_infix_comparison
@@ -89,8 +94,8 @@ module ScopedSearch::QueryLanguage::Parser
           lhs
         end
     end
-  end  
-  
+  end
+
   # Parses a single value.
   # This can either be a constant value or a field name.
   def parse_value
@@ -98,18 +103,18 @@ module ScopedSearch::QueryLanguage::Parser
     ScopedSearch::QueryLanguage::AST::LeafNode.new(next_token)
   end
 
-  protected 
-  
-  def current_token
+  protected
+
+  def current_token # :nodoc:
     @current_token
   end
-  
-  def peek_token(amount = 1)
+
+  def peek_token(amount = 1) # :nodoc:
     @tokens[amount - 1]
   end
 
-  def next_token
+  def next_token # :nodoc:
     @current_token = @tokens.shift
-  end  
+  end
 
 end
\ No newline at end of file</diff>
      <filename>lib/scoped_search/query_language/parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,39 @@
+# The Tokenizer module adds methods to the query language compiler that transforms a query string
+# into a stream of tokens, which are more appropriate for parsing a query string.
 module ScopedSearch::QueryLanguage::Tokenizer
 
+  # All keywords that the language supports
   KEYWORDS = { 'and' =&gt; :and, 'or' =&gt; :or, 'not' =&gt; :not, 'set?' =&gt; :notnull, 'null?' =&gt; :null }
+
+  # Every operator the language supports.
   OPERATORS = { '&amp;' =&gt; :and, '|' =&gt; :or, '&amp;&amp;' =&gt; :and, '||' =&gt; :or, '-'=&gt; :not, '!' =&gt; :not, '~' =&gt; :like, '!~' =&gt; :unlike,
       '=' =&gt; :eq, '==' =&gt; :eq, '!=' =&gt; :ne, '&lt;&gt;' =&gt; :ne, '&gt;' =&gt; :gt, '&lt;' =&gt; :lt, '&gt;=' =&gt; :gte, '&lt;=' =&gt; :lte }
 
-  
+  # Tokenizes the string and returns the result as an array of tokens.
   def tokenize
     @current_char_pos = -1
     to_a
   end
 
+  # Returns the current character of the string
   def current_char
     @current_char
   end
 
+  # Returns a following character of the string (by default, the next
+  # character), without updating the position pointer.
   def peek_char(amount = 1)
     @str[@current_char_pos + amount, 1]
   end
 
+  # Returns the next character of the string, and moves the position
+  # pointer one step forward
   def next_char
     @current_char_pos += 1
     @current_char = @str[@current_char_pos, 1]
   end
 
+  # Tokenizes the string by iterating over the characters.
   def each_token(&amp;block)
     while next_char
       case current_char
@@ -35,28 +46,33 @@ module ScopedSearch::QueryLanguage::Tokenizer
       else;                      tokenize_keyword(&amp;block)
       end
     end
-  end  
+  end
 
+  # Tokenizes an operator that occurs in the OPERATORS hash
   def tokenize_operator(&amp;block)
     operator = current_char
     operator &lt;&lt; next_char if OPERATORS.has_key?(operator + peek_char)
     yield(OPERATORS[operator])
   end
 
+  # Tokenizes a keyword, and converts it to a Symbol if it is recognized as a
+  # reserved language keyword (the KEYWORDS array).
   def tokenize_keyword(&amp;block)
     keyword = current_char
-    keyword &lt;&lt; next_char while /[^=&lt;&gt;\s\&amp;\|\)\(,]/ =~ peek_char      
+    keyword &lt;&lt; next_char while /[^=&lt;&gt;\s\&amp;\|\)\(,]/ =~ peek_char
     KEYWORDS.has_key?(keyword.downcase) ? yield(KEYWORDS[keyword.downcase]) : yield(keyword)
   end
 
+  # Tokenizes a keyword that is quoted using double quotes. Allows escaping
+  # of double quote characters by backslashes.
   def tokenize_quoted_keyword(&amp;block)
     keyword = &quot;&quot;
     until next_char.nil? || current_char == '&quot;'
       keyword &lt;&lt; (current_char == &quot;\\&quot; ? next_char : current_char)
     end
-    yield(keyword)      
+    yield(keyword)
   end
 
   alias :each :each_token
-  
+
 end
\ No newline at end of file</diff>
      <filename>lib/scoped_search/query_language/tokenizer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,20 +2,26 @@ Gem::Specification.new do |s|
   s.name    = 'scoped_search'
   s.version = '2.0.0'
   s.date    = '2009-08-26'
-  
-  s.summary = &quot;A Rails plugin to search your models using a named_scope&quot;
-  s.description = &quot;Scoped search makes it easy to search your ActiveRecord-based models. It will create a named scope according to a provided query string. The named_scope can be used like any other named_scope, so it can be cchained or combined with will_paginate.&quot;
-  
+
+  s.summary = &quot;A Rails plugin to search your models with a simple query language, implemented using a named_scope&quot;
+  s.description = &lt;&lt;EOS
+    Scoped search makes it easy to search your ActiveRecord-based models.
+    It will create a named scope :search_for that can be called with a query string. It will build an SQL query using
+    the provided query string and a definition that specifies on what fields to search. Because the functionality is
+    built on named_scope, the result of the search_for call can be used like any other named_scope, so it can be
+    chained with another scope or combined with will_paginate.&quot;
+EOS
+
   s.authors  = ['Willem van Bergen', 'Wes Hays']
   s.email    = ['willem@vanbergen.org', 'weshays@gbdev.com']
   s.homepage = 'http://wiki.github.com/wvanbergen/scoped_search'
-  
+
   s.add_runtime_dependency('activerecord', '&gt;= 2.1.0')
   s.add_development_dependency('rspec', '&gt;= 1.1.4')
-  
+
   s.rdoc_options &lt;&lt; '--title' &lt;&lt; s.name &lt;&lt; '--main' &lt;&lt; 'README.rdoc' &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source'
   s.extra_rdoc_files = ['README.rdoc']
-  
-  s.files = %w(LICENSE README.rdoc Rakefile init.rb lib lib/scoped_search lib/scoped_search.rb lib/scoped_search/adapters.rb lib/scoped_search/definition.rb lib/scoped_search/query_builder.rb lib/scoped_search/query_language lib/scoped_search/query_language.rb lib/scoped_search/query_language/ast.rb lib/scoped_search/query_language/parser.rb lib/scoped_search/query_language/tokenizer.rb spec spec/database.yml spec/integration spec/integration/api_spec.rb spec/integration/ordinal_querying_spec.rb spec/integration/relation_querying_spec.rb spec/integration/string_querying_spec.rb spec/lib spec/lib/database.rb spec/lib/matchers.rb spec/lib/mocks.rb spec/spec_helper.rb spec/unit spec/unit/ast_spec.rb spec/unit/definition_spec.rb spec/unit/parser_spec.rb spec/unit/query_builder_spec.rb spec/unit/tokenizer_spec.rb tasks tasks/database_tests.rake tasks/github-gem.rake)
+
+  s.files      = %w(LICENSE README.rdoc Rakefile init.rb lib lib/scoped_search lib/scoped_search.rb lib/scoped_search/adapters.rb lib/scoped_search/definition.rb lib/scoped_search/query_builder.rb lib/scoped_search/query_language lib/scoped_search/query_language.rb lib/scoped_search/query_language/ast.rb lib/scoped_search/query_language/parser.rb lib/scoped_search/query_language/tokenizer.rb spec spec/database.yml spec/integration spec/integration/api_spec.rb spec/integration/ordinal_querying_spec.rb spec/integration/relation_querying_spec.rb spec/integration/string_querying_spec.rb spec/lib spec/lib/database.rb spec/lib/matchers.rb spec/lib/mocks.rb spec/spec_helper.rb spec/unit spec/unit/ast_spec.rb spec/unit/definition_spec.rb spec/unit/parser_spec.rb spec/unit/query_builder_spec.rb spec/unit/tokenizer_spec.rb tasks tasks/database_tests.rake tasks/github-gem.rake)
   s.test_files = %w(spec/integration/api_spec.rb spec/integration/ordinal_querying_spec.rb spec/integration/relation_querying_spec.rb spec/integration/string_querying_spec.rb spec/unit/ast_spec.rb spec/unit/definition_spec.rb spec/unit/parser_spec.rb spec/unit/query_builder_spec.rb spec/unit/tokenizer_spec.rb)
 end
\ No newline at end of file</diff>
      <filename>scoped_search.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,17 @@
 sqlite3:
   adapter: &quot;sqlite3&quot;
   database: &quot;:memory:&quot;
-  
+
 mysql:
   adapter: &quot;mysql&quot;
   host: &quot;localhost&quot;
   user: &quot;root&quot;
   password:
   database: &quot;scoped_search_test&quot;
-  
+
 postgresql:
   adapter: &quot;postgresql&quot;
   host: &quot;localhost&quot;
   username: &quot;sstest&quot;
   password: &quot;sstest&quot;
-  database: &quot;scoped_search_test&quot;  
+  database: &quot;scoped_search_test&quot;</diff>
      <filename>spec/database.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,66 +1,66 @@
 require &quot;#{File.dirname(__FILE__)}/../spec_helper&quot;
 
 describe ScopedSearch, &quot;API&quot; do
-  
+
   # This spec requires the API to be stable, so that projects using
   # scoped_search do not have to update their code if a new (minor)
-  # version is released. 
+  # version is released.
   #
   # API compatibility is only guaranteed for minor version changes;
-  # New major versions may change the API and require code changes 
+  # New major versions may change the API and require code changes
   # in projects using this plugin.
   #
   # Because of the API stability guarantee, these spec's may only
   # be changed for new major releases.
-  
+
   before(:all) do
     ScopedSearch::Spec::Database.establish_connection
   end
 
   after(:all) do
-    ScopedSearch::Spec::Database.close_connection    
-  end  
-  
+    ScopedSearch::Spec::Database.close_connection
+  end
+
   context 'for unprepared ActiveRecord model' do
-        
+
     it &quot;should respond to :scoped_search to setup scoped_search for the model&quot; do
       Class.new(ActiveRecord::Base).should respond_to(:scoped_search)
     end
   end
-  
+
   context 'for a prepared ActiveRecord model' do
-    
+
     before(:all) do
       @class = ScopedSearch::Spec::Database.create_model(:field =&gt; :string) do |klass|
         klass.scoped_search :on =&gt; :field
       end
     end
-    
+
     after(:all) do
-      ScopedSearch::Spec::Database.drop_model(@class)    
+      ScopedSearch::Spec::Database.drop_model(@class)
     end
-    
+
     it &quot;should respond to :search_for to perform searches&quot; do
       @class.should respond_to(:search_for)
     end
-    
+
     it &quot;should return an ActiveRecord::NamedScope::Scope when :search_for is called&quot; do
       @class.search_for('query').class.should eql(ActiveRecord::NamedScope::Scope)
     end
   end
-  
+
   context 'having backwards compatibility' do
-    
+
     before(:each) do
       class Foo &lt; ActiveRecord::Base
         belongs_to :bar
       end
     end
-    
+
     after(:each) do
       Object.send :remove_const, :Foo
     end
-    
+
     it &quot;should respond to :searchable_on&quot; do
       Foo.should respond_to(:searchable_on)
     end
@@ -73,10 +73,10 @@ describe ScopedSearch, &quot;API&quot; do
     it &quot;should create a Field with a valid relation when using the underscore notation&quot; do
       ScopedSearch::Definition::Field.should_receive(:new).with(
           instance_of(ScopedSearch::Definition), hash_including(:in =&gt; :bar, :on =&gt; :related_field))
-          
+
       Foo.searchable_on(:bar_related_field)
     end
-    
+
   end
 
 end</diff>
      <filename>spec/integration/api_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,31 +97,31 @@ describe ScopedSearch do
     it &quot;should accept YY-MM-DD as date format&quot; do
       @class.search_for('date = 09-01-02').should have(1).item
     end
-    
+
     it &quot;should accept MM/DD/YY as date format&quot; do
       @class.search_for('date = 01/02/09').should have(1).item
-    end    
-    
+    end
+
     it &quot;should accept YYYY/MM/DD as date format&quot; do
       @class.search_for('date = 2009/01/02').should have(1).item
     end
-    
+
     it &quot;should accept MM/DD/YYYY as date format&quot; do
       @class.search_for('date = 01/02/2009').should have(1).item
-    end      
-    
+    end
+
     it &quot;should ignore an invalid date and thus return all records&quot; do
       @class.search_for('&gt;= 2009-14-57').should have(2).items
-    end      
-    
+    end
+
     it &quot;should find the records with a timestamp set some point on the provided date&quot; do
       @class.search_for('&gt;= 2009-01-02').should have(1).item
     end
-    
+
     it &quot;should support full timestamps&quot; do
       @class.search_for('&gt; &quot;2009-01-02 02:02:02&quot;').should have(1).item
     end
-    
+
     it &quot;should find no record with a timestamp in the past&quot; do
       @class.search_for('&lt; 2009-01-02').should have(0).item
     end
@@ -129,14 +129,14 @@ describe ScopedSearch do
     it &quot;should find all timestamps on a date if no time is given using the = operator&quot; do
       @class.search_for('= 2009-01-02').should have(1).item
     end
-    
+
     it &quot;should find all timestamps on a date if no time is when no operator is given&quot; do
       @class.search_for('2009-01-02').should have(1).item
-    end    
-    
+    end
+
     it &quot;should find all timestamps not on a date if no time is given using the != operator&quot; do
       @class.search_for('!= 2009-01-02').should have(0).item
-    end      
+    end
 
     it &quot;should find the records when the date part of a timestamp matches a date&quot; do
       @class.search_for('&gt;= 2009-01-02').should have(1).item</diff>
      <filename>spec/integration/ordinal_querying_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,19 +13,19 @@ describe ScopedSearch do
   context 'querying a :belongs_to relation' do
 
     before(:all) do
-      
+
       # The related class
       ActiveRecord::Migration.create_table(:bars) { |t| t.string :related }
       class Bar &lt; ActiveRecord::Base; has_many :foos; end
-      
+
       # The class on which to call search_for
       Foo = ScopedSearch::Spec::Database.create_model(:foo =&gt; :string, :bar_id =&gt; :integer) do |klass|
         klass.belongs_to :bar
         klass.scoped_search :in =&gt; :bar, :on =&gt; :related
       end
-      
+
       @bar_record = Bar.create!(:related =&gt; 'bar')
-      
+
       Foo.create!(:foo =&gt; 'foo',       :bar =&gt; @bar_record)
       Foo.create!(:foo =&gt; 'foo too',   :bar =&gt; @bar_record)
       Foo.create!(:foo =&gt; 'foo three', :bar =&gt; Bar.create!(:related =&gt; 'another bar'))
@@ -85,11 +85,11 @@ describe ScopedSearch do
       Object.send :remove_const, :Foo
       Object.send :remove_const, :Bar
     end
-    
+
     it &quot;should find all records with at least one bar record containing 'bar'&quot; do
       Foo.search_for('bar').should have(2).items
     end
-    
+
     it &quot;should find the only record with at least one bar record having the exact value 'bar'&quot; do
       Foo.search_for('= bar').should have(1).item
     end
@@ -97,13 +97,13 @@ describe ScopedSearch do
     it &quot;should find all records for which at least one related bar record exists&quot; do
       Foo.search_for('set? related').should have(2).items
     end
-    
+
     it &quot;should find all records for which none related bar records exist&quot; do
       Foo.search_for('null? related').should have(1).items
     end
-    
+
   end
-  
+
   context 'querying a :has_one relation' do
 
     before(:all) do
@@ -132,11 +132,11 @@ describe ScopedSearch do
       Object.send :remove_const, :Foo
       Object.send :remove_const, :Bar
     end
-    
+
     it &quot;should find all records with a bar record containing 'bar&quot; do
       Foo.search_for('bar').should have(2).items
     end
-    
+
     it &quot;should find the only record with the bar record has the exact value 'bar&quot; do
       Foo.search_for('= bar').should have(1).item
     end
@@ -144,7 +144,7 @@ describe ScopedSearch do
     it &quot;should find all records for which the related bar record exists&quot; do
       Foo.search_for('set? related').should have(2).items
     end
-    
+
     it &quot;should find all records for which the related bar record does not exist&quot; do
       Foo.search_for('null? related').should have(1).items
     end
@@ -158,7 +158,7 @@ describe ScopedSearch do
       ActiveRecord::Migration.create_table(:bars) { |t| t.string :related }
       ActiveRecord::Migration.create_table(:bars_foos, :id =&gt; false) { |t| t.integer :foo_id; t.integer :bar_id }
       ActiveRecord::Migration.create_table(:foos) { |t| t.string :foo }
-      
+
       # The related class
       class Bar &lt; ActiveRecord::Base; end
 
@@ -175,7 +175,7 @@ describe ScopedSearch do
       @bar_1 = Bar.create!(:related =&gt; 'bar')
       @bar_2 = Bar.create!(:related =&gt; 'other bar')
       @bar_3 = Bar.create!(:related =&gt; 'last bar')
-      
+
       @foo_1.bars &lt;&lt; @bar_1 &lt;&lt; @bar_2
       @foo_2.bars &lt;&lt; @bar_2 &lt;&lt; @bar_3
     end
@@ -183,15 +183,15 @@ describe ScopedSearch do
     after(:all) do
       ActiveRecord::Migration.drop_table(:bars_foos)
       ActiveRecord::Migration.drop_table(:bars)
-      ActiveRecord::Migration.drop_table(:foos)      
+      ActiveRecord::Migration.drop_table(:foos)
       Object.send :remove_const, :Foo
       Object.send :remove_const, :Bar
     end
-    
+
     it &quot;should find all records with at least one associated bar record containing 'bar'&quot; do
       Foo.search_for('bar').should have(2).items
     end
-    
+
     it &quot;should find record which is related to @bar_1&quot; do
       Foo.search_for('= bar').should have(1).items
     end
@@ -206,14 +206,14 @@ describe ScopedSearch do
   end
 
   context 'querying a :has_many =&gt; :through relation' do
-    
+
     before(:all) do
 
       # Create some tables
       ActiveRecord::Migration.create_table(:bars) { |t| t.integer :foo_id; t.integer :baz_id }
       ActiveRecord::Migration.create_table(:bazs) { |t| t.string :related }
       ActiveRecord::Migration.create_table(:foos) { |t| t.string :foo }
-      
+
       # The related classes
       class Bar &lt; ActiveRecord::Base; belongs_to :baz; belongs_to :foo; end
       class Baz &lt; ActiveRecord::Base; has_many :bars; end
@@ -222,7 +222,7 @@ describe ScopedSearch do
       class Foo &lt; ActiveRecord::Base
         has_many :bars
         has_many :bazs, :through =&gt; :bars
-        
+
         scoped_search :in =&gt; :bazs, :on =&gt; :related
       end
 
@@ -248,8 +248,8 @@ describe ScopedSearch do
       Object.send :remove_const, :Foo
       Object.send :remove_const, :Bar
       Object.send :remove_const, :Baz
-    end   
-    
+    end
+
     it &quot;should find the two records that are related to a baz record&quot; do
       Foo.search_for('baz').should have(2).items
     end</diff>
      <filename>spec/integration/relation_querying_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,28 +6,28 @@ describe ScopedSearch, :search_for do
     ScopedSearch::Spec::Database.establish_connection
     @class = ScopedSearch::Spec::Database.create_model(:string =&gt; :string, :another =&gt; :string, :explicit =&gt; :string) do |klass|
       klass.scoped_search :on =&gt; :string
-      klass.scoped_search :on =&gt; :another,  :default_operator =&gt; :eq, :alias =&gt; :alias      
+      klass.scoped_search :on =&gt; :another,  :default_operator =&gt; :eq, :alias =&gt; :alias
       klass.scoped_search :on =&gt; :explicit, :only_explicit =&gt; true
     end
-    
+
     @class.create!(:string =&gt; 'foo', :another =&gt; 'temp 1', :explicit =&gt; 'baz')
-    @class.create!(:string =&gt; 'bar', :another =&gt; 'temp 2', :explicit =&gt; 'baz')      
+    @class.create!(:string =&gt; 'bar', :another =&gt; 'temp 2', :explicit =&gt; 'baz')
     @class.create!(:string =&gt; 'baz', :another =&gt; 'temp 3', :explicit =&gt; nil)
   end
-    
+
   after(:all) do
     ScopedSearch::Spec::Database.drop_model(@class)
-    ScopedSearch::Spec::Database.close_connection 
+    ScopedSearch::Spec::Database.close_connection
   end
-  
+
   context 'in an implicit string field' do
     it &quot;should find the record with an exact string match&quot; do
       @class.search_for('foo').should have(1).item
     end
-    
+
     it &quot;should find the opther two records using NOT with an exact string match&quot; do
       @class.search_for('-foo').should have(2).item
-    end    
+    end
 
     it &quot;should find the record with an exact string match and an explicit field operator&quot; do
       @class.search_for('string = foo').should have(1).item
@@ -36,14 +36,14 @@ describe ScopedSearch, :search_for do
     it &quot;should find the record with an exact string match and an explicit field operator&quot; do
       @class.search_for('another = foo').should have(0).items
     end
-    
+
     it &quot;should find the record with an partial string match&quot; do
       @class.search_for('fo').should have(1).item
     end
-    
+
     it &quot;should find the other two records using NOT with an partial string match&quot; do
       @class.search_for('-fo').should have(2).item
-    end    
+    end
 
     it &quot;should not find the record with an explicit equals operator and a partial match&quot; do
       @class.search_for('= fo').should have(0).items
@@ -52,14 +52,14 @@ describe ScopedSearch, :search_for do
     it &quot;should find the record with an explicit LIKE operator and a partial match&quot; do
       @class.search_for('~ fo').should have(1).items
     end
-    
+
     it &quot;should find the all other record with an explicit NOT LIKE operator and a partial match&quot; do
       @class.search_for('string !~ fo').should have(@class.count - 1).items
-    end  
+    end
 
     it &quot;should not find a record with a non-match&quot; do
       @class.search_for('nonsense').should have(0).items
-    end        
+    end
 
     it &quot;should find two records if it partially matches them&quot; do
       @class.search_for('ba').should have(2).item
@@ -67,11 +67,11 @@ describe ScopedSearch, :search_for do
 
     it &quot;should find no records starting with an a&quot; do
       @class.search_for('a%').should have(0).item
-    end  
+    end
 
     it &quot;should find one records ending with an oo&quot; do
       @class.search_for('%oo').should have(1).item
-    end  
+    end
 
     it &quot;should find records without case sensitivity when using the LIKE operator&quot; do
       @class.search_for('string ~ FOO').should have(1).item
@@ -88,58 +88,58 @@ describe ScopedSearch, :search_for do
     it &quot;should find records without case sensitivity when using the NOT LIKE operator&quot; do
       @class.search_for('string !~ FOO').should have(2).items
     end
-    
+
     it &quot;should find the record if one of the query words match using OR&quot; do
       @class.search_for('foo OR nonsense').should have(1).item
-    end  
-    
+    end
+
     it &quot;should find no records in one of the AND conditions isn't met&quot; do
       @class.search_for('foo AND nonsense').should have(0).item
-    end  
+    end
 
     it &quot;should find two records every single OR conditions matches one single record&quot; do
       @class.search_for('foo OR baz').should have(2).item
-    end  
+    end
 
     it &quot;should find two records every single AND conditions matches one single record&quot; do
       @class.search_for('foo AND baz').should have(0).item
-    end 
-  end 
-  
+    end
+  end
+
   context 'in a field with a different default operator' do
     it &quot;should find an exact match&quot; do
       @class.search_for('&quot;temp 1&quot;').should have(1).item
     end
-    
+
     it &quot;should find the orther records using NOT and an exact match&quot; do
       @class.search_for('-&quot;temp 1&quot;').should have(2).item
     end
-    
+
     it &quot;should find an explicit match&quot; do
       @class.search_for('another = &quot;temp 1&quot;').should have(1).item
     end
-    
+
     it &quot;should not find a partial match&quot; do
       @class.search_for('temp').should have(0).item
-    end    
-    
+    end
+
     it &quot;should find all records using a NOT with a partial match on all records&quot; do
       @class.search_for('-temp&quot;').should have(3).item
-    end     
+    end
 
     it &quot;should find a partial match when the like operator is given&quot; do
       @class.search_for('~ temp').should have(3).item
     end
-    
+
     it &quot;should find a partial match when the like operator and the field name is given&quot; do
       @class.search_for('another ~ temp').should have(3).item
     end
   end
-  
+
   context 'using an aliased field' do
     it &quot;should find an explicit match using its alias&quot; do
       @class.search_for('alias = &quot;temp 1&quot;').should have(1).item
-    end   
+    end
   end
 
   context 'in an explicit string field' do
@@ -159,14 +159,14 @@ describe ScopedSearch, :search_for do
     it &quot;should find all records when searching on the explicit field&quot; do
       @class.search_for('explicit ~ ba').should have(2).items
     end
-    
+
     it &quot;should only find the record with string = foo and explicit = baz&quot; do
       @class.search_for('foo, explicit = baz').should have(1).item
     end
   end
-  
+
   context 'using null? and set? queries' do
-    
+
     it &quot;should return all records if the string field is being checked with set?&quot; do
       @class.search_for('set? string').should have(3).items
     end
@@ -182,6 +182,6 @@ describe ScopedSearch, :search_for do
     it &quot;should return all records without a value if the string field is being checked with null?&quot; do
       @class.search_for('null? explicit').should have(1).items
     end
-    
+
   end
 end</diff>
      <filename>spec/integration/string_querying_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ module ScopedSearch::Spec::Database
       self.establish_named_connection(ENV['DATABASE'])
     else
       self.establish_default_connection
-    end  
+    end
   end
 
   def self.establish_named_connection(name)
@@ -23,21 +23,21 @@ module ScopedSearch::Spec::Database
   def self.close_connection
     ActiveRecord::Base.remove_connection
   end
-  
+
   def self.create_model(fields)
     table_name = &quot;model_#{rand}&quot;.gsub(/\./, '')
-    ActiveRecord::Migration.create_table(table_name) do |t| 
-      fields.each do |name, field_type| 
+    ActiveRecord::Migration.create_table(table_name) do |t|
+      fields.each do |name, field_type|
         t.send(field_type.to_s.gsub(/^unindexed_/, '').to_sym, name)
       end
     end
-    
+
     klass = Class.new(ActiveRecord::Base)
     klass.set_table_name(table_name)
     yield(klass) if block_given?
     return klass
   end
-  
+
   def self.drop_model(klass)
     ActiveRecord::Migration.drop_table(klass.table_name)
   end</diff>
      <filename>spec/lib/database.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,22 +19,22 @@ module ScopedSearch::Spec::Matchers
           (operator.nil? || operator == node.operator)
     end
   end
-  
+
   def be_leaf_node(value = nil)
     simple_matcher('node to be an logical operator') do |node|
       node.kind_of?(ScopedSearch::QueryLanguage::AST::LeafNode) &amp;&amp; (value.nil? || value == node.value)
-    end 
+    end
   end
-  
-  def tokenize_to(*tokens) 
+
+  def tokenize_to(*tokens)
     simple_matcher(&quot;to tokenize to #{tokens.inspect}&quot;) do |string|
       tokens == ScopedSearch::QueryLanguage::Compiler.tokenize(string)
     end
-  end 
+  end
 
   def parse_to(tree)
     simple_matcher(&quot;to parse to #{tree.inspect}&quot;) do |string|
-      tree == ScopedSearch::QueryLanguage::Compiler.parse(string).to_a 
-    end    
+      tree == ScopedSearch::QueryLanguage::Compiler.parse(string).to_a
+    end
   end
 end</diff>
      <filename>spec/lib/matchers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ module ScopedSearch::Spec::Mocks
     ar_mock.stub!(:connection).and_return(mock_database_connection)
     return ar_mock
   end
-  
+
   def mock_database_connection
     c_mock = mock('ActiveRecord::Base.connection')
     return c_mock</diff>
      <filename>spec/lib/mocks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -65,7 +65,7 @@ describe ScopedSearch::QueryLanguage::AST do
 
       it &quot;should create a child node for every subsequent array item&quot; do
         @ast.should have(2).children
-      end    
+      end
 
       it &quot;should create a nested OR structure for a nested array&quot; do
         @ast.lhs.should be_leaf_node('a')
@@ -134,7 +134,7 @@ describe ScopedSearch::QueryLanguage::AST::OperatorNode do
 
   context 'with 1 child' do
     before(:each) do
-      @node = tree([:not, '1']) 
+      @node = tree([:not, '1'])
     end
 
     it 'should be a prefix operator' do
@@ -156,7 +156,7 @@ describe ScopedSearch::QueryLanguage::AST::OperatorNode do
 
   context 'with 2 children' do
     before(:each) do
-      @node = tree([:eq, '1', '2']) 
+      @node = tree([:eq, '1', '2'])
     end
 
     it &quot;should be an infix operator&quot; do
@@ -164,7 +164,7 @@ describe ScopedSearch::QueryLanguage::AST::OperatorNode do
     end
 
     it &quot;should not be a prefix operator&quot; do
-      @node.should_not be_prefix      
+      @node.should_not be_prefix
     end
 
     it &quot;should return the first child as LHS&quot; do
@@ -179,7 +179,7 @@ describe ScopedSearch::QueryLanguage::AST::OperatorNode do
 
   context 'many children' do
     before(:each) do
-      @node = tree([:and, '1', '2', '3', '4']) 
+      @node = tree([:and, '1', '2', '3', '4'])
     end
 
     it &quot;should be an infix operator&quot; do</diff>
      <filename>spec/unit/ast_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ describe ScopedSearch::Definition do
   end
 
   describe '#initialize' do
-    
+
     it &quot;should create the named scope when&quot; do
       @klass.should_receive(:named_scope).with(:search_for, instance_of(Proc))
       ScopedSearch::Definition.new(@klass)</diff>
      <filename>spec/unit/definition_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,23 @@
 require &quot;#{File.dirname(__FILE__)}/../spec_helper&quot;
 
 describe ScopedSearch::QueryLanguage::Parser do
-        
+
   it &quot;should create a 1-node tree for a single keyword&quot; do
     'single'.should parse_to('single')
   end
-  
+
   it &quot;should create a two-item AND construct for two keywords&quot; do
-    'double_1 double_2'.should parse_to([:and, 'double_1', 'double_2'])    
+    'double_1 double_2'.should parse_to([:and, 'double_1', 'double_2'])
   end
-  
+
   it &quot;should create a three-item AND construct for three keywords&quot; do
     'triplet_1 triplet_2 triplet_3'.should parse_to([:and, 'triplet_1', 'triplet_2', 'triplet_3'])
   end
-  
+
   it &quot;should create a four-item AND construct by simplifying AND constructs&quot; do
     '1 (2 (3 4))'.should parse_to([:and, '1', '2', '3', '4'])
   end
-  
+
   it &quot;should create an OR construct&quot; do
     'some OR simple OR keywords'.should parse_to([:or, 'some', 'simple', 'keywords'])
   end
@@ -25,19 +25,19 @@ describe ScopedSearch::QueryLanguage::Parser do
   it &quot;should nest an OR as second argument of the AND construct&quot; do
     'some simple OR keywords'.should parse_to([:and, 'some', [:or, 'simple', 'keywords']])
   end
-  
+
   it &quot;should nest an OR as first argument of an AND construct&quot; do
     'some OR simple keywords'.should parse_to([:and, [:or, 'some', 'simple'], 'keywords'])
   end
-  
+
   it &quot;should handle parenthesis as AND block, placed in an OR block&quot; do
     'some OR (simple keywords)'.should parse_to([:or, 'some', [:and, 'simple', 'keywords']])
   end
-  
+
   it &quot;should handle parenthesis as OR block in an AND block&quot; do
     '(some OR simple) keywords'.should parse_to([:and, [:or, 'some', 'simple'], 'keywords'])
   end
-  
+
   it &quot;should create a block for the NOT keyword&quot; do
     'not easy'.should parse_to([:not, 'easy'])
   end
@@ -45,11 +45,11 @@ describe ScopedSearch::QueryLanguage::Parser do
   it &quot;should create a nsted NOT block&quot; do
     'not !easy'.should parse_to([:not, [:not, 'easy']])
   end
-  
+
   it &quot;should create a block for the NOT keyword in an AND block&quot; do
     'hard !easy'.should parse_to([:and, 'hard', [:not, 'easy']])
   end
-  
+
   it &quot;should create a block for the NOT keyword in an OR block&quot; do
     'hard || !easy'.should parse_to([:or, 'hard', [:not, 'easy']])
   end
@@ -57,11 +57,11 @@ describe ScopedSearch::QueryLanguage::Parser do
   it &quot;should create a block for the NOT keyword in an OR block&quot; do
     '!easy OR !hard'.should parse_to([:or, [:not, 'easy'], [:not, 'hard']])
   end
-  
+
   it &quot;should nest the NOT blocks correctly according to parantheses&quot; do
     '!(easy OR !hard)'.should parse_to([:not, [:or, 'easy', [:not, 'hard']]])
   end
-  
+
   it &quot;should create OR blocks in an AND block&quot; do
     '(a|b)(b|c)'.should parse_to([:and, [:or, 'a', 'b'], [:or, 'b', 'c']])
   end
@@ -69,11 +69,11 @@ describe ScopedSearch::QueryLanguage::Parser do
   it &quot;should create OR blocks in an explicit AND block&quot; do
     '(a|b)&amp;(b|c)'.should parse_to([:and, [:or, 'a', 'b'], [:or, 'b', 'c']])
   end
-  
+
   it &quot;should ignore a comma under normal circumstances&quot; do
     'a,b'.should parse_to([:and, 'a', 'b'])
   end
-  
+
   it &quot;should correctly parse an infix comparison&quot; do
     'a&gt;b'.should parse_to([:gt, 'a', 'b'])
   end
@@ -85,7 +85,7 @@ describe ScopedSearch::QueryLanguage::Parser do
   it &quot;should create a comparison in an AND block because of the comma delimiter&quot; do
     'a, &lt; b'.should parse_to([:and, 'a', [:lt, 'b']])
   end
-  
+
   it &quot;should create a infix and prefix comparison in an AND block because of parentheses&quot; do
     '(a = b) &gt;c'.should parse_to([:and, [:eq, 'a', 'b'], [:gt, 'c']])
   end
@@ -97,7 +97,7 @@ describe ScopedSearch::QueryLanguage::Parser do
   it &quot;should create a infix and prefix comparison in an AND block because of first come first serve&quot; do
     'a = b &gt; c'.should parse_to([:and, [:eq, 'a', 'b'], [:gt, 'c']])
   end
-  
+
   it &quot;should parse a null? keyword&quot; do
     'set? a b null? c'.should parse_to([:and, [:notnull, 'a'], 'b', [:null, 'c']])
   end</diff>
      <filename>spec/unit/parser_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,17 +5,17 @@ describe ScopedSearch::QueryBuilder do
   before(:each) do
     @definition = mock('ScopedSearch::Definition')
   end
-  
+
   it &quot;should return empty conditions if the search query is nil&quot; do
     ScopedSearch::QueryBuilder.build_query(@definition, nil).should == { }
   end
-  
+
   it &quot;should return empty conditions if the query is blank&quot; do
     ScopedSearch::QueryBuilder.build_query(@definition, &quot;&quot;).should == { }
   end
-  
+
   it &quot;should return empty conditions if the query is whitespace only&quot; do
     ScopedSearch::QueryBuilder.build_query(@definition, &quot;\t &quot;).should == { }
   end
-  
+
 end</diff>
      <filename>spec/unit/query_builder_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,35 @@
 require &quot;#{File.dirname(__FILE__)}/../spec_helper&quot;
 
 describe ScopedSearch::QueryLanguage::Tokenizer do
-  
+
   it &quot;should create tokens for strings&quot; do
     'some simple keywords'.should tokenize_to('some', 'simple', 'keywords')
   end
-  
+
   it &quot;should ignore excessive whitespace&quot; do
     &quot;  with\twhitespace   \n&quot;.should tokenize_to('with', 'whitespace')
   end
-  
+
   it &quot;should leave quoted strings intact&quot; do
     '&quot;quoted string&quot;'.should tokenize_to(&quot;quoted string&quot;)
   end
-  
+
   it &quot;should allow escaping quotes in quoted strings using a backslash&quot; do
     '&quot;quoted \&quot;string&quot;'.should tokenize_to('quoted &quot;string')
   end
-  
+
   it &quot;should allow escaping the escape charachter&quot; do
     '&quot;quoted \\\\string&quot;'.should tokenize_to('quoted \\string')
   end
-  
+
   it &quot;should handle unclosed quoted string gracefully&quot; do
     '&quot;quoted string'.should tokenize_to(&quot;quoted string&quot;)
   end
-  
+
   it &quot;should tokenize multiple quoted strings&quot; do
     '&quot;quoted string&quot;   &quot;another&quot;  '.should tokenize_to(&quot;quoted string&quot;, 'another')
   end
-  
+
   it &quot;should tokenize multiple quoted strings without separating whitespace&quot; do
     '&quot;quoted string&quot;&quot;another&quot;'.should tokenize_to(&quot;quoted string&quot;, 'another')
   end
@@ -45,23 +45,23 @@ describe ScopedSearch::QueryLanguage::Tokenizer do
   it &quot;should allow quotes in the middle of a normal string&quot; do
     'a&quot;b'.should tokenize_to('a&quot;b')
   end
-  
+
   it &quot;should parse keyword characters&quot; do
     'a | -(&quot;b&quot;&quot;c&quot;) &amp; d'.should tokenize_to('a', :or, :not, :lparen, 'b', 'c', :rparen, :and, 'd')
   end
-  
+
   it &quot;should tokenize null operators&quot; do
     'set? a null? b'.should tokenize_to(:notnull, 'a', :null, 'b')
-  end  
+  end
 
   it &quot;should parse double keyword characters&quot; do
     'a || b'.should tokenize_to('a', :or, 'b')
   end
-  
+
   it &quot;should parse double keyword characters with whitespace as separate tokens&quot; do
     'a | | b'.should tokenize_to('a', :or, :or, 'b')
   end
-  
+
   it &quot;should parse keyword strings&quot; do
     &quot;a and b&quot;.should tokenize_to('a', :and, 'b')
   end
@@ -89,9 +89,9 @@ describe ScopedSearch::QueryLanguage::Tokenizer do
   it &quot;should parse an equals operator within a string as separate token&quot; do
     'a=b'.should tokenize_to('a', :eq, 'b')
   end
-  
+
   it &quot;should not parse an operator within a string as separate token when quoted&quot; do
     '&quot;a=b&quot;'.should tokenize_to('a=b')
-  end  
-  
+  end
+
 end</diff>
      <filename>spec/unit/tokenizer_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,20 @@
 require 'yaml' unless Object::const_defined?('YAML')
 
 namespace :spec do
-  
-  databases = YAML.load(File.read(File.dirname(__FILE__) + '/../spec/database.yml'))  
-  
+
+  databases = YAML.load(File.read(File.dirname(__FILE__) + '/../spec/database.yml'))
+
   desc &quot;Run testsuite on all configured databases in spec/database.yml&quot;
   task(:all =&gt; databases.keys.map { |db| db.to_sym }) do
     puts &quot;\nFinished testing on all configured databases!&quot;
     puts &quot;(Configure databases by adjusting test/database.yml)&quot;
   end
-  
+
   databases.each do |database, config|
     desc &quot;Run testsuite on #{database} database.&quot;
     task database.to_sym do
       puts &quot;Running specs for #{database} database...\n\n&quot;
       sh &quot;rake spec DATABASE=#{database}&quot;
     end
-  end  
+  end
 end
\ No newline at end of file</diff>
      <filename>tasks/database_tests.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>774817347ac300e3ab2c715532ca0645ba5b8df6</id>
    </parent>
  </parents>
  <author>
    <name>Willem van Bergen</name>
    <email>willem@vanbergen.org</email>
  </author>
  <url>http://github.com/wvanbergen/scoped_search/commit/63d403df3ae3d34931f3889b4b94c50c61992584</url>
  <id>63d403df3ae3d34931f3889b4b94c50c61992584</id>
  <committed-date>2009-09-28T21:44:28-07:00</committed-date>
  <authored-date>2009-09-28T21:44:28-07:00</authored-date>
  <message>Improved RDoc documentation and fixed whitespace issues.</message>
  <tree>7e6d1d4429b1daec0af911284b26c71c52855e64</tree>
  <committer>
    <name>Willem van Bergen</name>
    <email>willem@vanbergen.org</email>
  </committer>
</commit>
