delayed-method 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/delayed-method.rb +3 -1
- data/spec/delayed_method_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 199c2c86472c9f45d731e41a266ba517587eff94
|
4
|
+
data.tar.gz: 4328833b2ff5aea3fa0a58914a7526c5b7744bd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5af85b205520aa22f3cbc6eba3df5f2c1a905b1147762a380159095839bfb3e97415e81f1eb155631e5b5c4d8b8773a8c9e0c918280cb5340d04427c87256644
|
7
|
+
data.tar.gz: 8b0ab7e181a93f3856ba4a6621b961ad7f8d145173320def18595c2938bd230af73ebb48dd8f8c47d0966f5cff6a2c354b5a7ba4b95e28fa9aebbcfda4f4bff3
|
data/README.md
CHANGED
data/lib/delayed-method.rb
CHANGED
@@ -5,8 +5,10 @@ class DelayedMethod
|
|
5
5
|
@queue = :delayed
|
6
6
|
|
7
7
|
class << self
|
8
|
+
attr_accessor :debugging
|
9
|
+
|
8
10
|
def perform(klass_name, instance_id, method, *args)
|
9
|
-
puts "<#{klass_name}##{instance_id}>##{method}#{args}"
|
11
|
+
puts "<#{klass_name}##{instance_id}>##{method}#{args}" if debugging
|
10
12
|
if instance_id
|
11
13
|
Object.const_get(klass_name).find(instance_id).send(method, *args)
|
12
14
|
else
|
data/spec/delayed_method_spec.rb
CHANGED
@@ -2,6 +2,14 @@ require File.dirname(__FILE__) + '/spec_helper'
|
|
2
2
|
require 'active_record'
|
3
3
|
|
4
4
|
describe DelayedMethod do
|
5
|
+
describe "debugging get/set" do
|
6
|
+
it "works" do
|
7
|
+
DelayedMethod.debugging = true
|
8
|
+
expect(DelayedMethod.debugging).to eq true
|
9
|
+
DelayedMethod.debugging = nil
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
5
13
|
describe "enqueue and perform" do
|
6
14
|
context "object does not respond method" do
|
7
15
|
it "raises exception" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed-method
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phuong Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|