rservicebus2 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rservicebus2/monitor_configure.rb +0 -6
- metadata +2 -3
- data/lib/rservicebus2/monitor/csvdir.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa48cc5be79539e2b0fc2bc70ca2bf86c7f161de
|
4
|
+
data.tar.gz: 9735a150aca1857d125135bd7c70be73a4323874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76641daf559bf300faacaf4df75ef7cca58001b14a16c69776d3718296e8279ede997ee520a428112f1ff3ef3b2bb5ea0e912ac4445ca474583d2e161b609f7b
|
7
|
+
data.tar.gz: 563ba030c27b61b6c7319de3b5ecb2471befdddf4206847f1bfd26fc25369a351f5d542fbcc9460e82bf2dd12dc12a63e634d430b994d1300bb3d83030f06bb1
|
@@ -45,12 +45,6 @@ module RServiceBus2
|
|
45
45
|
name = k.sub('RSBOB_', '')
|
46
46
|
monitor = nil
|
47
47
|
case uri.scheme
|
48
|
-
when 'csvdir'
|
49
|
-
require 'rservicebus2/monitor/csvdir'
|
50
|
-
monitor = MonitorCsvDir.new(@host, name, uri)
|
51
|
-
when 'xmldir'
|
52
|
-
require 'rservicebus2/monitor/xmldir'
|
53
|
-
monitor = MonitorXmlDir.new(@host, name, uri)
|
54
48
|
when 'dir'
|
55
49
|
require 'rservicebus2/monitor/dir'
|
56
50
|
monitor = MonitorDir.new(@host, name, uri)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rservicebus2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guy Irvine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uuidtools
|
@@ -113,7 +113,6 @@ files:
|
|
113
113
|
- lib/rservicebus2/message/subscription.rb
|
114
114
|
- lib/rservicebus2/message/verboseoutput.rb
|
115
115
|
- lib/rservicebus2/message.rb
|
116
|
-
- lib/rservicebus2/monitor/csvdir.rb
|
117
116
|
- lib/rservicebus2/monitor/dir.rb
|
118
117
|
- lib/rservicebus2/monitor/dirnotifier.rb
|
119
118
|
- lib/rservicebus2/monitor/message.rb
|
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'rservicebus2/monitor/dir'
|
2
|
-
require 'csv'
|
3
|
-
|
4
|
-
module RServiceBus2
|
5
|
-
# Pull files and pre-parse as csv
|
6
|
-
class MonitorCsvDir < MonitorDir
|
7
|
-
def check_payload_for_number_of_columns(payload)
|
8
|
-
return if @query_string_parts.nil?
|
9
|
-
return unless @query_string_parts.key?('cols')
|
10
|
-
|
11
|
-
cols = @query_string_parts['cols'][0].to_i
|
12
|
-
payload.each_with_index do |row, idx|
|
13
|
-
if row.length != cols
|
14
|
-
fail "Expected number of columns, #{cols}, Actual number of columns,
|
15
|
-
#{row.length}, on line, #{idx}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def check_send_hash
|
21
|
-
if !@query_string_parts.nil? && @query_string_parts.key?('hash')
|
22
|
-
flag = @query_string_parts['hash'][0]
|
23
|
-
return flag == 'Y'
|
24
|
-
end
|
25
|
-
|
26
|
-
false
|
27
|
-
end
|
28
|
-
|
29
|
-
def process_to_hash(p)
|
30
|
-
headline = payload.shift
|
31
|
-
payload = []
|
32
|
-
p.each do |csvline|
|
33
|
-
hash = {}
|
34
|
-
csvline.each_with_index do |v, idx|
|
35
|
-
hash[headline[idx]] = v
|
36
|
-
end
|
37
|
-
payload << hash
|
38
|
-
end
|
39
|
-
|
40
|
-
payload
|
41
|
-
end
|
42
|
-
|
43
|
-
def process_content(content)
|
44
|
-
payload = CSV.parse(content)
|
45
|
-
check_payload_for_number_of_columns(payload)
|
46
|
-
|
47
|
-
payload = process_to_hash(payload) if check_send_hash
|
48
|
-
|
49
|
-
payload
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|