lita-excuses 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/lib/lita/handlers/excuses.rb +7 -5
- data/lita-excuses.gemspec +1 -1
- data/spec/lita/handlers/excuses_spec.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1682eee8003d5fc1393f736edcbd864b73b059f0
|
4
|
+
data.tar.gz: 0e75ca95a53253266776d689bdb69215bda7ab22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a874d3190ce93eee90256b0da8ac1c1d7c1fc4880302c99da5d9e9d3a27d11a1a6ca0fbcb9befa41c1a2f4f5c1645804b798d6c98f951610c1f0a311cc536a
|
7
|
+
data.tar.gz: 43d1453e7178721180dbb91f72bdb9d2a2f70c31bdb01f01836ffee21bb1af70951e59fab6c2b89cb6b79aea19b2f770215b4a188a4a7514ecae5335f4a3aaf6
|
data/README.md
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
# lita-excuses
|
2
2
|
|
3
|
-
|
3
|
+
[](https://travis-ci.org/webdestroya/lita-excuses)
|
4
|
+
[](https://codeclimate.com/github/webdestroya/lita-excuses)
|
5
|
+
[](https://coveralls.io/r/webdestroya/lita-excuses)
|
6
|
+
|
7
|
+
**lita-excuses** is a handler for [Lita](https://github.com/jimmycuadra/lita) that provides a random excuse from [developerexcuses.com](http://developerexcuses.com/).
|
4
8
|
|
5
|
-
## Installation
|
6
9
|
|
10
|
+
## Installation
|
7
11
|
|
8
12
|
gem "lita-excuses"
|
9
13
|
|
10
14
|
## Usage
|
11
15
|
|
12
16
|
* `Lita: excuse`
|
13
|
-
* `!excuse`
|
14
17
|
|
15
18
|
## License
|
16
19
|
|
@@ -4,8 +4,7 @@ require "nokogiri"
|
|
4
4
|
module Lita
|
5
5
|
module Handlers
|
6
6
|
class Excuses < Handler
|
7
|
-
route %r{excuse}i, :excuse, command: true, help: { "excuse" => "Responds with a random excuse." }
|
8
|
-
route %r{!excuse}i, :excuse, command: false
|
7
|
+
route %r{^excuse$}i, :excuse, command: true, help: { "excuse" => "Responds with a random excuse." }
|
9
8
|
|
10
9
|
def excuse(response)
|
11
10
|
response.reply retrieve_excuse
|
@@ -14,10 +13,13 @@ module Lita
|
|
14
13
|
private
|
15
14
|
|
16
15
|
def retrieve_excuse
|
17
|
-
|
16
|
+
|
17
|
+
resp = http.get('http://programmingexcuses.com/')
|
18
|
+
|
19
|
+
doc = Nokogiri::HTML(resp.body)
|
20
|
+
|
18
21
|
"\"#{doc.css('a').text}\""
|
19
|
-
rescue
|
20
|
-
puts e.inspect
|
22
|
+
rescue
|
21
23
|
"Sorry, I was unable to come up with a good excuse for you."
|
22
24
|
end
|
23
25
|
|
data/lita-excuses.gemspec
CHANGED
@@ -2,5 +2,9 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Lita::Handlers::Excuses, lita_handler: true do
|
4
4
|
it { routes_command("excuse").to(:excuse) }
|
5
|
-
|
5
|
+
|
6
|
+
it "tests an excuse" do
|
7
|
+
send_command("excuse")
|
8
|
+
expect(replies.last).to_not eq("Sorry, I was unable to come up with a good excuse for you.")
|
9
|
+
end
|
6
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-excuses
|
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
|
- Mitch Dempsey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|