Skip to content

Commit

Permalink
Merge pull request #2 from tristaneuan/master
Browse files Browse the repository at this point in the history
Add "g" as a synonym for "google" to invoke search
  • Loading branch information
jimmycuadra committed May 4, 2014
2 parents d661e33 + 1756f66 commit 3653062
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lita/handlers/google.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
})

Expand Down
1 change: 1 addition & 0 deletions spec/lita/handlers/google_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3653062

Please sign in to comment.