alexa_skillsimulator 0.3.2 → 0.4.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/alexa_skillsimulator.rb +8 -31
- metadata +22 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93bff20714288108b6afba43e7c5a847456157a64c259202205930d5147c8132
|
4
|
+
data.tar.gz: e9b5a47d744ff6f6019f076ee2621321cbc41954a3db269b5111ad3ea38e1497
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 295d8c8620ee033b6beabc9bc16c24c61c7a81b644b4ba6999b64854498ccc51de6c5597ad32802fbb2e4f4afb87814722f00a7467dc719f7145849ab2bb322b
|
7
|
+
data.tar.gz: a30ab51ae824341478072bae9118269b8c6fc6282e181a44525db346afd0a25db0a98eeea79df06a9d2ddcee766a6bff585a215ea30d226fd9f413ad7a9d2b46
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/alexa_skillsimulator.rb
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
# file: alexa_skillsimulator.rb
|
4
4
|
|
5
|
-
require 'askio'
|
6
5
|
require 'console_cmdr'
|
7
6
|
require 'securerandom'
|
7
|
+
require 'alexa_utteranceresponder'
|
8
8
|
|
9
9
|
|
10
10
|
class AlexaShell < ConsoleCmdr
|
11
11
|
|
12
|
-
def initialize(
|
12
|
+
def initialize(modelstxt=[], debug: false, userid: nil, deviceid: nil)
|
13
13
|
|
14
|
-
@alexa = AlexaSkillSimulator.new(
|
14
|
+
@alexa = AlexaSkillSimulator.new(modelstxt, debug: debug,
|
15
15
|
userid: userid, deviceid: deviceid)
|
16
16
|
super(debug: debug)
|
17
17
|
|
@@ -61,7 +61,7 @@ class AlexaShell < ConsoleCmdr
|
|
61
61
|
return (@running=false; '' )
|
62
62
|
|
63
63
|
else
|
64
|
-
return
|
64
|
+
return @alexa.ask command
|
65
65
|
end
|
66
66
|
|
67
67
|
end
|
@@ -79,10 +79,10 @@ class AlexaSkillSimulator
|
|
79
79
|
attr_reader :invocation
|
80
80
|
attr_accessor :deviceid
|
81
81
|
|
82
|
-
def initialize(
|
82
|
+
def initialize(modelstxt=[], debug: false, userid: nil, deviceid: nil)
|
83
83
|
|
84
|
-
@
|
85
|
-
@
|
84
|
+
@debug, @deviceid = debug, deviceid
|
85
|
+
@aur = AlexaUtteranceResponder.new(modelstxt, userid: userid, deviceid: deviceid, debug: true)
|
86
86
|
|
87
87
|
end
|
88
88
|
|
@@ -91,31 +91,8 @@ class AlexaSkillSimulator
|
|
91
91
|
puts
|
92
92
|
puts ' debugger: s: ' + s.inspect if @debug
|
93
93
|
|
94
|
-
|
95
|
-
deviceid: deviceid)
|
96
|
-
|
97
|
-
invocation = aio.invocation.gsub(/ /,'\s')
|
98
|
-
|
99
|
-
regex = %r{
|
100
|
-
|
101
|
-
(?<ask>(?<action>tell|ask)\s#{invocation}\s(?<request>.*)){0}
|
102
|
-
(?<open>(?<action>open)\s#{invocation}){0}
|
103
|
-
\g<ask>|\g<open>
|
104
|
-
}x
|
105
|
-
|
106
|
-
r2 = s.downcase.gsub(/,/,'').match(regex)
|
107
|
-
|
108
|
-
puts ' debugger: r2: ' + r2.inspect if @debug
|
109
|
-
puts
|
110
|
-
|
111
|
-
return "hmmm, I don't know that one." unless r2
|
112
|
-
return respond() if r2[:action] == 'open'
|
113
|
-
|
114
|
-
r = aio.ask r2[:request], &blk
|
115
|
-
|
116
|
-
r ? r : "I'm sorry I didn't understand what you said"
|
94
|
+
@aur.ask(s)
|
117
95
|
|
118
96
|
end
|
119
97
|
|
120
|
-
|
121
98
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexa_skillsimulator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
XiPxizrh/Vra9EAGIf0VzCi8g1HvOrx9ryTcDVXPKzf7YJGlHOWYgoIjTVUAAoMp
|
36
36
|
Ke26GT4jNyIN1UZ4Npszdo39
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: askio
|
@@ -77,6 +77,26 @@ dependencies:
|
|
77
77
|
- - "~>"
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0.5'
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: alexa_utteranceresponder
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.2.0
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.2'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.2.0
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0.2'
|
80
100
|
description:
|
81
101
|
email: james@jamesrobertson.eu
|
82
102
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|