pushyd 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c164022741e67725c4df7becef21483e55a6859
4
- data.tar.gz: 613a5d94c098c12f4f39e023ddd163712a8581c3
3
+ metadata.gz: 8cb8408ab24d4a66d50b11e7c4f54e752759f9be
4
+ data.tar.gz: 23b2ee2ca006cd53c66f3dbb66d8b5b196450893
5
5
  SHA512:
6
- metadata.gz: 228e4f772c5f5d6541e426d288b5e29b7f32382897d058511b229ffdb7e058325cd303e35eb62f88c0b94c3726c01b41683fc588047d61a841cb332f068ab541
7
- data.tar.gz: a659b7425f0ff0a5859582ceb28a37156be0befe66d2e14f35e6b8d648209607ebd73832944b05840852a6a7cc320bed3adfece419fce586961db9ccd1e4e430
6
+ metadata.gz: c8788397bfe8f4d047d77c1f322d1dd1af05e0a8b15df9af83b08e123fb4d9d9324a7c1ab22a7e4667b29c50f06db3e5329632f14e4f96e797ade6ac28177271
7
+ data.tar.gz: 28d9b7d5d04dae4d987f8c5a623873e360d483bc4dc7897eecd7d49a4126c36f448c2b89b7b0b31a056688901af846029630d3e5956f261ddf8b431fe908e384
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pushyd (0.5.2)
4
+ pushyd (0.5.3)
5
5
  bunny (~> 2.3)
6
6
  chamber (~> 2.9)
7
7
  daemons
data/lib/pushyd/conf.rb CHANGED
@@ -113,7 +113,7 @@ protected
113
113
 
114
114
  def self.prepare_newrelic section, logfile
115
115
  # Disable NewRelic if no config present
116
- unless section.is_a?(Hash)
116
+ unless section.is_a?(Hash) && section[:licence]
117
117
  ENV["NEWRELIC_AGENT_ENABLED"] = "false"
118
118
  return
119
119
  end
@@ -11,8 +11,7 @@ PROXY_USE_ACK = false
11
11
  LOG_ROTATION = "daily"
12
12
  LOG_TRIM_LINE = 200
13
13
  LOG_FORMAT_TIME = "%Y-%m-%d %H:%M:%S"
14
- LOG_FORMAT_HEADER = "%s %d\t%-8s %-15s "
15
-
16
- LOG_FORMAT_ARRAY = " %s"
17
- LOG_FORMAT_HASH = " %-15s %s\n"
14
+ LOG_FORMAT_HEADER = "%s \t%d\t%-8s %-15s "
15
+ LOG_FORMAT_ARRAY = "%s %s"
16
+ LOG_FORMAT_HASH = "%s %-15s %s\n"
18
17
 
@@ -63,19 +63,17 @@ module PushyDaemon
63
63
  end
64
64
  end
65
65
 
66
+ def debug messages
67
+ @logger.debug messages
68
+ end
66
69
  def info message, lines = []
67
70
  @logger.info message
68
71
  debug_lines lines
69
72
  end
70
-
71
73
  def error messages
72
74
  @logger.error messages
73
75
  end
74
76
 
75
- def debug messages
76
- @logger.debug messages
77
- end
78
-
79
77
  def log_message msg_way, msg_exchange, msg_key, msg_body = [], msg_attrs = {}
80
78
  # Message header
81
79
  @logger.info sprintf("%3s %-15s %s", msg_way, msg_exchange, msg_key)
@@ -127,7 +125,7 @@ module PushyDaemon
127
125
  rule_name = rule[:name].to_s
128
126
  rule_topic = rule[:topic].to_s
129
127
  rule_routes = rule[:routes].to_s.split(' ')
130
- rule_queue = "#{Conf.name}-#{rule[:name]}"
128
+ rule_queue = "#{Conf.app_name}-#{rule[:name]}"
131
129
  fail PushyDaemon::EndpointSubscribeContext, "rule [#{rule_name}] lacking topic" unless rule_topic
132
130
  fail PushyDaemon::EndpointSubscribeContext, "rule [#{rule_name}] lacking routes" if rule_routes.empty?
133
131
 
@@ -168,11 +166,11 @@ module PushyDaemon
168
166
 
169
167
  private
170
168
 
171
- def debug_lines lines
169
+ def debug_lines lines, prefix = ''
172
170
  if lines.is_a? Array
173
- @logger.debug lines.map{ |line| sprintf(LOG_FORMAT_ARRAY, line) }
171
+ @logger.debug lines.map{ |line| sprintf(LOG_FORMAT_ARRAY, prefix, line) }
174
172
  elsif lines.is_a? Hash
175
- @logger.debug lines.map{ |key, value| sprintf(LOG_FORMAT_HASH, key, value) }
173
+ @logger.debug lines.map{ |key, value| sprintf(LOG_FORMAT_HASH, prefix, key, value) }
176
174
  end
177
175
  end
178
176
 
@@ -69,7 +69,7 @@ module PushyDaemon
69
69
  # Prepare headers
70
70
  headers = {
71
71
  sent_at: DateTime.now.iso8601,
72
- sent_by: Conf.name,
72
+ sent_by: Conf.app_name,
73
73
  }
74
74
 
75
75
  # Prepare exchange_name and routing_key
@@ -83,7 +83,7 @@ module PushyDaemon
83
83
  @exchange.publish(body.to_json,
84
84
  routing_key: routing_key,
85
85
  headers: headers,
86
- app_id: Conf.name,
86
+ app_id: Conf.app_name,
87
87
  content_type: "application/json",
88
88
  )
89
89
  end
data/pushyd.gemspec CHANGED
@@ -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.2"
4
+ spec.version = "0.5.3"
5
5
 
6
6
  # Project description
7
7
  spec.name = "pushyd"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushyd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler