rservicebus 0.1.68 → 0.1.69
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rservicebus-create +121 -0
- data/lib/rservicebus/Monitor/CsvDir.rb +1 -2
- data/lib/rservicebus/Monitor/Dir.rb +3 -2
- metadata +14 -12
@@ -0,0 +1,121 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#################################
|
4
|
+
# Contract
|
5
|
+
def contract( name )
|
6
|
+
|
7
|
+
content = %{
|
8
|
+
class First
|
9
|
+
end
|
10
|
+
|
11
|
+
}
|
12
|
+
|
13
|
+
File.write( "#{name}/Contract.rb", content )
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
#################################
|
18
|
+
# Rakefile
|
19
|
+
def rakefile( name )
|
20
|
+
|
21
|
+
content = %{
|
22
|
+
require 'rake/testtask'
|
23
|
+
|
24
|
+
Rake::TestTask.new do |t|
|
25
|
+
t.libs << 'test'
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "Run tests"
|
29
|
+
task :default => :test
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
File.write( "#{name}/Rakefile", content )
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
#################################
|
38
|
+
# Procfile
|
39
|
+
def procfile( name )
|
40
|
+
|
41
|
+
content = %{
|
42
|
+
#{name}: env APPNAME=#{name.capitalize} VERBOSE=true MAX_RETRIES=0 WORKING_DIR=$HOME_DIR rservicebus
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
File.write( "#{name}/Procfile", content )
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
#################################
|
52
|
+
# MessageHandler
|
53
|
+
def messagehandler( name )
|
54
|
+
|
55
|
+
content = %{
|
56
|
+
class MessageHandler_First
|
57
|
+
|
58
|
+
def Handle( msg )
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
}
|
65
|
+
|
66
|
+
Dir.mkdir( "#{name}/MessageHandler" )
|
67
|
+
File.write( "#{name}/MessageHandler/First.rb", content )
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
#################################
|
72
|
+
# Test
|
73
|
+
def test( name )
|
74
|
+
|
75
|
+
content = %{
|
76
|
+
require 'test/unit'
|
77
|
+
require './Contract'
|
78
|
+
require './MessageHandler/First'
|
79
|
+
|
80
|
+
|
81
|
+
class Test_MessageHandler_First<MessageHandler_First
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
class FirstTest < Test::Unit::TestCase
|
88
|
+
|
89
|
+
def setup
|
90
|
+
@handler = Test_MessageHandler_First.new
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_Basic
|
94
|
+
@handler.Handle( First.new )
|
95
|
+
|
96
|
+
assert_equal false, @handler.nil?
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
}
|
101
|
+
|
102
|
+
Dir.mkdir( "#{name}/test" )
|
103
|
+
File.write( "#{name}/test/test_First.rb", content )
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
################################################################
|
109
|
+
|
110
|
+
abort "usage: #{File.basename( $0 )} <name>" if ARGV.length != 1
|
111
|
+
|
112
|
+
#################################
|
113
|
+
name = ARGV[0].downcase
|
114
|
+
|
115
|
+
#################################
|
116
|
+
Dir.mkdir( name )
|
117
|
+
contract( name )
|
118
|
+
rakefile( name )
|
119
|
+
procfile( name )
|
120
|
+
messagehandler( name )
|
121
|
+
test( name )
|
@@ -117,7 +117,7 @@ module RServiceBus
|
|
117
117
|
content = self.ReadContentFromFile( filePath )
|
118
118
|
payload = self.ProcessContent( content )
|
119
119
|
|
120
|
-
self.send( payload, URI.parse( "file://#{filePath}"
|
120
|
+
self.send( payload, URI.parse( "file://#{filePath}" ) )
|
121
121
|
return content
|
122
122
|
end
|
123
123
|
|
@@ -142,9 +142,10 @@ module RServiceBus
|
|
142
142
|
}
|
143
143
|
end
|
144
144
|
File.unlink( filePath )
|
145
|
-
|
145
|
+
|
146
146
|
fileProcessed = fileProcessed + 1
|
147
147
|
RServiceBus.log "Processed #{fileProcessed} of #{fileList.length}."
|
148
|
+
RServiceBus.log "Allow system tick #{self.class.name}"
|
148
149
|
return if fileProcessed >= maxFilesProcessed
|
149
150
|
end
|
150
151
|
|
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.1.
|
4
|
+
version: 0.1.69
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuidtools
|
16
|
-
requirement: &
|
16
|
+
requirement: &70324608741340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70324608741340
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &70324608740900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70324608740900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: beanstalk-client
|
38
|
-
requirement: &
|
38
|
+
requirement: &70324608740480 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70324608740480
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: fluiddb
|
49
|
-
requirement: &
|
49
|
+
requirement: &70324608740060 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70324608740060
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: parse-cron
|
60
|
-
requirement: &
|
60
|
+
requirement: &70324608739640 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70324608739640
|
69
69
|
description: A Ruby interpretation of NServiceBus
|
70
70
|
email: guy@guyirvine.com
|
71
71
|
executables:
|
@@ -74,6 +74,7 @@ executables:
|
|
74
74
|
- ReturnMessagesToSourceQueue
|
75
75
|
- SendEmptyMessage
|
76
76
|
- rservicebus-transport
|
77
|
+
- rservicebus-create
|
77
78
|
extensions: []
|
78
79
|
extra_rdoc_files: []
|
79
80
|
files:
|
@@ -152,6 +153,7 @@ files:
|
|
152
153
|
- bin/ReturnMessagesToSourceQueue
|
153
154
|
- bin/rsb_ctl
|
154
155
|
- bin/rservicebus
|
156
|
+
- bin/rservicebus-create
|
155
157
|
- bin/rservicebus-init
|
156
158
|
- bin/rservicebus-transport
|
157
159
|
- bin/SendEmptyMessage
|