rservicebus2 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rservicebus2/handler_manager.rb +2 -1
- data/lib/rservicebus2/monitor/dir.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 310f4095a8d5bdac9dc5e3289363045830b560ad
|
4
|
+
data.tar.gz: f949d25fe99b66b5936318a5ff7f9aa3ecdcf930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d08c6901b48c52854c11e339c1d247bc756685fe6e36940c5611f16f16facf431916c339ed7398a76bad9967038d106562a9cf970fbc5f7b448ece37c09b152
|
7
|
+
data.tar.gz: 8eac73140ba49a7a6c07a8a2cd53522d082deb0c1aa2381bdde3284f06d815aacc6c75fffa662e728e9bd6ac3f15143974d35276e106690ec9f7924684c92585
|
@@ -66,7 +66,8 @@ module RServiceBus2
|
|
66
66
|
self
|
67
67
|
end
|
68
68
|
|
69
|
-
def add_handler(
|
69
|
+
def add_handler(lc_msg_name, handler)
|
70
|
+
msg_name = lc_msg_name.gsub(/(?<=_|^)(\w)/){$1.upcase}.gsub(/(?:_)(\w)/,'\1')
|
70
71
|
@handler_list[msg_name] = [] if @handler_list[msg_name].nil?
|
71
72
|
return unless @handler_list[msg_name].index{ |x| x.class.name == handler.class.name }.nil?
|
72
73
|
|
@@ -4,6 +4,7 @@ require 'zlib'
|
|
4
4
|
|
5
5
|
module RServiceBus2
|
6
6
|
# Monitor Directory for files
|
7
|
+
# rubocop:disable Metrics/ClassLength
|
7
8
|
class MonitorDir < Monitor
|
8
9
|
def connect(uri)
|
9
10
|
# Pass the path through the Dir object to check syntax on startup
|
@@ -81,6 +82,7 @@ module RServiceBus2
|
|
81
82
|
gz.read
|
82
83
|
end
|
83
84
|
|
85
|
+
# rubocop:disable Metrics/MethodLength
|
84
86
|
def read_content_from_file(file_path)
|
85
87
|
content = ''
|
86
88
|
if @input_filter.length > 0
|
@@ -113,6 +115,10 @@ module RServiceBus2
|
|
113
115
|
|
114
116
|
file_list = Dir.glob("#{@path}/*")
|
115
117
|
file_list.each do |file_path|
|
118
|
+
if File.file?(file_path) != true
|
119
|
+
RServiceBus2.log "Skipping directory, #{file_path}"
|
120
|
+
next
|
121
|
+
end
|
116
122
|
RServiceBus2.log "Ready to process, #{file_path}"
|
117
123
|
content = process_path(file_path)
|
118
124
|
|