futurism 0.7.0 → 0.7.1

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: b49e6ebab4db767a2f7aaa4fbc6500ed4103787ea3abefc0489ef6a1536c4fec
4
- data.tar.gz: 066ab614d937281fe22e5a6d17b8873370c29649815be1b966e2bc22e7cf4ed0
3
+ metadata.gz: 8bbd52daa2dfe15d3a6dc9c9e374d6be65299a42a7ee3975cee51838811f7783
4
+ data.tar.gz: 29bcba992840173fe09f1e67ecdfa387dfedc8b8574d1ef988a4f98b55142bd2
5
5
  SHA512:
6
- metadata.gz: 638f1eb1bb3fb7304024282419ae2f3baa92a8e9cafe60d31ece08ba837925279005ce905b4acec2c68a6673f430b6b29fec8f4ee9fee5232539c2ea827f54ba
7
- data.tar.gz: 5d9a0f5d66ee06ea62b6875b4cf19bab6a22c0b0f272ddacfbe2ad0f5d8f06b4a288c32a6863f5d9c4e65de4b9df3799343fff5a5086a06597e9b23a66c9ab53
6
+ metadata.gz: 6efdbccf19c4c0b9a16f92f8461cb9fb8153796b81f6cbdd981e7d16779cca93a907033fbff2dac3bd354a22335e22d014a46f14bda18d4ad973605447ef1f20
7
+ data.tar.gz: b642b4d646ae5b1047330a833f7d4c7eeb8c684f15337835afc1b56f5d1b51cf0fea9ac9234a693562152b92d09f5febea8eb415b0aa4a8c97a77c96ae2cd42f
data/README.md CHANGED
@@ -137,7 +137,7 @@ You can also pass in the controller that will be used to render the partial.
137
137
  By default (i.e. not passing in a value), futurize will use `ApplicationController`, but you may override by setting the Futurism default controller in an initializer, for example `config/initializers/futurism.rb`.
138
138
 
139
139
  ```ruby
140
- Futurism.default_controller = MyController
140
+ Futurism.default_controller = "MyController" # to avoid the controller from trying to autoload at boot, provide as a string
141
141
  ```
142
142
 
143
143
  ### HTML Options
@@ -13,7 +13,12 @@ module Futurism
13
13
 
14
14
  autoload :Helpers, "futurism/helpers"
15
15
 
16
- mattr_accessor :skip_in_test, :default_controller
16
+ mattr_accessor :skip_in_test, default: false
17
+
18
+ mattr_writer :default_controller
19
+ def self.default_controller
20
+ (@@default_controller || "::ApplicationController").to_s.constantize
21
+ end
17
22
 
18
23
  ActiveSupport.on_load(:action_view) {
19
24
  include Futurism::Helpers
@@ -2,6 +2,9 @@ require "rails"
2
2
  require "action_cable"
3
3
  require "cable_ready"
4
4
  require "futurism/engine"
5
+ require "futurism/message_verifier"
6
+ require "futurism/resolver/controller"
7
+ require "futurism/resolver/controller/renderer"
5
8
  require "futurism/channel"
6
9
  require "futurism/helpers"
7
10
 
@@ -10,6 +13,13 @@ module Futurism
10
13
 
11
14
  autoload :Helpers, "futurism/helpers"
12
15
 
16
+ mattr_accessor :skip_in_test, default: false
17
+
18
+ mattr_writer :default_controller
19
+ def self.default_controller
20
+ (@@default_controller || "::ApplicationController").to_s.constantize
21
+ end
22
+
13
23
  ActiveSupport.on_load(:action_view) {
14
24
  include Futurism::Helpers
15
25
  }
@@ -9,13 +9,9 @@ module Futurism
9
9
  .to_s
10
10
  .safe_constantize
11
11
  else
12
- default_controller
12
+ Futurism.default_controller
13
13
  end
14
14
  end
15
-
16
- def self.default_controller
17
- Futurism.default_controller || ::ApplicationController
18
- end
19
15
  end
20
16
  end
21
17
  end
@@ -0,0 +1,17 @@
1
+ module Futurism
2
+ module Resolver
3
+ class Controller
4
+ def self.from(signed_string:)
5
+ if signed_string.present?
6
+ Futurism::MessageVerifier
7
+ .message_verifier
8
+ .verify(signed_string)
9
+ .to_s
10
+ .safe_constantize
11
+ else
12
+ Futurism.default_controller
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Futurism
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: futurism
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Rubisch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-29 00:00:00.000000000 Z
11
+ date: 2020-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -171,6 +171,7 @@ files:
171
171
  - lib/futurism/helpers.rb~
172
172
  - lib/futurism/message_verifier.rb
173
173
  - lib/futurism/resolver/controller.rb
174
+ - lib/futurism/resolver/controller.rb~
174
175
  - lib/futurism/resolver/controller/renderer.rb
175
176
  - lib/futurism/resolver/controller/renderer.rb~
176
177
  - lib/futurism/shims/deep_transform_values.rb