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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3130daa06b25e379ff25dddee80a102cdf29fabf2b283502d49a7b970055544
4
- data.tar.gz: dcbe3ced01fd74b697f17f20180db263ad645094790c763a7be024f6712f8bec
3
+ metadata.gz: 86af16b2f948820500ad35a61204d611fe509359713a72c81e1b333280905c8b
4
+ data.tar.gz: 9120a93f9f0682f43620641899a0c81e1c38e73fcc2d5c449fb5fcfaefeaa7aa
5
5
  SHA512:
6
- metadata.gz: 8ef07caae0ff60dc792d0cddd6fa16d1acfe28c9ffcf8ed208d22899f22f253d32680629601f9dff5171ab53eaacb8bf22961cf787501eade05ea2853b7ba005
7
- data.tar.gz: 07f01fdf20c07d15a5a40611693aacf7803a5ed6f9d776ddb2043f0be53ed218953d7d185850e39c8eb3b30fc7b85902b1b8330de950f96e9d402ce8e6fd8d4f
6
+ metadata.gz: cdc2d52c22ba978f4bd7101de2b1f2e356918bf1b7139e3481e2f193bda549dc512148a4080fcc11bfb4ed6171bdb116418ec540aa971c31c11505ca4904f0c8
7
+ data.tar.gz: 0a4f4970c47e166ce492125fc101a19a5a82057ff8f31bb1714a7d1f8ebebe0d9e1c5611f3da3daa9214009d88761c91fbca7493e4cf2a1257c7eb9f0a748c92
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.0.4]
2
+
3
+ - Run our code in `after_initialize` so the operation monkey-patch can be applied.
4
+ - Fix constant loading for `eager_load = true` environments, aka production.
5
+
1
6
  ## [0.0.3]
2
7
 
3
8
  - Fix gemspec.
@@ -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
- Trailblazer::Operation.extend(Pro::Operation::WTF) # TODO: only apply to selected OPs or make at least configurable?
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
- config_options = {
14
- render_wtf: config.trailblazer.pro.render_wtf,
15
- }
14
+ config_options = {
15
+ render_wtf: config.trailblazer.pro.render_wtf,
16
+ }
16
17
 
17
- if File.exist?(Rails::SESSION_PATH)
18
- # TODO: warn if file not present etc.
19
- json = File.read(Rails::SESSION_PATH)
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
- Pro.initialize!(**Session.deserialize(json), **config_options)
22
+ Pro.initialize!(**Session.deserialize(json), **config_options)
22
23
 
23
- trace_operations = config.trailblazer.pro.trace_operations
24
+ trace_operations = config.trailblazer.pro.trace_operations
24
25
 
25
- if trace_operations
26
- # constants can be passed as strings to avoid autoloading issues.
27
- trace_operations = trace_operations.collect { |klass, config| [klass.constantize, config] }.to_h
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
- Pro.trace_operations!(trace_operations)
30
- end
30
+ Pro.trace_operations!(trace_operations)
31
+ end
31
32
 
32
- # TODO: add {Activity.invoke} here, too!
33
- # Trailblazer::Activity.extend(Pro::Call::Activity) # FIXME: only if allowed! # TODO: only apply to selected OPs.
34
- else # no configuration happend, yet.
35
- Pro.initialize!(api_key: "")
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
@@ -1,9 +1,7 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Trailblazer
4
2
  module Pro
5
3
  module Rails
6
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
7
5
  end
8
6
  end
9
7
  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.3
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 00:00:00.000000000 Z
11
+ date: 2023-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer-pro