alexa_skillresponse 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: d486aeca39fe81f082a334eb2318f9f0882a48c8a57747a985a7e095a11d1403
4
- data.tar.gz: 512bccdae79ae963e0a689519f06def2dd3e8dc95948d098399dc5d08a05fe9c
3
+ metadata.gz: de4bae67e8384cac33492ac076d3b71150e46a504cfc89d35f1605d027003dec
4
+ data.tar.gz: 822fd05e3b2c889759df10a2bb728dd42bae343836f843a093599f2b99edecab
5
5
  SHA512:
6
- metadata.gz: 528a5c267e4a6400ff7590957b3d83ba0e55d3114d13c91ba2c95fe7088980f2fe63a02d1ad1bee6f6430ff3e446a914a5e2aeec61a83fd694ad23c8b1811c3b
7
- data.tar.gz: 87d3370fd48549e22157030a524df31ee6c9ed06c1cb40aed52524ef896ebb8c65aeb8cbfe2362c4e667d8467aa723660791dff08e22742b03238199822484bd
6
+ metadata.gz: 130b2e9e51643b846cc18a0d97eaacf6f171c559859e7d35d6b932439fb681b6dbd1c65ac614b1cf90ff4a7a972e779d57cc5d6ac2eb8ec55612420f817f26aa
7
+ data.tar.gz: 72e58fb4fb03e9a97e90bd8a304a98e4ffa9864d9e97c4137e1eb1f65e0e366b1831c670cf6cc648886936adb013ba6ddad3644ce8e0001413ff34eeaf488135
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -62,7 +62,9 @@ class AlexaSkillResponse
62
62
 
63
63
  rsc = @rsc
64
64
  puts 'rsc found'.info if @debug
65
+
65
66
  if rsc.registry and user and device then
67
+
66
68
  puts ('sending to the registry').info if @debug
67
69
  rsc.registry.set_key("hkey_apps/alexa/users/" +
68
70
  user.downcase.gsub(/\W+/,'_') + "/lastsession/device", device)
@@ -71,17 +73,41 @@ class AlexaSkillResponse
71
73
 
72
74
  puts 'code:' + code.inspect if @debug
73
75
  text, mimetype = eval(code)
76
+
77
+ return ssml_output text if text =~ /<speak/
78
+
79
+ case mimetype
80
+ when 'application/json'
81
+ txt_output text
82
+ when 'application/ssml'
83
+ ssml_output text
84
+ else
85
+ txt_output text, attentive: attr[:attentive]
86
+ end
74
87
 
75
- return out if mimetype == 'application/json'
76
-
77
- output text, attentive: attr[:attentive]
78
- =begin
79
- =end
88
+
80
89
  end
81
90
 
82
91
  private
92
+
93
+ def ssml_output(s)
94
+
95
+ h = {
96
+ version: "1.0",
97
+ response: {
98
+ outputSpeech: {
99
+ type: "SSML",
100
+ ssml: ""
101
+ }
102
+ }
103
+ }
104
+
105
+ h[:response][:outputSpeech][:ssml] = s
106
+
107
+ h
108
+ end
83
109
 
84
- def output(s='I hear you', attentive: false)
110
+ def txt_output(s='I hear you', attentive: false)
85
111
 
86
112
  h = {
87
113
  version: "1.0",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexa_skillresponse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -30,7 +30,7 @@ cert_chain:
30
30
  LlGV+1M7EF/3KD6gOhEYz1EWlT542WsvEMRT4NNheh4sollCx//BxyUcXIXUB3Af
31
31
  vMQ=
32
32
  -----END CERTIFICATE-----
33
- date: 2019-03-08 00:00:00.000000000 Z
33
+ date: 2019-04-29 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rscript
metadata.gz.sig CHANGED
Binary file