preflex 1.0.4 → 1.1.0

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: 93ff9ac254c499f07c9703b93a5acade2bc3b5b7abdd9b1c12e06aca08d02472
4
- data.tar.gz: fda569cd181bf0af1d9bcc287846bd3361156536e5179189e735b7feb9066996
3
+ metadata.gz: 480b69bc648fbfeb5a69a9b4bc9d0bc99b954bd0e7b9476af0a5f03b9f6b9159
4
+ data.tar.gz: 6ccbd7b123a353b71a3f90ebe61fb124dfbf39e146fec0217ff557c9f656cb64
5
5
  SHA512:
6
- metadata.gz: 207fa6e28e81f557c521c2508ba9b5cac219f36ca2710dc9b519112f20a3f7d3fe800d1a420f497dac4f4995c6451116bf526216f52ddd00d9abb6dd134cd986
7
- data.tar.gz: b421a971532f726599d94b12641c9e7cc550f48c49941e62608dbeb33f1f89881341faa73f6e911d43408c8eb1ac9ef65ccaa7e0371be37c72c63bbc78ee016d
6
+ metadata.gz: 33c6c7bea76a5cc28a57c55a1f9534446c8acfb5e513a9b7b64f56986a7c6519004b068a8f98b99e7ff00f98087584bd5cfdd221fba4737c9d1e08ed05c670a1
7
+ data.tar.gz: d40abca380a989b8894a9a1dd30503c46362472dab7ff72dbea5fe3849d09f9cb56b1d1f3448df356c22d581192d205f22fda2ecf66fb9ba5e03621429391e57
@@ -2,7 +2,7 @@ module Preflex::SetCurrentContext
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- before_action :preflex_set_current_context
5
+ prepend_before_action :preflex_set_current_context
6
6
  end
7
7
 
8
8
  protected
@@ -3,7 +3,7 @@ module Preflex
3
3
  extend self
4
4
 
5
5
  # PREFLEX_PREFERENCE_JS = File.read(Preferences::Preflex::Engine.root.join("app", "static", "preflex_preference.js"))
6
- def script_tag(*preference_klasses)
6
+ def script_raw(*preference_klasses)
7
7
  return ''.html_safe if preference_klasses.empty?
8
8
 
9
9
  base = <<~JS
@@ -72,7 +72,13 @@ module Preflex
72
72
  "window['#{klass.name}'] = new PreflexPreference('#{klass.name}', #{klass.current.data_for_js});"
73
73
  end
74
74
 
75
- "<script>#{js.join("\n")}</script>".html_safe
75
+ js.join("\n")
76
+ end
77
+
78
+ def script_tag(*preference_klasses)
79
+ return ''.html_safe if preference_klasses.empty?
80
+
81
+ "<script data-turbo-eval=\"false\">#{script_raw(*preference_klasses)}</script>".html_safe
76
82
  end
77
83
  end
78
84
  end
@@ -1,3 +1,3 @@
1
1
  module Preflex
2
- VERSION = "1.0.4"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owais
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-20 00:00:00.000000000 Z
11
+ date: 2024-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.4.10
89
+ rubygems_version: 3.5.9
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: A simple but powerful Rails engine for storing preferences, feature flags,