abongo 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/abongo/sugar.rb +18 -2
- data/lib/abongo/version.rb +1 -1
- data/lib/abongo/view_helper.rb +18 -2
- metadata +3 -3
data/lib/abongo/sugar.rb
CHANGED
@@ -14,9 +14,25 @@ class Abongo
|
|
14
14
|
elsif (Abongo.options[:enable_selection] && !params[test_name].nil?)
|
15
15
|
choice = alternatives[params[test_name].to_i]
|
16
16
|
elsif (alternatives.nil?)
|
17
|
-
|
17
|
+
begin
|
18
|
+
choice = Abongo.flip(test_name, options)
|
19
|
+
rescue
|
20
|
+
if Abongo.options[:failsafe]
|
21
|
+
choice = true
|
22
|
+
else
|
23
|
+
raise
|
24
|
+
end
|
25
|
+
end
|
18
26
|
else
|
19
|
-
|
27
|
+
begin
|
28
|
+
choice = Abongo.test(test_name, alternatives, options)
|
29
|
+
rescue
|
30
|
+
if Abongo.options[:failsafe]
|
31
|
+
choice = Abongo.parse_alternatives(alternatives).first
|
32
|
+
else
|
33
|
+
raise
|
34
|
+
end
|
35
|
+
end
|
20
36
|
end
|
21
37
|
|
22
38
|
if block_given?
|
data/lib/abongo/version.rb
CHANGED
data/lib/abongo/view_helper.rb
CHANGED
@@ -12,9 +12,25 @@ class Abongo
|
|
12
12
|
elsif (Abongo.options[:enable_selection] && !params[test_name].nil?)
|
13
13
|
choice = alternatives[params[test_name].to_i]
|
14
14
|
elsif (alternatives.nil?)
|
15
|
-
|
15
|
+
begin
|
16
|
+
choice = Abongo.flip(test_name, options)
|
17
|
+
rescue
|
18
|
+
if Abongo.options[:failsafe]
|
19
|
+
choice = true
|
20
|
+
else
|
21
|
+
raise
|
22
|
+
end
|
23
|
+
end
|
16
24
|
else
|
17
|
-
|
25
|
+
begin
|
26
|
+
choice = Abongo.test(test_name, alternatives, options)
|
27
|
+
rescue
|
28
|
+
if Abongo.options[:failsafe]
|
29
|
+
choice = Abongo.parse_alternatives(alternatives).first
|
30
|
+
else
|
31
|
+
raise
|
32
|
+
end
|
33
|
+
end
|
18
34
|
end
|
19
35
|
|
20
36
|
if block
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Fairley
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-28 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|