forked from lmarlow/resque-meta
-
Notifications
You must be signed in to change notification settings - Fork 1
/
resque-meta.gemspec
56 lines (45 loc) · 1.7 KB
/
resque-meta.gemspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require File.expand_path('../lib/resque/plugins/meta/version', __FILE__)
Gem::Specification.new do |s|
s.name = "resque-meta"
s.version = Resque::Plugins::Meta::Version
s.date = Time.now.strftime('%Y-%m-%d')
s.summary = "A Resque plugin for storing job metadata."
s.homepage = "http://github.com/lmarlow/resque-meta"
s.email = "[email protected]"
s.authors = [ "Lee Marlow" ]
s.has_rdoc = false
s.files = %w( README.md Rakefile LICENSE )
s.files += Dir.glob("lib/**/*")
s.files += Dir.glob("test/**/*")
s.description = <<desc
A Resque plugin. If you want to be able to add metadata for a job
to track anything you want, extend it with this module.
For example:
require 'resque-meta'
class MyJob
extend Resque::Plugins::Meta
def self.perform(meta_id, *args)
heavy_lifting
end
end
meta0 = MyJob.enqueue('stuff')
meta0.enqueued_at # => 'Wed May 19 13:42:41 -0600 2010'
meta0.meta_id # => '03c9e1a045ad012dd20500264a19273c'
meta0['foo'] = 'bar' # => 'bar'
meta0.save
# later
meta1 = MyJob.get_meta('03c9e1a045ad012dd20500264a19273c')
meta1.job_class # => MyJob
meta1.enqueued_at # => 'Wed May 19 13:42:41 -0600 2010'
meta1['foo'] # => 'bar'
desc
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
s.add_runtime_dependency('resque', ["~> 1.8"])
s.add_development_dependency('rake', ["~> 0.9.2"])
else
s.add_dependency('resque', ["~> 1.8"])
s.add_dependency('rake', ["~> 0.9.2"])
end
end