reactrb 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/react/component/tags.rb +1 -1
- data/lib/reactive-ruby/version.rb +1 -1
- data/spec/react/opal_jquery_extensions_spec.rb +14 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 432c02f2ff9fa554e3a2a1204eeefd0ddc298517
|
4
|
+
data.tar.gz: 5f3cab14f2b427012679be08b6b9be74b83906ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc66ddd5e99becd6dc75cd130905f2b5c4eeff00801a9381244286d22a501500b48be20bae15f3fdd8f1310e94025dd0de4578d734e8ed7a922badad2c1300a0
|
7
|
+
data.tar.gz: f88436fe6d61c23e9cd66db39a2bf76c72cf4c9cbd9e6f9c9f59b8e96b49f921278c64719f70364089174dc175ea3e6597ec28599d626c9b227186adad87fe46
|
data/lib/react/component/tags.rb
CHANGED
@@ -83,7 +83,7 @@ module React
|
|
83
83
|
private
|
84
84
|
|
85
85
|
def find_component(name)
|
86
|
-
scopes = self.class.name.split('::').inject([Module]) do |nesting, next_const|
|
86
|
+
scopes = "#{self.class.name}".split('::').inject([Module]) do |nesting, next_const|
|
87
87
|
nesting + [nesting.last.const_get(next_const)]
|
88
88
|
end.reverse
|
89
89
|
scope = scopes.detect { |s| s.const_defined?(name) } || return
|
@@ -6,7 +6,20 @@ describe 'Element' do
|
|
6
6
|
React::API.clear_component_class_cache
|
7
7
|
end
|
8
8
|
|
9
|
-
it 'renders a top level component using render' do
|
9
|
+
it 'renders a top level component using render with a block' do
|
10
|
+
stub_const 'Foo', Class.new(React::Component::Base)
|
11
|
+
Foo.class_eval do
|
12
|
+
param :name
|
13
|
+
def render
|
14
|
+
"hello #{params.name}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
test_div = Element.new(:div)
|
18
|
+
test_div.render { Foo(name: 'fred') }
|
19
|
+
expect(Element[test_div].find('span').html).to eq('hello fred')
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'renders a top level component using render with a container and params ' do
|
10
23
|
test_div = Element.new(:div)
|
11
24
|
test_div.render(:span, id: :render_test_span) { 'hello' }
|
12
25
|
expect(Element[test_div].find('#render_test_span').html).to eq('hello')
|