ask_awesomely 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +2 -2
- data/lib/ask_awesomely/field/number.rb +2 -2
- data/lib/ask_awesomely/field/picture_choice.rb +2 -2
- data/lib/ask_awesomely/field/rating.rb +22 -7
- data/lib/ask_awesomely/field/statement.rb +2 -2
- data/lib/ask_awesomely/typeform.rb +12 -12
- data/lib/ask_awesomely/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c1913658f6a69f4ac165957a1acfdc8962c9e79
|
4
|
+
data.tar.gz: 99237e8b4ade837e1ea1204ad3d3a14b8b90cab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08b91b44f2abd00498579fcc703a68bc47cb4356376d6bc3e52ca40acd76a60bc50059355ee42354bfbc2bd53cd1d0fd60b47fa4fa75b06a60781ac8cf6a987d
|
7
|
+
data.tar.gz: e3a8726f2cc969cecccb201cf74141c546490651253c2b4cae0d99be121261844801ca623b3c0b3f63e6d9122994c3fbc8d7fc9e2136b9d310deea770bdec8ea
|
data/.travis.yml
CHANGED
@@ -2,7 +2,7 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 2.2.2
|
4
4
|
- 2.2.3
|
5
|
-
-
|
5
|
+
- 2.3.1
|
6
6
|
env:
|
7
7
|
global:
|
8
8
|
secure: IiOYP2G1Ufie+zMYz/l/+wnLwej6REZCKgFN+hNUU5//0UugDMQHbVHSLPSEuAu3g8T/9CcPgYLVYcTrsZC9Hn/TtB3Sc8w3OuSELD1prsanMlySjTHDTLmZynmDT/IFWxz2mdKIaFwHKvbipJw+VUxyTiFD/Iu/Ns/goM4+HBemxh2cuomAqPIo2qTKWxl9hpcT3YFf9ylbLKFe6LfnRCygeTK+nY3ooZMP+vC5tnYmLX74FINZKnliG8npNXG0fc7X/W5zzy0vKHGKobirxTqgMERZH1voGCShoVKtH9YISgr9g+JJ8AvVHVr58mjc3U26tChl6MKxMYIc+iscX/aoUEPQ6yPgST+Wj7+ZcFduFg/C3xgs0BoNRsJDLDD37a9uyEJet7iusMARs+X+buimRdEUvddkEdW4SNj76Jqjwsgp09Isl5LOLwUB+xsCE9s6CK3pOOsPHVnultFILsSk86Cre2+E2QEukt4r1cghn+Lf9+sdRwOHnBUT6G3p5S1t313JWNfZGx3auFEXacK5jmDjvqWH6QPUfVZJ25XGlHkVhsv4q09/dJcyr//tPsjD6Yrx2hc+pkIu24o8RPQlmpgTTpb/A3a2xaJOaP+PNJB0yT3LAxabEmvsCZCmmhScScagxTCdlBpP43q/Bjr2RA5Mbd+LVRBh7t/90RI=
|
data/README.md
CHANGED
@@ -182,7 +182,7 @@ A block of text that isn't a question and requires no answer.
|
|
182
182
|
field :statement do
|
183
183
|
say "what you want to say"
|
184
184
|
button_text "Okay, next question"
|
185
|
-
|
185
|
+
no_quotation_marks
|
186
186
|
end
|
187
187
|
```
|
188
188
|
|
@@ -296,7 +296,7 @@ field :rating do
|
|
296
296
|
ask "How much did you enjoy Jonny Wiseau's seminal hit, The Room?"
|
297
297
|
|
298
298
|
steps 10
|
299
|
-
shape
|
299
|
+
shape "skull"
|
300
300
|
end
|
301
301
|
|
302
302
|
```
|
@@ -1,11 +1,26 @@
|
|
1
1
|
module AskAwesomely
|
2
2
|
class Field::Rating < Field::Field
|
3
3
|
|
4
|
-
POSSIBLE_STEPS =
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
POSSIBLE_STEPS = 1..10
|
5
|
+
VALID_SHAPES = [
|
6
|
+
"star",
|
7
|
+
"heart",
|
8
|
+
"user",
|
9
|
+
"up",
|
10
|
+
"crown",
|
11
|
+
"cat",
|
12
|
+
"dog",
|
13
|
+
"circle",
|
14
|
+
"flag",
|
15
|
+
"droplet",
|
16
|
+
"tick",
|
17
|
+
"lightbulb",
|
18
|
+
"trophy",
|
19
|
+
"cloud",
|
20
|
+
"thunderbolt",
|
21
|
+
"pencil",
|
22
|
+
"skull"
|
23
|
+
]
|
9
24
|
|
10
25
|
def initialize(*)
|
11
26
|
super
|
@@ -20,8 +35,8 @@ module AskAwesomely
|
|
20
35
|
end
|
21
36
|
|
22
37
|
def shape(shape)
|
23
|
-
unless
|
24
|
-
raise ArgumentError, "shape must be one of: #{
|
38
|
+
unless VALID_SHAPES.include?(shape)
|
39
|
+
raise ArgumentError, "shape must be one of: #{VALID_SHAPES.join(", ")}"
|
25
40
|
end
|
26
41
|
|
27
42
|
@state.shape = shape
|
@@ -1,26 +1,26 @@
|
|
1
1
|
module AskAwesomely
|
2
2
|
class Typeform
|
3
|
-
|
4
|
-
attr_reader :links, :id, :structure
|
3
|
+
attr_reader :links, :id, :structure, :fields
|
5
4
|
|
6
5
|
def initialize(structure)
|
7
6
|
@structure = structure
|
7
|
+
@fields = []
|
8
8
|
end
|
9
9
|
|
10
10
|
def title
|
11
11
|
@structure.class._state.title
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def public_url
|
15
|
-
@public_url ||= links.find
|
16
|
-
link[
|
17
|
-
|
15
|
+
@public_url ||= links.find do |link|
|
16
|
+
link['rel'] == 'form_render'
|
17
|
+
end.fetch('href')
|
18
18
|
end
|
19
19
|
|
20
20
|
def private_url
|
21
|
-
@private_url ||= links.find
|
22
|
-
link[
|
23
|
-
|
21
|
+
@private_url ||= links.find do |link|
|
22
|
+
link['rel'] == 'self'
|
23
|
+
end.fetch('href')
|
24
24
|
end
|
25
25
|
|
26
26
|
def embed_as(type, options = {})
|
@@ -28,13 +28,13 @@ module AskAwesomely
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def update_with_api_response(response)
|
31
|
-
@links = response[
|
32
|
-
@id = response[
|
31
|
+
@links = response['_links']
|
32
|
+
@id = response['id']
|
33
|
+
@fields = response['fields']
|
33
34
|
end
|
34
35
|
|
35
36
|
def to_json
|
36
37
|
@structure.to_json
|
37
38
|
end
|
38
|
-
|
39
39
|
end
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ask_awesomely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Machin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|