botbase-module-demo 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9af62da75989c81acf7b2773e42240e8265e3a41
4
+ data.tar.gz: f5be7646ba6e5dfd16b3ac53a701d8c1507fdfd8
5
+ SHA512:
6
+ metadata.gz: 49a3544efacbda6f0bff858420459c419d65ac89447f6656090cf94bf3d90c2b7e5ed3673dcd9ed7f3c824f256871056137f2c71db44325967ec0d513ccec131
7
+ data.tar.gz: 9079bc162139d75c2c45ad9ec114b065555ef7ead42a631370438e11678bac0929c6636f1617f3c53b91803ddd14e40e50bde80d0d08b095d75889a806b2ad51
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ ;���µт�/���hϯL�f
2
+ 3N�p7�7��/v� �iG����gs�]c��/��kKY� E���%��s~�b��C۩�9����ڕ-�O��dZ,- 3��� c�e��M �W�k��H�(~��J�&d�+�>�n�2O�����Z,�pԫ4��hj5��N&U]q:j#5��8'��Xڠd�^(�)�=W�9]���7e����8f��rX'������^�/θ~%+aFG�n��Gf# )zU���7z�ӹ�
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: botbase-module-demo.rb
4
+
5
+ # A service module used by the BotBase gem
6
+
7
+ class BotBaseModuleDemo
8
+
9
+ def initialize(x=nil)
10
+
11
+ @phrases = {}
12
+ service_modules = nil
13
+
14
+ a = if service_modules then
15
+
16
+ service_modules
17
+
18
+ else
19
+
20
+ @h = {
21
+ "^What's the time?" => "'The time is ' + Time.now.strftime(\"%-I:%M%p\")",
22
+ "hello?" => %q("hello #{sender}, how can I help you?" % sender),
23
+ 'unknown' => "\"I'm sorry, I don't understand what you said.\""
24
+ }
25
+ [@h]
26
+
27
+ end
28
+
29
+ a.each {|x| @phrases.merge! x }
30
+
31
+ end
32
+
33
+ def query(sender='user01', msg)
34
+ r = @phrases.detect {|k,v| msg =~ /#{k}/i }
35
+
36
+ raw_msg = if r then
37
+ r.last
38
+ else
39
+ @h['unknown']
40
+ end
41
+
42
+ response = eval raw_msg
43
+ end
44
+
45
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: botbase-module-demo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE2MDcyNzE4NDEyN1oXDTE3MDcyNzE4NDEyN1owSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBALQJEthjeyo/iRt2YzgetEb+S2L2r6NDqKjvSKK9kvn15yqsl7KaL1DSFMYe
19
+ 9qL/TbNtbG4omC6ukxIcHnlFsQLChvIWWwKbZteCmRXKC3xMd+dXeIZu1oalXz1A
20
+ K2KQMoG3tYJBHNCNf7aZJStywj5MJbqE/ltjFJJ/WowZpb5qHSvV9BTp1eXvqJPK
21
+ v9u9x91mJsqpYLwAwQ12uUZxLA99OUgvrhNS5tBQI9dk2feUI/opmTcjo9AQbM1p
22
+ dKHylPkJdQdNI5IO6HR3epdV0yaPkTy0GIoi+5BgnIrRCmvo743UI3LuWXD8OQjo
23
+ m/DsFGkhOGPoHu1dkB5YJeknRSkCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUciAuhL6yd1l1zrE1XN2+ytvG+gwwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAlIhq9hST
27
+ SqrdMyhHwvsnNxSCPWi5Q//cYjPjgFHdKAkvEkObs5M2gi0aHp/RU1//cHFG19QM
28
+ vjLreY0vR8Q3OnbSkPQgTUxAuw5v+m4jy//No6hc2pihfYPJGWHFBcqP0hYPuvXp
29
+ DSw/7Ozdk5usCRL575zaJgjF2pceeomubvrP+jN+1hKXCegvsMTf+6T0P/0ZjWTC
30
+ PDZyUujSJmFJtbQ8YkIISWHJ7udyB/oUJZw6zgqxW4wM9xB3yiRQHS0FSB+N7ZfQ
31
+ 6bDTpY2VSTMD1tFYNtLNdpwCsOBVFkvtVBPx8hAoH7fM9NozyeURv9lBz1bvCLfu
32
+ wVqhzKKHV6a9Kg==
33
+ -----END CERTIFICATE-----
34
+ date: 2016-07-27 00:00:00.000000000 Z
35
+ dependencies: []
36
+ description:
37
+ email: james@r0bertson.co.uk
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - lib/botbase-module-demo.rb
43
+ homepage: https://github.com/jrobertson/botbase-module-demo
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.5.1
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: An experimental service module used by the botbase gem.
67
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1 @@
1
+ B"sc�� "�_*��/F� �=