omf_common 6.0.2 → 6.0.3

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.
@@ -20,8 +20,7 @@ OP_MODE = :development
20
20
  opts = {
21
21
  communication: {
22
22
  #url: 'xmpp://srv.mytestbed.net',
23
- auth: {}
24
-
23
+ #auth: {}
25
24
  },
26
25
  eventloop: { type: :em},
27
26
  logging: {
@@ -66,8 +65,8 @@ def observe(tname, comm)
66
65
  ts = Time.now.strftime('%H:%M:%S')
67
66
  puts "#{ts} #{msg.type}(#{msg.itype}) #{$debug ? msg.inspect : ''}"
68
67
  #puts " #{topic.id}"
69
- if (src_topic = msg.src.id) == topic.id
70
- puts " #{topic.id}"
68
+ if (src_topic = (msg.src.is_a?(OmfCommon::Comm::Topic) ? msg.src.id : msg.src)) == topic.id
69
+ puts " #{topic.id}"
71
70
  else
72
71
  puts " #{src_topic} via #{topic.id}"
73
72
  end
@@ -24,7 +24,7 @@ opts = {
24
24
  eventloop: { type: :em},
25
25
  logging: {
26
26
  level: 'info'
27
- }
27
+ }
28
28
  }
29
29
 
30
30
  resource_url = nil
@@ -64,7 +64,7 @@ opts[:communication][:url] = r.join('/')
64
64
  key = nil
65
65
  def err_exit
66
66
  $stderr.puts("Options need to be of the 'key: value' type")
67
- exit(-1)
67
+ exit(-1)
68
68
  end
69
69
  rest.each do |s|
70
70
  sa = s.split(':')
@@ -89,7 +89,7 @@ def print_prop(name, value, level = 0)
89
89
  if value.is_a? Hash
90
90
  puts ''
91
91
  value.each {|k, v| print_prop(k, v, level + 1)}
92
- else
92
+ else
93
93
  puts " #{value}"
94
94
  end
95
95
  end
@@ -98,8 +98,8 @@ OmfCommon.init(OP_MODE, opts) do |el|
98
98
  OmfCommon.comm.on_connected do |comm|
99
99
  comm.subscribe(resource) do |topic|
100
100
  topic.configure(resource_properties) do |msg|
101
- if (src_topic = msg.src.id) == topic.id
102
- puts "#{topic.id}"
101
+ if (src_topic = (msg.src.is_a?(OmfCommon::Comm::Topic) ? msg.src.id : msg.src)) == topic.id
102
+ puts "#{topic.id}"
103
103
  else
104
104
  puts "#{src_topic} via #{topic.id}"
105
105
  end
data/bin/omf_send_request CHANGED
@@ -22,7 +22,7 @@ opts = {
22
22
  eventloop: { type: :em},
23
23
  logging: {
24
24
  level: 'info'
25
- }
25
+ }
26
26
  }
27
27
 
28
28
  resource_url = nil
@@ -53,7 +53,7 @@ def print_prop(name, value, level = 0)
53
53
  if value.is_a? Hash
54
54
  puts ''
55
55
  value.each {|k, v| print_prop(k, v, level + 1)}
56
- else
56
+ else
57
57
  puts " #{value}"
58
58
  end
59
59
  end
@@ -62,8 +62,8 @@ OmfCommon.init(OP_MODE, opts) do |el|
62
62
  OmfCommon.comm.on_connected do |comm|
63
63
  comm.subscribe(resource) do |topic|
64
64
  topic.request(req_properties) do |msg|
65
- if (src_topic = msg.src.id) == topic.id
66
- puts "#{topic.id}"
65
+ if (src_topic = (msg.src.is_a?(OmfCommon::Comm::Topic) ? msg.src.id : msg.src)) == topic.id
66
+ puts "#{topic.id}"
67
67
  else
68
68
  puts "#{src_topic} via #{topic.id}"
69
69
  end
@@ -75,4 +75,4 @@ OmfCommon.init(OP_MODE, opts) do |el|
75
75
  el.after($timeout) { el.stop } if $timeout > 0
76
76
  end
77
77
  end
78
- end
78
+ end
@@ -22,11 +22,11 @@ module OmfCommon
22
22
  #
23
23
  def init(opts = {})
24
24
  @opts = {
25
- #:ssl (Hash) TLS (SSL) parameters to use.
26
- heartbeat: 20, # (Fixnum) default: 0 Connection heartbeat, in seconds. 0 means no heartbeat. Can also be configured server-side starting with RabbitMQ 3.0.
27
- #:on_tcp_connection_failure (#call) A callable object that will be run if connection to server fails
28
- #:on_possible_authentication_failure (#call) A callable object that will be run if authentication fails (see Authentication failure section)
29
- reconnect_delay: 20 # (Fixnum) Delay in seconds before attempting reconnect on detected failure
25
+ #:ssl (Hash) TLS (SSL) parameters to use.
26
+ heartbeat: 20, # (Fixnum) - default: 0 Connection heartbeat, in seconds. 0 means no heartbeat. Can also be configured server-side starting with RabbitMQ 3.0.
27
+ #:on_tcp_connection_failure (#call) - A callable object that will be run if connection to server fails
28
+ #:on_possible_authentication_failure (#call) - A callable object that will be run if authentication fails (see Authentication failure section)
29
+ reconnect_delay: 20 # (Fixnum) - Delay in seconds before attempting reconnect on detected failure
30
30
  }.merge(opts)
31
31
 
32
32
  unless (@url = @opts.delete(:url))
@@ -4,6 +4,6 @@
4
4
  # By downloading or using this software you accept the terms and the liability disclaimer in the License.
5
5
 
6
6
  module OmfCommon
7
- VERSION = "6.0.2"
7
+ VERSION = "6.0.3"
8
8
  PROTOCOL_VERSION = "6.0"
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-14 00:00:00.000000000 Z
12
+ date: 2013-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  version: '0'
293
293
  segments:
294
294
  - 0
295
- hash: 475954182867685216
295
+ hash: 2941832345659960024
296
296
  requirements: []
297
297
  rubyforge_project: omf_common
298
298
  rubygems_version: 1.8.25