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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2958d070204fb5e6864522685980645766fe0c7c
4
- data.tar.gz: a6a28802f1b4711703ee21fce59648ab020d4b68
3
+ metadata.gz: 432c02f2ff9fa554e3a2a1204eeefd0ddc298517
4
+ data.tar.gz: 5f3cab14f2b427012679be08b6b9be74b83906ae
5
5
  SHA512:
6
- metadata.gz: c9b615808c1a56ea6ce344c902387dc2d27d21e971fbea47e2191439bf7e46ae5efd0f523a5f09a282c863247005f9071d6337a4e521567b1d06cdd95a515620
7
- data.tar.gz: 6b17254733aaa175a56bfc8ec4a22601af4579758363a941c79bc514fd6276e911e3d89191dd6f48f6d0de4d543639bfe373350dec0ad4e1adc9339abf8e01cf
6
+ metadata.gz: cc66ddd5e99becd6dc75cd130905f2b5c4eeff00801a9381244286d22a501500b48be20bae15f3fdd8f1310e94025dd0de4578d734e8ed7a922badad2c1300a0
7
+ data.tar.gz: f88436fe6d61c23e9cd66db39a2bf76c72cf4c9cbd9e6f9c9f59b8e96b49f921278c64719f70364089174dc175ea3e6597ec28599d626c9b227186adad87fe46
@@ -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
@@ -1,3 +1,3 @@
1
1
  module React
2
- VERSION = '0.8.4'
2
+ VERSION = '0.8.5'
3
3
  end
@@ -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')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chang