ellen-google_image 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/ellen-google_image.gemspec +1 -1
- data/lib/ellen/google_image/version.rb +1 -1
- data/lib/ellen/handlers/google_image.rb +16 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0569d08da2060c76111e064ffea6012068af4f3a
|
4
|
+
data.tar.gz: d43f47877a9e6723f24365a47b4cd2680625fd7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cf883f780fac390e098cdcbc1da32d4150b59685e60f0569780aef1a33b6c55c713abb6190c293f876978aa668ada5a1049fde724a47b3db607384fccb5b20f
|
7
|
+
data.tar.gz: 69a99d371744803305d43512862bd63af74d334aae67a597cc95fde708a28d01f99411d3a5f18d4e57dbd9f00b89b581be38b01631ce783fd41a107142d366e0
|
data/CHANGELOG.md
CHANGED
data/ellen-google_image.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "ellen", ">= 0.0.
|
19
|
+
spec.add_dependency "ellen", ">= 0.0.8"
|
20
20
|
spec.add_dependency "faraday"
|
21
21
|
spec.add_dependency "faraday_middleware"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.6"
|
@@ -1,17 +1,27 @@
|
|
1
1
|
module Ellen
|
2
2
|
module Handlers
|
3
3
|
class GoogleImage < Base
|
4
|
-
on /image (.+)/, description: "Search image from Google"
|
5
|
-
|
6
|
-
|
4
|
+
on /image (.+)/, name: "image", description: "Search image from Google"
|
5
|
+
|
6
|
+
on /animate (.+)/, name: "animate", description: "Search animation from Google"
|
7
|
+
|
8
|
+
def image(message)
|
9
|
+
if url = search(message[1])
|
10
|
+
robot.say url
|
7
11
|
end
|
8
12
|
end
|
9
13
|
|
10
|
-
|
11
|
-
if url =
|
12
|
-
say url
|
14
|
+
def animate(message)
|
15
|
+
if url = search(message[1], animated: true)
|
16
|
+
robot.say url
|
13
17
|
end
|
14
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def search(query, options = {})
|
23
|
+
Ellen::GoogleImage::Client.new(options.merge(query: query)).get
|
24
|
+
end
|
15
25
|
end
|
16
26
|
end
|
17
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ellen-google_image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ellen
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|