diff --git a/lib/lita/handlers/google.rb b/lib/lita/handlers/google.rb index 0c9e5f7..5ea0117 100644 --- a/lib/lita/handlers/google.rb +++ b/lib/lita/handlers/google.rb @@ -8,7 +8,7 @@ module Handlers class Google < Handler URL = "https://ajax.googleapis.com/ajax/services/search/web" - route(/^google\s+(.+)/i, :search, command: true, help: { + route(/^(?:google|g)\s+(.+)/i, :search, command: true, help: { "google QUERY" => "Return the first Google search result for QUERY." }) diff --git a/spec/lita/handlers/google_spec.rb b/spec/lita/handlers/google_spec.rb index 4331fde..72557df 100644 --- a/spec/lita/handlers/google_spec.rb +++ b/spec/lita/handlers/google_spec.rb @@ -3,6 +3,7 @@ describe Lita::Handlers::Google, lita_handler: true do it { routes_command("google ruby").to(:search) } it { routes_command("google me ruby").to(:search) } + it { routes_command("g ruby").to(:search) } describe "#search" do let(:response) do