resque_unit 1.0.0.beta.1 → 1.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque_unit.rb +0 -1
- data/lib/resque_unit/resque/test_extensions.rb +0 -2
- metadata +3 -18
- data/lib/resque_unit/helpers.rb +0 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7f97661c4942301890a017728285e1ab9d65b3f
|
4
|
+
data.tar.gz: 260b78240c5893fd2a63f555699d46643f4d0d1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7c292dff03229418161eab51a16f8e9f3415df0d5ed24b58dbf8bca94453c0962bf792de19c0669b080c3ed12642f2a1b07ea381003aefb8024847b74950ea
|
7
|
+
data.tar.gz: e6b67c8fbd8b9409981b409836d9613a20a8b7fc1732b98beaee8b353ccbf18c3977b8af464bd368165c9021b0e47dceec1bbd4ac8d2f3db514aaa696973b776
|
data/lib/resque_unit.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque_unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.beta.
|
4
|
+
version: 1.0.0.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Weiss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: json
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.4.6
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.4.6
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: fakeredis
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,7 +104,6 @@ files:
|
|
118
104
|
- README.md
|
119
105
|
- lib/resque_unit.rb
|
120
106
|
- lib/resque_unit/assertions.rb
|
121
|
-
- lib/resque_unit/helpers.rb
|
122
107
|
- lib/resque_unit/resque.rb
|
123
108
|
- lib/resque_unit/resque/test_extensions.rb
|
124
109
|
- lib/resque_unit/scheduler_assertions.rb
|
@@ -149,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
134
|
version: 1.3.1
|
150
135
|
requirements: []
|
151
136
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.4.5.1
|
153
138
|
signing_key:
|
154
139
|
specification_version: 4
|
155
140
|
summary: Minitest and Test::Unit support for resque job queueing
|
data/lib/resque_unit/helpers.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
module ResqueUnit
|
2
|
-
module Helpers
|
3
|
-
# Given a Ruby object, returns a string suitable for storage in a
|
4
|
-
# queue.
|
5
|
-
def encode(object)
|
6
|
-
if defined? Yajl
|
7
|
-
Yajl::Encoder.encode(object)
|
8
|
-
else
|
9
|
-
object.to_json
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
# Given a string, returns a Ruby object.
|
14
|
-
def decode(object)
|
15
|
-
return unless object
|
16
|
-
|
17
|
-
if defined? Yajl
|
18
|
-
begin
|
19
|
-
Yajl::Parser.parse(object, :check_utf8 => false)
|
20
|
-
rescue Yajl::ParseError
|
21
|
-
end
|
22
|
-
else
|
23
|
-
begin
|
24
|
-
JSON.parse(object)
|
25
|
-
rescue JSON::ParserError
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
# Given a word with dashes, returns a camel cased version of it.
|
31
|
-
#
|
32
|
-
# classify('job-name') # => 'JobName'
|
33
|
-
def classify(dashed_word)
|
34
|
-
dashed_word.split('-').each { |part| part[0] = part[0].chr.upcase }.join
|
35
|
-
end
|
36
|
-
|
37
|
-
# Given a camel cased word, returns the constant it represents
|
38
|
-
#
|
39
|
-
# constantize('JobName') # => JobName
|
40
|
-
def constantize(camel_cased_word)
|
41
|
-
camel_cased_word = camel_cased_word.to_s
|
42
|
-
|
43
|
-
if camel_cased_word.include?('-')
|
44
|
-
camel_cased_word = classify(camel_cased_word)
|
45
|
-
end
|
46
|
-
|
47
|
-
names = camel_cased_word.split('::')
|
48
|
-
names.shift if names.empty? || names.first.empty?
|
49
|
-
|
50
|
-
constant = Object
|
51
|
-
names.each do |name|
|
52
|
-
constant = constant.const_get(name) || constant.const_missing(name)
|
53
|
-
end
|
54
|
-
constant
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|