rservicebus 0.0.66 → 0.0.68

Sign up to get free protection for your applications and to get access to all the features.
@@ -89,7 +89,7 @@ module RServiceBus
89
89
  @maxRetries = self.getValue( "MAX_RETRIES", "5" ).to_i
90
90
  @queueTimeout = self.getValue( "QUEUE_TIMEOUT", "5" ).to_i
91
91
  @statOutputCountdown = self.getValue( "STAT_OUTPUT_COUNTDOWN", "100" ).to_i
92
- @subscriptionUri = self.getValue( "SUBSCRIPTION_URI", "marshal:///tmp/#{appName}_subscriptions.yaml" )
92
+ @subscriptionUri = self.getValue( "SUBSCRIPTION_URI", "file:///tmp/#{appName}_subscriptions.yaml" )
93
93
 
94
94
  auditQueueName = self.getValue( "AUDIT_QUEUE_NAME" )
95
95
  if auditQueueName.nil? then
@@ -13,9 +13,9 @@ module RServiceBus
13
13
  require "rservicebus/SubscriptionStorage/Redis"
14
14
  s = SubscriptionStorage_Redis.new( appName, uri )
15
15
 
16
- when "marshal"
17
- require "rservicebus/SubscriptionStorage/Marshal"
18
- s = SubscriptionStorage_Marshal.new( appName, uri )
16
+ when "file"
17
+ require "rservicebus/SubscriptionStorage/File"
18
+ s = SubscriptionStorage_File.new( appName, uri )
19
19
 
20
20
  else
21
21
  abort("Scheme, #{uri.scheme}, not recognised when configuring subscription storage, #{uri_string}");
@@ -5,7 +5,7 @@ module RServiceBus
5
5
 
6
6
  class Monitor_CsvDir<Monitor_Dir
7
7
 
8
-
8
+
9
9
  def checkPayloadForNumberOfColumns( payload )
10
10
  return if @QueryStringParts.nil?
11
11
  return unless @QueryStringParts.has_key?("cols")
@@ -18,10 +18,39 @@ module RServiceBus
18
18
  end
19
19
 
20
20
  end
21
+
22
+ def checkSendHash
23
+ if !@QueryStringParts.nil? && @QueryStringParts.has_key?("hash") then
24
+ flag = @QueryStringParts["hash"][0]
25
+ return flag == "Y"
26
+ end
27
+
28
+ return false
29
+ end
30
+
31
+
32
+ def ProcessToHash( payload )
33
+ headLine = payload.shift
34
+ newPayload = Array.new
35
+ payload.each do |csvline|
36
+ hash = Hash.new
37
+ csvline.each_with_index do |v,idx|
38
+ hash[headLine[idx]] = v
39
+ end
40
+ newPayload << hash
41
+ end
42
+
43
+ return newPayload
44
+ end
21
45
 
22
46
  def ProcessContent( content )
23
47
  payload = CSV.parse( content )
24
48
  self.checkPayloadForNumberOfColumns( payload )
49
+
50
+ if self.checkSendHash then
51
+ payload = self.ProcessToHash( payload )
52
+ end
53
+
25
54
  return payload
26
55
  end
27
56
 
@@ -1,7 +1,7 @@
1
1
  module RServiceBus
2
2
 
3
3
  #Implementation of Subscription Storage to Redis
4
- class SubscriptionStorage_Marshal<SubscriptionStorage
4
+ class SubscriptionStorage_File<SubscriptionStorage
5
5
 
6
6
  @path
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rservicebus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.66
4
+ version: 0.0.68
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-13 00:00:00.000000000 Z
12
+ date: 2013-05-14 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A Ruby interpretation of NServiceBus
15
15
  email: guy@guyirvine.com
@@ -59,7 +59,7 @@ files:
59
59
  - lib/rservicebus/Saga.rb
60
60
  - lib/rservicebus/Stats.rb
61
61
  - lib/rservicebus/SubscriptionManager.rb
62
- - lib/rservicebus/SubscriptionStorage/Marshal.rb
62
+ - lib/rservicebus/SubscriptionStorage/File.rb
63
63
  - lib/rservicebus/SubscriptionStorage/Redis.rb
64
64
  - lib/rservicebus/SubscriptionStorage.rb
65
65
  - lib/rservicebus/Test/Bus.rb