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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fd9df671871f783955d7a569d6da64725e04fe8
4
- data.tar.gz: 55d0f84b60261365a747699954f84eaa769512c0
3
+ metadata.gz: 143f68c5a6c15ed234298f76a13640cebbcca6c2
4
+ data.tar.gz: 27c95fed1de6be7bbd4db8de56d9cf00e4a20b63
5
5
  SHA512:
6
- metadata.gz: 20b478c185291d6e3c457667c96c5f9fbc1448529ef9dbf4ecf5969b3e477db11658e57b8d6e632e33f9a61c230815edb9e1acd03e279aeb625053a3e3598087
7
- data.tar.gz: 342d1fc6283039b6dc8d0a4172a9f0042c71419303a66cbcdc39a8460f06675f1a174c3cab3ec29a7b59033945041fb072f87aba309820d458f5d31e89d14603
6
+ metadata.gz: 0156046e0de44290e24befc06bfb88ac19400aa2578e1172cecf6742009ae89e0d2dcc99c3daf53f0ac0fe96cf55c453440e60d9b60469a62dc3bbfa53675c8f
7
+ data.tar.gz: 76371f76f359dfe73b213d979e4c8dd1b5fbcd5926f57efd66b649a90930b9467e68f4cba02f0e73d224392a22918a262716f5580cb0162c403e53d99654d23f
@@ -4,3 +4,9 @@ rvm:
4
4
  script: bundle exec rspec
5
5
  before_install:
6
6
  - gem update --system
7
+ services:
8
+ - redis-server
9
+ notifications:
10
+ webhooks:
11
+ urls:
12
+ - https://lita-freenode.herokuapp.com/travis
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
- requested_word = response.matches[0][0]
18
- word, definition, example = fetch_definition(requested_word)
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 #{requested_word}.")
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(requested_word)
30
+ def fetch_definition(term)
31
31
  http_response = http.get(
32
32
  "http://api.urbandictionary.com/v0/define",
33
- term: URI.escape(requested_word)
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.1"
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.1
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-07-30 00:00:00.000000000 Z
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.0.3
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: