traut 0.2.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,13 @@
1
1
  amqp:
2
2
  host: localhost
3
- port: 5672
3
+ port: 5671
4
4
  vhost: '/'
5
5
  username: 'guest'
6
6
  password: 'guest'
7
7
  exchange: 'traut'
8
- queue: ''
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/'
@@ -14,7 +14,8 @@ module Traut
14
14
  {
15
15
  'config' => './traut.conf',
16
16
  'logdir' => './logs/',
17
- 'debug' => true
17
+ 'debug' => true,
18
+ 'ssl' => {}
18
19
  }
19
20
  end
20
21
  end
@@ -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
- ## NOTE: Have to start AMQP connection out here.
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']) do |connection|
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')
@@ -1,3 +1,3 @@
1
1
  module Traut
2
- VERSION = "0.2.4"
2
+ VERSION = "1.0.0"
3
3
  end
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.2.4
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-01-26 00:00:00.000000000 Z
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: &77334250 !ruby/object:Gem::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: *77334250
24
+ version_requirements: *83468870
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: systemu
27
- requirement: &77333980 !ruby/object:Gem::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: *77333980
35
+ version_requirements: *83467490
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: json
38
- requirement: &77333650 !ruby/object:Gem::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: *77333650
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: