ralyxa 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/lib/ralyxa/card.rb +7 -0
- data/lib/ralyxa/errors.rb +2 -0
- data/lib/ralyxa/version.rb +1 -1
- 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: 3802804f734d1955dd3b5e09e5b466304d5296bd
|
4
|
+
data.tar.gz: a85ebe34a857be6e437b7005569e9efa3f8d166a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82c8bc2e1f457be53163bd95e2cae1c4b86f3a1c216bdffff70519f2f4f83bcfb2098b9c9764f005779549538d9fbbe14158d79fabe87536bbd27757af0d11d0
|
7
|
+
data.tar.gz: 0f5289e068b2ba14ad9e13ccf0159a6eea25382d4f455b177b08af203716a1af521b02f21d6be23744878b8729303b69cff264e1b3b1bd9321e9984c00615d4f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -136,11 +136,13 @@ end
|
|
136
136
|
|
137
137
|
# Standard card
|
138
138
|
intent "SendStandardCard" do
|
139
|
-
standard_card = card("Hello World", "I'm alive!", "
|
139
|
+
standard_card = card("Hello World", "I'm alive!", "https://placehold.it/200")
|
140
140
|
ask("What do you think of the Standard card I just sent?", card: standard_card)
|
141
141
|
end
|
142
142
|
```
|
143
143
|
|
144
|
+
> Card images must be under 2MB and available at an SSL-enabled (HTTPS) endpoint.
|
145
|
+
|
144
146
|
## Development
|
145
147
|
|
146
148
|
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.
|
data/lib/ralyxa/card.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require_relative './errors'
|
2
|
+
|
1
3
|
module Ralyxa
|
2
4
|
class Card
|
3
5
|
SIMPLE_CARD_TYPE = "Simple"
|
@@ -35,6 +37,7 @@ module Ralyxa
|
|
35
37
|
end
|
36
38
|
|
37
39
|
def set_image(card)
|
40
|
+
raise UnsecureUrlError.new("Card images must be available at an SSL-enabled (HTTPS) endpoint. Your current image url is: #{ @image_url }") unless secure?(@image_url)
|
38
41
|
card[:image] = Hash.new
|
39
42
|
card[:image][:smallImageUrl] = @image_url
|
40
43
|
card[:image][:largeImageUrl] = @image_url
|
@@ -47,5 +50,9 @@ module Ralyxa
|
|
47
50
|
def standard?
|
48
51
|
!!@image_url
|
49
52
|
end
|
53
|
+
|
54
|
+
def secure?(url)
|
55
|
+
URI.parse(url).scheme == "https"
|
56
|
+
end
|
50
57
|
end
|
51
58
|
end
|
data/lib/ralyxa/version.rb
CHANGED
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.3.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-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- bin/setup
|
73
73
|
- lib/ralyxa.rb
|
74
74
|
- lib/ralyxa/card.rb
|
75
|
+
- lib/ralyxa/errors.rb
|
75
76
|
- lib/ralyxa/handler.rb
|
76
77
|
- lib/ralyxa/output_speech.rb
|
77
78
|
- lib/ralyxa/register_intents.rb
|