# File lib/lookup.rb, line 100
    def search(msg, options={})
      options[:api] ||= if /^1\.9/.match(msg)
        "Ruby 1.9"
      elsif /^1\.8/.match(msg)
        "Ruby 1.8.7"
      elsif /^Rails/i.match(msg)
        "Rails"
      end
      
      msg = msg.gsub(/^(.*?)\s/, "") if options[:api]
      
      splitter = options[:splitter] || "#"
      parts = msg.split(" ")[0..-1].flatten.map { |a| a.split(splitter) }.flatten!
      # It's a constant! Oh... and there's nothing else in the string!
      first = smart_rails_constant_substitutions(parts.first)
      output = if /^[A-Z]/.match(first) && parts.size == 1
        find_constant(first)
       # It's a method!
      else
        # Right, so they only specified one argument. Therefore, we look everywhere.
        if parts.size == 1
          o = find_method(parts.last)
        # Left, so they specified two arguments. First is probably a constant, so let's find that!
        else
          o = find_method(parts.last, first)
        end
        o
      end

      output = search(msg, options.merge(:splitter => ".")) if output.empty? && splitter != "."
      
      options[:api] ||= ["Ruby 1.8.7", "Rails"]
      selected_output = output.select { |m| options[:api].include?(m.api.name) }
      selected_output = output if selected_output.empty?

      return selected_output
    end