openagent 0.9.6 → 0.9.8
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/openagent/client.rb
CHANGED
@@ -110,9 +110,9 @@ module OpenAgent
|
|
110
110
|
begin
|
111
111
|
run_once
|
112
112
|
sleep wait_period
|
113
|
-
rescue ResponseError => e
|
113
|
+
rescue OpenAgent::ResponseError => e
|
114
114
|
@log.error e
|
115
|
-
rescue Net::
|
115
|
+
rescue Net::HTTPError => e
|
116
116
|
@log.error e
|
117
117
|
sleep(5)
|
118
118
|
end
|
@@ -146,11 +146,11 @@ module OpenAgent
|
|
146
146
|
|
147
147
|
log "Request", req.body
|
148
148
|
@zone.send_request(req).tap do |response|
|
149
|
-
log "Response", formatted_xml(response.body, @pretty_print)
|
150
149
|
|
151
150
|
if response.body.nil? or response.body.empty?
|
152
|
-
raise ResponseError, "Response is empty"
|
151
|
+
raise OpenAgent::ResponseError, "Response is empty"
|
153
152
|
else
|
153
|
+
log "Response", formatted_xml(response.body, @pretty_print)
|
154
154
|
incoming = Message.new
|
155
155
|
MessageRepresenter.new(incoming).from_xml(response.body)
|
156
156
|
|
data/lib/openagent/version.rb
CHANGED
@@ -4,10 +4,11 @@ module SIF
|
|
4
4
|
class Ack
|
5
5
|
include Virtus.model
|
6
6
|
|
7
|
+
attribute :header, Common::Header
|
8
|
+
|
7
9
|
attribute :original_source_id, String
|
8
10
|
attribute :original_msg_id, String
|
9
11
|
|
10
|
-
attribute :header, Common::Header
|
11
12
|
attribute :status, Common::Status
|
12
13
|
attribute :error, Common::Error
|
13
14
|
end
|
@@ -6,12 +6,12 @@ module SIF
|
|
6
6
|
|
7
7
|
self.representation_wrap = 'SIF_Ack'
|
8
8
|
|
9
|
-
property :original_source_id, :as => 'SIF_OriginalSourceId'
|
10
|
-
property :original_msg_id, :as => 'SIF_OriginalMsgId'
|
11
|
-
|
12
9
|
property :header, :as => 'SIF_Header',
|
13
10
|
:class => SIF::Infra::Common::Header,
|
14
11
|
:decorator => Infra::Common::Header
|
12
|
+
property :original_source_id, :as => 'SIF_OriginalSourceId'
|
13
|
+
property :original_msg_id, :as => 'SIF_OriginalMsgId'
|
14
|
+
|
15
15
|
property :status, :as => 'SIF_Status',
|
16
16
|
:class => SIF::Infra::Common::Status,
|
17
17
|
:decorator => Infra::Common::Status
|
@@ -74,7 +74,7 @@ describe OpenAgent::MessageBuilder do
|
|
74
74
|
it "acks" do
|
75
75
|
msg = header_checks_out{ builder.ack("SRCID", "MSGID", "1") }
|
76
76
|
msg.ack.status.code.should == 1
|
77
|
-
represent(msg).to_xml.should == "<SIF_Message xmlns=\"http://www.sifinfo.org/infrastructure/2.x\" Version=\"2.0r1\">\n <SIF_Ack>\n <
|
77
|
+
represent(msg).to_xml.should == "<SIF_Message xmlns=\"http://www.sifinfo.org/infrastructure/2.x\" Version=\"2.0r1\">\n <SIF_Ack>\n <SIF_Header>\n <SIF_MsgId>GUUID</SIF_MsgId>\n <SIF_Timestamp>TIME</SIF_Timestamp>\n <SIF_SourceId>canvas</SIF_SourceId>\n </SIF_Header>\n <SIF_OriginalSourceId>SRCID</SIF_OriginalSourceId>\n <SIF_OriginalMsgId>MSGID</SIF_OriginalMsgId>\n <SIF_Status>\n <SIF_Code>1</SIF_Code>\n </SIF_Status>\n </SIF_Ack>\n</SIF_Message>"
|
78
78
|
end
|
79
79
|
|
80
80
|
it "provisions" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openagent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-08-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|