pushyd 0.5.0 → 0.5.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2afb6ffc0b508f3e4f2a04bd947ec1a9e52833d1
4
- data.tar.gz: 000db1acc65e2be1a87e0351b4aba6578aa7ac55
3
+ metadata.gz: f4d99244c44f7f99042eb496abe4831847dff1dc
4
+ data.tar.gz: 24c424c9b17278722785b0cabc84c3876df550ba
5
5
  SHA512:
6
- metadata.gz: 1efc1420e8d39d6df4a375239b9400cc9b868752cf9dc6549f75d0041607bcf25e65c251ea888a2adb8a35b35dfbedae182a6a1ac160fefae655bc0f6b8348a2
7
- data.tar.gz: f5d231791ae1526e7e852c1f13c74457446961aa2d7610e62fa5273d797bfca52129a6d7fdc6b91c45bfb90a2f8b8c4e1723ae9f0be4b4ef510714e59faf9a06
6
+ metadata.gz: 4600f69fc437189494e35dc3d762d0f3875cee5b50531864d67db2faefb54fe9087f934e2c8b757866fad562dd03be041c31d979705b81168fb115cf8e07bf68
7
+ data.tar.gz: eb7f68cbb2fc3ab2ecec2fbcd3cc6663d0879f60b8c421cc769e328d2ffc059e8b6e3a2f25aa5b14d6d5794dcc9999dec636f70566eb3fd7d8dde9af172bef0a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pushyd (0.5.0)
4
+ pushyd (0.5.1)
5
5
  bunny (~> 2.3)
6
6
  chamber (~> 2.9)
7
7
  daemons
data/bin/pushyd CHANGED
@@ -48,10 +48,10 @@ end
48
48
 
49
49
  # Display final configuration, quit if config dump requested
50
50
  puts "--- #{Conf.app_name} #{Conf.app_ver}"
51
- puts "Environment \t #{Conf.app_env}"
52
- puts "Config files \t #{Conf.files}"
53
- puts "Started at \t #{Conf.app_started}"
54
- puts "Loging to file \t #{Conf[:log][:file]}" if Conf[:log].is_a? Enumerable
51
+ puts "Environment #{Conf.app_env}"
52
+ puts "Config files #{Conf.files}"
53
+ puts "Started at #{Conf.app_started}"
54
+ puts "Loging to file #{Conf[:log][:file]}" if Conf[:log].is_a? Enumerable
55
55
  puts
56
56
  puts Conf.dump
57
57
 
@@ -1,13 +1,13 @@
1
1
  # common defaults
2
- flag: 0
3
2
  bus:
4
3
  host: localhost
5
4
  port: 5672
6
5
  user: guest
7
6
  pass: guest
8
7
 
9
- log:
8
+ logs:
10
9
  file: null
10
+ newrelic: null
11
11
  level: debug
12
12
 
13
13
  shout:
@@ -25,8 +25,6 @@ class Conf
25
25
  attr_reader :spec
26
26
  attr_reader :files
27
27
  attr_reader :host
28
- attr_reader :pidfile
29
-
30
28
  end
31
29
 
32
30
  def self.init app_root = nil
@@ -67,9 +65,6 @@ class Conf
67
65
  # Init New Relic
68
66
  prepare_newrelic self[:newrelic], self.at(:logs, :newrelic)
69
67
 
70
- # Prepare PID file is not present
71
- prepare_pidfile
72
-
73
68
  # Try to access any key to force parsing of the files
74
69
  self[:dummy]
75
70
 
@@ -114,8 +109,8 @@ protected
114
109
  @files << File.expand_path(path) if path
115
110
  end
116
111
 
117
- def self.prepare_pidfile
118
- self[:pidfile] ||= "/tmp/#{@app_name}-#{@host}-#{self[:port]}.pid"
112
+ def self.get_pidfile
113
+ self[:pidfile] || "/tmp/#{@app_name}-#{@host}-#{self[:port]}.pid"
119
114
  end
120
115
 
121
116
  def self.prepare_newrelic section, logfile
@@ -11,7 +11,7 @@ module PushyDaemon
11
11
 
12
12
  def initialize
13
13
  # Prepare logger
14
- init_logger Conf[:log]
14
+ init_logger Conf[:logs]
15
15
 
16
16
  # Done
17
17
  info "endpoint initialized"
@@ -27,7 +27,11 @@ module PushyDaemon
27
27
  protected
28
28
 
29
29
  def init_logger logconf
30
+ # Check structure conformity or set it to an empty hash
31
+ logconf = {} unless logconf.is_a? Hash
32
+
30
33
  # Extract context
34
+ logconf ||= {}
31
35
  logfile = logconf[:file]
32
36
  loglevel = logconf[:level]
33
37
  me = self.class.name
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  # Project version
4
- spec.version = "0.5.0"
4
+ spec.version = "0.5.1"
5
5
 
6
6
  # Project description
7
7
  spec.name = "pushyd"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushyd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI