ralyxa 1.0.0 → 1.1.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
  SHA1:
3
- metadata.gz: 6e3f8442dcb51d6e780ebc37bc846b2929351af0
4
- data.tar.gz: 5278a2bada22ba5f69207780e4114a8890793de0
3
+ metadata.gz: ef0f253c2830e00d4079d4270ce2b523c12a340a
4
+ data.tar.gz: fab75b7d1e766238e2496e98775e4f035995edb2
5
5
  SHA512:
6
- metadata.gz: ef36564dafddabaae15059ff9218d44bd3b17b28394a52596ebe3ac6665643f54c55a05c35b8aa7da1eb908087791367960fde26f560de1c437dc22eec49ee47
7
- data.tar.gz: 1fd77d6e2e8d7f1a45e5bb3a789d04f833f5ddb9443d649c4825bcf0b722bb038ba63e04465a3c9ddeed1754f645a2ab0313c0c13993cb4d0b45d5c8e93edd7e
6
+ metadata.gz: 2c24c71c0a97047ed5653472a1c7d18c2c315b7b93f548e566f3e75054e3429a11a392a4a8d9ac6b0b7b2bea82f856028f2251ce41b5ef59b488bda556b6dfc1
7
+ data.tar.gz: b4fee59e0a471b6490e5b7b4a28693282184ba85ed2cd73efeaebcee6932bbb3448408fb140ffc3fcd1e2a6f4289f322d082e66ce2505e090b344af488017af3
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A Ruby framework for interacting with Amazon Alexa. Designed to work with Sinatra, although can be used with a few other web frameworks.
4
4
 
5
+ An example application implementing the gem can be played with [here](https://github.com/sjmog/ralyxa_example).
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -26,10 +28,10 @@ First, you've gotta pass the request from Sinatra to Ralyxa. Add a single `POST`
26
28
 
27
29
  ```ruby
28
30
  require 'sinatra'
29
- require './lib/alexa'
31
+ require 'ralyxa'
30
32
 
31
33
  post '/' do
32
- Alexa::Skill.handle(request)
34
+ Ralyxa::Skill.handle(request)
33
35
  end
34
36
  ```
35
37
 
@@ -139,13 +141,6 @@ intent "SendStandardCard" do
139
141
  end
140
142
  ```
141
143
 
142
- ##### TODO
143
-
144
- - Account linking :construction:
145
- - Audio directives :construction:
146
- - Reprompts :construction:
147
- - Generator?
148
-
149
144
  ## Development
150
145
 
151
146
  After checking out the repo, run `bundle install` to install dependencies. Then, run `rspec` to run the tests. You can also run `irb` for an interactive prompt that will allow you to experiment.
@@ -154,6 +149,12 @@ After checking out the repo, run `bundle install` to install dependencies. Then,
154
149
 
155
150
  Bug reports and pull requests are welcome on GitHub at https://github.com/sjmog/ralyxa. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
156
151
 
152
+ The main areas of focus are:
153
+
154
+ - Account linking :construction:
155
+ - Audio directives :construction:
156
+ - Reprompts :construction:
157
+ - Generators?
157
158
 
158
159
  ## License
159
160
 
@@ -2,11 +2,14 @@ require 'json'
2
2
 
3
3
  module Ralyxa
4
4
  class Request
5
+ INTENT_REQUEST_TYPE = "IntentRequest".freeze
6
+
5
7
  def initialize(original_request)
6
8
  @request = JSON.parse(original_request.body.read)
7
9
  end
8
10
 
9
11
  def intent_name
12
+ return @request["request"]["type"] unless intent_request?
10
13
  @request["request"]["intent"]["name"]
11
14
  end
12
15
 
@@ -21,5 +24,11 @@ module Ralyxa
21
24
  def session_attribute(attribute_name)
22
25
  @request["session"]["attributes"][attribute_name]
23
26
  end
27
+
28
+ private
29
+
30
+ def intent_request?
31
+ @request["request"]["type"] == INTENT_REQUEST_TYPE
32
+ end
24
33
  end
25
34
  end
@@ -1,3 +1,3 @@
1
1
  module Ralyxa
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ralyxa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Morgan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,7 @@ files:
80
80
  - lib/ralyxa/response_builder.rb
81
81
  - lib/ralyxa/skill.rb
82
82
  - lib/ralyxa/version.rb
83
+ - pkg/ralyxa-1.0.0.gem
83
84
  - ralyxa.gemspec
84
85
  homepage: https://github.com/sjmog/ralyxa
85
86
  licenses: