resque-lifecycle 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7cfd0620a61423a7892936014af7263e8b02e0b7
4
+ data.tar.gz: ac8749adb04a4fe93bda42e7355086c9ff8a8169
5
+ SHA512:
6
+ metadata.gz: 75a9236fa21105ff748a5b932e702eb3b1ba7e7c8ce4e9024d2560b431b579e40ff7a02ed7aeb2888a0bce9d66294df2a270e58a84f3d80f843b44ae79e6eb3b
7
+ data.tar.gz: 36730a67132c6f556c8a10dcae44f4dbd291bd4c0de2489138ddc1909c6f9c30e53cf4cf3e3b45dc870e5e1b6fdf9450313725253eb1bb04ab49bac083f348a9
Binary file
@@ -0,0 +1,3 @@
1
+ �4�a1�����󠘈�PS����0�ڦ
2
+ �WS%�)�U���  �@�����>*�������[>ok�'O�N����C)���|�+���a �[�I�n^%��Q��5�b+��L�~��;�jű>n{f ?r;@�@G��gی�'tj��'�a���W�p�|c��ڽ�
3
+ z�nV�R�e%tF�� 7yG�??�Ǝ��W�D� ;|��Wp5DZk|�� �*�]�-]r�>��GhR�;��BF]l����5
@@ -1,8 +1,6 @@
1
1
  module Resque
2
-
3
2
  module Lifecycle
4
-
5
- def self.included(base) #:nodoc:
3
+ def self.included(base)
6
4
  base.class_eval do
7
5
  alias_method :push_without_lifecycle, :push
8
6
  extend ClassMethods
@@ -10,20 +8,17 @@ module Resque
10
8
  end
11
9
 
12
10
  module ClassMethods
13
-
14
11
  # Wrapper for the original Resque push method, which adds a
15
12
  # created_at timestamp to any +item+ pushed onto the queue which
16
13
  # responds to #[]=.
17
14
  #
18
15
  def push(queue, item)
19
16
  if item.respond_to?(:[]=)
20
- item[:created_at] = Time.now.to_i
17
+ exists = item.respond_to?(:[]) && item['created_at']
18
+ item['created_at'] = Time.now.to_i unless exists
21
19
  end
22
20
  push_without_lifecycle queue, item
23
21
  end
24
-
25
22
  end
26
-
27
23
  end
28
-
29
24
  end
metadata CHANGED
@@ -1,100 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: resque-lifecycle
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 1
9
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
10
5
  platform: ruby
11
- authors:
6
+ authors:
7
+ - Michael Grosser
12
8
  - bitbckt
13
9
  autorequire:
14
10
  bindir: bin
15
- cert_chain: []
16
-
17
- date: 2010-04-08 00:00:00 -07:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: shoulda
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 10
30
- version: "2.10"
31
- type: :development
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: resque
35
- prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "="
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 1
42
- - 8
43
- - 0
44
- version: 1.8.0
45
- type: :runtime
46
- version_requirements: *id002
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MRAwDgYDVQQDDAdtaWNo
15
+ YWVsMRcwFQYKCZImiZPyLGQBGRYHZ3Jvc3NlcjESMBAGCgmSJomT8ixkARkWAml0
16
+ MB4XDTEzMDIwMzE4MTMxMVoXDTE0MDIwMzE4MTMxMVowPzEQMA4GA1UEAwwHbWlj
17
+ aGFlbDEXMBUGCgmSJomT8ixkARkWB2dyb3NzZXIxEjAQBgoJkiaJk/IsZAEZFgJp
18
+ dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMorXo/hgbUq97+kII9H
19
+ MsQcLdC/7wQ1ZP2OshVHPkeP0qH8MBHGg6eYisOX2ubNagF9YTCZWnhrdKrwpLOO
20
+ cPLaZbjUjljJ3cQR3B8Yn1veV5IhG86QseTBjymzJWsLpqJ1UZGpfB9tXcsFtuxO
21
+ 6vHvcIHdzvc/OUkICttLbH+1qb6rsHUceqh+JrH4GrsJ5H4hAfIdyS2XMK7YRKbh
22
+ h+IBu6dFWJJByzFsYmV1PDXln3UBmgAt65cmCu4qPfThioCGDzbSJrGDGLmw/pFX
23
+ FPpVCm1zgYSb1v6Qnf3cgXa2f2wYGm17+zAVyIDpwryFru9yF/jJxE38z/DRsd9R
24
+ /88CAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUsiNnXHtKeMYYcr4yJVmQ
25
+ WONL+IwwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQAlyN7kKo/NQCQ0
26
+ AOzZLZ3WAePvStkCFIJ53tsv5Kyo4pMAllv+BgPzzBt7qi605mFSL6zBd9uLou+W
27
+ Co3s48p1dy7CjjAfVQdmVNHF3MwXtfC2OEyvSQPi4xKR8iba8wa3xp9LVo1PuLpw
28
+ /6DsrChWw74HfsJN6qJOK684hJeT8lBYAUfiC3wD0owoPSg+XtyAAddisR+KV5Y1
29
+ NmVHuLtQcNTZy+gRht3ahJRMuC6QyLmkTsf+6MaenwAMkAgHdswGsJztOnNnBa3F
30
+ y0kCSWmK6D+x/SbfS6r7Ke07MRqziJdB9GuE1+0cIRuFh8EQ+LN6HXCKM5pon/GU
31
+ ycwMXfl0
32
+ -----END CERTIFICATE-----
33
+ date: 2013-10-11 00:00:00.000000000 Z
34
+ dependencies: []
47
35
  description:
48
- email: brandon@systemisdown.net
36
+ email: michael@grosser.it
49
37
  executables: []
50
-
51
38
  extensions: []
52
-
53
- extra_rdoc_files:
54
- - LICENSE
55
- - README.rdoc
56
- files:
57
- - .document
58
- - .gitignore
59
- - LICENSE
60
- - README.rdoc
61
- - Rakefile
62
- - VERSION
39
+ extra_rdoc_files: []
40
+ files:
63
41
  - lib/resque-lifecycle.rb
64
42
  - lib/resque/lifecycle.rb
65
- - resque-lifecycle.gemspec
66
- - test/helper.rb
67
- - test/test_lifecycle.rb
68
- has_rdoc: true
69
- homepage: http://github.com/bitbckt/resque-lifecycle
70
- licenses: []
71
-
43
+ homepage: https://github.com/grosser/resque-lifecycle
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
72
47
  post_install_message:
73
- rdoc_options:
74
- - --charset=UTF-8
75
- require_paths:
48
+ rdoc_options: []
49
+ require_paths:
76
50
  - lib
77
- required_ruby_version: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- segments:
82
- - 0
83
- version: "0"
84
- required_rubygems_version: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- segments:
89
- - 0
90
- version: "0"
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
91
61
  requirements: []
92
-
93
62
  rubyforge_project:
94
- rubygems_version: 1.3.6
63
+ rubygems_version: 2.0.6
95
64
  signing_key:
96
- specification_version: 3
65
+ specification_version: 4
97
66
  summary: Adds job lifecycle data to Resque payloads
98
- test_files:
99
- - test/helper.rb
100
- - test/test_lifecycle.rb
67
+ test_files: []
@@ -0,0 +1,2 @@
1
+ �ƪ�߮������phAj�"
2
+ �U˓�����Xg��-�k[G����d5���?�e���i��:��R � F\��� ���d�C-t�u�]���Q���R�6��Ž8XB۩*���Y(��H+�h:
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2010 Brandon Mitchell
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.
@@ -1,28 +0,0 @@
1
- = resque-lifecycle
2
-
3
- Resque::Lifecycle extends Resque's default enqueueing process to add a simple timestamp to the payload of
4
- each enqueued job. This allows easy measurement of queue throughput by inspecting the creation time of the
5
- head element on the queue.
6
-
7
- == Usage
8
-
9
- require 'resque'
10
- require 'resque-lifecycle'
11
-
12
- module Resque
13
- include Resque::Lifecycle
14
- end
15
-
16
- == Note on Patches/Pull Requests
17
-
18
- * Fork the project.
19
- * Make your feature addition or bug fix.
20
- * Add tests for it. This is important so I don't break it in a
21
- future version unintentionally.
22
- * Commit, do not mess with rakefile, version, or history.
23
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
24
- * Send me a pull request. Bonus points for topic branches.
25
-
26
- == Copyright
27
-
28
- Copyright (c) 2010 Brandon Mitchell. See LICENSE for details.
data/Rakefile DELETED
@@ -1,53 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "resque-lifecycle"
8
- gem.summary = "Adds job lifecycle data to Resque payloads"
9
- gem.email = "brandon@systemisdown.net"
10
- gem.homepage = "http://github.com/bitbckt/resque-lifecycle"
11
- gem.authors = ["bitbckt"]
12
- gem.add_development_dependency "shoulda", ">= 2.10"
13
- gem.add_dependency "resque", "1.8.0"
14
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
- end
16
- Jeweler::GemcutterTasks.new
17
- rescue LoadError
18
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19
- end
20
-
21
- require 'rake/testtask'
22
- Rake::TestTask.new(:test) do |test|
23
- test.libs << 'lib' << 'test'
24
- test.pattern = 'test/**/test_*.rb'
25
- test.verbose = true
26
- end
27
-
28
- begin
29
- require 'rcov/rcovtask'
30
- Rcov::RcovTask.new do |test|
31
- test.libs << 'test'
32
- test.pattern = 'test/**/test_*.rb'
33
- test.verbose = true
34
- end
35
- rescue LoadError
36
- task :rcov do
37
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
38
- end
39
- end
40
-
41
- task :test => :check_dependencies
42
-
43
- task :default => :test
44
-
45
- require 'rake/rdoctask'
46
- Rake::RDocTask.new do |rdoc|
47
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
-
49
- rdoc.rdoc_dir = 'rdoc'
50
- rdoc.title = "resque-lifecycle #{version}"
51
- rdoc.rdoc_files.include('README*')
52
- rdoc.rdoc_files.include('lib/**/*.rb')
53
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.1
@@ -1,57 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{resque-lifecycle}
8
- s.version = "0.1.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["bitbckt"]
12
- s.date = %q{2010-04-08}
13
- s.email = %q{brandon@systemisdown.net}
14
- s.extra_rdoc_files = [
15
- "LICENSE",
16
- "README.rdoc"
17
- ]
18
- s.files = [
19
- ".document",
20
- ".gitignore",
21
- "LICENSE",
22
- "README.rdoc",
23
- "Rakefile",
24
- "VERSION",
25
- "lib/resque-lifecycle.rb",
26
- "lib/resque/lifecycle.rb",
27
- "resque-lifecycle.gemspec",
28
- "test/helper.rb",
29
- "test/test_lifecycle.rb"
30
- ]
31
- s.homepage = %q{http://github.com/bitbckt/resque-lifecycle}
32
- s.rdoc_options = ["--charset=UTF-8"]
33
- s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.6}
35
- s.summary = %q{Adds job lifecycle data to Resque payloads}
36
- s.test_files = [
37
- "test/helper.rb",
38
- "test/test_lifecycle.rb"
39
- ]
40
-
41
- if s.respond_to? :specification_version then
42
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
- s.specification_version = 3
44
-
45
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
46
- s.add_development_dependency(%q<shoulda>, [">= 2.10"])
47
- s.add_runtime_dependency(%q<resque>, ["= 1.8.0"])
48
- else
49
- s.add_dependency(%q<shoulda>, [">= 2.10"])
50
- s.add_dependency(%q<resque>, ["= 1.8.0"])
51
- end
52
- else
53
- s.add_dependency(%q<shoulda>, [">= 2.10"])
54
- s.add_dependency(%q<resque>, ["= 1.8.0"])
55
- end
56
- end
57
-
@@ -1,17 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
- require 'shoulda'
4
-
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
- $LOAD_PATH.unshift(File.dirname(__FILE__))
7
- require 'resque-lifecycle'
8
-
9
- module ResqueMock
10
- extend self
11
-
12
- def push(queue, item)
13
- item
14
- end
15
-
16
- end
17
-
@@ -1,18 +0,0 @@
1
- require 'helper'
2
-
3
- module ResqueMock
4
- include Resque::Lifecycle
5
- end
6
-
7
- class LifecycleTest < Test::Unit::TestCase
8
-
9
- should 'add created_at to items with #[]=' do
10
- assert_not_nil ResqueMock.push('queue', { })[:created_at]
11
- end
12
-
13
- should 'not modify items missing #[]=' do
14
- item = Object.new
15
- assert_equal item.object_id, ResqueMock.push('queue', item).object_id
16
- end
17
-
18
- end