resque-meta 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,38 +1,15 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
1
4
  require 'rake/testtask'
2
- require 'rake/rdoctask'
5
+ Rake::TestTask.new do |t|
6
+ t.libs << 'lib'
7
+ t.pattern = 'test/**/*_test.rb'
8
+ t.verbose = false
9
+ end
3
10
 
4
11
  def command?(command)
5
12
  system("type #{command} > /dev/null")
6
13
  end
7
14
 
8
- #
9
- # Tests
10
- #
11
-
12
15
  task :default => :test
13
-
14
- if command? :turn
15
- desc "Run tests"
16
- task :test do
17
- suffix = "-n #{ENV['TEST']}" if ENV['TEST']
18
- sh "turn test/*_test.rb #{suffix}"
19
- end
20
- else
21
- Rake::TestTask.new do |t|
22
- t.libs << 'lib'
23
- t.pattern = 'test/**/*_test.rb'
24
- t.verbose = false
25
- end
26
- end
27
-
28
- #
29
- # Gems
30
- #
31
-
32
- begin
33
- require 'mg'
34
- MG.new("resque-meta.gemspec")
35
- rescue LoadError
36
- warn "mg not available."
37
- warn "Install it with: gem i mg"
38
- end
@@ -1,7 +1,7 @@
1
1
  module Resque
2
2
  module Plugins
3
3
  module Meta
4
- Version = '1.0.1'
4
+ Version = '1.0.2'
5
5
  end
6
6
  end
7
7
  end
@@ -36,7 +36,7 @@ module Resque
36
36
  # passed the same arguments as `perform`, that is, your job's
37
37
  # payload.
38
38
  def meta_id(*args)
39
- Digest::SHA1.hexdigest([ Time.now.to_i, self, args ].join)
39
+ Digest::SHA1.hexdigest([ Time.now.to_f, rand, self, args ].join)
40
40
  end
41
41
 
42
42
  # Override in your job to control the how many seconds a job's
data/test/meta_test.rb CHANGED
@@ -55,7 +55,7 @@ class MetaTest < Test::Unit::TestCase
55
55
  end
56
56
 
57
57
  def test_meta_version
58
- assert_equal '1.0.1', Resque::Plugins::Meta::Version
58
+ assert_equal '1.0.2', Resque::Plugins::Meta::Version
59
59
  end
60
60
 
61
61
  def test_lint
data/test/test_helper.rb CHANGED
@@ -23,10 +23,13 @@ end
23
23
  at_exit do
24
24
  next if $!
25
25
 
26
+ exit_code = Test::Unit::AutoRunner.run
27
+
26
28
  pid = `ps -A -o pid,command | grep [r]edis-test`.split(" ")[0]
27
- puts "Killing test redis server..."
29
+ puts "Killing test redis server[#{pid}]..."
28
30
  `rm -f #{dir}/dump.rdb`
29
31
  Process.kill("KILL", pid.to_i)
32
+ exit exit_code
30
33
  end
31
34
 
32
35
  puts "Starting redis for testing at localhost:9736..."
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-meta
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lee Marlow
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-10 00:00:00 -06:00
18
+ date: 2010-11-03 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -78,7 +78,7 @@ files:
78
78
  - test/meta_test.rb
79
79
  - test/redis-test.conf
80
80
  - test/test_helper.rb
81
- has_rdoc: true
81
+ has_rdoc: false
82
82
  homepage: http://github.com/lmarlow/resque-meta
83
83
  licenses: []
84
84