lita-inspirebot 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/LICENSE.txt +22 -0
- data/README.md +33 -3
- data/lib/lita/handlers/inspirebot.rb +7 -6
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6123ff8010d3b9fa59a1c033d0656ef3f5d5bd6b
|
4
|
+
data.tar.gz: 56f1506f7fa6a926142f464e9e053ac734bb474c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bed85cb605aa8eb08f54a36e565ffa2701b44aa5cdddbbdb5e2a4dd722f12dc6cb0ae5210e1120bef26acd01ae73d93cc9ac23ab146b1dd06ecdc77c14a9f11
|
7
|
+
data.tar.gz: f96eda9f858b68a9e1ce86a3978e2db7b944d1367868e1de7c770d4876d26c829d7b8e93b6f6cf8817149153d01e055c7ec903c3b92481c1e006ba4ec1964ade
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 John Wang
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
|
-
|
1
|
+
Lita Inspirebot Handler
|
2
|
+
=======================
|
2
3
|
|
3
|
-
|
4
|
+
[![Gem Version][gem-version-svg]][gem-version-link]
|
5
|
+
[![Build Status][build-status-svg]][build-status-link]
|
6
|
+
[![Coverage Status][coverage-status-svg]][coverage-status-link]
|
7
|
+
[![Dependency Status][dependency-status-svg]][dependency-status-link]
|
8
|
+
[![Code Climate][codeclimate-status-svg]][codeclimate-status-link]
|
9
|
+
[![Scrutinizer Code Quality][scrutinizer-status-svg]][scrutinizer-status-link]
|
10
|
+
[![Downloads][downloads-svg]][downloads-link]
|
11
|
+
[![Docs][docs-rubydoc-svg]][docs-rubydoc-link]
|
12
|
+
[![License][license-svg]][license-link]
|
13
|
+
|
14
|
+
`lita-inspirebot` is a handler for Lita that replies with a set of inspirational quotes.
|
4
15
|
|
5
16
|
## Installation
|
6
17
|
|
@@ -21,4 +32,23 @@ Lita > My favorite things in life don't cost any money. It's really clear that t
|
|
21
32
|
|
22
33
|
Inspirebot for Lita is available under an MIT-style license. See [LICENSE.txt](LICENSE.txt) for details.
|
23
34
|
|
24
|
-
Inspirebot for Lita © 2016 by [John Wang](https://github.com/grokify)
|
35
|
+
Inspirebot for Lita © 2016 by [John Wang](https://github.com/grokify)
|
36
|
+
|
37
|
+
[gem-version-svg]: https://badge.fury.io/rb/lita-inspirebot.svg
|
38
|
+
[gem-version-link]: http://badge.fury.io/rb/lita-inspirebot
|
39
|
+
[downloads-svg]: http://ruby-gem-downloads-badge.herokuapp.com/lita-inspirebot
|
40
|
+
[downloads-link]: https://rubygems.org/gems/lita-inspirebot
|
41
|
+
[build-status-svg]: https://api.travis-ci.org/grokify/lita-inspirebot.svg?branch=master
|
42
|
+
[build-status-link]: https://travis-ci.org/grokify/lita-inspirebot
|
43
|
+
[coverage-status-svg]: https://coveralls.io/repos/grokify/lita-inspirebot/badge.svg?branch=master
|
44
|
+
[coverage-status-link]: https://coveralls.io/r/grokify/lita-inspirebot?branch=master
|
45
|
+
[dependency-status-svg]: https://gemnasium.com/grokify/lita-inspirebot.svg
|
46
|
+
[dependency-status-link]: https://gemnasium.com/grokify/lita-inspirebot
|
47
|
+
[codeclimate-status-svg]: https://codeclimate.com/github/grokify/lita-inspirebot/badges/gpa.svg
|
48
|
+
[codeclimate-status-link]: https://codeclimate.com/github/grokify/lita-inspirebot
|
49
|
+
[scrutinizer-status-svg]: https://scrutinizer-ci.com/g/grokify/lita-inspirebot/badges/quality-score.png?b=master
|
50
|
+
[scrutinizer-status-link]: https://scrutinizer-ci.com/g/grokify/lita-inspirebot/?branch=master
|
51
|
+
[docs-rubydoc-svg]: https://img.shields.io/badge/docs-rubydoc-blue.svg
|
52
|
+
[docs-rubydoc-link]: http://www.rubydoc.info/gems/lita-inspirebot/
|
53
|
+
[license-svg]: https://img.shields.io/badge/license-MIT-blue.svg
|
54
|
+
[license-link]: https://github.com/grokify/lita-inspirebot/blob/master/LICENSE.txt
|
@@ -86,11 +86,9 @@ end
|
|
86
86
|
module Lita
|
87
87
|
module Handlers
|
88
88
|
class Inspirebot < Handler
|
89
|
-
|
90
|
-
route(/^authors\s*$/i, :authors, command:
|
91
|
-
route(/^
|
92
|
-
route(/^quote\s+([A-Za-z]+)!?\s*/i, :quote, command: is_command, help: { "echo TEXT" => "Replies back with TEXT." })
|
93
|
-
route(/^help\s*$/i, :menu, command: is_command, help: { "echo TEXT" => "Replies back with TEXT." })
|
89
|
+
route(/^inspire me!?\s*$/i, :quote, command: false, help: { 'inspire me!' => 'Returns a random quote' })
|
90
|
+
route(/^quote authors\s*$/i, :authors, command: false, help: { 'quote authors' => 'Returns a list of known authors.' })
|
91
|
+
route(/^quote\s+([A-Za-z0-9]+)!?\s*/i, :quote, command: false, help: { 'quote <AUTHOR>' => 'Replies with random AUTHOR quote.' })
|
94
92
|
|
95
93
|
def authors(response)
|
96
94
|
@quotes = ::Inspirebot::Quotes.new
|
@@ -100,7 +98,10 @@ module Lita
|
|
100
98
|
|
101
99
|
def quote(response)
|
102
100
|
@quotes = ::Inspirebot::Quotes.new
|
103
|
-
|
101
|
+
author = response.match_data[1].downcase
|
102
|
+
unless author == 'authors'
|
103
|
+
response.reply @quotes.get_quote(author)
|
104
|
+
end
|
104
105
|
end
|
105
106
|
|
106
107
|
def menu(response)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-inspirebot
|
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
|
- John Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -130,6 +130,7 @@ extensions: []
|
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
132
|
- Gemfile
|
133
|
+
- LICENSE.txt
|
133
134
|
- README.md
|
134
135
|
- Rakefile
|
135
136
|
- lib/lita-inspirebot.rb
|