haredo 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -6
- data/src/lib/haredo/peer.rb +23 -10
- data/src/lib/haredo/plugins/example.rb +17 -0
- data/src/lib/haredo/version.rb +3 -3
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a2cff8b9e4c6d2df39d29382b3cc6d1ad1cdf653
|
4
|
+
data.tar.gz: b51c600b77eadf34286f5a10ac7664f7814c7105
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1fa6921a853aa13fb1bdae3e3712eca4366d22ecd4039034aa2a6fea77976e70427eefcb6af0b0c49d0562668df48d6597330733ea8e78736f75a6b2b2de073a
|
7
|
+
data.tar.gz: 96a79dcc5cce9d2d91f3ba198a4940903e3d11409fb98b0ed5e1340a43da1bdaf4dfbc1390be4f3e691becaa3c4c5fbd6aab1786db98fcd110351650b07e0306
|
data/src/lib/haredo/peer.rb
CHANGED
@@ -195,20 +195,33 @@ class Peer
|
|
195
195
|
#'x-message-ttl' => 1000
|
196
196
|
}
|
197
197
|
|
198
|
-
user
|
199
|
-
password
|
200
|
-
host
|
201
|
-
port
|
202
|
-
vhost
|
203
|
-
queue_props
|
204
|
-
ssl
|
198
|
+
user = args[:user] || 'guest'
|
199
|
+
password = args[:password] || 'guest'
|
200
|
+
host = args[:host] || 'localhost'
|
201
|
+
port = args[:port] || '5672'
|
202
|
+
vhost = args[:vhost] || ''
|
203
|
+
queue_props = args[:queue] || queue_args
|
204
|
+
ssl = args[:ssl] || {}
|
205
|
+
tls_cert = ssl['tls_cert'] || ''
|
206
|
+
tls_key = ssl['tls_key'] || ''
|
207
|
+
tls_ca_certs = [ssl['tls_ca']]
|
205
208
|
|
206
|
-
|
207
|
-
|
209
|
+
use_ssl = false
|
210
|
+
if ssl.size > 0 and ssl['enable'] == true
|
211
|
+
use_ssl = true
|
212
|
+
port = ssl['port'] || '5671'
|
208
213
|
end
|
209
214
|
|
210
215
|
begin
|
211
|
-
|
216
|
+
if use_ssl == true
|
217
|
+
@cnx = Bunny.new( "amqps://#{user}:#{password}@#{host}:#{port}#{vhost}",
|
218
|
+
:tls_cert => tls_cert,
|
219
|
+
:tls_key => tls_key,
|
220
|
+
:tls_ca_certificates => tls_ca_certs)
|
221
|
+
else
|
222
|
+
@cnx = Bunny.new("amqp://#{user}:#{password}@#{host}:#{port}#{vhost}")
|
223
|
+
end
|
224
|
+
|
212
225
|
@cnx.start()
|
213
226
|
rescue Bunny::TCPConnectionFailed => e
|
214
227
|
return false
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'haredo/plugin'
|
3
|
+
|
4
|
+
class Plugin < HareDo::Plugin
|
5
|
+
|
6
|
+
UUID = 'example'
|
7
|
+
|
8
|
+
def initialize(service, config)
|
9
|
+
super UUID, service, config
|
10
|
+
end
|
11
|
+
|
12
|
+
def process(msg)
|
13
|
+
# Send back configuration
|
14
|
+
@peer.reply(msg, :data=>JSON::pretty_generate(@config))
|
15
|
+
end
|
16
|
+
|
17
|
+
end # class Plugin
|
data/src/lib/haredo/version.rb
CHANGED
@@ -4,8 +4,8 @@ module HareDo
|
|
4
4
|
VERSION_MAJ = '2'
|
5
5
|
VERSION_MIN = '0'
|
6
6
|
VERSION_CL = ''
|
7
|
-
VERSION_PL = '
|
8
|
-
VERSION = '2.0.
|
9
|
-
RELEASE_DATE = '
|
7
|
+
VERSION_PL = '6'
|
8
|
+
VERSION = '2.0.6-1'
|
9
|
+
RELEASE_DATE = 'Tue, 15 Oct 2013 13:03:56 -0500'
|
10
10
|
|
11
11
|
end # module HareDo
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haredo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Owens
|
8
8
|
autorequire:
|
9
9
|
bindir: src/bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
description: A P2P framework over RabbitMQ
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- src/lib/haredo/peer.rb
|
39
39
|
- src/lib/haredo/plugin.rb
|
40
40
|
- src/lib/haredo/plugins/echo.rb
|
41
|
+
- src/lib/haredo/plugins/example.rb
|
41
42
|
- src/lib/haredo/plugins/status.rb
|
42
43
|
- src/lib/haredo/service/admin/daemon.rb
|
43
44
|
- src/lib/haredo/service/config.rb
|
@@ -55,17 +56,17 @@ require_paths:
|
|
55
56
|
- src/lib
|
56
57
|
required_ruby_version: !ruby/object:Gem::Requirement
|
57
58
|
requirements:
|
58
|
-
- -
|
59
|
+
- - '>='
|
59
60
|
- !ruby/object:Gem::Version
|
60
61
|
version: '0'
|
61
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
63
|
requirements:
|
63
|
-
- -
|
64
|
+
- - '>='
|
64
65
|
- !ruby/object:Gem::Version
|
65
66
|
version: '0'
|
66
67
|
requirements: []
|
67
68
|
rubyforge_project:
|
68
|
-
rubygems_version: 2.0.
|
69
|
+
rubygems_version: 2.0.3
|
69
70
|
signing_key:
|
70
71
|
specification_version: 4
|
71
72
|
summary: A simple client/server framework using RabbitMQ
|