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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06d8a8a110ec6897312c7cd97aadcde63b5a5c303d7597dfb3a110ba202e94d3
4
- data.tar.gz: ef127e746f6b4c8cee9d024a6368ee6f729626290106b4cc85d9600138d317f6
3
+ metadata.gz: c0d2e2a83217838bd12d781d75ddf8d2ceee68a276f25250033cfd88ec5fe03c
4
+ data.tar.gz: 4e694303f68f0603ad5e3053cfcab2d1320687e19b7d2eb3923f15d68c4dd901
5
5
  SHA512:
6
- metadata.gz: f29dd8bb58731e45a94e4ad800f2df651f98f260851509765e4a821312c1f3d026ebc4b2a68f479b2b4bee96c5e68f9c1633a9d2cc762a9b382aa2715e5ad220
7
- data.tar.gz: e4a0cbe15974d7ea681eec581fe890cbed6799727b78342d5c4a7f39be065e3b31ab46da8bf0e453c6e8fa921bc867cc2d688a95396d02e63b585d5b35657fce
6
+ metadata.gz: 63f82f601d39aeda829260eafdc390ad0ea506c6a9510876ed5703266cd0496b24942a18337807f52c55a1df3617c5fff84476ed4e5ce35d18a6c396cc5431cd
7
+ data.tar.gz: 0da4ed8bfc3272d8ee4e0a542a60b6bb0266f44fee2c59f2318f93b1c4a759579707e78ebe637bd70c6b40f6e806159cf3cecd4b423c5efe4e4a8e0ef91b1fc8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ductr (0.1.1)
4
+ ductr (0.1.2)
5
5
  activejob (~> 7.0)
6
6
  annotable (~> 0.1)
7
7
  colorize (~> 0.8)
@@ -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, method)
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 scheduler, method_name and options.
82
+ # Returns a callable object based on given method and options.
82
83
  #
83
- # @param [Scheduler] scheduler The scheduler instance
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(scheduler, method_name, **)
90
- scheduler.method(method_name)
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] method The callable object (the scheduler's method in this case)
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, method)
103
- rufus.send(:do_schedule, rufus_type, rufus_value, nil, {}, false, method)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Ductr
4
4
  # @return [String] The ductr's version number
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
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.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-18 00:00:00.000000000 Z
11
+ date: 2023-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug