lita-inspirebot 0.0.2 → 0.0.3

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: 6123ff8010d3b9fa59a1c033d0656ef3f5d5bd6b
4
- data.tar.gz: 56f1506f7fa6a926142f464e9e053ac734bb474c
3
+ metadata.gz: ad9b640e1260d27e29393b8a7260e91f4af8d380
4
+ data.tar.gz: 1d551c375e7f2b4f42917b42eb577d23decdebef
5
5
  SHA512:
6
- metadata.gz: 5bed85cb605aa8eb08f54a36e565ffa2701b44aa5cdddbbdb5e2a4dd722f12dc6cb0ae5210e1120bef26acd01ae73d93cc9ac23ab146b1dd06ecdc77c14a9f11
7
- data.tar.gz: f96eda9f858b68a9e1ce86a3978e2db7b944d1367868e1de7c770d4876d26c829d7b8e93b6f6cf8817149153d01e055c7ec903c3b92481c1e006ba4ec1964ade
6
+ metadata.gz: f961f0d0c4f50a8f0c1fe04883ae66e9fe64ad4c9dbb76720eae9222a85f2c147fe21cb65af3372dab2c8b87531bade041e8745f655cc281d5094c5eac4a4765
7
+ data.tar.gz: b1c7e9f3d2dc6079761e574fcd5cd8d3831b4663c3fb3bc8bddb3c895ecb3400bfd78ef80798586fa436f3b38570eed7b176d4bce2c5c73f0c221cf84dfd7418
data/README.md CHANGED
@@ -24,10 +24,18 @@ gem "lita-inspirebot"
24
24
  ## Usage
25
25
 
26
26
  ```
27
+ You > quote authors
28
+ Lita > I know about the following authors: branson, jobs, tesla. To hear quotes, type QUOTE {AUTHOR}
27
29
  You > quote jobs!
28
30
  Lita > My favorite things in life don't cost any money. It's really clear that the most precious resource we all have is time.
29
31
  ```
30
32
 
33
+ ## Notes
34
+
35
+ ### RingCentral SMSbot Developer Accounts
36
+
37
+ In addition to standard routes, this handler also supports routes for building [SMSbots using RingCentral](https://github.com/grokify/lita-ringcentral)'s [developer sandbox accounts](https://developers.ringcentral.com).
38
+
31
39
  ## License
32
40
 
33
41
  Inspirebot for Lita is available under an MIT-style license. See [LICENSE.txt](LICENSE.txt) for details.
@@ -72,7 +72,7 @@ module Inspirebot
72
72
  quote += ' - ' + display if @add_attribution
73
73
  else
74
74
  authors = authors_string
75
- quote = "I'm sorry, I could not found quotes for #{name}. I know about the following authors #{authors}"
75
+ quote = "I'm sorry, I could not found quotes for #{name}. To get a list of authors, type QUOTE AUTHORS"
76
76
  end
77
77
  return quote
78
78
  end
@@ -86,26 +86,29 @@ end
86
86
  module Lita
87
87
  module Handlers
88
88
  class Inspirebot < Handler
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.' })
89
+ route(/^(?:Test SMS usng a RingCentral Developer account - )?inspire me!?\s*$/i, :quote, command: false, help: { 'inspire me!' => 'Returns a random quote' })
90
+ route(/^(?:Test SMS usng a RingCentral Developer account - )?authors\s*$/i, :authors, command: false, help: { 'quote authors' => 'Returns a list of known authors.' })
91
+ route(/^(?:Test SMS usng a RingCentral Developer account - )?quote\s+([A-Za-z0-9]+)!?\s*/i, :quote, command: false, help: { 'quote <AUTHOR>' => 'Replies with random AUTHOR quote.' })
92
92
 
93
93
  def authors(response)
94
94
  @quotes = ::Inspirebot::Quotes.new
95
- authors = @quotes.authors_string
95
+ authors = @quotes.authors_string.upcase
96
96
  response.reply "I know about the following authors: #{authors}. To hear quotes, type QUOTE {AUTHOR}"
97
97
  end
98
98
 
99
99
  def quote(response)
100
100
  @quotes = ::Inspirebot::Quotes.new
101
101
  author = response.match_data[1].downcase
102
- unless author == 'authors'
102
+ if author.downcase == 'authors'
103
+ authors = @quotes.authors_string.upcase
104
+ response.reply "I know about the following authors: #{authors}. To hear quotes, type QUOTE {AUTHOR}"
105
+ else
103
106
  response.reply @quotes.get_quote(author)
104
107
  end
105
108
  end
106
109
 
107
110
  def menu(response)
108
- help = 'use AUTHORS to get a list of authors. use QUOTE {AUTHOR} to get a random quote from the author'
111
+ help = 'use QUOTE AUTHORS to get a list of authors. use QUOTE {AUTHOR} to get a random quote from the author'
109
112
  response.reply @quotes.get_quote(help)
110
113
  end
111
114
  end
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.2
4
+ version: 0.0.3
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-04 00:00:00.000000000 Z
11
+ date: 2016-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita