daemon-kit 0.1.7.12 → 0.1.8pre
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Manifest.txt +4 -0
- data/README.rdoc +11 -9
- data/Rakefile +0 -1
- data/TODO.txt +1 -2
- data/bin/daemon-kit +11 -11
- data/daemon-kit.gemspec +109 -78
- data/lib/daemon_kit.rb +7 -10
- data/lib/daemon_kit/abstract_logger.rb +22 -14
- data/lib/daemon_kit/application.rb +0 -1
- data/lib/daemon_kit/arguments.rb +1 -6
- data/lib/daemon_kit/commands/destroy.rb +10 -0
- data/lib/daemon_kit/commands/generate.rb +10 -0
- data/lib/daemon_kit/config.rb +7 -2
- data/lib/daemon_kit/generators.rb +67 -0
- data/lib/daemon_kit/generators/base.rb +60 -0
- data/lib/daemon_kit/initializer.rb +1 -1
- data/lib/daemon_kit/jabber.rb +1 -0
- data/lib/daemon_kit/tasks/framework.rake +6 -1
- data/lib/daemon_kit/vendor/thor-0.12.3/CHANGELOG.rdoc +80 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/LICENSE +20 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/README.rdoc +234 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/Thorfile +64 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor.rb +242 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/actions.rb +274 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/actions/create_file.rb +103 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/actions/directory.rb +91 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/actions/empty_directory.rb +134 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/actions/file_manipulation.rb +223 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/actions/inject_into_file.rb +101 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/base.rb +515 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/core_ext/file_binary_read.rb +9 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/core_ext/hash_with_indifferent_access.rb +75 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/core_ext/ordered_hash.rb +100 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/error.rb +27 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/group.rb +271 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/invocation.rb +178 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/parser.rb +4 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/parser/argument.rb +67 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/parser/arguments.rb +145 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/parser/option.rb +132 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/parser/options.rb +142 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/rake_compat.rb +66 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/runner.rb +303 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/shell.rb +78 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/shell/basic.rb +239 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/shell/color.rb +108 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/task.rb +111 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/util.rb +233 -0
- data/lib/daemon_kit/vendor/thor-0.12.3/lib/thor/version.rb +3 -0
- data/lib/daemon_kit/xmpp.rb +75 -6
- data/{daemon_generators → lib/generators/daemon_kit}/amqp/USAGE +0 -0
- data/lib/generators/daemon_kit/amqp/amqp_generator.rb +24 -0
- data/{daemon_generators → lib/generators/daemon_kit}/amqp/templates/config/amqp.yml +0 -0
- data/{daemon_generators/amqp/templates/config/initializers → lib/generators/daemon_kit/amqp/templates/config/pre-daemonize}/amqp.rb +0 -0
- data/{daemon_generators/amqp/templates/libexec/daemon.rb → lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb} +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/USAGE +0 -0
- data/lib/generators/daemon_kit/app/app_generator.rb +140 -0
- data/lib/generators/daemon_kit/app/templates/Gemfile +8 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/README +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/Rakefile +0 -0
- data/lib/generators/daemon_kit/app/templates/bin/daemon.tt +7 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/config/arguments.rb +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/config/boot.rb +10 -3
- data/{app_generators/daemon_kit/templates/config/environment.rb → lib/generators/daemon_kit/app/templates/config/environment.rb.tt} +1 -1
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/config/environments/development.rb +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/config/environments/production.rb +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/config/environments/test.rb +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/config/post-daemonize/readme +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/config/pre-daemonize/readme +0 -0
- data/{app_generators/daemon_kit/templates/lib/daemon.rb → lib/generators/daemon_kit/app/templates/lib/%app_name%.rb} +0 -0
- data/{app_generators/daemon_kit/templates/libexec/daemon.erb → lib/generators/daemon_kit/app/templates/libexec/%app_name%-daemon.rb} +0 -0
- data/{app_generators/daemon_kit → lib/generators/daemon_kit/app}/templates/script/console +0 -0
- data/lib/generators/daemon_kit/app/templates/script/destroy +2 -0
- data/lib/generators/daemon_kit/app/templates/script/generate +2 -0
- data/lib/generators/daemon_kit/capistrano/capistrano_generator.rb +21 -0
- data/{daemon_generators/deploy_capistrano → lib/generators/daemon_kit/capistrano}/templates/Capfile +0 -0
- data/{daemon_generators/deploy_capistrano → lib/generators/daemon_kit/capistrano}/templates/USAGE +0 -0
- data/{daemon_generators/deploy_capistrano/templates/config/deploy.rb → lib/generators/daemon_kit/capistrano/templates/config/deploy.rb.tt} +1 -1
- data/lib/generators/daemon_kit/capistrano/templates/config/deploy/production.rb.tt +6 -0
- data/lib/generators/daemon_kit/capistrano/templates/config/deploy/staging.rb.tt +6 -0
- data/{daemon_generators/deploy_capistrano → lib/generators/daemon_kit/capistrano}/templates/config/environments/staging.rb +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/cron/USAGE +0 -0
- data/lib/generators/daemon_kit/cron/cron_generator.rb +24 -0
- data/{daemon_generators/cron/templates/config/initializers → lib/generators/daemon_kit/cron/templates/config/pre-daemonize}/cron.rb +0 -0
- data/{daemon_generators/cron/templates/libexec/daemon.rb → lib/generators/daemon_kit/cron/templates/libexec/%app_name%-daemon.rb} +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/cucumber/USAGE +0 -0
- data/lib/generators/daemon_kit/cucumber/cucumber_generator.rb +45 -0
- data/{daemon_generators/cucumber/templates/cucumber_environment.rb → lib/generators/daemon_kit/cucumber/templates/config/environments/cucumber.rb} +0 -0
- data/lib/generators/daemon_kit/cucumber/templates/features/step_definitions/.empty_directory +0 -0
- data/{daemon_generators/cucumber/templates → lib/generators/daemon_kit/cucumber/templates/features/support}/env.rb +0 -0
- data/{daemon_generators/cucumber/templates → lib/generators/daemon_kit/cucumber/templates/script}/cucumber +1 -2
- data/{daemon_generators/cucumber/templates → lib/generators/daemon_kit/cucumber/templates/tasks}/cucumber.rake +0 -0
- data/{daemon_generators/jabber → lib/generators/daemon_kit/nanite_agent}/USAGE +0 -0
- data/lib/generators/daemon_kit/nanite_agent/nanite_agent_generator.rb +29 -0
- data/{daemon_generators → lib/generators/daemon_kit}/nanite_agent/templates/config/nanite.yml +0 -0
- data/{daemon_generators/nanite_agent/templates/config/initializers → lib/generators/daemon_kit/nanite_agent/templates/config/pre-daemonize}/nanite_agent.rb +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/nanite_agent/templates/lib/actors/sample.rb +0 -0
- data/{daemon_generators/nanite_agent/templates/libexec/daemon.rb → lib/generators/daemon_kit/nanite_agent/templates/libexec/%app_name%-daemon.rb} +0 -0
- data/{daemon_generators/nanite_agent → lib/generators/daemon_kit/rspec}/USAGE +0 -0
- data/lib/generators/daemon_kit/rspec/rspec_generator.rb +20 -0
- data/{daemon_generators/rspec/templates/spec.rb → lib/generators/daemon_kit/rspec/templates/spec/%app_name%_spec.rb} +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/rspec/templates/spec/spec.opts +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/rspec/templates/spec/spec_helper.rb +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/rspec/templates/tasks/rspec.rake +0 -0
- data/{daemon_generators/rspec → lib/generators/daemon_kit/ruote}/USAGE +0 -0
- data/lib/generators/daemon_kit/ruote/ruote_generator.rb +29 -0
- data/{daemon_generators → lib/generators/daemon_kit}/ruote/templates/config/amqp.yml +0 -0
- data/{daemon_generators/ruote/templates/config/initializers → lib/generators/daemon_kit/ruote/templates/config/pre-daemonize}/ruote.rb +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/ruote/templates/config/ruote.yml +0 -0
- data/{daemon_generators/ruote/templates/lib/daemon.rb → lib/generators/daemon_kit/ruote/templates/lib/%app_name%.rb} +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/ruote/templates/lib/sample.rb +0 -0
- data/{daemon_generators/ruote/templates/libexec/daemon.rb → lib/generators/daemon_kit/ruote/templates/libexec/%app_name%-daemon.rb} +0 -0
- data/{daemon_generators/ruote → lib/generators/daemon_kit/test_unit}/USAGE +0 -0
- data/{daemon_generators → lib/generators/daemon_kit}/test_unit/templates/tasks/test_unit.rake +0 -0
- data/{daemon_generators/test_unit/templates/test/test.rb → lib/generators/daemon_kit/test_unit/templates/test/%app_name%_test.rb.tt} +1 -1
- data/{daemon_generators → lib/generators/daemon_kit}/test_unit/templates/test/test_helper.rb +0 -0
- data/lib/generators/daemon_kit/test_unit/test_unit_generator.rb +20 -0
- data/lib/generators/daemon_kit/xmpp/templates/config/pre-daemonize/xmpp.rb +6 -0
- data/{daemon_generators/jabber/templates/config/jabber.yml → lib/generators/daemon_kit/xmpp/templates/config/xmpp.yml} +5 -2
- data/lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb +27 -0
- data/lib/generators/daemon_kit/xmpp/xmpp_generator.rb +24 -0
- data/spec/argument_spec.rb +1 -1
- data/spec/config_spec.rb +7 -3
- metadata +110 -86
- data/app_generators/daemon_kit/daemon_kit_generator.rb +0 -178
- data/app_generators/daemon_kit/templates/bin/daemon.erb +0 -7
- data/app_generators/daemon_kit/templates/script/destroy +0 -14
- data/app_generators/daemon_kit/templates/script/generate +0 -14
- data/daemon_generators/amqp/amqp_generator.rb +0 -65
- data/daemon_generators/cron/cron_generator.rb +0 -64
- data/daemon_generators/cucumber/cucumber_generator.rb +0 -38
- data/daemon_generators/deploy_capistrano/deploy_capistrano_generator.rb +0 -35
- data/daemon_generators/deploy_capistrano/templates/config/deploy/production.rb +0 -6
- data/daemon_generators/deploy_capistrano/templates/config/deploy/staging.rb +0 -6
- data/daemon_generators/jabber/jabber_generator.rb +0 -65
- data/daemon_generators/jabber/templates/config/initializers/jabber.rb +0 -7
- data/daemon_generators/jabber/templates/libexec/daemon.rb +0 -27
- data/daemon_generators/nanite_agent/nanite_agent_generator.rb +0 -68
- data/daemon_generators/rspec/rspec_generator.rb +0 -55
- data/daemon_generators/ruote/ruote_generator.rb +0 -67
- data/daemon_generators/test_unit/USAGE +0 -5
- data/daemon_generators/test_unit/test_unit_generator.rb +0 -51
- data/test/test_jabber_generator.rb +0 -49
@@ -1,67 +0,0 @@
|
|
1
|
-
class RuoteGenerator < RubiGen::Base
|
2
|
-
|
3
|
-
default_options :author => nil
|
4
|
-
|
5
|
-
attr_reader :name
|
6
|
-
|
7
|
-
def initialize(runtime_args, runtime_options = {})
|
8
|
-
super
|
9
|
-
usage if args.empty?
|
10
|
-
@name = args.shift
|
11
|
-
extract_options
|
12
|
-
end
|
13
|
-
|
14
|
-
def manifest
|
15
|
-
record do |m|
|
16
|
-
# Ensure appropriate folder(s) exists
|
17
|
-
m.directory ''
|
18
|
-
|
19
|
-
# Create stubs
|
20
|
-
# m.template "template.rb.erb", "some_file_after_erb.rb"
|
21
|
-
# m.template_copy_each ["template.rb", "template2.rb"]
|
22
|
-
# m.template_copy_each ["template.rb", "template2.rb"], "some/path"
|
23
|
-
# m.file "file", "some_file_copied"
|
24
|
-
# m.file_copy_each ["path/to/file", "path/to/file2"]
|
25
|
-
# m.file_copy_each ["path/to/file", "path/to/file2"], "some/path"
|
26
|
-
|
27
|
-
m.directory 'config'
|
28
|
-
m.template 'config/amqp.yml', 'config/amqp.yml'
|
29
|
-
m.template 'config/ruote.yml', 'config/ruote.yml'
|
30
|
-
m.directory 'config/initializers'
|
31
|
-
m.template 'config/initializers/ruote.rb', "config/initializers/#{name}.rb"
|
32
|
-
|
33
|
-
m.directory 'lib'
|
34
|
-
m.template 'lib/daemon.rb', "lib/#{name}.rb"
|
35
|
-
m.template 'lib/sample.rb', 'lib/sample.rb'
|
36
|
-
m.directory 'libexec'
|
37
|
-
m.template 'libexec/daemon.rb', "libexec/#{name}-daemon.rb"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
protected
|
42
|
-
def banner
|
43
|
-
<<-EOS
|
44
|
-
Creates a ...
|
45
|
-
|
46
|
-
USAGE: #{$0} #{spec.name} name
|
47
|
-
EOS
|
48
|
-
end
|
49
|
-
|
50
|
-
def add_options!(opts)
|
51
|
-
# opts.separator ''
|
52
|
-
# opts.separator 'Options:'
|
53
|
-
# For each option below, place the default
|
54
|
-
# at the top of the file next to "default_options"
|
55
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
56
|
-
# "Some comment about this option",
|
57
|
-
# "Default: none") { |o| options[:author] = o }
|
58
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
59
|
-
end
|
60
|
-
|
61
|
-
def extract_options
|
62
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
63
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
64
|
-
# raw instance variable value.
|
65
|
-
# @author = options[:author]
|
66
|
-
end
|
67
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
class TestUnitGenerator < RubiGen::Base
|
2
|
-
|
3
|
-
attr_reader :gem_name, :module_name
|
4
|
-
|
5
|
-
def initialize(runtime_args, runtime_options = {})
|
6
|
-
super
|
7
|
-
@destination_root = File.expand_path(destination_root)
|
8
|
-
@gem_name = base_name
|
9
|
-
@module_name = @gem_name.camelcase
|
10
|
-
extract_options
|
11
|
-
end
|
12
|
-
|
13
|
-
def manifest
|
14
|
-
record do |m|
|
15
|
-
# Ensure appropriate folder(s) exists
|
16
|
-
m.directory 'test'
|
17
|
-
m.directory 'tasks'
|
18
|
-
|
19
|
-
m.template 'test/test.rb', "test/#{gem_name}_test.rb"
|
20
|
-
m.template_copy_each %w( test_helper.rb ), 'test'
|
21
|
-
m.file_copy_each %w( test_unit.rake ), 'tasks'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
protected
|
26
|
-
def banner
|
27
|
-
<<-EOS
|
28
|
-
Creates a ...
|
29
|
-
|
30
|
-
USAGE: #{$0} #{spec.name} name
|
31
|
-
EOS
|
32
|
-
end
|
33
|
-
|
34
|
-
def add_options!(opts)
|
35
|
-
# opts.separator ''
|
36
|
-
# opts.separator 'Options:'
|
37
|
-
# For each option below, place the default
|
38
|
-
# at the top of the file next to "default_options"
|
39
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
40
|
-
# "Some comment about this option",
|
41
|
-
# "Default: none") { |o| options[:author] = o }
|
42
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
43
|
-
end
|
44
|
-
|
45
|
-
def extract_options
|
46
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
47
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
48
|
-
# raw instance variable value.
|
49
|
-
# @author = options[:author]
|
50
|
-
end
|
51
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
-
|
3
|
-
|
4
|
-
class TestJabberGenerator < Test::Unit::TestCase
|
5
|
-
include RubiGen::GeneratorTestHelper
|
6
|
-
|
7
|
-
def setup
|
8
|
-
bare_setup
|
9
|
-
end
|
10
|
-
|
11
|
-
def teardown
|
12
|
-
bare_teardown
|
13
|
-
end
|
14
|
-
|
15
|
-
# Some generator-related assertions:
|
16
|
-
# assert_generated_file(name, &block) # block passed the file contents
|
17
|
-
# assert_directory_exists(name)
|
18
|
-
# assert_generated_class(name, &block)
|
19
|
-
# assert_generated_module(name, &block)
|
20
|
-
# assert_generated_test_for(name, &block)
|
21
|
-
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
22
|
-
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
23
|
-
#
|
24
|
-
# Other helper methods are:
|
25
|
-
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
26
|
-
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
27
|
-
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
28
|
-
|
29
|
-
def test_generator_without_options
|
30
|
-
name = "myapp"
|
31
|
-
run_generator('jabber', [name], sources)
|
32
|
-
assert_directory_exists "config"
|
33
|
-
assert_generated_file "config/jabber.yml"
|
34
|
-
assert_directory_exists "config/initializers"
|
35
|
-
assert_generated_file "config/initializers/myapp.rb"
|
36
|
-
assert_directory_exists "libexec"
|
37
|
-
assert_generated_file "libexec/myapp-daemon.rb"
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
def sources
|
42
|
-
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
43
|
-
]
|
44
|
-
end
|
45
|
-
|
46
|
-
def generator_path
|
47
|
-
"daemon_generators"
|
48
|
-
end
|
49
|
-
end
|