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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e36ff8184489e5c0415e3ee4ce57985c10470fe
4
- data.tar.gz: e210411cac14668a7aa3e5bd3ccd30f7d358da5b
3
+ metadata.gz: 199c2c86472c9f45d731e41a266ba517587eff94
4
+ data.tar.gz: 4328833b2ff5aea3fa0a58914a7526c5b7744bd7
5
5
  SHA512:
6
- metadata.gz: da3ce8966c10d57988f8fddf82851ca665885375d3dd7b96ed45252f46a93b9e5e7fc3ae91498f020bfa2cd68a3fe8687acb2674d461e088b07c591fd77258f2
7
- data.tar.gz: 7d7fea6d7148b4f586aa58908391d14a71d9edff03bdf912322a7d0db6f0b0d99c77c423dfc869d23ea2322685e431b792971b30498d64400dd3b90771627c31
6
+ metadata.gz: 5af85b205520aa22f3cbc6eba3df5f2c1a905b1147762a380159095839bfb3e97415e81f1eb155631e5b5c4d8b8773a8c9e0c918280cb5340d04427c87256644
7
+ data.tar.gz: 8b0ab7e181a93f3856ba4a6621b961ad7f8d145173320def18595c2938bd230af73ebb48dd8f8c47d0966f5cff6a2c354b5a7ba4b95e28fa9aebbcfda4f4bff3
data/README.md CHANGED
@@ -57,7 +57,7 @@ ActiveRecord reading from master instead of slave, you can do this:
57
57
  class MyCustomDelayedMethod < DelayedMethod
58
58
  @queue = :delayed
59
59
 
60
- def perform(klass_name, instance_id, method, *args)
60
+ def perform(*args)
61
61
  wrap_method do
62
62
  super
63
63
  end
@@ -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
@@ -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.3.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: 2019-11-16 00:00:00.000000000 Z
11
+ date: 2020-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque