Permalink
Browse files

Added support for Sphinx Ruby client that comes bundled with Sphinx i…

…tself
  • Loading branch information...
1 parent beebdca commit e46d5de7c725f4f8ef28501356fbfdf80a3021c6 @olegshaldybin olegshaldybin committed with lukemelia Jun 23, 2010
Showing with 13 additions and 1 deletion.
  1. +12 −0 lib/rack/bug/panels/sphinx_panel/sphinx_extension.rb
  2. +1 −1 lib/rack/bug/panels/sphinx_panel/stats.rb
@@ -11,3 +11,15 @@ def request_with_rack_bug(command, messages)
alias_method_chain :request, :rack_bug
end
end
+
+if defined?(Sphinx::Client)
+ Sphinx::Client.class_eval do
+ def PerformRequest_with_rack_bug(command, request, additional = nil)
+ Rack::Bug::SphinxPanel.record(command, request) do
+ PerformRequest_without_rack_bug(command, request, additional)
+ end
+ end
+
+ alias_method_chain :PerformRequest, :rack_bug
+ end
+end
@@ -12,7 +12,7 @@ def initialize(time, *command_args)
if command_args.flatten.first == :search
@command = "search: " + decode_message(command_args.first.flatten.last).collect{|k,v| "#{k} => #{v}"}.join(", ")
else
- @command = command_args.flatten.first.to_s + ": No more info is available for this Riddle request type"
+ @command = command_args.flatten.first.to_s + ": No more info is available for this Sphinx request type"
end
end

0 comments on commit e46d5de

Please sign in to comment.