lita-urban-dictionary 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/README.md +1 -1
- data/lib/lita/handlers/urban_dictionary.rb +5 -5
- data/lita-urban-dictionary.gemspec +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 143f68c5a6c15ed234298f76a13640cebbcca6c2
|
4
|
+
data.tar.gz: 27c95fed1de6be7bbd4db8de56d9cf00e4a20b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0156046e0de44290e24befc06bfb88ac19400aa2578e1172cecf6742009ae89e0d2dcc99c3daf53f0ac0fe96cf55c453440e60d9b60469a62dc3bbfa53675c8f
|
7
|
+
data.tar.gz: 76371f76f359dfe73b213d979e4c8dd1b5fbcd5926f57efd66b649a90930b9467e68f4cba02f0e73d224392a22918a262716f5580cb0162c403e53d99654d23f
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# lita-urban-dictionary
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/jimmycuadra/lita-urban-dictionary.png)](https://travis-ci.org/jimmycuadra/lita-urban-dictionary)
|
3
|
+
[![Build Status](https://travis-ci.org/jimmycuadra/lita-urban-dictionary.png?branch=master)](https://travis-ci.org/jimmycuadra/lita-urban-dictionary)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/jimmycuadra/lita-urban-dictionary.png)](https://codeclimate.com/github/jimmycuadra/lita-urban-dictionary)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/jimmycuadra/lita-urban-dictionary/badge.png)](https://coveralls.io/r/jimmycuadra/lita-urban-dictionary)
|
6
6
|
|
@@ -14,23 +14,23 @@ module Lita
|
|
14
14
|
)
|
15
15
|
|
16
16
|
def define(response)
|
17
|
-
|
18
|
-
word, definition, example = fetch_definition(
|
17
|
+
term = response.matches[0][0]
|
18
|
+
word, definition, example = fetch_definition(term)
|
19
19
|
if word
|
20
20
|
message = "#{word}: #{definition}"
|
21
21
|
message << "\nExample: #{example}" if example
|
22
22
|
response.reply(message)
|
23
23
|
else
|
24
|
-
response.reply("No definition found for #{
|
24
|
+
response.reply("No definition found for #{term}.")
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
def fetch_definition(
|
30
|
+
def fetch_definition(term)
|
31
31
|
http_response = http.get(
|
32
32
|
"http://api.urbandictionary.com/v0/define",
|
33
|
-
term:
|
33
|
+
term: term
|
34
34
|
)
|
35
35
|
|
36
36
|
if http_response.status == 200
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-urban-dictionary"
|
3
|
-
spec.version = "0.0.
|
3
|
+
spec.version = "0.0.2"
|
4
4
|
spec.authors = ["Jimmy Cuadra"]
|
5
5
|
spec.email = ["jimmy@jimmycuadra.com"]
|
6
6
|
spec.description = %q{A Lita handler for fetching definitions from Urban Dictionary.}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-urban-dictionary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Cuadra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -132,11 +132,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.1.11
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: A Lita handler for fetching definitions from Urban Dictionary.
|
139
139
|
test_files:
|
140
140
|
- spec/lita/handlers/urban_dictionary_spec.rb
|
141
141
|
- spec/spec_helper.rb
|
142
|
-
has_rdoc:
|