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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36e143d16109ffb56627d2f6c2c1bcba2354feec
4
- data.tar.gz: e9e26c77a713553a236e01677d3907ec3f906985
3
+ metadata.gz: 1682eee8003d5fc1393f736edcbd864b73b059f0
4
+ data.tar.gz: 0e75ca95a53253266776d689bdb69215bda7ab22
5
5
  SHA512:
6
- metadata.gz: 2d3693a1e607a8a73f793781b8c01512606f43d194f3d4b207a3f2178d222df26fb4744c11c55bc87f4d4483fa7610a1ec9ce5fb901284fd453b20058ebead12
7
- data.tar.gz: 2b3d34ec82eecb2df30f040b9ef137b376f43074b4479fba797eb9beafe73729ba2750a5f4ab6c111403afd671c796db9e2b5ee1f345afc8b225ac872a7d869b
6
+ metadata.gz: 53a874d3190ce93eee90256b0da8ac1c1d7c1fc4880302c99da5d9e9d3a27d11a1a6ca0fbcb9befa41c1a2f4f5c1645804b798d6c98f951610c1f0a311cc536a
7
+ data.tar.gz: 43d1453e7178721180dbb91f72bdb9d2a2f70c31bdb01f01836ffee21bb1af70951e59fab6c2b89cb6b79aea19b2f770215b4a188a4a7514ecae5335f4a3aaf6
data/README.md CHANGED
@@ -1,16 +1,19 @@
1
1
  # lita-excuses
2
2
 
3
- This Lita plugin provides a random excuse from [developerexcuses.com](http://developerexcuses.com/).
3
+ [![Build Status](https://travis-ci.org/webdestroya/lita-excuses.png)](https://travis-ci.org/webdestroya/lita-excuses)
4
+ [![Code Climate](https://codeclimate.com/github/webdestroya/lita-excuses.png)](https://codeclimate.com/github/webdestroya/lita-excuses)
5
+ [![Coverage Status](https://coveralls.io/repos/webdestroya/lita-excuses/badge.png)](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
- doc = Nokogiri::HTML(open("http://programmingexcuses.com/"))
16
+
17
+ resp = http.get('http://programmingexcuses.com/')
18
+
19
+ doc = Nokogiri::HTML(resp.body)
20
+
18
21
  "\"#{doc.css('a').text}\""
19
- rescue Exception => e
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-excuses"
3
- spec.version = "0.0.1"
3
+ spec.version = "0.0.3"
4
4
  spec.authors = ["Mitch Dempsey"]
5
5
  spec.email = ["mrdempsey@gmail.com"]
6
6
  spec.description = %q{Adds a Lita handler to provide developer excuses}
@@ -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
- it { routes("!excuse").to(:excuse) }
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.1
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-23 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita