daemon-kit 0.2.3 → 0.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/.travis.yml +15 -0
- data/Gemfile +1 -1
- data/History.txt +4 -0
- data/{README.rdoc → README.md} +43 -34
- data/Rakefile +1 -1
- data/bin/daemon-kit +4 -0
- data/daemon-kit.gemspec +6 -6
- data/features/amqp_generator.feature +27 -0
- data/features/app_generator.feature +46 -0
- data/features/capistrano_generator.feature +30 -0
- data/features/cron_generator.feature +26 -0
- data/features/ruote_generator.feature +27 -0
- data/features/sqs_generator.feature +21 -0
- data/features/step_definitions/daemon_steps.rb +10 -0
- data/features/support/env.rb +8 -0
- data/features/test_unit_generator.feature +18 -0
- data/lib/daemon_kit.rb +0 -1
- data/lib/daemon_kit/generators.rb +0 -1
- data/lib/daemon_kit/version.rb +1 -1
- data/lib/generators/daemon_kit/amqp/amqp_generator.rb +1 -1
- data/lib/generators/daemon_kit/app/app_generator.rb +1 -3
- data/lib/generators/daemon_kit/app/templates/script/destroy +1 -1
- data/lib/generators/daemon_kit/capistrano/capistrano_generator.rb +1 -1
- data/lib/generators/daemon_kit/cron/cron_generator.rb +1 -1
- data/lib/generators/daemon_kit/rspec/templates/spec/%app_name%_spec.rb +3 -3
- data/lib/generators/daemon_kit/ruote/ruote_generator.rb +4 -2
- data/lib/generators/daemon_kit/sqs/sqs_generator.rb +1 -1
- data/spec/abstract_logger_spec.rb +3 -3
- data/spec/spec_helper.rb +17 -9
- data/tasks/cucumber.rake +4 -11
- metadata +69 -82
- data/lib/daemon_kit/nanite.rb +0 -7
- data/lib/daemon_kit/nanite/agent.rb +0 -77
- data/lib/generators/daemon_kit/nanite_agent/USAGE +0 -5
- data/lib/generators/daemon_kit/nanite_agent/nanite_agent_generator.rb +0 -29
- data/lib/generators/daemon_kit/nanite_agent/templates/config/nanite.yml +0 -35
- data/lib/generators/daemon_kit/nanite_agent/templates/config/pre-daemonize/nanite_agent.rb +0 -6
- data/lib/generators/daemon_kit/nanite_agent/templates/lib/actors/sample.rb +0 -11
- data/lib/generators/daemon_kit/nanite_agent/templates/libexec/%app_name%-daemon.rb +0 -31
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -71
- data/tasks/tests.rake +0 -6
- data/test/test_amqp_generator.rb +0 -48
- data/test/test_cron_generator.rb +0 -45
- data/test/test_daemon-kit_generator.rb +0 -84
- data/test/test_daemon_kit_config.rb +0 -28
- data/test/test_deploy_capistrano_generator.rb +0 -48
- data/test/test_generator_helper.rb +0 -29
- data/test/test_helper.rb +0 -7
- data/test/test_nanite_agent_generator.rb +0 -49
- data/test/test_ruote_generator.rb +0 -51
- data/test/test_sqs_generator.rb +0 -48
- data/test/test_test_unit_generator.rb +0 -46
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YTkzN2E2MjJiYmYzZTFmZWQ4YWRkZTFjMTk3OGY3NDY1OGJjOGVlODgwNDZj
|
10
|
-
OTNkMzBiYTIwYzg4MzQ1YzE3M2EzMmMxNmY0MmM5NzA4MjJhMmM1M2FlNDcy
|
11
|
-
NzM3N2ZmNGY0MGJlYzYzMjAzMjYxNjhlMWUxZDRmM2E4YTM2ZDk=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
M2ZiZWQzYjU5ZmQ1Y2YxMjdkNDFmYWVjNzQ5ZDkzNTY1M2U5ZDNiYWNhYjRl
|
14
|
-
YzI1YmY1MjBhYTQyMGJiMGY1ZGU2MzMwNmNmMTkzYTJiMDhiYmVkZTc2YjAw
|
15
|
-
MDYwNDUxY2E0Nzc5N2ZkYTk1ZjRjMGUxYTBjZmRmZGVhNDkxNDE=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9356410391db8c1c25d11bed90a08e76fba383a3
|
4
|
+
data.tar.gz: c87d71466d79190914007f2596262df9c8b338fd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4d58c735226158c03e18e936f1fdb39d8387bf59f464265c0694312825e23b6d0d9ba850fa13102fdb4ebfcc860fec035b338bf3579cb9b79209d41db0221138
|
7
|
+
data.tar.gz: e601935b3e7798ca8dd232ffa31ec15c3aab44aa14024fcca41f6b03f099f2936e898f9858154718bb9cb844aad1d646b514ff568caa4794b97ed97d3715b77e
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/History.txt
CHANGED
data/{README.rdoc → README.md}
RENAMED
@@ -1,11 +1,15 @@
|
|
1
|
-
|
1
|
+
# Daemon Kit
|
2
|
+
|
3
|
+
[![Code Climate](https://codeclimate.com/github/kennethkalmer/daemon-kit.png)](https://codeclimate.com/github/kennethkalmer/daemon-kit)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/daemon-kit.png)](http://badge.fury.io/rb/daemon-kit)
|
5
|
+
[![Build Status](https://travis-ci.org/kennethkalmer/daemon-kit.png)](https://travis-ci.org/kennethkalmer/daemon-kit)
|
2
6
|
|
3
7
|
* https://github.com/kennethkalmer/daemon-kit/wiki
|
4
8
|
* http://rdoc.info/github/kennethkalmer/daemon-kit
|
5
9
|
* http://groups.google.com/group/daemon-kit (daemon-kit@googlegroups.com)
|
6
|
-
*
|
10
|
+
* \#daemon-kit on Freenode
|
7
11
|
|
8
|
-
|
12
|
+
## Description
|
9
13
|
|
10
14
|
Daemon Kit aims to simplify creating Ruby daemons by providing a sound application skeleton (through a generator), task specific generators (jabber bot, etc) and robust environment management code.
|
11
15
|
|
@@ -16,90 +20,95 @@ Supported generators:
|
|
16
20
|
* XMPP bot (evented)
|
17
21
|
* AMQP consumer (evented)
|
18
22
|
* SQS consumer
|
19
|
-
* Nanite agent
|
23
|
+
* Nanite agent (requires < 0.3)
|
20
24
|
* Cron-style daemon
|
21
25
|
* ruote remote participants
|
22
26
|
|
23
|
-
|
27
|
+
## Features/Problems
|
24
28
|
|
25
29
|
* Build it
|
26
30
|
* Review TODO.txt
|
27
31
|
|
28
|
-
|
32
|
+
## Synopsis
|
29
33
|
|
34
|
+
```
|
30
35
|
$ daemon-kit -h
|
36
|
+
```
|
31
37
|
|
32
38
|
Get some help
|
33
39
|
|
40
|
+
```
|
34
41
|
$ daemon-kit [/path/to/your/daemon] [options]
|
42
|
+
```
|
35
43
|
|
36
44
|
The above command generates a skeleton daemon environment for you to adapt.
|
37
45
|
|
46
|
+
```
|
38
47
|
$ daemon-kit [/path/to/your/daemon] -i xmpp
|
48
|
+
```
|
39
49
|
|
40
50
|
Use the 'xmpp' generator instead of the default one.
|
41
51
|
|
42
|
-
|
52
|
+
## Generators
|
43
53
|
|
44
|
-
Currently
|
54
|
+
Currently five generators exist: default, xmpp, amqp, cron, ruote. Prior to version 0.3 there was a nanite generator too.
|
45
55
|
|
46
56
|
The default generator creates a simple daemon with an infinite loop inside that you can adapt.
|
47
57
|
|
48
|
-
|
49
|
-
|
50
|
-
The jabber generator creates a simple daemon that leverages the blather[http://blather.squishtech.com/] gem to process inbound messages. The daemon will manage the roster and other little tasks, leaving you to provide the hooks for processing messages, presence notifications and subscription request.
|
51
|
-
|
52
|
-
=== Cron Generator
|
58
|
+
### XMPP Generator
|
53
59
|
|
54
|
-
The
|
60
|
+
The jabber generator creates a simple daemon that leverages the [blather](http://blather.squishtech.com/) gem to process inbound messages. The daemon will manage the roster and other little tasks, leaving you to provide the hooks for processing messages, presence notifications and subscription request.
|
55
61
|
|
56
|
-
|
62
|
+
### Cron Generator
|
57
63
|
|
58
|
-
The
|
64
|
+
The cron generator creates a simple daemon that leverages the [rufus-scheduler](http://github.com/jmettraux/rufus-scheduler) gem to create a simple cron-lie daemon. Please be aware that this daemon could never be a replacement for the battle-tested cron[http://www.gentoo.org/doc/en/cron-guide.xml] utility shipped standard with most *nix distributions.
|
59
65
|
|
60
|
-
|
66
|
+
### AMQP Consumer Generator
|
61
67
|
|
62
|
-
The
|
68
|
+
The AMQP generator creates a simple daemon that has all the stub code and configuration in place to help you write AMQP consumers quickly and effectively. The generated daemon relies on the presence of the [amqp](http://github.com/ruby-amqp/amqp) gem.
|
63
69
|
|
64
|
-
|
70
|
+
### ruote Remote Participants
|
65
71
|
|
66
|
-
The ruote
|
72
|
+
The [ruote](http://openwfe.rubyforge.org) remote participant generator speeds up the development of workflow participants that run outside of the Ruby process that houses the engine. Daemon-kit handles all the communication and delegation logic, allowing you to focus purely on your participant's activities.
|
67
73
|
|
68
|
-
|
74
|
+
## Requirements
|
69
75
|
|
70
76
|
* Ruby 1.8.7 or later (developed on REE/1.9.1)
|
71
|
-
* eventmachine-0.12.10
|
77
|
+
* [eventmachine-0.12.10](http://rubyeventmachine.com)
|
72
78
|
* rspec (for writing/running your specs)
|
73
79
|
|
74
|
-
|
80
|
+
## Generator Requirements
|
75
81
|
|
76
82
|
Depending on the generator you choose for your daemon, it might require additional gems to run.
|
77
83
|
|
78
|
-
* xmpp - blather
|
79
|
-
* cron - rufus-scheduler
|
80
|
-
* amqp - amqp
|
81
|
-
*
|
82
|
-
* ruote - none, although ruote[http://openwfe.rubyforge.org] should probably be running somewhere
|
84
|
+
* xmpp - [blather](http://blather.squishtech.com/)
|
85
|
+
* cron - [rufus-scheduler](http://github.com/jmettraux/rufus-scheduler) (at least version 2.0.0)
|
86
|
+
* amqp - [amqp](http://github.com/tmm1/amqp)
|
87
|
+
* ruote - none, although [ruote](http://openwfe.rubyforge.org) should probably be running somewhere
|
83
88
|
|
84
|
-
The generators are all written using Thor
|
89
|
+
The generators are all written using [Thor](http://rdoc.info/rdoc/wycats/thor), which is bundled with daemon-kit and not needed for running any of the generators.
|
85
90
|
|
86
|
-
|
91
|
+
## Install
|
87
92
|
|
88
93
|
Currently recommended to stick to the git repo:
|
89
94
|
|
95
|
+
```
|
90
96
|
$ git clone git://github.com/kennethkalmer/daemon-kit.git
|
91
97
|
$ rake build
|
92
98
|
$ gem install pkg/daemon-kit-X.X.X.gem
|
99
|
+
```
|
93
100
|
|
94
|
-
Stable versions, when released are available directly from
|
101
|
+
Stable versions, when released are available directly from Rubygems:
|
95
102
|
|
103
|
+
```
|
96
104
|
$ gem install daemon-kit
|
105
|
+
```
|
97
106
|
|
98
|
-
|
107
|
+
## Upgrading
|
99
108
|
|
100
109
|
When upgrading daemons generated from earlier versions of daemon-kit, it is easier in most cases to re-generate the daemon. Since 0.1.8 the generators use Thor, which allows you to review a diff of each file before deciding to overwrite it.
|
101
110
|
|
102
|
-
|
111
|
+
## Further reading
|
103
112
|
|
104
113
|
* Configuration.txt
|
105
114
|
* Deployment.txt
|
@@ -107,7 +116,7 @@ When upgrading daemons generated from earlier versions of daemon-kit, it is easi
|
|
107
116
|
* RuoteParticipants.txt
|
108
117
|
* http://www.opensourcery.co.za/tag/daemon-kit/
|
109
118
|
|
110
|
-
|
119
|
+
## License
|
111
120
|
|
112
121
|
(The MIT License)
|
113
122
|
|
data/Rakefile
CHANGED
data/bin/daemon-kit
CHANGED
data/daemon-kit.gemspec
CHANGED
@@ -30,21 +30,21 @@ $ daemon-kit -h
|
|
30
30
|
"Deployment.txt",
|
31
31
|
"History.txt",
|
32
32
|
"Logging.txt",
|
33
|
-
"README.
|
33
|
+
"README.md",
|
34
34
|
"RuoteParticipants.txt",
|
35
35
|
"TODO.txt",
|
36
36
|
]
|
37
37
|
|
38
|
-
gem.add_dependency(%q<thor>)
|
39
38
|
gem.add_development_dependency(%q<bundler>)
|
40
|
-
gem.add_development_dependency(%q<rake>)
|
39
|
+
gem.add_development_dependency(%q<rake>)
|
41
40
|
gem.add_development_dependency(%q<rdoc>)
|
42
41
|
gem.add_development_dependency(%q<rspec>, ["~> 2.6"])
|
43
|
-
gem.add_development_dependency(%q<cucumber>, ["~>
|
44
|
-
gem.add_development_dependency(%q<
|
42
|
+
gem.add_development_dependency(%q<cucumber>, ["~> 1.3.8"])
|
43
|
+
gem.add_development_dependency(%q<aruba>, ["~> 0.5.3"])
|
45
44
|
gem.add_development_dependency(%q<SyslogLogger>)
|
45
|
+
|
46
|
+
gem.add_dependency(%q<thor>)
|
46
47
|
gem.add_runtime_dependency(%q<eventmachine>, [">= 0.12.10"])
|
47
48
|
gem.add_runtime_dependency(%q<safely>, [">= 0.3.1"])
|
48
|
-
gem.add_runtime_dependency(%q<rubigen>)
|
49
49
|
gem.add_runtime_dependency(%q<i18n>)
|
50
50
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: AMQP generator provides some additional infrastructure
|
2
|
+
|
3
|
+
Scenario: Using AMQP generator when generating a new daemon
|
4
|
+
When I run `daemon-kit vuvuzela -i amqp`
|
5
|
+
And I cd to "vuvuzela"
|
6
|
+
Then the following files should exist:
|
7
|
+
| config/amqp.yml |
|
8
|
+
| config/pre-daemonize/amqp.rb |
|
9
|
+
| libexec/vuvuzela-daemon.rb |
|
10
|
+
And the file "Gemfile" should contain:
|
11
|
+
"""
|
12
|
+
gem 'amqp'
|
13
|
+
"""
|
14
|
+
|
15
|
+
Scenario: Using AMQP generator on an existing daemon
|
16
|
+
Given I have an existing daemon called "vuvuzela"
|
17
|
+
And I cd to "vuvuzela"
|
18
|
+
When I run `./script/generate amqp` interactively
|
19
|
+
And I accept the conflicts
|
20
|
+
Then the following files should exist:
|
21
|
+
| config/amqp.yml |
|
22
|
+
| config/pre-daemonize/amqp.rb |
|
23
|
+
| libexec/vuvuzela-daemon.rb |
|
24
|
+
And the file "Gemfile" should contain:
|
25
|
+
"""
|
26
|
+
gem 'amqp'
|
27
|
+
"""
|
@@ -0,0 +1,46 @@
|
|
1
|
+
Feature: Generating a new daemon
|
2
|
+
|
3
|
+
daemon-kit offers an application generator to get you started.
|
4
|
+
|
5
|
+
Scenario: Generator offers help when no arguments are provided
|
6
|
+
When I run `daemon-kit`
|
7
|
+
Then the output should contain:
|
8
|
+
"""
|
9
|
+
Usage:
|
10
|
+
daemon-kit app APP_PATH
|
11
|
+
"""
|
12
|
+
|
13
|
+
Scenario: Generator offers help when asked
|
14
|
+
When I run `daemon-kit --help`
|
15
|
+
Then the output should contain:
|
16
|
+
"""
|
17
|
+
Usage:
|
18
|
+
daemon-kit app APP_PATH
|
19
|
+
"""
|
20
|
+
|
21
|
+
Scenario: Generating a default daemon
|
22
|
+
When I run `daemon-kit vuvuzela`
|
23
|
+
And I cd to "vuvuzela"
|
24
|
+
Then the following files should exist:
|
25
|
+
| Gemfile |
|
26
|
+
| README |
|
27
|
+
| Rakefile |
|
28
|
+
| bin/vuvuzela |
|
29
|
+
| config/arguments.rb |
|
30
|
+
| config/boot.rb |
|
31
|
+
| config/environments/development.rb |
|
32
|
+
| config/environments/test.rb |
|
33
|
+
| config/environments/production.rb |
|
34
|
+
| config/pre-daemonize/readme |
|
35
|
+
| config/post-daemonize/readme |
|
36
|
+
| lib/vuvuzela.rb |
|
37
|
+
| libexec/vuvuzela-daemon.rb |
|
38
|
+
| script/console |
|
39
|
+
| script/destroy |
|
40
|
+
| script/generate |
|
41
|
+
| spec/spec_helper.rb |
|
42
|
+
And the following directories should exist:
|
43
|
+
| log |
|
44
|
+
| tasks |
|
45
|
+
| vendor |
|
46
|
+
| tmp |
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Feature: Capistrano generator provides some additional infrastructure
|
2
|
+
|
3
|
+
Scenario: Using the capistrano generator when generating a new daemon
|
4
|
+
When I run `daemon-kit vuvuzela -d capistrano`
|
5
|
+
And I cd to "vuvuzela"
|
6
|
+
Then the following files should exist:
|
7
|
+
| Capfile |
|
8
|
+
| config/deploy.rb |
|
9
|
+
| config/deploy/staging.rb |
|
10
|
+
| config/deploy/production.rb |
|
11
|
+
And the file "Gemfile" should contain:
|
12
|
+
"""
|
13
|
+
gem 'capistrano'
|
14
|
+
gem 'capistrano-ext'
|
15
|
+
"""
|
16
|
+
|
17
|
+
Scenario: Using AMQP generator on an existing daemon
|
18
|
+
Given I have an existing daemon called "vuvuzela"
|
19
|
+
And I cd to "vuvuzela"
|
20
|
+
When I run `./script/generate capistrano`
|
21
|
+
Then the following files should exist:
|
22
|
+
| Capfile |
|
23
|
+
| config/deploy.rb |
|
24
|
+
| config/deploy/staging.rb |
|
25
|
+
| config/deploy/production.rb |
|
26
|
+
And the file "Gemfile" should contain:
|
27
|
+
"""
|
28
|
+
gem 'capistrano'
|
29
|
+
gem 'capistrano-ext'
|
30
|
+
"""
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Feature: Cron generator
|
2
|
+
|
3
|
+
Scenario: Using cron generator when generating a new daemon
|
4
|
+
When I run `daemon-kit vuvuzela -i cron`
|
5
|
+
And I cd to "vuvuzela"
|
6
|
+
Then the following files should exist:
|
7
|
+
| config/pre-daemonize/cron.rb |
|
8
|
+
| libexec/vuvuzela-daemon.rb |
|
9
|
+
And the file "Gemfile" should contain:
|
10
|
+
"""
|
11
|
+
gem 'rufus-scheduler'
|
12
|
+
"""
|
13
|
+
|
14
|
+
Scenario: Using AMQP generator on an existing daemon
|
15
|
+
Given I have an existing daemon called "vuvuzela"
|
16
|
+
And I cd to "vuvuzela"
|
17
|
+
When I run `./script/generate cron` interactively
|
18
|
+
And I accept the conflicts
|
19
|
+
Then the following files should exist:
|
20
|
+
| config/pre-daemonize/cron.rb |
|
21
|
+
| libexec/vuvuzela-daemon.rb |
|
22
|
+
And the file "Gemfile" should contain:
|
23
|
+
"""
|
24
|
+
gem 'rufus-scheduler'
|
25
|
+
"""
|
26
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: Ruote remote participant generator
|
2
|
+
|
3
|
+
Scenario: Using ruote generator when generating a new daemon
|
4
|
+
When I run `daemon-kit vuvuzela -i ruote`
|
5
|
+
And I cd to "vuvuzela"
|
6
|
+
Then the following files should exist:
|
7
|
+
| config/amqp.yml |
|
8
|
+
| config/pre-daemonize/ruote.rb |
|
9
|
+
| lib/vuvuzela.rb |
|
10
|
+
| lib/sample.rb |
|
11
|
+
| libexec/vuvuzela-daemon.rb |
|
12
|
+
And the file "Gemfile" should contain "gem 'amqp'"
|
13
|
+
And the file "Gemfile" should contain "gem 'json'"
|
14
|
+
|
15
|
+
Scenario: Using AMQP generator on an existing daemon
|
16
|
+
Given I have an existing daemon called "vuvuzela"
|
17
|
+
And I cd to "vuvuzela"
|
18
|
+
When I run `./script/generate ruote` interactively
|
19
|
+
And I accept the conflicts
|
20
|
+
Then the following files should exist:
|
21
|
+
| config/amqp.yml |
|
22
|
+
| config/pre-daemonize/ruote.rb |
|
23
|
+
| lib/vuvuzela.rb |
|
24
|
+
| lib/sample.rb |
|
25
|
+
| libexec/vuvuzela-daemon.rb |
|
26
|
+
And the file "Gemfile" should contain "gem 'amqp'"
|
27
|
+
And the file "Gemfile" should contain "gem 'json'"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Feature: SQS generator
|
2
|
+
|
3
|
+
Scenario: Using SQS generator when generating a new daemon
|
4
|
+
When I run `daemon-kit vuvuzela -i sqs`
|
5
|
+
And I cd to "vuvuzela"
|
6
|
+
Then the following files should exist:
|
7
|
+
| config/sqs.yml |
|
8
|
+
| config/pre-daemonize/sqs.rb |
|
9
|
+
| libexec/vuvuzela-daemon.rb |
|
10
|
+
And the file "Gemfile" should contain "gem 'aws-sdk'"
|
11
|
+
|
12
|
+
Scenario: Using AMQP generator on an existing daemon
|
13
|
+
Given I have an existing daemon called "vuvuzela"
|
14
|
+
And I cd to "vuvuzela"
|
15
|
+
When I run `./script/generate sqs` interactively
|
16
|
+
And I accept the conflicts
|
17
|
+
Then the following files should exist:
|
18
|
+
| config/sqs.yml |
|
19
|
+
| config/pre-daemonize/sqs.rb |
|
20
|
+
| libexec/vuvuzela-daemon.rb |
|
21
|
+
And the file "Gemfile" should contain "gem 'aws-sdk'"
|