activekit 0.2.1 → 0.2.3.dev1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_kit/engine.rb +4 -0
- data/lib/active_kit/loader.rb +3 -0
- data/lib/active_kit/middleware.rb +24 -0
- data/lib/active_kit/sequence/sequenceable.rb +2 -1
- data/lib/active_kit/version.rb +1 -1
- data/lib/active_kit.rb +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdfebffac9f65f7b8e393240aebefc53bb56d46a1eaff8070837735adf269e99
|
4
|
+
data.tar.gz: 331f0bef2a0675a603bf462885b7bf0c47a5acca2efcc8a59db8150555183bdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f814ff88427a48347b5272a7cec69997fed42d5910a9fa708fdd45b7e19957ebd6df5b1d0a12d025bcd7bf65d99e630aa2ed879ac7b3e5c50ddbf043c7bcdf55
|
7
|
+
data.tar.gz: b79dc6fa0fd3d62e7f03fe0e69426969d77380614e4c3b64a1fec5c21162ae7440a4fc23d2af922370474ad8dc4a6b38ed615c0dc2f3425349ef7138a426e03f
|
data/lib/active_kit/engine.rb
CHANGED
@@ -3,6 +3,10 @@ module ActiveKit
|
|
3
3
|
isolate_namespace ActiveKit
|
4
4
|
config.eager_load_namespaces << ActiveKit
|
5
5
|
|
6
|
+
initializer "active_kit.add_middleware" do |app|
|
7
|
+
app.middleware.use ActiveKit::Middleware
|
8
|
+
end
|
9
|
+
|
6
10
|
initializer "active_kit.activekitable" do
|
7
11
|
require "active_kit/activekitable"
|
8
12
|
|
data/lib/active_kit/loader.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module ActiveKit
|
2
|
+
class Middleware
|
3
|
+
def initialize(app)
|
4
|
+
@app = app
|
5
|
+
end
|
6
|
+
|
7
|
+
# Middleware that determines which ActiveKit schedules to run.
|
8
|
+
def call(env)
|
9
|
+
request = ActionDispatch::Request.new(env)
|
10
|
+
|
11
|
+
activekit_runner(request) do
|
12
|
+
@app.call(env)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def activekit_runner(request, &blk)
|
19
|
+
ActiveKit::Loader.ensure_middleware_for!(request: request)
|
20
|
+
|
21
|
+
yield
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -52,7 +52,7 @@ module ActiveKit
|
|
52
52
|
after_save :activekit_sequence_sequenceable_callback
|
53
53
|
after_destroy :activekit_sequence_sequenceable_callback
|
54
54
|
|
55
|
-
|
55
|
+
define_method :activekit_sequence_sequenceable_callback do
|
56
56
|
inverse_assoc = self.class.search_inverse_assoc(self, updater_on)
|
57
57
|
position = positioning_method ? self.public_send(positioning_method) : nil
|
58
58
|
if inverse_assoc.respond_to?(:each)
|
@@ -62,6 +62,7 @@ module ActiveKit
|
|
62
62
|
end
|
63
63
|
logger.info "ActiveSequence - Sequencing from #{self.class.name}: Done."
|
64
64
|
end
|
65
|
+
private :activekit_sequence_sequenceable_callback
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
data/lib/active_kit/version.rb
CHANGED
data/lib/active_kit.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activekit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3.dev1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- plainsource
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/active_kit/activekiter.rb
|
57
57
|
- lib/active_kit/engine.rb
|
58
58
|
- lib/active_kit/loader.rb
|
59
|
+
- lib/active_kit/middleware.rb
|
59
60
|
- lib/active_kit/relation.rb
|
60
61
|
- lib/active_kit/sequence.rb
|
61
62
|
- lib/active_kit/sequence/sequence.rb
|
@@ -80,9 +81,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
81
|
version: '0'
|
81
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
83
|
requirements:
|
83
|
-
- - "
|
84
|
+
- - ">"
|
84
85
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
86
|
+
version: 1.3.1
|
86
87
|
requirements: []
|
87
88
|
rubygems_version: 3.1.2
|
88
89
|
signing_key:
|