ductr 0.2.1 → 0.2.3

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: fa37b082cbb7246983b3aafc9fd6f9ea8436aa201dae3edc28e7ccff233a57f6
4
- data.tar.gz: 3e97dc981be10b8e94c2a7749af660808c876b327ba22f2878a63f3e90cccc29
3
+ metadata.gz: f2d5c7ce2296b1c9640bb6b5e11707d6d60a2409622715da8649b31028ff7013
4
+ data.tar.gz: 1961c232e613e98f3f6630b44ed6b497a50220c8f6808da426d41fdb0c61c6ba
5
5
  SHA512:
6
- metadata.gz: 6eebfe6af89ab33b6a4b8ca12af531bd70fdd8676bfffe0592f8ddc0f5e10445dcc2b61060af3d9ad66877a7bd9353d13d6b3972eee1ad18f41a2f7f8399a12c
7
- data.tar.gz: 9ce1cd06dd2efb0bcfe02ef1d9188c619967c70f89f030040c473a4f6e904866ead1fc950275df836da8a03b6a7593230e153ce692446380aa69d4718a74e63d
6
+ metadata.gz: a851b1b742d2557ab82561d5b560bec771b564b6dabe98280ddf2b5a683dfe0993bb397a9e0e7f5ae788eaa0e8112343030fd16b971a1cde8cac601db9882b62
7
+ data.tar.gz: '05719e09e026fcdf59927b46f7dac7699a24fd3a3c3b34473862355bd13bcd36ba0b92831623179ff2df22e98452f08eeacb68e4a295bbef41314f3b91f71a79'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ductr (0.2.1)
4
+ ductr (0.2.3)
5
5
  activejob (~> 7.0)
6
6
  annotable (~> 0.1)
7
7
  colorize (~> 0.8)
@@ -118,4 +118,4 @@ DEPENDENCIES
118
118
  yard (~> 0.9)
119
119
 
120
120
  BUNDLED WITH
121
- 2.4.8
121
+ 2.4.15
@@ -26,9 +26,12 @@ module Ductr
26
26
  # @see https://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache.html#method-c-lookup_store
27
27
  attr_reader :store_adapter
28
28
 
29
- # @return [Array] The store adapter config
29
+ # @return [Array] The store adapter config args
30
30
  attr_reader :store_parameters
31
31
 
32
+ # @return [Hash<Symbol, Object>] The store adapter config options
33
+ attr_reader :store_options
34
+
32
35
  # @return [Hash] The parsed YML configuration
33
36
  attr_reader :yml
34
37
 
@@ -56,9 +59,10 @@ module Ductr
56
59
  #
57
60
  # @return [void]
58
61
  #
59
- def store(adapter, *parameters)
62
+ def store(adapter, *parameters, **options)
60
63
  @store_adapter = adapter
61
64
  @store_parameters = parameters
65
+ @store_options = options
62
66
  end
63
67
 
64
68
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # The base class of all sequel-based adapters.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A destination control that write rows one by one.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A lookup control that execute one query per row.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A source control that yields rows one by one.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A destination control that accumulates rows in a buffer to write them by batch.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A lookup control that execute the query for a bunch of rows.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A destination control that accumulates rows in a buffer to upsert them by batch.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A lookup control that execute the query for a bunch of rows and merge them with the buffer's rows.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A source control that allows to select a big number of rows by relying on pagination.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # The rufus-scheduler handler class.
7
7
  # @see https://github.com/jmettraux/rufus-scheduler#scheduling-handler-instances
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductr
4
- module Sequel
4
+ module SequelBase
5
5
  #
6
6
  # A trigger based on the RufusTrigger, runs the PollingHandler at the given timing.
7
7
  #
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.2.1"
5
+ VERSION = "0.2.3"
6
6
  end
data/lib/ductr.rb CHANGED
@@ -98,11 +98,15 @@ module Ductr
98
98
  # @return [ActiveSupport::Cache::Store] The store instance
99
99
  #
100
100
  def store
101
+ adapter = config.store_adapter
102
+ params = config.store_parameters
103
+ options = config.store_options
104
+
101
105
  @store ||= \
102
- if config.store_adapter.is_a? Class
103
- config.store_adapter.new(*config.store_parameters)
106
+ if adapter.is_a? Class
107
+ adapter.new(*params, **options)
104
108
  else
105
- ActiveSupport::Cache.lookup_store(config.store_adapter, *config.store_parameters)
109
+ ActiveSupport::Cache.lookup_store(adapter, *params, **options)
106
110
  end
107
111
  end
108
112
  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.2.1
4
+ version: 0.2.3
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-04-02 00:00:00.000000000 Z
11
+ date: 2023-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -252,17 +252,17 @@ files:
252
252
  - lib/ductr/registry.rb
253
253
  - lib/ductr/rufus_trigger.rb
254
254
  - lib/ductr/scheduler.rb
255
- - lib/ductr/sequel/adapter.rb
256
- - lib/ductr/sequel/basic_destination.rb
257
- - lib/ductr/sequel/basic_lookup.rb
258
- - lib/ductr/sequel/basic_source.rb
259
- - lib/ductr/sequel/buffered_destination.rb
260
- - lib/ductr/sequel/buffered_lookup.rb
261
- - lib/ductr/sequel/buffered_upsert_destination.rb
262
- - lib/ductr/sequel/match_lookup.rb
263
- - lib/ductr/sequel/paginated_source.rb
264
- - lib/ductr/sequel/polling_handler.rb
265
- - lib/ductr/sequel/polling_trigger.rb
255
+ - lib/ductr/sequel_base/adapter.rb
256
+ - lib/ductr/sequel_base/basic_destination.rb
257
+ - lib/ductr/sequel_base/basic_lookup.rb
258
+ - lib/ductr/sequel_base/basic_source.rb
259
+ - lib/ductr/sequel_base/buffered_destination.rb
260
+ - lib/ductr/sequel_base/buffered_lookup.rb
261
+ - lib/ductr/sequel_base/buffered_upsert_destination.rb
262
+ - lib/ductr/sequel_base/match_lookup.rb
263
+ - lib/ductr/sequel_base/paginated_source.rb
264
+ - lib/ductr/sequel_base/polling_handler.rb
265
+ - lib/ductr/sequel_base/polling_trigger.rb
266
266
  - lib/ductr/store.rb
267
267
  - lib/ductr/store/job_serializer.rb
268
268
  - lib/ductr/store/job_store.rb
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
295
  - !ruby/object:Gem::Version
296
296
  version: '0'
297
297
  requirements: []
298
- rubygems_version: 3.4.8
298
+ rubygems_version: 3.4.15
299
299
  signing_key:
300
300
  specification_version: 4
301
301
  summary: Data pipeline and ETL framework.