alexa_skillresponse 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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/alexa_skillresponse.rb +50 -0
- metadata +87 -0
- metadata.gz.sig +2 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 11f9acc985f926f95e13a0685994a8969f38f61b
|
4
|
+
data.tar.gz: e0ee24092f333726e9845b036c5339c77b664742
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ad2dcd264712cf45cd848e5c08c39617ad4887e31aa79a89efc2dcff13a6e861cebc3743e9d9e80e9c23aec52eeff0049107dbeb3c7bed429bcd52dcb655f80f
|
7
|
+
data.tar.gz: 8e336d77cc13322fb88a8b6f4e1d7da9217fa7ebd47926b64abca8b32d7154a72761e5be81854e97fb0e75846cef0bb0e754f39e54f5b4757b97e7c365b4eed3
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: alexa_skillresponse.rb
|
4
|
+
|
5
|
+
|
6
|
+
require 'rscript'
|
7
|
+
|
8
|
+
|
9
|
+
class AlexaSkillResponse
|
10
|
+
|
11
|
+
def initialize(package, debug: false)
|
12
|
+
@rscript = RScript.new(type: 'response', debug: debug)
|
13
|
+
@package, @debug = package, debug
|
14
|
+
puts '@package: ' + @package.inspect if @debug
|
15
|
+
end
|
16
|
+
|
17
|
+
def run(h)
|
18
|
+
|
19
|
+
req = h[:request]
|
20
|
+
id = req[:type] == 'IntentRequest' ? req[:intent][:name] : 'welcome'
|
21
|
+
puts 'id: ' + id.inspect if @debug
|
22
|
+
|
23
|
+
code, _, attr = @rscript.read ['//response:' + id, @package]
|
24
|
+
text, mimetype = eval(code)
|
25
|
+
|
26
|
+
return out if mimetype == 'application/json'
|
27
|
+
|
28
|
+
output text, attr[:attentive]
|
29
|
+
end
|
30
|
+
|
31
|
+
def output(s='I hear you', attentive)
|
32
|
+
|
33
|
+
h = {
|
34
|
+
version: "1.0",
|
35
|
+
response: {
|
36
|
+
outputSpeech: {
|
37
|
+
type: "PlainText",
|
38
|
+
text: ""
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
h[:response][:outputSpeech][:text] = s
|
44
|
+
puts 'attentive: ' + attentive.inspect if @debug
|
45
|
+
h[:response][:shouldEndSession] = (attentive == 'true') ? false : true
|
46
|
+
|
47
|
+
h
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: alexa_skillresponse
|
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
|
+
MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwNzEwMjIyMDUxWhcN
|
15
|
+
MTkwNzEwMjIyMDUxWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC2mh7m
|
17
|
+
JCKKq/eTlfLZoxkEqAErcDE4ew4upBpJqmFeWOIloiGM1X0GxWmzOKtthZ0QVv5e
|
18
|
+
lKQaQk4w1PSY7cwBAdf2Dx7960WHuSUAR+M0TUG8r5Wdy613BW6ekrXdQaC63S+B
|
19
|
+
KdujWPvjDzR186UIu+QuKss2oBqGIHnRmoF9k+UaPZnbFUHMfWIxNo8MpwRFe8mQ
|
20
|
+
8GXsKKtwqr2F++pIOm8X02vysI84Xetg47doOQWn9ehkvpCVhKuCr7sQM5XylnXh
|
21
|
+
WoH4HN33DQ4OEBTq4wBb+Rgs/cl1ZX7VH1NOEGwjZv17CwWq04VxESZnmFpK6iwj
|
22
|
+
nR34IuDno7zvmaHTAgMBAAGjgYowgYcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
23
|
+
HQYDVR0OBBYEFIlwg9qobb/ERHITdKNiP7GXP2K7MCYGA1UdEQQfMB2BG2dlbW1h
|
24
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTAmBgNVHRIEHzAdgRtnZW1tYXN0ZXJAamFt
|
25
|
+
ZXNyb2JlcnRzb24uZXUwDQYJKoZIhvcNAQEFBQADggEBABt9MiTNKh4PfhCfya3s
|
26
|
+
alIkEDVMZB6bQrAS+Dm3wxD/fzPbV4eaaCnHeyGfOjhfkUnnShOMr/CU+KJ0bIBS
|
27
|
+
P2uV8E/HFHL/bhX9gG5TKIPgFN8Y8zd+28US/wAJ0YFaZfFytOmu72tOzyT6zpCs
|
28
|
+
x8eGQTf2lWe88Fc7yGvyRPC6QaxzuedjY+tysCZ+1WYQb7bggxgKFYUQF7jCY3tP
|
29
|
+
xX9D3QLA05Z5/B26cxYsz/NuHzn5Rk5xIBLrBHcL9IOeWK4hYcyeI4IXNqIMyrVo
|
30
|
+
LlGV+1M7EF/3KD6gOhEYz1EWlT542WsvEMRT4NNheh4sollCx//BxyUcXIXUB3Af
|
31
|
+
vMQ=
|
32
|
+
-----END CERTIFICATE-----
|
33
|
+
date: 2018-07-10 00:00:00.000000000 Z
|
34
|
+
dependencies:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rscript
|
37
|
+
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0.4'
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 0.4.3
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - "~>"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0.4'
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.4.3
|
55
|
+
description:
|
56
|
+
email: james@jamesrobertson.eu
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- lib/alexa_skillresponse.rb
|
62
|
+
homepage: https://github.com/jrobertson/alexa_skillresponse
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata: {}
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 2.6.13
|
83
|
+
signing_key:
|
84
|
+
specification_version: 4
|
85
|
+
summary: Responds to an Alexa Skill request using Ruby scripts embedded in a kind
|
86
|
+
of XML format
|
87
|
+
test_files: []
|
metadata.gz.sig
ADDED