converse 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/converse/interaction.rb +12 -0
- data/lib/converse/rest/rest_interaction.rb +1 -2
- data/lib/converse/version.rb +1 -1
- metadata +3 -3
data/lib/converse/interaction.rb
CHANGED
@@ -100,6 +100,10 @@ module Converse
|
|
100
100
|
@conversation = broker.broker_conversation(@broker.open_topic(@concern, @action))
|
101
101
|
@conversation.subscribe(SimpleLogger.new)
|
102
102
|
@should_i_ask ? response = ask : response = say
|
103
|
+
if not success?(response)
|
104
|
+
response = handle_error!(response)
|
105
|
+
return nil if response.nil?
|
106
|
+
end
|
103
107
|
translated_response = broker.translate_response(response)
|
104
108
|
interpret_conversation(translated_response)
|
105
109
|
end
|
@@ -108,6 +112,14 @@ module Converse
|
|
108
112
|
response
|
109
113
|
end
|
110
114
|
|
115
|
+
def success?(response)
|
116
|
+
true
|
117
|
+
end
|
118
|
+
|
119
|
+
def handle_error!(response)
|
120
|
+
response
|
121
|
+
end
|
122
|
+
|
111
123
|
def ensure_that(substance)
|
112
124
|
@validation = substance
|
113
125
|
self
|
@@ -32,13 +32,12 @@ module Converse
|
|
32
32
|
path + "?" + compile_params(params)
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
35
|
+
def success?(response)
|
36
36
|
test_value = "#{response.code}"
|
37
37
|
return test_value == "200"
|
38
38
|
end
|
39
39
|
|
40
40
|
def interpret_conversation(response)
|
41
|
-
format_error(response) if not response_ok?(response)
|
42
41
|
return format_response(response.body)
|
43
42
|
end
|
44
43
|
|
data/lib/converse/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: converse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 23
|
10
|
+
version: 1.0.23
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ernst van Graan
|