traut 0.2.4 → 1.0.0
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/etc/traut.conf +4 -2
- data/lib/traut.rb +2 -1
- data/lib/traut/application.rb +13 -2
- data/lib/traut/version.rb +1 -1
- metadata +9 -8
data/etc/traut.conf
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
amqp:
|
2
2
|
host: localhost
|
3
|
-
port:
|
3
|
+
port: 5671
|
4
4
|
vhost: '/'
|
5
5
|
username: 'guest'
|
6
6
|
password: 'guest'
|
7
7
|
exchange: 'traut'
|
8
|
-
|
8
|
+
ssl:
|
9
|
+
private_key: /etc/rabbitmq/ca/client/key.pem
|
10
|
+
cert_chain: /etc/rabbitmq/ca/client/cert.pem
|
9
11
|
|
10
12
|
debug: true
|
11
13
|
logdir: './logs/'
|
data/lib/traut.rb
CHANGED
data/lib/traut/application.rb
CHANGED
@@ -15,11 +15,22 @@ module Traut
|
|
15
15
|
@logger = Logger.new File.join( File.expand_path(@options['logdir']), 'traut.log')
|
16
16
|
@logger.level = boolean(@options['debug']) ? Logger::DEBUG : Logger::INFO
|
17
17
|
|
18
|
-
##
|
18
|
+
## We start the AMQP connection out here, rather than in Server, to
|
19
|
+
## isolate that code from its specific duties and so that we do not have
|
20
|
+
## to pass extranious configuration details into it.
|
19
21
|
amqp = @options['amqp']
|
20
22
|
|
21
23
|
AMQP.connect(:host => amqp['host'], :port => amqp['port'], :vhost => amqp['vhost'],
|
22
|
-
:username => amqp['username'], :password => amqp['password']
|
24
|
+
:username => amqp['username'], :password => amqp['password'], :ssl => {
|
25
|
+
:cert_chain_file => amqp['ssl']['cert_chain'],
|
26
|
+
:private_key_file => amqp['ssl']['private_key']
|
27
|
+
},
|
28
|
+
:on_tcp_connection_failure => Proc.new { |settings|
|
29
|
+
puts "TCP Connection failure; details:\n\n#{settings.inspect}\n\n"; exit 1
|
30
|
+
},
|
31
|
+
:on_possible_authentication_failure => Proc.new { |settings|
|
32
|
+
puts "Authentication failure, I'm afraid:\n\n#{settings.inspect}\n\n"; exit 1
|
33
|
+
}) do |connection|
|
23
34
|
@logger.info "Traut #{Traut::VERSION} started"
|
24
35
|
channel = AMQP::Channel.new(connection)
|
25
36
|
exchange = channel.topic(amqp['exchange'] || 'traut')
|
data/lib/traut/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: amqp
|
16
|
-
requirement: &
|
16
|
+
requirement: &83468870 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.9.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *83468870
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: systemu
|
27
|
-
requirement: &
|
27
|
+
requirement: &83467490 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.4'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *83467490
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: json
|
38
|
-
requirement: &
|
38
|
+
requirement: &83466860 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 1.6.5
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *83466860
|
47
47
|
description: Unix cron is a venerable program that turns the passage of time into
|
48
48
|
program invokation. Traut does the same, but using AMQP events to trigger execution.
|
49
49
|
AMQP message payloads are written to the stdin of invoked commands.
|
@@ -94,3 +94,4 @@ signing_key:
|
|
94
94
|
specification_version: 3
|
95
95
|
summary: Traut is like cron for AMQP events.
|
96
96
|
test_files: []
|
97
|
+
has_rdoc:
|