lita-onewheel-google 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 811ba4a8a5471b06a191a1bb71080f7dd5c4433f
|
4
|
+
data.tar.gz: 6e2f50902775ceef57a0ba09673afedc774849fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23687fb049ceca2fa6cccbd200158abe475bb4081ca262b5de33fe541b4c7d7a3293d5b1b4903f93b40e87c529a4c1f0e68223896501499732e47e1a75a1acac
|
7
|
+
data.tar.gz: 3244b7e18f1174481cf65f2424292977a5bdbe67966091dba9b706e1b0195d1fc6557366eec24c65be573fc466c2353e94c3a6566008d24561c181c6c674d141
|
@@ -14,8 +14,7 @@ module Lita
|
|
14
14
|
|
15
15
|
def search(response)
|
16
16
|
query = response.matches[0][0]
|
17
|
-
|
18
|
-
result = JSON.parse(search_result)
|
17
|
+
result = ::OnewheelGoogle::search(query, config.custom_search_engine_id, config.google_api_key, config.safe_search)
|
19
18
|
response.reply "#{result['items'][0]['link']} #{result['items'][0]['title']}: #{result['items'][0]['snippet']}"
|
20
19
|
end
|
21
20
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-google'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.4'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = 'An implementation of Google Custom Search Engine for searching in chat.'
|
@@ -5,7 +5,7 @@ describe Lita::Handlers::OnewheelGoogle, lita_handler: true do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
mock_result_json = File.open('spec/fixtures/mock_result.json').read
|
8
|
-
allow(OnewheelGoogle).to receive(:search).and_return(mock_result_json)
|
8
|
+
allow(OnewheelGoogle).to receive(:search).and_return(JSON.parse mock_result_json)
|
9
9
|
|
10
10
|
registry.configure do |config|
|
11
11
|
config.handlers.onewheel_google.custom_search_engine_id = ''
|