alexa_modelbuilder 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c5c978765d3aa5439483ae534a87d4b37424b09
4
- data.tar.gz: 2e70d2a03514580b93fd33a816dcbb790f4059e4
3
+ metadata.gz: 29a02805ad54f017357ba708f22df04007d448c2
4
+ data.tar.gz: b0caf4832186a73f8934b8a787a2c24bf945f08b
5
5
  SHA512:
6
- metadata.gz: 56434970f521ff0a790dcf9eda19daf899237a3d50a8a2db29171e731c757e68bed895f7d68fe742e83a1a9f323d039c3cb99339c415e08ba77172766297838a
7
- data.tar.gz: 708e299b5b3be0894fcaa4d9d9eb25330064509147ea196212f373923ed74894aeb6faab2e10155a0396f7d4bb8deb0a8e52527a1800900d2f3f22976e3c68fe
6
+ metadata.gz: e751188d404f465fcf07d63594e94ca8420db3187d16eb53312edd61dc1b0169b4bc3f53533cd36769723f1df503fe47bee15449a2363415816f326f64132a06
7
+ data.tar.gz: fb9010de80a78700c832c877dde453d0355aadcc385ea7ddb7c25dd981ddca243bbf127f10ed45a38e15c69e2b3b24082e4108923276f35e4a48e219a8f4c664
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -83,8 +83,8 @@ class AlexaModelBuilder
83
83
  @h
84
84
  end
85
85
 
86
- def to_manifest()
87
- JSON.pretty_generate(@manifest)
86
+ def to_manifest(json: false)
87
+ json ? JSON.pretty_generate(@manifest) : @manifest
88
88
  end
89
89
 
90
90
  ## A guideline of fields to include within the raw document
@@ -106,7 +106,7 @@ endpoint: input
106
106
  def build_manifest(h)
107
107
 
108
108
  manifest = {
109
- "vendorId" => 'YOUR_VENDOR_ID',
109
+ "vendorId" => '',
110
110
  "manifest" => {
111
111
  "publishingInformation" => {
112
112
  "locales" => {
@@ -146,8 +146,10 @@ endpoint: input
146
146
  info['summary'] = h[:summary] || h[:name]
147
147
 
148
148
  examples = ["Alexa, open %s." % h[:invocation]]
149
- examples += h[:intent].select{|x| x.is_a? Array}.take(2).map do |x|
150
- "Alexa, %s." % x.first[-1][:utterance].first
149
+ examples += h[:intent].select{|x| x.is_a? Hash}.take(2).map do |x|
150
+ phrases = x.first[-1][:utterance]
151
+ puts 'phrases: ' + phrases.inspect if @debug
152
+ "Alexa, %s." % (phrases.is_a?(Array) ? phrases.first : phrases)
151
153
  end
152
154
 
153
155
  info['examplePhrases'] = examples
@@ -171,6 +173,9 @@ endpoint: input
171
173
 
172
174
 
173
175
  instruct = ["open %s" % h[:invocation]]
176
+ instruct << h[:intent].select{|x| x.is_a? Hash}\
177
+ .first.values.first[:utterance].first
178
+
174
179
  tests = instruct.map.with_index {|x, i| "%s) Say 'Alexa, %s'" % [i+1, x]}
175
180
  m['publishingInformation']['testingInstructions'] = tests.join(' ')
176
181
 
@@ -178,8 +183,8 @@ endpoint: input
178
183
  end
179
184
 
180
185
 
181
- def to_model()
182
- JSON.pretty_generate(@interact_model)
186
+ def to_model(json: false)
187
+ json ? JSON.pretty_generate(@interact_model) : @interact_model
183
188
  end
184
189
 
185
190
  def to_json(pretty: true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexa_modelbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -82,6 +82,6 @@ rubyforge_project:
82
82
  rubygems_version: 2.6.13
83
83
  signing_key:
84
84
  specification_version: 4
85
- summary: Builds an Alexa Skills Interaction Model and optionally an Alexa Skills manigest
85
+ summary: Builds an Alexa Skills Interaction Model and optionally an Alexa Skills manifest
86
86
  in JSON format from plain text
87
87
  test_files: []
metadata.gz.sig CHANGED
Binary file