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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e40513677c79353f24598b12de09b5e48a1aa76e
4
- data.tar.gz: ab7185b12531e81367b3257f70ecd31112e2e236
3
+ metadata.gz: 3802804f734d1955dd3b5e09e5b466304d5296bd
4
+ data.tar.gz: a85ebe34a857be6e437b7005569e9efa3f8d166a
5
5
  SHA512:
6
- metadata.gz: 7715ae699016e510f47523ee336e5c07ad7b5e89c7e39b62f399166d6916fb42aead5b346ed5b8d6b3a0498c49d92449c67ab454a0db5b0bb7e27f41809bf589
7
- data.tar.gz: 6b1e13b8828a07eea0f8145e3477f765b9e6b71b2d6b2d5b9d93a482253a6f4cb897c8f0114db1873d82dd774dc2c3ae86771f28e961995fcec163cd354910a3
6
+ metadata.gz: 82c8bc2e1f457be53163bd95e2cae1c4b86f3a1c216bdffff70519f2f4f83bcfb2098b9c9764f005779549538d9fbbe14158d79fabe87536bbd27757af0d11d0
7
+ data.tar.gz: 0f5289e068b2ba14ad9e13ccf0159a6eea25382d4f455b177b08af203716a1af521b02f21d6be23744878b8729303b69cff264e1b3b1bd9321e9984c00615d4f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ralyxa (1.1.1)
4
+ ralyxa (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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!", "http://placehold.it/200")
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
@@ -0,0 +1,2 @@
1
+ class UnsecureUrlError < StandardError
2
+ end
@@ -1,3 +1,3 @@
1
1
  module Ralyxa
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
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.2.0
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-17 00:00:00.000000000 Z
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