pushyd 0.2.0 → 0.2.2
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/bin/pushyd +6 -6
- data/lib/pushyd/endpoint.rb +2 -2
- data/lib/pushyd/proxy.rb +2 -2
- data/lib/pushyd/shouter.rb +4 -4
- data/lib/pushyd.rb +1 -1
- data/pushyd.gemspec +1 -1
- metadata +2 -2
- /data/lib/pushyd/{config.rb → conf.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1917e117ce7a5a5b12ba2af39cffd2c40c3e09ac
|
4
|
+
data.tar.gz: d5b334b8b2a3cb38c453ff7fa81fd2ad47806624
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cda75054f168c1e27c1e9c53f58238a3000dae52bd2a76b86371c06f87f3cd1fb7ecfbfa5bb1d67d41b87336819479b7c46b3d542d942fb4db273f9da757f546
|
7
|
+
data.tar.gz: 3ddf68fb9dd3e9d4e9f5a09f5c2a62110a465b4ff05d0d12c53a3e092ebe33da1d7e6ab582e533f98b9da1540307c8919d57ecbde524505944d42ed61c098b98
|
data/Gemfile.lock
CHANGED
data/bin/pushyd
CHANGED
@@ -31,15 +31,15 @@ begin
|
|
31
31
|
end.order!(ARGV)
|
32
32
|
|
33
33
|
# Build Chamber-based configuration from Gemspec with initial context
|
34
|
-
|
34
|
+
Conf.prepare root: APP_ROOT, gemspec: "pushyd", env: cmd_env, config: cmd_config
|
35
35
|
|
36
36
|
# Display final configuration
|
37
|
-
puts "--- #{
|
38
|
-
puts "Environment \t #{
|
39
|
-
puts "Config files \t #{
|
37
|
+
puts "--- #{Conf.name} #{Conf.version}"
|
38
|
+
puts "Environment \t #{Conf.env}"
|
39
|
+
puts "Config files \t #{Conf.files}"
|
40
40
|
puts
|
41
|
-
puts "Log file \t #{
|
42
|
-
puts
|
41
|
+
puts "Log file \t #{Conf[:log]}"
|
42
|
+
puts Conf.dump if cmd_dump
|
43
43
|
|
44
44
|
rescue OptionParser::InvalidOption => e
|
45
45
|
abort "EXITING: option parser: #{e.message}"
|
data/lib/pushyd/endpoint.rb
CHANGED
@@ -12,7 +12,7 @@ module PushyDaemon
|
|
12
12
|
|
13
13
|
def initialize
|
14
14
|
# Prepare logger (may be NIL > won't output anything)
|
15
|
-
logfile =
|
15
|
+
logfile = Conf[:log]
|
16
16
|
|
17
17
|
# Create the logger
|
18
18
|
@logger = PushyLogger.new(logfile, LOG_ROTATION)
|
@@ -95,7 +95,7 @@ module PushyDaemon
|
|
95
95
|
rule_name = rule[:name].to_s
|
96
96
|
rule_topic = rule[:topic].to_s
|
97
97
|
rule_routes = rule[:routes].to_s.split(' ')
|
98
|
-
rule_queue = "#{
|
98
|
+
rule_queue = "#{Conf.name}-#{PROXY_SCOPE}-#{rule[:name]}"
|
99
99
|
raise PushyDaemon::EndpointSubscribeContext, "rule [#{rule_name}] lacking topic" unless rule_topic
|
100
100
|
raise PushyDaemon::EndpointSubscribeContext, "rule [#{rule_name}] lacking routes" if rule_routes.empty?
|
101
101
|
|
data/lib/pushyd/proxy.rb
CHANGED
@@ -23,12 +23,12 @@ module PushyDaemon
|
|
23
23
|
@table.align_column(5, :right)
|
24
24
|
|
25
25
|
# Start connexion to RabbitMQ and create channel
|
26
|
-
conn = connect
|
26
|
+
conn = connect Conf.bus
|
27
27
|
@channel = conn.create_channel
|
28
28
|
info "connected on a channel"
|
29
29
|
|
30
30
|
# Check config
|
31
|
-
config_rules =
|
31
|
+
config_rules = Conf[:rules]
|
32
32
|
unless (config_rules.is_a? Enumerable) && !config_rules.empty?
|
33
33
|
error "prepare: empty [rules] section"
|
34
34
|
end
|
data/lib/pushyd/shouter.rb
CHANGED
@@ -19,12 +19,12 @@ module PushyDaemon
|
|
19
19
|
@keys = []
|
20
20
|
|
21
21
|
# Start connexion to RabbitMQ and create channel
|
22
|
-
conn = connect
|
22
|
+
conn = connect Conf.bus
|
23
23
|
@channel = conn.create_channel
|
24
24
|
info "connected on a channel"
|
25
25
|
|
26
26
|
# Check config
|
27
|
-
config_shout =
|
27
|
+
config_shout = Conf[:shout]
|
28
28
|
if (config_shout.is_a? Enumerable) && !config_shout.empty?
|
29
29
|
@keys = config_shout[:keys] if config_shout[:keys].is_a? Array
|
30
30
|
@topic = config_shout[:topic]
|
@@ -75,7 +75,7 @@ module PushyDaemon
|
|
75
75
|
# Add timestamp
|
76
76
|
headers = {
|
77
77
|
sent_at: DateTime.now.iso8601,
|
78
|
-
sent_by:
|
78
|
+
sent_by: Conf.name
|
79
79
|
}
|
80
80
|
exchange_name = @exchange.name
|
81
81
|
|
@@ -89,7 +89,7 @@ module PushyDaemon
|
|
89
89
|
@exchange.publish(body.to_json,
|
90
90
|
routing_key: routing_key,
|
91
91
|
headers: headers,
|
92
|
-
app_id:
|
92
|
+
app_id: Conf.name,
|
93
93
|
content_type: "application/json",
|
94
94
|
)
|
95
95
|
|
data/lib/pushyd.rb
CHANGED
data/pushyd.gemspec
CHANGED
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.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
@@ -179,7 +179,7 @@ files:
|
|
179
179
|
- bin/pushyd
|
180
180
|
- defaults.yml
|
181
181
|
- lib/pushyd.rb
|
182
|
-
- lib/pushyd/
|
182
|
+
- lib/pushyd/conf.rb
|
183
183
|
- lib/pushyd/constants.rb
|
184
184
|
- lib/pushyd/daemon.rb
|
185
185
|
- lib/pushyd/endpoint.rb
|
File without changes
|