trinidad_resque_extension 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/Gemfile.lock +51 -0
- data/LICENSE +20 -0
- data/README.md +57 -0
- data/Rakefile +115 -0
- data/lib/resque_ext.rb +11 -0
- data/lib/resque_lifecycle_listener.rb +69 -0
- data/lib/trinidad_resque_extension.rb +82 -0
- data/spec/resque_lifecycle_listener_spec.rb +60 -0
- data/spec/resque_test_setup.rb +4 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/trinidad_resque_extension_spec.rb +56 -0
- data/trinidad_resque_extension.gemspec +77 -0
- metadata +125 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
trinidad_resque_extension (0.1.0)
|
5
|
+
rake
|
6
|
+
resque
|
7
|
+
trinidad
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
diff-lcs (1.1.2)
|
13
|
+
jruby-rack (1.0.7)
|
14
|
+
json (1.4.6-java)
|
15
|
+
mocha (0.9.12)
|
16
|
+
rack (1.2.2)
|
17
|
+
rake (0.8.7)
|
18
|
+
redis (2.1.1)
|
19
|
+
redis-namespace (0.10.0)
|
20
|
+
redis (< 3.0.0)
|
21
|
+
resque (1.15.0)
|
22
|
+
json (~> 1.4.6)
|
23
|
+
redis-namespace (>= 0.10.0)
|
24
|
+
sinatra (>= 0.9.2)
|
25
|
+
vegas (~> 0.1.2)
|
26
|
+
rspec (2.5.0)
|
27
|
+
rspec-core (~> 2.5.0)
|
28
|
+
rspec-expectations (~> 2.5.0)
|
29
|
+
rspec-mocks (~> 2.5.0)
|
30
|
+
rspec-core (2.5.1)
|
31
|
+
rspec-expectations (2.5.0)
|
32
|
+
diff-lcs (~> 1.1.2)
|
33
|
+
rspec-mocks (2.5.0)
|
34
|
+
sinatra (1.2.0)
|
35
|
+
rack (~> 1.1)
|
36
|
+
tilt (>= 1.2.2, < 2.0)
|
37
|
+
tilt (1.2.2)
|
38
|
+
trinidad (1.1.0)
|
39
|
+
jruby-rack (>= 1.0.6)
|
40
|
+
trinidad_jars (>= 1.0.0)
|
41
|
+
trinidad_jars (1.0.1)
|
42
|
+
vegas (0.1.8)
|
43
|
+
rack (>= 1.0.0)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
java
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
mocha
|
50
|
+
rspec
|
51
|
+
trinidad_resque_extension!
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 David Calavera
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
Trinidad resque extension
|
2
|
+
-------------------------
|
3
|
+
|
4
|
+
Extension to initialize resque as a process under Trinidad's control and integrate resque's console.
|
5
|
+
When Trinidad starts up it also starts the resque's workers and the console up.
|
6
|
+
|
7
|
+
http://github.com/defunkt/resque
|
8
|
+
|
9
|
+
Installation
|
10
|
+
============
|
11
|
+
|
12
|
+
jruby -S gem install trinidad_resque_extension
|
13
|
+
|
14
|
+
Configuration
|
15
|
+
=============
|
16
|
+
|
17
|
+
Any of the configuration options that resque needs can be specified in the trinidad's configuration file:
|
18
|
+
|
19
|
+
<pre>
|
20
|
+
---
|
21
|
+
extensions:
|
22
|
+
resque:
|
23
|
+
queues: critical, normal, low # resque workers
|
24
|
+
count: 354 # number of resque processes, by default 1
|
25
|
+
redis_host: 'localhost:6379' # where redis is running
|
26
|
+
</pre>
|
27
|
+
|
28
|
+
By default, trinidad creates a worker called `trinidad_resque` if we don't
|
29
|
+
specify anyone, so we can configure the extension through the command line
|
30
|
+
with all the default options:
|
31
|
+
|
32
|
+
<pre>$ jruby -S trinidad -l resque</pre>
|
33
|
+
|
34
|
+
The resque console is deployed on /resque but we can disable it with the
|
35
|
+
option `disable_web`:
|
36
|
+
|
37
|
+
<pre>
|
38
|
+
---
|
39
|
+
extensions:
|
40
|
+
resque:
|
41
|
+
disable_web: true
|
42
|
+
</pre>
|
43
|
+
|
44
|
+
The extension tries to load the tasks from the directory `lib/tasks` but
|
45
|
+
this parameter can be overrided with the option `path`:
|
46
|
+
|
47
|
+
<pre>
|
48
|
+
---
|
49
|
+
extensions:
|
50
|
+
resque:
|
51
|
+
path: 'tasks_dir'
|
52
|
+
</pre>
|
53
|
+
|
54
|
+
Copyright
|
55
|
+
=========
|
56
|
+
|
57
|
+
Copyright (c) 2011 David Calavera <calavera@apache.org>. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
#############################################################################
|
6
|
+
#
|
7
|
+
# Helper functions
|
8
|
+
#
|
9
|
+
#############################################################################
|
10
|
+
|
11
|
+
def name
|
12
|
+
@name ||= Dir['*.gemspec'].first.split('.').first
|
13
|
+
end
|
14
|
+
|
15
|
+
def version
|
16
|
+
line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
17
|
+
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
18
|
+
end
|
19
|
+
|
20
|
+
def date
|
21
|
+
Date.today.to_s
|
22
|
+
end
|
23
|
+
|
24
|
+
def rubyforge_project
|
25
|
+
name
|
26
|
+
end
|
27
|
+
|
28
|
+
def gemspec_file
|
29
|
+
"#{name}.gemspec"
|
30
|
+
end
|
31
|
+
|
32
|
+
def gem_file
|
33
|
+
"#{name}-#{version}.gem"
|
34
|
+
end
|
35
|
+
|
36
|
+
def replace_header(head, header_name)
|
37
|
+
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
38
|
+
end
|
39
|
+
|
40
|
+
#############################################################################
|
41
|
+
#
|
42
|
+
# Standard tasks
|
43
|
+
#
|
44
|
+
#############################################################################
|
45
|
+
|
46
|
+
task :default => :spec
|
47
|
+
|
48
|
+
require 'rspec/core/rake_task'
|
49
|
+
|
50
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
51
|
+
spec.rspec_opts = ['--color', "--format documentation"]
|
52
|
+
end
|
53
|
+
desc "Open an irb session preloaded with this library"
|
54
|
+
task :console do
|
55
|
+
sh "irb -rubygems -r ./lib/#{name}.rb"
|
56
|
+
end
|
57
|
+
#
|
58
|
+
#############################################################################
|
59
|
+
#
|
60
|
+
# Packaging tasks
|
61
|
+
#
|
62
|
+
#############################################################################
|
63
|
+
|
64
|
+
desc "release a version"
|
65
|
+
task :release => :build do
|
66
|
+
unless `git branch` =~ /^\* master$/
|
67
|
+
puts "You must be on the master branch to release!"
|
68
|
+
exit!
|
69
|
+
end
|
70
|
+
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
71
|
+
sh "git tag v#{version}"
|
72
|
+
sh "git push origin master"
|
73
|
+
sh "git push --tags"
|
74
|
+
sh "gem push pkg/#{name}-#{version}.gem"
|
75
|
+
end
|
76
|
+
|
77
|
+
desc "build gem"
|
78
|
+
task :build => :gemspec do
|
79
|
+
sh "mkdir -p pkg"
|
80
|
+
sh "gem build #{gemspec_file}"
|
81
|
+
sh "mv #{gem_file} pkg"
|
82
|
+
end
|
83
|
+
|
84
|
+
desc "install gem"
|
85
|
+
task :install => :build do
|
86
|
+
sh "gem install pkg/#{name}-#{version}.gem"
|
87
|
+
end
|
88
|
+
|
89
|
+
task :gemspec do
|
90
|
+
# read spec file and split out manifest section
|
91
|
+
spec = File.read(gemspec_file)
|
92
|
+
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
93
|
+
|
94
|
+
# replace name version and date
|
95
|
+
replace_header(head, :name)
|
96
|
+
replace_header(head, :version)
|
97
|
+
replace_header(head, :date)
|
98
|
+
#comment this out if your rubyforge_project has a different name
|
99
|
+
replace_header(head, :rubyforge_project)
|
100
|
+
|
101
|
+
# determine file list from git ls-files
|
102
|
+
files = `git ls-files`.
|
103
|
+
split("\n").
|
104
|
+
sort.
|
105
|
+
reject { |file| file =~ /^\./ }.
|
106
|
+
reject { |file| file =~ /^(rdoc|pkg|src|git-hooks)/ }.
|
107
|
+
map { |file| " #{file}" }.
|
108
|
+
join("\n")
|
109
|
+
|
110
|
+
# piece file back together and write
|
111
|
+
manifest = " s.files = %w[\n#{files}\n ]\n"
|
112
|
+
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
113
|
+
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
114
|
+
puts "Updated #{gemspec_file}"
|
115
|
+
end
|
data/lib/resque_ext.rb
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
require File.expand_path('../resque_ext', __FILE__)
|
2
|
+
|
3
|
+
module Trinidad
|
4
|
+
module Extensions
|
5
|
+
module Resque
|
6
|
+
require 'rake'
|
7
|
+
require 'resque/tasks'
|
8
|
+
|
9
|
+
class ResqueLifecycleListener
|
10
|
+
include Trinidad::Tomcat::LifecycleListener
|
11
|
+
|
12
|
+
def initialize(options)
|
13
|
+
@options = options
|
14
|
+
end
|
15
|
+
|
16
|
+
def lifecycle_event(event)
|
17
|
+
case event.type
|
18
|
+
when Trinidad::Tomcat::Lifecycle::BEFORE_START_EVENT
|
19
|
+
start_workers
|
20
|
+
when Trinidad::Tomcat::Lifecycle::BEFORE_STOP_EVENT
|
21
|
+
stop_workers
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def start_workers
|
26
|
+
Thread.new do
|
27
|
+
load_tasks
|
28
|
+
task = configure_workers
|
29
|
+
invoke_workers task
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def load_tasks
|
34
|
+
Dir.glob(File.join(@options[:path], '**', '*.rb')).each do |path|
|
35
|
+
load path
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def configure_workers
|
40
|
+
task = 'resque:work'
|
41
|
+
|
42
|
+
if @options[:count]
|
43
|
+
ENV['COUNT'] = @options[:count].to_s
|
44
|
+
task = 'resque:workers'
|
45
|
+
end
|
46
|
+
|
47
|
+
ENV['QUEUES'] ||= @options[:queues]
|
48
|
+
|
49
|
+
::Resque.redis = @options[:redis_host]
|
50
|
+
|
51
|
+
load @options[:setup] if @options[:setup]
|
52
|
+
task
|
53
|
+
end
|
54
|
+
|
55
|
+
def invoke_workers(task)
|
56
|
+
Rake::Task[task].invoke
|
57
|
+
rescue Errno::ECONNREFUSED
|
58
|
+
puts "WARN: Cannot connect with Redis. Please restart the server when Redis is up again."
|
59
|
+
@redis_econnref = true
|
60
|
+
end
|
61
|
+
|
62
|
+
def stop_workers
|
63
|
+
return if @redis_econnref # double check redis is connected, otherwise return
|
64
|
+
::Resque.workers.each { |w| w.shutdown! }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
module Trinidad
|
2
|
+
module Extensions
|
3
|
+
require File.expand_path('../resque_lifecycle_listener', __FILE__)
|
4
|
+
module Resque
|
5
|
+
VERSION = '0.1.0'
|
6
|
+
end
|
7
|
+
|
8
|
+
class ResqueApp < Trinidad::RackupWebApp
|
9
|
+
def init_params
|
10
|
+
super
|
11
|
+
add_parameter_unless_exist 'rackup', "require 'rubygems';require 'resque';require 'resque/server';run Resque::Server.new"
|
12
|
+
@params
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class ResqueServerExtension < ServerExtension
|
17
|
+
attr_accessor :options
|
18
|
+
|
19
|
+
def initialize(options)
|
20
|
+
super
|
21
|
+
@options[:redis_host] ||= 'localhost:6379'
|
22
|
+
@options[:queues] ||= 'trinidad_resque'
|
23
|
+
@options[:path] ||= File.join('lib', 'tasks')
|
24
|
+
end
|
25
|
+
|
26
|
+
def configure(tomcat)
|
27
|
+
add_resque_listener(tomcat)
|
28
|
+
|
29
|
+
init_resque_web(tomcat) unless @options[:disable_web]
|
30
|
+
|
31
|
+
trap_signals(tomcat)
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_resque_listener(tomcat)
|
35
|
+
tomcat.host.add_lifecycle_listener(Trinidad::Extensions::Resque::ResqueLifecycleListener.new(@options))
|
36
|
+
end
|
37
|
+
|
38
|
+
def init_resque_web(tomcat)
|
39
|
+
opts = prepare_options
|
40
|
+
|
41
|
+
app_context = tomcat.addWebapp(opts[:context_path], opts[:web_app_dir])
|
42
|
+
|
43
|
+
web_app = ResqueApp.new({}, opts)
|
44
|
+
|
45
|
+
app_context.add_lifecycle_listener(Trinidad::Lifecycle::Default.new(web_app))
|
46
|
+
web_app
|
47
|
+
end
|
48
|
+
|
49
|
+
def prepare_options
|
50
|
+
# where resque gem is
|
51
|
+
resque_path = Gem::GemPathSearcher.new.find('resque').full_gem_path
|
52
|
+
|
53
|
+
opts = {
|
54
|
+
:context_path => '/resque',
|
55
|
+
:jruby_min_runtimes => 1,
|
56
|
+
:jruby_max_runtimes => 2,
|
57
|
+
:libs_dir => 'libs',
|
58
|
+
:classes_dir => 'classes',
|
59
|
+
:public => 'public',
|
60
|
+
:environment => 'production'
|
61
|
+
}
|
62
|
+
|
63
|
+
opts.deep_merge!(@options)
|
64
|
+
opts[:web_app_dir] = File.expand_path('lib/resque/server', resque_path)
|
65
|
+
opts
|
66
|
+
end
|
67
|
+
|
68
|
+
def trap_signals(tomcat)
|
69
|
+
# trap signals and stop tomcat properly to make sure resque is also stopped properly
|
70
|
+
trap('INT') { tomcat.stop }
|
71
|
+
trap('TERM') { tomcat.stop }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class ResqueOptionsExtension < OptionsExtension
|
76
|
+
def configure(parser, default_options)
|
77
|
+
default_options[:extensions] ||= {}
|
78
|
+
default_options[:extensions][:resque] = {}
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "Trinidad::Extensions::Resque::ResqueLifecycleListener" do
|
4
|
+
R = Trinidad::Extensions::Resque::ResqueLifecycleListener
|
5
|
+
|
6
|
+
it "configures workers with the task 'resque:work'" do
|
7
|
+
task = configure_with_opts({})
|
8
|
+
task.should == 'resque:work'
|
9
|
+
end
|
10
|
+
|
11
|
+
it "sets the name of the queues in the environment variable" do
|
12
|
+
configure_with_opts({:queues => 'test'})
|
13
|
+
ENV['QUEUES'].should == 'test'
|
14
|
+
end
|
15
|
+
|
16
|
+
it "sets the redis host name" do
|
17
|
+
r = ::Resque.expects(:"redis=").with('localhost:6359')
|
18
|
+
configure_with_opts({:redis_host => 'localhost:6359'})
|
19
|
+
end
|
20
|
+
|
21
|
+
it "sets the number of workers with the option :count" do
|
22
|
+
task = configure_with_opts({:count => 3})
|
23
|
+
ENV['COUNT'].should == '3'
|
24
|
+
task.should == 'resque:workers'
|
25
|
+
end
|
26
|
+
|
27
|
+
it "loads the setup script with the option :setup" do
|
28
|
+
configure_with_opts({:setup => File.expand_path('../resque_test_setup.rb', __FILE__)})
|
29
|
+
Rake::Task['test:setup'].should be_instance_of(Rake::Task)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "invokes the rake task given its name" do
|
33
|
+
Rake::Task.any_instance.expects(:invoke)
|
34
|
+
listener = R.new({})
|
35
|
+
listener.invoke_workers('resque:work')
|
36
|
+
end
|
37
|
+
|
38
|
+
it "does not try to shut the workers down when it could not connect with Redis" do
|
39
|
+
Rake::Task.any_instance.expects(:invoke).raises(Errno::ECONNREFUSED)
|
40
|
+
::Resque.expects(:workers).never
|
41
|
+
|
42
|
+
listener = R.new({})
|
43
|
+
listener.invoke_workers('resque:work')
|
44
|
+
listener.stop_workers
|
45
|
+
end
|
46
|
+
|
47
|
+
it "invokes the shutdown! method for each worker before stopping the host" do
|
48
|
+
m = mock
|
49
|
+
m.expects(:shutdown!)
|
50
|
+
::Resque.expects(:workers).returns([m])
|
51
|
+
|
52
|
+
listener = R.new({})
|
53
|
+
listener.stop_workers
|
54
|
+
end
|
55
|
+
|
56
|
+
def configure_with_opts(options)
|
57
|
+
listener = R.new(options)
|
58
|
+
listener.configure_workers
|
59
|
+
end
|
60
|
+
end
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "Trinidad::Extensions::ResqueServerExtension" do
|
4
|
+
subject { Trinidad::Extensions::ResqueServerExtension.new({}) }
|
5
|
+
let(:tomcat) { Trinidad::Tomcat::Tomcat.new }
|
6
|
+
|
7
|
+
context "without user options" do
|
8
|
+
it "uses localhost:6379 as default redis installation" do
|
9
|
+
subject.options[:redis_host].should == 'localhost:6379'
|
10
|
+
end
|
11
|
+
|
12
|
+
it "adds a default queue called 'trinidad_resque'" do
|
13
|
+
subject.options[:queues].should == 'trinidad_resque'
|
14
|
+
end
|
15
|
+
|
16
|
+
it "enables the reque console" do
|
17
|
+
subject.options[:disable_web].should be_nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it "add the resque listener to the tomcat's default host" do
|
22
|
+
subject.add_resque_listener tomcat
|
23
|
+
tomcat.host.find_lifecycle_listeners.should have(1).listener
|
24
|
+
end
|
25
|
+
|
26
|
+
it "creates an application context for the resque console" do
|
27
|
+
context = find_resque_web
|
28
|
+
context.should be_instance_of(Trinidad::Tomcat::StandardContext)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "does not create the application context when the option :disable_web is true" do
|
32
|
+
e = Trinidad::Extensions::ResqueServerExtension.new({:disable_web => true})
|
33
|
+
e.configure tomcat
|
34
|
+
tomcat.host.find_child('/resque').should be_nil
|
35
|
+
end
|
36
|
+
|
37
|
+
it "uses the rackup parameter to start the application" do
|
38
|
+
find_web_app.init_params['rackup'].should =~ /Resque::Server.new/
|
39
|
+
end
|
40
|
+
|
41
|
+
it "uses resque gem directory as application base directory" do
|
42
|
+
resque_path = Gem::GemPathSearcher.new.find('resque').full_gem_path
|
43
|
+
find_web_app.web_app_dir.should =~ /^#{resque_path}/
|
44
|
+
end
|
45
|
+
|
46
|
+
def find_resque_web
|
47
|
+
subject.init_resque_web tomcat
|
48
|
+
tomcat.host.find_child('/resque')
|
49
|
+
end
|
50
|
+
|
51
|
+
def find_web_app
|
52
|
+
context = find_resque_web
|
53
|
+
listener = context.find_lifecycle_listeners.select {|l| l.is_a? Trinidad::Lifecycle::Default }.first
|
54
|
+
listener.webapp
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
## This is the rakegem gemspec template. Make sure you read and understand
|
2
|
+
## all of the comments. Some sections require modification, and others can
|
3
|
+
## be deleted if you don't need them. Once you understand the contents of
|
4
|
+
## this file, feel free to delete any comments that begin with two hash marks.
|
5
|
+
## You can find comprehensive Gem::Specification documentation, at
|
6
|
+
## http://docs.rubygems.org/read/chapter/20
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
9
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
|
+
s.rubygems_version = '1.3.5'
|
11
|
+
|
12
|
+
## Leave these as is they will be modified for you by the rake gemspec task.
|
13
|
+
## If your rubyforge_project name is different, then edit it and comment out
|
14
|
+
## the sub! line in the Rakefile
|
15
|
+
s.name = 'trinidad_resque_extension'
|
16
|
+
s.version = '0.1.0'
|
17
|
+
s.date = '2011-04-01'
|
18
|
+
s.rubyforge_project = 'trinidad_resque_extension'
|
19
|
+
|
20
|
+
## Make sure your summary is short. The description may be as long
|
21
|
+
## as you like.
|
22
|
+
s.summary = "Trinidad resque extension"
|
23
|
+
s.description = "Trinidad extension to autoconfigure and launch Resque"
|
24
|
+
|
25
|
+
## List the primary authors. If there are a bunch of authors, it's probably
|
26
|
+
## better to set the email to an email list or something. If you don't have
|
27
|
+
## a custom homepage, consider using your GitHub URL or the like.
|
28
|
+
s.authors = ["David Calavera"]
|
29
|
+
s.email = 'calavera@apache.org'
|
30
|
+
s.homepage = 'http://github.com/trinidad/trinidad_resque_extension'
|
31
|
+
|
32
|
+
## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
|
33
|
+
## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
|
34
|
+
s.require_paths = %w[lib]
|
35
|
+
|
36
|
+
## Specify any RDoc options here. You'll want to add your README and
|
37
|
+
## LICENSE files to the extra_rdoc_files list.
|
38
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
39
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
40
|
+
|
41
|
+
## List your runtime dependencies here. Runtime dependencies are those
|
42
|
+
## that are needed for an end user to actually USE your code.
|
43
|
+
s.add_dependency('rake')
|
44
|
+
s.add_dependency('trinidad')
|
45
|
+
s.add_dependency('resque')
|
46
|
+
|
47
|
+
## List your development dependencies here. Development dependencies are
|
48
|
+
## those that are only needed during development
|
49
|
+
s.add_development_dependency('rspec')
|
50
|
+
s.add_development_dependency('mocha')
|
51
|
+
|
52
|
+
## Leave this section as-is. It will be automatically generated from the
|
53
|
+
## contents of your Git repository via the gemspec task. DO NOT REMOVE
|
54
|
+
## THE MANIFEST COMMENTS, they are used as delimiters by the task.
|
55
|
+
# = MANIFEST =
|
56
|
+
s.files = %w[
|
57
|
+
Gemfile
|
58
|
+
Gemfile.lock
|
59
|
+
LICENSE
|
60
|
+
README.md
|
61
|
+
Rakefile
|
62
|
+
lib/resque_ext.rb
|
63
|
+
lib/resque_lifecycle_listener.rb
|
64
|
+
lib/trinidad_resque_extension.rb
|
65
|
+
spec/resque_lifecycle_listener_spec.rb
|
66
|
+
spec/resque_test_setup.rb
|
67
|
+
spec/spec.opts
|
68
|
+
spec/spec_helper.rb
|
69
|
+
spec/trinidad_resque_extension_spec.rb
|
70
|
+
trinidad_resque_extension.gemspec
|
71
|
+
]
|
72
|
+
# = MANIFEST =
|
73
|
+
|
74
|
+
## Test files will be grabbed from the file list. Make sure the path glob
|
75
|
+
## matches what you actually use.
|
76
|
+
s.test_files = s.files.select { |path| path =~ /^spec\/.*_spec\.rb/ }
|
77
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: trinidad_resque_extension
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- David Calavera
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-04-01 00:00:00 -07:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rake
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: trinidad
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "0"
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: resque
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rspec
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
type: :development
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: mocha
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id005
|
71
|
+
description: Trinidad extension to autoconfigure and launch Resque
|
72
|
+
email: calavera@apache.org
|
73
|
+
executables: []
|
74
|
+
|
75
|
+
extensions: []
|
76
|
+
|
77
|
+
extra_rdoc_files:
|
78
|
+
- README.md
|
79
|
+
- LICENSE
|
80
|
+
files:
|
81
|
+
- Gemfile
|
82
|
+
- Gemfile.lock
|
83
|
+
- LICENSE
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
86
|
+
- lib/resque_ext.rb
|
87
|
+
- lib/resque_lifecycle_listener.rb
|
88
|
+
- lib/trinidad_resque_extension.rb
|
89
|
+
- spec/resque_lifecycle_listener_spec.rb
|
90
|
+
- spec/resque_test_setup.rb
|
91
|
+
- spec/spec.opts
|
92
|
+
- spec/spec_helper.rb
|
93
|
+
- spec/trinidad_resque_extension_spec.rb
|
94
|
+
- trinidad_resque_extension.gemspec
|
95
|
+
has_rdoc: true
|
96
|
+
homepage: http://github.com/trinidad/trinidad_resque_extension
|
97
|
+
licenses: []
|
98
|
+
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options:
|
101
|
+
- --charset=UTF-8
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: "0"
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: "0"
|
116
|
+
requirements: []
|
117
|
+
|
118
|
+
rubyforge_project: trinidad_resque_extension
|
119
|
+
rubygems_version: 1.5.1
|
120
|
+
signing_key:
|
121
|
+
specification_version: 2
|
122
|
+
summary: Trinidad resque extension
|
123
|
+
test_files:
|
124
|
+
- spec/resque_lifecycle_listener_spec.rb
|
125
|
+
- spec/trinidad_resque_extension_spec.rb
|