openagent 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/openagent/client.rb +4 -2
- data/lib/openagent/version.rb +1 -1
- data/lib/sif/infra/common/message.rb +9 -3
- data/spec/response_spec.rb +8 -0
- metadata +2 -2
data/lib/openagent/client.rb
CHANGED
@@ -53,7 +53,9 @@ module OpenAgent
|
|
53
53
|
@log.info "#{name}\n#{body}\n"
|
54
54
|
end
|
55
55
|
|
56
|
-
# Proxy to OpenAgent::
|
56
|
+
# Proxy to OpenAgent::MessageBuilder, e.g. ack, request, event, provision,
|
57
|
+
# register, unregister, ping, sleep, wakeup, get_message, get_zone_status,
|
58
|
+
# get_agent_acl
|
57
59
|
def method_missing(method, *args, &block)
|
58
60
|
if @builder.respond_to?(method)
|
59
61
|
message = @builder.send(method, *args)
|
@@ -157,7 +159,7 @@ module OpenAgent
|
|
157
159
|
|
158
160
|
check_for_errors(incoming)
|
159
161
|
|
160
|
-
yield incoming if block_given?
|
162
|
+
yield incoming, outgoing if block_given?
|
161
163
|
end
|
162
164
|
end
|
163
165
|
end
|
data/lib/openagent/version.rb
CHANGED
@@ -26,10 +26,16 @@ module SIF
|
|
26
26
|
nil
|
27
27
|
end
|
28
28
|
|
29
|
+
def response?
|
30
|
+
inner_message && inner_message.response
|
31
|
+
end
|
32
|
+
|
29
33
|
def final_packet?
|
30
|
-
|
31
|
-
|
32
|
-
|
34
|
+
response? && !inner_message.response.more_packets?
|
35
|
+
end
|
36
|
+
|
37
|
+
def request_msg_id
|
38
|
+
response? && inner_message.response.request_msg_id
|
33
39
|
end
|
34
40
|
|
35
41
|
def response_objects
|
data/spec/response_spec.rb
CHANGED
@@ -32,4 +32,12 @@ describe OpenAgent::Client do
|
|
32
32
|
ref_ids << student.ref_id
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
it "has final_packet? shortcut" do
|
37
|
+
@msg.final_packet?.should_not be_true
|
38
|
+
end
|
39
|
+
|
40
|
+
it "has request_msg_id shortcut" do
|
41
|
+
@msg.request_msg_id.should == "136F9F8028850131013848E0EB1826A1"
|
42
|
+
end
|
35
43
|
end
|
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.8.
|
4
|
+
version: 0.8.5
|
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-01-
|
14
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|