trailblazer-pro-rails 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/trailblazer/pro/rails/railtie.rb +20 -18
- data/lib/trailblazer/pro/rails/version.rb +1 -3
- 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: 86af16b2f948820500ad35a61204d611fe509359713a72c81e1b333280905c8b
|
4
|
+
data.tar.gz: 9120a93f9f0682f43620641899a0c81e1c38e73fcc2d5c449fb5fcfaefeaa7aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc2d52c22ba978f4bd7101de2b1f2e356918bf1b7139e3481e2f193bda549dc512148a4080fcc11bfb4ed6171bdb116418ec540aa971c31c11505ca4904f0c8
|
7
|
+
data.tar.gz: 0a4f4970c47e166ce492125fc101a19a5a82057ff8f31bb1714a7d1f8ebebe0d9e1c5611f3da3daa9214009d88761c91fbca7493e4cf2a1257c7eb9f0a748c92
|
data/CHANGELOG.md
CHANGED
@@ -8,31 +8,33 @@ module Trailblazer
|
|
8
8
|
|
9
9
|
# load session and set Pro::Session.session
|
10
10
|
initializer "trailblazer-pro-rails.load_session_and_extend_operation" do
|
11
|
-
|
11
|
+
config.after_initialize do
|
12
|
+
Trailblazer::Operation.extend(Pro::Operation::WTF) # TODO: only apply to selected OPs or make at least configurable?
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
config_options = {
|
15
|
+
render_wtf: config.trailblazer.pro.render_wtf,
|
16
|
+
}
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
if File.exist?(Rails::SESSION_PATH)
|
19
|
+
# TODO: warn if file not present etc.
|
20
|
+
json = File.read(Rails::SESSION_PATH)
|
20
21
|
|
21
|
-
|
22
|
+
Pro.initialize!(**Session.deserialize(json), **config_options)
|
22
23
|
|
23
|
-
|
24
|
+
trace_operations = config.trailblazer.pro.trace_operations
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
if trace_operations
|
27
|
+
# constants can be passed as strings to avoid autoloading issues.
|
28
|
+
trace_operations = trace_operations.collect { |klass, config| [klass.constantize, config] }.to_h
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
Pro.trace_operations!(trace_operations)
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
# TODO: add {Activity.invoke} here, too!
|
34
|
+
# Trailblazer::Activity.extend(Pro::Call::Activity) # FIXME: only if allowed! # TODO: only apply to selected OPs.
|
35
|
+
else # no configuration happend, yet.
|
36
|
+
Pro.initialize!(api_key: "")
|
37
|
+
end
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-pro-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trailblazer-pro
|