ductr 0.1.0 → 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: aa086bc74fe03508488dc65a5904eca264403a430ceaa8a0240ec51bb2a61d1c
4
- data.tar.gz: '085639963d2ae2151f22b642de482a3a3b17f83015029e579179459c76e3048c'
3
+ metadata.gz: c0d2e2a83217838bd12d781d75ddf8d2ceee68a276f25250033cfd88ec5fe03c
4
+ data.tar.gz: 4e694303f68f0603ad5e3053cfcab2d1320687e19b7d2eb3923f15d68c4dd901
5
5
  SHA512:
6
- metadata.gz: b4292ff971e517ae868adc9da20584b9663ca2f2f05ce7b6b0e9bfc67b1c989919c327883d69a675741b70f400143143b854dc6e746943e396ffd1febae39486
7
- data.tar.gz: f3615c8431c13a5528c0b3505d755b3517b4a7628ae84bfdfcdb7033d6d6981fc533677675581cea71ef0ddd092716a04ac04688905e1cde4028e5f60d628422
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.0)
4
+ ductr (0.1.2)
5
5
  activejob (~> 7.0)
6
6
  annotable (~> 0.1)
7
7
  colorize (~> 0.8)
@@ -13,10 +13,10 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- activejob (7.0.4)
17
- activesupport (= 7.0.4)
16
+ activejob (7.0.4.3)
17
+ activesupport (= 7.0.4.3)
18
18
  globalid (>= 0.3.6)
19
- activesupport (7.0.4)
19
+ activesupport (7.0.4.3)
20
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
21
21
  i18n (>= 1.6, < 2)
22
22
  minitest (>= 5.1)
@@ -26,17 +26,17 @@ GEM
26
26
  colorize (0.8.1)
27
27
  commander (4.6.0)
28
28
  highline (~> 2.0.0)
29
- concurrent-ruby (1.1.10)
29
+ concurrent-ruby (1.2.2)
30
30
  debug (1.6.3)
31
31
  irb (>= 1.3.6)
32
32
  reline (>= 0.3.1)
33
33
  diff-lcs (1.5.0)
34
34
  et-orbi (1.2.7)
35
35
  tzinfo
36
- fugit (1.7.1)
36
+ fugit (1.8.1)
37
37
  et-orbi (~> 1, >= 1.2.7)
38
38
  raabro (~> 1.4)
39
- globalid (1.0.0)
39
+ globalid (1.1.0)
40
40
  activesupport (>= 5.0)
41
41
  highline (2.0.3)
42
42
  i18n (1.12.0)
@@ -46,7 +46,7 @@ GEM
46
46
  reline (>= 0.3.0)
47
47
  json (2.6.2)
48
48
  kiba (4.0.0)
49
- minitest (5.16.3)
49
+ minitest (5.18.0)
50
50
  parallel (1.22.1)
51
51
  parlour (5.0.0)
52
52
  commander (~> 4.5)
@@ -97,13 +97,13 @@ GEM
97
97
  sorbet-runtime
98
98
  yard
99
99
  thor (1.2.1)
100
- tzinfo (2.0.5)
100
+ tzinfo (2.0.6)
101
101
  concurrent-ruby (~> 1.0)
102
102
  unicode-display_width (2.3.0)
103
103
  webrick (1.7.0)
104
104
  yard (0.9.28)
105
105
  webrick (~> 1.7.0)
106
- zeitwerk (2.6.4)
106
+ zeitwerk (2.6.7)
107
107
 
108
108
  PLATFORMS
109
109
  x86_64-linux
@@ -27,6 +27,8 @@ module Ductr
27
27
 
28
28
  desc "schedule, s [SCHEDULERS]", "Run the given schedulers"
29
29
  def schedule(*scheduler_names)
30
+ raise ArgumentError, "You must pass at least one scheduler name" if scheduler_names.empty?
31
+
30
32
  scheduler_names.each { |name| name.camelize.constantize.new }
31
33
  Scheduler.start
32
34
 
@@ -41,7 +41,6 @@ module Ductr
41
41
  def gen_root
42
42
  copy_file "gemfile.rb", "Gemfile"
43
43
  copy_file "rubocop.yml", ".rubocop.yml"
44
- copy_file "tool-versions", ".tool-versions"
45
44
 
46
45
  create_file "app/jobs/.gitkeep"
47
46
  create_file "app/pipelines/.gitkeep"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "active_support/cache/file_store"
3
4
 
4
5
  Ductr.configure do |config|
@@ -2,5 +2,5 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "annotable", git: "git@gitlab.com:la-manufacture/rocket/annotable.git", branch: "master"
6
- gem "ductr", git: "git@gitlab.com:la-manufacture/rocket/ductr.git", branch: "main"
5
+ gem "annotable", "~> 0.1"
6
+ gem "ductr", "~> 0.1"
@@ -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.0"
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.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Morel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-15 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
@@ -224,7 +224,6 @@ files:
224
224
  - lib/ductr/cli/templates/project/config_environment_development.rb
225
225
  - lib/ductr/cli/templates/project/gemfile.rb
226
226
  - lib/ductr/cli/templates/project/rubocop.yml
227
- - lib/ductr/cli/templates/project/tool-versions
228
227
  - lib/ductr/configuration.rb
229
228
  - lib/ductr/etl/controls/buffered_destination.rb
230
229
  - lib/ductr/etl/controls/buffered_transform.rb
@@ -270,7 +269,7 @@ metadata:
270
269
  homepage_uri: https://github.com/ductr-io/ductr
271
270
  source_code_uri: https://github.com/ductr-io/ductr
272
271
  changelog_uri: https://github.com/ductr-io/ductr/releases
273
- post_install_message:
272
+ post_install_message:
274
273
  rdoc_options: []
275
274
  require_paths:
276
275
  - lib
@@ -285,8 +284,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
284
  - !ruby/object:Gem::Version
286
285
  version: '0'
287
286
  requirements: []
288
- rubygems_version: 3.3.26
289
- signing_key:
287
+ rubygems_version: 3.4.8
288
+ signing_key:
290
289
  specification_version: 4
291
290
  summary: Data pipeline and ETL framework.
292
291
  test_files: []
@@ -1 +0,0 @@
1
- ruby 3.1.0