gorgon 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +7 -7
- data/README.md +3 -2
- data/lib/gorgon/callback_handler.rb +4 -0
- data/lib/gorgon/settings/rails_project_files_content.rb +19 -4
- data/lib/gorgon/version.rb +1 -1
- data/lib/gorgon/worker_manager.rb +1 -0
- data/spec/callback_handler_spec.rb +18 -1
- metadata +8 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gorgon (0.4.
|
4
|
+
gorgon (0.4.3)
|
5
5
|
amqp (~> 0.9.7)
|
6
6
|
awesome_print
|
7
7
|
bunny (~> 0.8.0)
|
@@ -14,12 +14,12 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: http://rubygems.org/
|
16
16
|
specs:
|
17
|
-
amq-client (0.9.
|
18
|
-
amq-protocol (>= 0.
|
17
|
+
amq-client (0.9.11)
|
18
|
+
amq-protocol (>= 1.0.1)
|
19
19
|
eventmachine
|
20
|
-
amq-protocol (
|
21
|
-
amqp (0.9.
|
22
|
-
amq-client (~> 0.9.
|
20
|
+
amq-protocol (1.1.0)
|
21
|
+
amqp (0.9.8)
|
22
|
+
amq-client (~> 0.9.5)
|
23
23
|
amq-protocol (>= 0.9.4)
|
24
24
|
eventmachine
|
25
25
|
awesome_print (1.1.0)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
rspec-expectations (2.11.3)
|
38
38
|
diff-lcs (~> 1.1.3)
|
39
39
|
rspec-mocks (2.11.3)
|
40
|
-
ruby-progressbar (1.0.
|
40
|
+
ruby-progressbar (1.0.2)
|
41
41
|
test-unit (2.5.2)
|
42
42
|
uuidtools (2.1.3)
|
43
43
|
yajl-ruby (1.1.0)
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ remote_test: &remote_test
|
|
23
23
|
min_messages: warning
|
24
24
|
```
|
25
25
|
|
26
|
-
Where `<<: *defaults` are the default values used in _database.yml_, like for example, adapter, username, password, and host. Replace
|
26
|
+
Where `<<: *defaults` are the default values used in _database.yml_, like for example, adapter, username, password, and host. Replace `<my-app>` with a name to identify this application's dbs
|
27
27
|
|
28
28
|
Installing listener as a Daemon process (Ubuntu 9.10 or later)
|
29
29
|
----------------------------------------------------------------
|
@@ -40,6 +40,7 @@ Also note that these steps are **not** meant to work on every project, they will
|
|
40
40
|
* gorgon.json
|
41
41
|
* test/gorgon_callbacks/after\_sync.rb
|
42
42
|
* test/gorgon_callbacks/before\_creating\_workers.rb
|
43
|
+
* test/gorgon_callbacks/after\_creating\_workers.rb
|
43
44
|
* test/gorgon_callbacks/before\_start.rb
|
44
45
|
* test/gorgon_callbacks/after\_complete.rb
|
45
46
|
* ~/.gorgon/gorgon_listener.json
|
@@ -94,4 +95,4 @@ Gorgon is maintained by:
|
|
94
95
|
* Victor Savkin
|
95
96
|
|
96
97
|
Gorgon is funded by [Nulogy Corp](http://www.nulogy.com/).
|
97
|
-
Thank you to all the [contributors](/Fitzsimmons/Gorgon/graphs/contributors).
|
98
|
+
Thank you to all the [contributors](/Fitzsimmons/Gorgon/graphs/contributors).
|
@@ -18,6 +18,8 @@ module Settings
|
|
18
18
|
content: after_sync_content},
|
19
19
|
{name: :before_creating_workers, file_name: "before_creating_workers.rb",
|
20
20
|
content: before_creating_workers_content},
|
21
|
+
{name: :after_creating_workers, file_name: "after_creating_workers.rb",
|
22
|
+
content: after_creating_workers_content},
|
21
23
|
{name: :before_start, file_name: "before_start.rb",
|
22
24
|
content: before_start_content},
|
23
25
|
{name: :after_complete, file_name: "after_complete.rb",
|
@@ -56,10 +58,23 @@ CONTENT
|
|
56
58
|
end
|
57
59
|
|
58
60
|
def before_creating_workers_content
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
<<-CONTENT
|
62
|
+
ENV["TEST_ENV_NUMBER"] = Process.pid.to_s
|
63
|
+
ENV["RAILS_ENV"] = 'remote_test'
|
64
|
+
|
65
|
+
pid, stdin, stdout, stderr = Open4::popen4 "TEST_ENV_NUMBER=#{Process.pid.to_s} RAILS_ENV='remote_test' bundle exec rake db:setup"
|
66
|
+
ignore, status = Process.waitpid2 pid
|
67
|
+
|
68
|
+
if status.exitstatus != 0
|
69
|
+
raise "ERROR: 'rake db:setup' failed.\n#{stderr.read}\n#{stdout.read}"
|
70
|
+
end
|
71
|
+
|
72
|
+
require File.expand_path('../../test_helper', __FILE__)
|
73
|
+
CONTENT
|
74
|
+
end
|
75
|
+
|
76
|
+
def after_creating_workers_content
|
77
|
+
after_complete_content
|
63
78
|
end
|
64
79
|
|
65
80
|
def before_start_content
|
data/lib/gorgon/version.rb
CHANGED
@@ -7,7 +7,8 @@ describe CallbackHandler do
|
|
7
7
|
:before_start => "some/file.rb",
|
8
8
|
:after_complete => "some/other/file.rb",
|
9
9
|
:before_creating_workers => "callbacks/before_creating_workers_file.rb",
|
10
|
-
:after_sync => "callbacks/after_sync_file.rb"
|
10
|
+
:after_sync => "callbacks/after_sync_file.rb",
|
11
|
+
:after_creating_workers => "callbacks/after_creating_workers.rb"
|
11
12
|
}
|
12
13
|
}
|
13
14
|
|
@@ -74,4 +75,20 @@ describe CallbackHandler do
|
|
74
75
|
|
75
76
|
handler.after_sync
|
76
77
|
end
|
78
|
+
|
79
|
+
it "calls the after creating workers hook" do
|
80
|
+
handler = CallbackHandler.new(config)
|
81
|
+
|
82
|
+
handler.should_receive(:load).with("callbacks/after_creating_workers.rb")
|
83
|
+
|
84
|
+
handler.after_creating_workers
|
85
|
+
end
|
86
|
+
|
87
|
+
it "does not attempt to load the after creating workers hook when after_creating_workers is not defined" do
|
88
|
+
handler = CallbackHandler.new({})
|
89
|
+
|
90
|
+
handler.should_not_receive(:load)
|
91
|
+
|
92
|
+
handler.after_creating_workers
|
93
|
+
end
|
77
94
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorgon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2013-02-08 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rake
|
@@ -281,12 +281,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
281
281
|
- - ! '>='
|
282
282
|
- !ruby/object:Gem::Version
|
283
283
|
version: '0'
|
284
|
+
segments:
|
285
|
+
- 0
|
286
|
+
hash: 266955656043169930
|
284
287
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
285
288
|
none: false
|
286
289
|
requirements:
|
287
290
|
- - ! '>='
|
288
291
|
- !ruby/object:Gem::Version
|
289
292
|
version: '0'
|
293
|
+
segments:
|
294
|
+
- 0
|
295
|
+
hash: 266955656043169930
|
290
296
|
requirements: []
|
291
297
|
rubyforge_project: gorgon
|
292
298
|
rubygems_version: 1.8.24
|