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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/pushyd/conf.rb +1 -1
- data/lib/pushyd/constants.rb +3 -4
- data/lib/pushyd/endpoint.rb +7 -9
- data/lib/pushyd/shouter.rb +2 -2
- data/pushyd.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cb8408ab24d4a66d50b11e7c4f54e752759f9be
|
4
|
+
data.tar.gz: 23b2ee2ca006cd53c66f3dbb66d8b5b196450893
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8788397bfe8f4d047d77c1f322d1dd1af05e0a8b15df9af83b08e123fb4d9d9324a7c1ab22a7e4667b29c50f06db3e5329632f14e4f96e797ade6ac28177271
|
7
|
+
data.tar.gz: 28d9b7d5d04dae4d987f8c5a623873e360d483bc4dc7897eecd7d49a4126c36f448c2b89b7b0b31a056688901af846029630d3e5956f261ddf8b431fe908e384
|
data/Gemfile.lock
CHANGED
data/lib/pushyd/conf.rb
CHANGED
data/lib/pushyd/constants.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/pushyd/endpoint.rb
CHANGED
@@ -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.
|
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
|
|
data/lib/pushyd/shouter.rb
CHANGED
@@ -69,7 +69,7 @@ module PushyDaemon
|
|
69
69
|
# Prepare headers
|
70
70
|
headers = {
|
71
71
|
sent_at: DateTime.now.iso8601,
|
72
|
-
sent_by: Conf.
|
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.
|
86
|
+
app_id: Conf.app_name,
|
87
87
|
content_type: "application/json",
|
88
88
|
)
|
89
89
|
end
|
data/pushyd.gemspec
CHANGED
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.
|
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-
|
11
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|