ductr 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ductr/rufus_trigger.rb +9 -9
- data/lib/ductr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0d2e2a83217838bd12d781d75ddf8d2ceee68a276f25250033cfd88ec5fe03c
|
4
|
+
data.tar.gz: 4e694303f68f0603ad5e3053cfcab2d1320687e19b7d2eb3923f15d68c4dd901
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63f82f601d39aeda829260eafdc390ad0ea506c6a9510876ed5703266cd0496b24942a18337807f52c55a1df3617c5fff84476ed4e5ce35d18a6c396cc5431cd
|
7
|
+
data.tar.gz: 0da4ed8bfc3272d8ee4e0a542a60b6bb0266f44fee2c59f2318f93b1c4a759579707e78ebe637bd70c6b40f6e806159cf3cecd4b423c5efe4e4a8e0ef91b1fc8
|
data/Gemfile.lock
CHANGED
data/lib/ductr/rufus_trigger.rb
CHANGED
@@ -53,8 +53,9 @@ module Ductr
|
|
53
53
|
def add(method, options)
|
54
54
|
rufus_type = options.keys.first
|
55
55
|
rufus_value = options.values.first
|
56
|
+
handler = callable(method, **options)
|
56
57
|
|
57
|
-
do_schedule(rufus_type, rufus_value,
|
58
|
+
do_schedule(rufus_type, rufus_value, handler)
|
58
59
|
end
|
59
60
|
|
60
61
|
#
|
@@ -78,16 +79,15 @@ module Ductr
|
|
78
79
|
end
|
79
80
|
|
80
81
|
#
|
81
|
-
# Returns a callable object based on given
|
82
|
+
# Returns a callable object based on given method and options.
|
82
83
|
#
|
83
|
-
# @param [
|
84
|
-
# @param [Symbol] method_name The scheduler's method name
|
84
|
+
# @param [Method] method The scheduler's method
|
85
85
|
# @param [Hash] ** The option passed to the trigger annotation
|
86
86
|
#
|
87
87
|
# @return [#call] A callable object
|
88
88
|
#
|
89
|
-
def callable(
|
90
|
-
|
89
|
+
def callable(method, **)
|
90
|
+
method
|
91
91
|
end
|
92
92
|
|
93
93
|
#
|
@@ -95,12 +95,12 @@ module Ductr
|
|
95
95
|
#
|
96
96
|
# @param [Symbol] rufus_type The rufus-scheduler type (`:once`, `:every`, `:interval` or `:cron`)
|
97
97
|
# @param [String] rufus_value The rufus-scheduler value (e.g. `"10min"`)
|
98
|
-
# @param [#call]
|
98
|
+
# @param [#call] handler The callable object (the scheduler's method in this case)
|
99
99
|
#
|
100
100
|
# @return [void]
|
101
101
|
#
|
102
|
-
def do_schedule(rufus_type, rufus_value,
|
103
|
-
rufus.send(:do_schedule, rufus_type, rufus_value, nil, {}, false,
|
102
|
+
def do_schedule(rufus_type, rufus_value, handler)
|
103
|
+
rufus.send(:do_schedule, rufus_type, rufus_value, nil, {}, false, handler)
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
data/lib/ductr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ductr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu Morel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug
|