rbexy 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rbexy/component.rb +10 -4
- data/lib/rbexy/version.rb +1 -1
- 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: 4cf2789f8c063a3b67dc6c4da86979b89214679833c8be14bee61d52b1a17f3b
|
|
4
|
+
data.tar.gz: 89d4d684fb473837be4b7c239e034ec6d27f9b754978cb6bfeb7b77774310e9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf0cd9cbf4fc983f6f7213da1babd5e6e334f86c3bd9a3f129f4889d69390946e858a29bc9cede2ffe36e510c6573fea1eb8e55b2e1f504964305a765efd3236
|
|
7
|
+
data.tar.gz: fc8090cb79071025b6f3ab491bdff3558a22dccfe43350830f36e6a8ba965e318b39e86bd07aec73659db428a4c223a115ccb3684b30a819e7dc5b577951d04b
|
data/Gemfile.lock
CHANGED
data/lib/rbexy/component.rb
CHANGED
|
@@ -3,6 +3,8 @@ require "action_view"
|
|
|
3
3
|
module Rbexy
|
|
4
4
|
class Component < ActionView::Base
|
|
5
5
|
class LookupContext < ActionView::LookupContext
|
|
6
|
+
attr_accessor :component_name_stack
|
|
7
|
+
|
|
6
8
|
def self.details_hash(context)
|
|
7
9
|
context.registered_details.each_with_object({}) do |key, details_hash|
|
|
8
10
|
value = key == :locale ? [context.locale] : context.send(key)
|
|
@@ -15,7 +17,8 @@ module Rbexy
|
|
|
15
17
|
# template path, since we're using the Rails partial-rendering
|
|
16
18
|
# functionality but don't want our templates prefixed with a `_`
|
|
17
19
|
def args_for_lookup(name, prefixes, partial, keys, details_options)
|
|
18
|
-
|
|
20
|
+
partial = false if component_name_stack.include?(name)
|
|
21
|
+
super(name, prefixes, partial, keys, details_options)
|
|
19
22
|
end
|
|
20
23
|
end
|
|
21
24
|
|
|
@@ -77,9 +80,12 @@ module Rbexy
|
|
|
77
80
|
attr_reader :view_context, :content_block, :old_lookup_context
|
|
78
81
|
|
|
79
82
|
def replace_lookup_context
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
unless view_renderer.lookup_context.is_a? Rbexy::Component::LookupContext
|
|
84
|
+
@old_lookup_context = view_renderer.lookup_context
|
|
85
|
+
view_renderer.lookup_context = build_lookup_context(old_lookup_context)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
(view_renderer.lookup_context.component_name_stack ||= []) << component_name
|
|
83
89
|
end
|
|
84
90
|
|
|
85
91
|
def restore_lookup_context
|
data/lib/rbexy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rbexy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Giancola
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-10-
|
|
11
|
+
date: 2020-10-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|