zas-service 0.1.0 → 0.2.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.
@@ -29,8 +29,8 @@ module Zas
29
29
  def initialize(config=ServiceConfiguration.new)
30
30
  self.host = config.host
31
31
  self.port = config.port
32
+ self.logger = config.logger
32
33
  self.context = ZMQ::Context.new
33
- self.logger = Syslogger.new(config.name, Syslog::LOG_PID, Syslog::LOG_LOCAL0)
34
34
  end
35
35
 
36
36
  # Public: Run the service. This method will block while awaiting incoming requests. The service
@@ -4,7 +4,7 @@ module Zas
4
4
  # host - The host to listen to requests on. May be "*" or an IP address.
5
5
  # port - The port number to listen to requests on.
6
6
  # name - The name of the service for logging.
7
- class ServiceConfiguration < Struct.new(:host, :port, :name)
7
+ class ServiceConfiguration < Struct.new(:host, :port, :name, :logger)
8
8
  def initialize(attributes={})
9
9
  attributes.each do |k, v|
10
10
  self[k] = v
@@ -19,5 +19,8 @@ module Zas
19
19
  def name
20
20
  self[:name] || 'zas-service'
21
21
  end
22
+ def logger
23
+ self[:logger] || Syslogger.new(name, Syslog::LOG_PID, Syslog::LOG_LOCAL0)
24
+ end
22
25
  end
23
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zas-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
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: 2012-04-27 00:00:00.000000000 Z
12
+ date: 2012-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: zmq