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 +4 -4
- data/README.md +10 -9
- data/lib/ralyxa/request.rb +9 -0
- data/lib/ralyxa/version.rb +1 -1
- data/pkg/ralyxa-1.0.0.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0f253c2830e00d4079d4270ce2b523c12a340a
|
4
|
+
data.tar.gz: fab75b7d1e766238e2496e98775e4f035995edb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 '
|
31
|
+
require 'ralyxa'
|
30
32
|
|
31
33
|
post '/' do
|
32
|
-
|
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
|
|
data/lib/ralyxa/request.rb
CHANGED
@@ -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
|
data/lib/ralyxa/version.rb
CHANGED
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.
|
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-
|
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:
|