botbase-module-phrases 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7642f5f4d370ab578cfda959fd07b3d073062620
4
+ data.tar.gz: c03c37caa26e7eea2c5e89b45ddd72c4512e8e86
5
+ SHA512:
6
+ metadata.gz: e7153d9c62c0707b82122380c832810162022c823f264191f6765d7584faf1a27cbb6addb8c967f1da93faef89e4a694527639a990331034c75e39a305ddd3cf
7
+ data.tar.gz: cacb7796659ac8f3e8519dd7cd873bd80505f672d46ed7d9942bd4d04dc1d7b68a3b8fcb747502cbccd48166e38bdfbefbbd772802330fbb5e940608c435e819
@@ -0,0 +1,2 @@
1
+ :���i }I
2
+ �G�깯`�'��V�0}<s��L���;˾t���� e�~�^�4��X�T�P*�7�Xc]O\�8�Ȅ�.4��-�|�y1"�̿?��ߐ_ jhI���Ih�ݙ�wz����1�"�h���1@� ~�>G1 "��G:�I��T��Q�"��~�y, k=y8��P�{�7}|� +�Ȗ�/�gt��Zl��v��!8��1w8��;�,i)�^J����C�o��������JP�5����%R?
Binary file
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: botbase-module-phrases.rb
4
+
5
+ # A service module used by the BotBase gem
6
+
7
+
8
+ require 'rsc'
9
+ require 'polyrex'
10
+ require 'sps-pub'
11
+ require 'spstrigger_execute'
12
+
13
+
14
+ class BotBaseModulePhrases
15
+
16
+ def initialize(host: nil, package_src: nil, reg: nil, keywords: '',
17
+ px_url: nil, sps_host: 'sps', sps_port: '59000', logfile: nil)
18
+
19
+ @rsc = RSC.new host, package_src
20
+
21
+ #px = Polyrex.new px_url
22
+
23
+ @ste = SPSTriggerExecute.new keywords, reg=nil, px=nil, logfile: logfile
24
+ @keywords = keywords
25
+ @sps = SPSPub.new host: sps_host, port: sps_port
26
+
27
+ end
28
+
29
+ def query(sender='user01', said)
30
+
31
+ #puts 'said: ' + said.inspect
32
+
33
+ a = @ste.mae message: said
34
+
35
+ if a.length > 0 then
36
+
37
+ h = {
38
+
39
+ rse: ->(x, rsc){
40
+
41
+ job = x.shift[/\/\/job:(.*)/,1]
42
+ package_path = x.shift
43
+ package = package_path[/([^\/]+)\.rsf$/,1]
44
+
45
+ rsc.run_job package, job, {}, args=x, package_path: package_path
46
+ },
47
+ sps: ->(x, rsc){ @sps.notice x },
48
+ ste: ->(x, rsc){ @ste.run x }
49
+ }
50
+
51
+ end
52
+
53
+ a.each do |type, x|
54
+
55
+ Thread.new do
56
+
57
+ begin
58
+ h[type].call x, @rsc
59
+ rescue
60
+ warning = 'botbase-module-phrases warning: ' + ($!).inspect
61
+ puts warning
62
+ end
63
+
64
+ end # /thread
65
+
66
+ end # /each
67
+
68
+ end
69
+
70
+ end
metadata ADDED
@@ -0,0 +1,148 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: botbase-module-phrases
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
+ 8ixkARkWAmV1MB4XDTE3MDQyNDIxMDEzOVoXDTE4MDQyNDIxMDEzOVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAL4jstPeY6aWcMnd3LTqAR76LnAfyZt9eiPLCdSk1aDyTFWftNoDdTlVmGiT
19
+ 43r91ihamdMcB7qMc5hy46cmFq7a05kMY+6KrVOpGF7ozKJBjgnz6FQeVquWHVe/
20
+ Folc5dm4nXxThLVYQ6zSp1VEuZMn26J0rQ1QxabL9WHpU5Ln5TyVGuo+WcKZFX5P
21
+ KNpFXJWh15bBDjjF62ZvN4w7kvT3d7kU76ElDqnSfsvAt4DsgrpnwxO9KK4e7mp8
22
+ /VctqLNByTZYN95QC1vcGH6MgMJXxD54RT0IBFrQMnNkFeugYs/a0U3iTmtsVXsa
23
+ eDAx+hTtODigDg3tblbum1ygdd8CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUI70EaT9kBbyGAg1NdD55965uV5MwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAViW8EMFX
27
+ u95Moqfcf3z0OT4+hMOa84BdnMZIzp81uimmxTeJq/qxPunOwUyJSiSsfy9Ucatd
28
+ JT9eBb79WgSsC2CwBJiY79uuAczxD9siXIcqogNzH2izay4RQtih1WnmxZ9NAA0F
29
+ 5b5dBSThFAYd5oClhp8XFcMojEAWCVlkokdVKRpBYOn8JPzgY7LX74UroS94GDSG
30
+ p1h3RDCojodg5D9UayFuFD++av/RaiIyw4X5/VUUX6twwL4P1pSFKMuFG5UoEtlJ
31
+ 4iQOEvIvyfh1vrJ0687D/rFgCEoNGhCnJptpgDrfnz7BMcmYjHYRdSXTL/iS+lDo
32
+ 5tGeZHWa8uIcew==
33
+ -----END CERTIFICATE-----
34
+ date: 2017-04-24 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: rsc
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.2'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.2.2
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.2'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.2.2
56
+ - !ruby/object:Gem::Dependency
57
+ name: polyrex
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.1'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 1.1.12
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '1.1'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 1.1.12
76
+ - !ruby/object:Gem::Dependency
77
+ name: sps-pub
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.5'
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: 0.5.4
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - "~>"
91
+ - !ruby/object:Gem::Version
92
+ version: '0.5'
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 0.5.4
96
+ - !ruby/object:Gem::Dependency
97
+ name: spstrigger_execute
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.4'
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: 0.4.6
106
+ type: :runtime
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: '0.4'
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: 0.4.6
116
+ description:
117
+ email: james@jamesrobertson.eu
118
+ executables: []
119
+ extensions: []
120
+ extra_rdoc_files: []
121
+ files:
122
+ - lib/botbase-module-phrases.rb
123
+ homepage: https://github.com/jrobertson/botbase-module-phrases
124
+ licenses:
125
+ - MIT
126
+ metadata: {}
127
+ post_install_message:
128
+ rdoc_options: []
129
+ require_paths:
130
+ - lib
131
+ required_ruby_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ requirements: []
142
+ rubyforge_project:
143
+ rubygems_version: 2.6.8
144
+ signing_key:
145
+ specification_version: 4
146
+ summary: A botbase module for matching a speech keyword which then triggers a general
147
+ RSC job or publishes an SPS message etc.
148
+ test_files: []
Binary file