daemon-kit 0.1.7.12 → 0.1.8pre
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/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,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
|
3
|
-
|
|
4
|
-
begin
|
|
5
|
-
require 'rubigen'
|
|
6
|
-
rescue LoadError
|
|
7
|
-
require 'rubygems'
|
|
8
|
-
require 'rubigen'
|
|
9
|
-
end
|
|
10
|
-
require 'rubigen/scripts/destroy'
|
|
11
|
-
|
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
|
13
|
-
RubiGen::Base.use_component_sources! [:daemon, :test_unit]
|
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
|
3
|
-
|
|
4
|
-
begin
|
|
5
|
-
require 'rubigen'
|
|
6
|
-
rescue LoadError
|
|
7
|
-
require 'rubygems'
|
|
8
|
-
require 'rubigen'
|
|
9
|
-
end
|
|
10
|
-
require 'rubigen/scripts/generate'
|
|
11
|
-
|
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
|
13
|
-
RubiGen::Base.use_component_sources! [:daemon]
|
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
class AmqpGenerator < 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
|
-
# Copy over our configs
|
|
28
|
-
m.directory 'config'
|
|
29
|
-
m.template 'config/amqp.yml', 'config/amqp.yml'
|
|
30
|
-
m.directory 'config/initializers'
|
|
31
|
-
m.template 'config/initializers/amqp.rb', "config/initializers/#{name}.rb"
|
|
32
|
-
|
|
33
|
-
# Copy over our daemon
|
|
34
|
-
m.directory 'libexec'
|
|
35
|
-
m.template 'libexec/daemon.rb', "libexec/#{name}-daemon.rb"
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
protected
|
|
40
|
-
def banner
|
|
41
|
-
<<-EOS
|
|
42
|
-
Creates a ...
|
|
43
|
-
|
|
44
|
-
USAGE: #{$0} #{spec.name} name
|
|
45
|
-
EOS
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def add_options!(opts)
|
|
49
|
-
# opts.separator ''
|
|
50
|
-
# opts.separator 'Options:'
|
|
51
|
-
# For each option below, place the default
|
|
52
|
-
# at the top of the file next to "default_options"
|
|
53
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
|
54
|
-
# "Some comment about this option",
|
|
55
|
-
# "Default: none") { |o| options[:author] = o }
|
|
56
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def extract_options
|
|
60
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
|
61
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
|
62
|
-
# raw instance variable value.
|
|
63
|
-
# @author = options[:author]
|
|
64
|
-
end
|
|
65
|
-
end
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
class CronGenerator < 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
|
-
# Copy over configs
|
|
28
|
-
m.directory 'config'
|
|
29
|
-
m.directory 'config/initializers'
|
|
30
|
-
m.template 'config/initializers/cron.rb', "config/initializers/#{name}.rb"
|
|
31
|
-
|
|
32
|
-
# Copy over our daemon
|
|
33
|
-
m.directory 'libexec'
|
|
34
|
-
m.template 'libexec/daemon.rb', "libexec/#{name}-daemon.rb"
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
protected
|
|
39
|
-
def banner
|
|
40
|
-
<<-EOS
|
|
41
|
-
Creates a ...
|
|
42
|
-
|
|
43
|
-
USAGE: #{$0} #{spec.name} name
|
|
44
|
-
EOS
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def add_options!(opts)
|
|
48
|
-
# opts.separator ''
|
|
49
|
-
# opts.separator 'Options:'
|
|
50
|
-
# For each option below, place the default
|
|
51
|
-
# at the top of the file next to "default_options"
|
|
52
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
|
53
|
-
# "Some comment about this option",
|
|
54
|
-
# "Default: none") { |o| options[:author] = o }
|
|
55
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def extract_options
|
|
59
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
|
60
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
|
61
|
-
# raw instance variable value.
|
|
62
|
-
# @author = options[:author]
|
|
63
|
-
end
|
|
64
|
-
end
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
require 'rbconfig'
|
|
2
|
-
require 'cucumber/version'
|
|
3
|
-
|
|
4
|
-
# This generator bootstraps a Rails project for use with Cucumber
|
|
5
|
-
class CucumberGenerator < RubiGen::Base
|
|
6
|
-
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
|
7
|
-
Config::CONFIG['ruby_install_name'])
|
|
8
|
-
|
|
9
|
-
def manifest
|
|
10
|
-
record do |m|
|
|
11
|
-
m.directory 'features/step_definitions'
|
|
12
|
-
m.template 'cucumber_environment.rb', 'config/environments/cucumber.rb',
|
|
13
|
-
:assigns => { :cucumber_version => ::Cucumber::VERSION::STRING }
|
|
14
|
-
|
|
15
|
-
m.directory 'features/support'
|
|
16
|
-
|
|
17
|
-
#if options[:spork]
|
|
18
|
-
# m.template 'spork_env.rb', 'features/support/env.rb'
|
|
19
|
-
#else
|
|
20
|
-
m.template 'env.rb', 'features/support/env.rb'
|
|
21
|
-
#end
|
|
22
|
-
|
|
23
|
-
m.directory 'tasks'
|
|
24
|
-
m.template 'cucumber.rake', 'tasks/cucumber.rake'
|
|
25
|
-
|
|
26
|
-
m.file 'cucumber', 'script/cucumber', {
|
|
27
|
-
:chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang]
|
|
28
|
-
}
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
protected
|
|
33
|
-
|
|
34
|
-
def banner
|
|
35
|
-
"Usage: #{$0} cucumber"
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
class DeployCapistranoGenerator < RubiGen::Base
|
|
2
|
-
|
|
3
|
-
attr_reader :name
|
|
4
|
-
|
|
5
|
-
def initialize(runtime_args, runtime_options = {})
|
|
6
|
-
super
|
|
7
|
-
usage if args.empty?
|
|
8
|
-
@name = args.shift
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def manifest
|
|
12
|
-
record do |m|
|
|
13
|
-
|
|
14
|
-
m.file "Capfile", "Capfile"
|
|
15
|
-
m.directory "config"
|
|
16
|
-
m.template "config/deploy.rb", "config/deploy.rb"
|
|
17
|
-
m.directory "config/deploy"
|
|
18
|
-
m.template "config/deploy/staging.rb", "config/deploy/staging.rb"
|
|
19
|
-
m.template "config/deploy/production.rb", "config/deploy/production.rb"
|
|
20
|
-
m.directory "config/environments"
|
|
21
|
-
m.file "config/environments/staging.rb", "config/environments/staging.rb", :collision => :skip
|
|
22
|
-
m.readme "USAGE"
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
protected
|
|
27
|
-
def banner
|
|
28
|
-
<<-EOS
|
|
29
|
-
Creates the required capistrano configurations for deploying your daemon code
|
|
30
|
-
to remote servers.
|
|
31
|
-
|
|
32
|
-
USAGE: #{$0} #{spec.name} daemon-name
|
|
33
|
-
EOS
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
class JabberGenerator < 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
|
-
# Copy over our configs
|
|
28
|
-
m.directory 'config'
|
|
29
|
-
m.template 'config/jabber.yml', 'config/jabber.yml'
|
|
30
|
-
m.directory 'config/initializers'
|
|
31
|
-
m.template 'config/initializers/jabber.rb', "config/initializers/#{name}.rb"
|
|
32
|
-
|
|
33
|
-
# Copy over our daemon
|
|
34
|
-
m.directory 'libexec'
|
|
35
|
-
m.template 'libexec/daemon.rb', "libexec/#{name}-daemon.rb"
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
protected
|
|
40
|
-
def banner
|
|
41
|
-
<<-EOS
|
|
42
|
-
Creates a ...
|
|
43
|
-
|
|
44
|
-
USAGE: #{$0} #{spec.name} name
|
|
45
|
-
EOS
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def add_options!(opts)
|
|
49
|
-
# opts.separator ''
|
|
50
|
-
# opts.separator 'Options:'
|
|
51
|
-
# For each option below, place the default
|
|
52
|
-
# at the top of the file next to "default_options"
|
|
53
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
|
54
|
-
# "Some comment about this option",
|
|
55
|
-
# "Default: none") { |o| options[:author] = o }
|
|
56
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def extract_options
|
|
60
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
|
61
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
|
62
|
-
# raw instance variable value.
|
|
63
|
-
# @author = options[:author]
|
|
64
|
-
end
|
|
65
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Generated jabber daemon
|
|
2
|
-
|
|
3
|
-
# Do your post daemonization configuration here
|
|
4
|
-
# At minimum you need just the first line (without the block), or a lot
|
|
5
|
-
# of strange things might start happening...
|
|
6
|
-
DaemonKit::Application.running! do |config|
|
|
7
|
-
# Trap signals with blocks or procs
|
|
8
|
-
# config.trap( 'INT' ) do
|
|
9
|
-
# # do something clever
|
|
10
|
-
# end
|
|
11
|
-
# config.trap( 'TERM', Proc.new { puts 'Going down' } )
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# IMPORTANT CONFIGURATION NOTE
|
|
15
|
-
#
|
|
16
|
-
# Please review and update 'config/jabber.yml' accordingly or this
|
|
17
|
-
# daemon won't work as advertised.
|
|
18
|
-
|
|
19
|
-
# This block gets called every time a message has been received from a
|
|
20
|
-
# valid master.
|
|
21
|
-
DaemonKit::Jabber.received_messages do |message|
|
|
22
|
-
# Simple echo service
|
|
23
|
-
DaemonKit::Jabber.deliver( message.from, message.body )
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# Run our Jabber bot
|
|
27
|
-
DaemonKit::Jabber.run
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
class NaniteAgentGenerator < 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
|
-
# Copy over our configs
|
|
28
|
-
m.directory 'lib'
|
|
29
|
-
m.directory 'lib/actors'
|
|
30
|
-
m.file 'lib/actors/sample.rb', 'lib/actors/sample.rb'
|
|
31
|
-
m.directory 'config'
|
|
32
|
-
m.template 'config/nanite.yml', 'config/nanite.yml'
|
|
33
|
-
m.directory 'config/initializers'
|
|
34
|
-
m.template 'config/initializers/nanite_agent.rb', "config/initializers/#{name}.rb"
|
|
35
|
-
|
|
36
|
-
# Copy over our daemon
|
|
37
|
-
m.directory 'libexec'
|
|
38
|
-
m.template 'libexec/daemon.rb', "libexec/#{name}-daemon.rb"
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
protected
|
|
43
|
-
def banner
|
|
44
|
-
<<-EOS
|
|
45
|
-
Creates a ...
|
|
46
|
-
|
|
47
|
-
USAGE: #{$0} #{spec.name} name
|
|
48
|
-
EOS
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def add_options!(opts)
|
|
52
|
-
# opts.separator ''
|
|
53
|
-
# opts.separator 'Options:'
|
|
54
|
-
# For each option below, place the default
|
|
55
|
-
# at the top of the file next to "default_options"
|
|
56
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
|
57
|
-
# "Some comment about this option",
|
|
58
|
-
# "Default: none") { |o| options[:author] = o }
|
|
59
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def extract_options
|
|
63
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
|
64
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
|
65
|
-
# raw instance variable value.
|
|
66
|
-
# @author = options[:author]
|
|
67
|
-
end
|
|
68
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
class RspecGenerator < RubiGen::Base
|
|
3
|
-
|
|
4
|
-
attr_reader :gem_name, :module_name
|
|
5
|
-
|
|
6
|
-
def initialize(runtime_args, runtime_options = {})
|
|
7
|
-
super
|
|
8
|
-
@destination_root = File.expand_path(destination_root)
|
|
9
|
-
@gem_name = base_name
|
|
10
|
-
@module_name = @gem_name.camelcase
|
|
11
|
-
extract_options
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def manifest
|
|
15
|
-
record do |m|
|
|
16
|
-
# Ensure appropriate folder(s) exists
|
|
17
|
-
m.directory 'spec'
|
|
18
|
-
m.directory 'tasks'
|
|
19
|
-
|
|
20
|
-
m.template 'spec.rb', "spec/#{gem_name}_spec.rb"
|
|
21
|
-
|
|
22
|
-
m.template_copy_each %w( spec.opts spec_helper.rb ), 'spec'
|
|
23
|
-
m.file_copy_each %w( rspec.rake ), 'tasks'
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
protected
|
|
28
|
-
def banner
|
|
29
|
-
<<-EOS
|
|
30
|
-
Install rspec BDD testing support.
|
|
31
|
-
|
|
32
|
-
Includes a rake task (tasks/rspec.rake) to be loaded by the root Rakefile,
|
|
33
|
-
which provides a "spec" task.
|
|
34
|
-
|
|
35
|
-
USAGE: #{$0} [options]
|
|
36
|
-
EOS
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def add_options!(opts)
|
|
40
|
-
# opts.separator ''
|
|
41
|
-
# opts.separator 'Options:'
|
|
42
|
-
# For each option below, place the default
|
|
43
|
-
# at the top of the file next to "default_options"
|
|
44
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
|
45
|
-
# "Some comment about this option",
|
|
46
|
-
# "Default: none") { |x| options[:author] = x }
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def extract_options
|
|
50
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
|
51
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
|
52
|
-
# raw instance variable value.
|
|
53
|
-
# @author = options[:author]
|
|
54
|
-
end
|
|
55
|
-
end
|