alexa_skillsimulator 0.3.2 → 0.4.0

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: 173c7f31b39b2f37532a919f81695e123fe1875245f2bb81d193d5008812c2f7
4
- data.tar.gz: 3fd7f8ec91f6b71836f0395158ee2089bb09ecdefa91daaf3ae14603895acf31
3
+ metadata.gz: 93bff20714288108b6afba43e7c5a847456157a64c259202205930d5147c8132
4
+ data.tar.gz: e9b5a47d744ff6f6019f076ee2621321cbc41954a3db269b5111ad3ea38e1497
5
5
  SHA512:
6
- metadata.gz: 9956f8e45c0143e31387315f20cb109c56172264e04d4a078853b6817f4431825b8ce5ea83c387b17f7d19f98b88af65147d821fb480fa7caec8cbcd7cc335cb
7
- data.tar.gz: 7458a79075529900cc6e3d2e1892fc3c2e73054f65c3d46f02a690d862e3fcdfe5ab2f5c98653bffa1086ecdbb02f76a9c7bbca9fe10f13d9417bac7f14d003f
6
+ metadata.gz: 295d8c8620ee033b6beabc9bc16c24c61c7a81b644b4ba6999b64854498ccc51de6c5597ad32802fbb2e4f4afb87814722f00a7467dc719f7145849ab2bb322b
7
+ data.tar.gz: a30ab51ae824341478072bae9118269b8c6fc6282e181a44525db346afd0a25db0a98eeea79df06a9d2ddcee766a6bff585a215ea30d226fd9f413ad7a9d2b46
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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(manifest, model, debug: false, userid: nil, deviceid: nil)
12
+ def initialize(modelstxt=[], debug: false, userid: nil, deviceid: nil)
13
13
 
14
- @alexa = AlexaSkillSimulator.new(manifest, model, debug: debug,
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 false
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(manifest, model, debug: false, userid: nil, deviceid: nil)
82
+ def initialize(modelstxt=[], debug: false, userid: nil, deviceid: nil)
83
83
 
84
- @manifest, @model = manifest, model
85
- @debug, @userid, @deviceid = debug, userid, deviceid
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
- aio = AskIO.new(@manifest, @model, debug: @debug, userid: @userid,
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.3.2
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: 2019-11-25 00:00:00.000000000 Z
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