reactive-ruby 0.7.8 → 0.7.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/rails-tutorial/Gemfile.lock +1 -1
- data/example/rails-tutorial/app/views/components/home/show.rb +6 -3
- data/lib/reactive-ruby/component.rb +2 -2
- data/lib/reactive-ruby/rendering_context.rb +9 -2
- data/lib/reactive-ruby/top_level.rb +1 -1
- data/lib/reactive-ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 052c49e46522094adc05b9cb25ab4e1a84b9278e
|
4
|
+
data.tar.gz: b9a5721c96d244535be8348991b28d9cf5f242e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e01c83717b8d4bf5832b251f096aee5882bdef41c687206d76e99cdb13bd03cc82f94b168209e7bd2d6cb0b79ed18993ed8812ac6630edc5b290c45182cc7e17
|
7
|
+
data.tar.gz: f1056417667e177f9671b9559f4dec30ae2409615648c7925a3af3607485468175c5f4a81bc21391590736052169989c278c7a6123038c5b7f64a4541cc4874d
|
@@ -5,15 +5,18 @@ module Components
|
|
5
5
|
module Home
|
6
6
|
|
7
7
|
class Show
|
8
|
-
|
8
|
+
|
9
9
|
include React::Component # will create a new component named Show
|
10
10
|
|
11
11
|
optional_param :say_hello_to
|
12
|
-
|
12
|
+
|
13
|
+
backtrace :on
|
13
14
|
|
14
15
|
def render
|
15
16
|
puts "Rendering my first component!"
|
16
|
-
|
17
|
+
div do
|
18
|
+
txt "hello #{'there '+say_hello_to if say_hello_to}" # render "hello" with optional 'there ...'
|
19
|
+
end
|
17
20
|
end
|
18
21
|
|
19
22
|
end
|
@@ -369,9 +369,9 @@ module React
|
|
369
369
|
end
|
370
370
|
|
371
371
|
module API
|
372
|
-
|
372
|
+
include Native
|
373
373
|
|
374
|
-
alias_native :dom_node, :getDOMNode
|
374
|
+
#alias_native :dom_node, :getDOMNode
|
375
375
|
alias_native :mounted?, :isMounted
|
376
376
|
alias_native :force_update!, :forceUpdate
|
377
377
|
|
@@ -8,7 +8,9 @@ module React
|
|
8
8
|
|
9
9
|
def self.render(name, *args, &block)
|
10
10
|
@buffer = [] unless @buffer
|
11
|
-
if
|
11
|
+
if name == "txt"
|
12
|
+
element = args[0]
|
13
|
+
elsif block
|
12
14
|
element = build do
|
13
15
|
saved_waiting_on_resources = waiting_on_resources
|
14
16
|
self.waiting_on_resources = nil
|
@@ -23,7 +25,7 @@ module React
|
|
23
25
|
raise "a components render method must generate and return exactly 1 element or a string"
|
24
26
|
end
|
25
27
|
|
26
|
-
@buffer << result.to_s if result.is_a? String or (result.respond_to? :acts_as_string? and result.acts_as_string?) # For convience we push the last return value on if its a string
|
28
|
+
@buffer << result.to_s if !(result === @buffer.last) and (result.is_a? String or (result.respond_to? :acts_as_string? and result.acts_as_string?)) # For convience we push the last return value on if its a string
|
27
29
|
@buffer << result if result.is_a? Element and @buffer.count == 0
|
28
30
|
if name
|
29
31
|
buffer = @buffer.dup
|
@@ -81,6 +83,11 @@ module React
|
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
86
|
+
def txt(*args)
|
87
|
+
return self.method_missing('txt', *args) if self.is_a? React::Component
|
88
|
+
React::RenderingContext.render("txt", self.to_s)
|
89
|
+
end
|
90
|
+
|
84
91
|
def br
|
85
92
|
return self.method_missing(*["br"]) if self.is_a? React::Component
|
86
93
|
React::RenderingContext.render("span") { React::RenderingContext.render(self.to_s); React::RenderingContext.render("br") }
|
@@ -10,7 +10,7 @@ module React
|
|
10
10
|
main map mark menu menuitem meta meter nav noscript object ol optgroup option
|
11
11
|
output p param picture pre progress q rp rt ruby s samp script section select
|
12
12
|
small source span strong style sub summary sup table tbody td textarea tfoot th
|
13
|
-
thead time title tr track u ul var video wbr)
|
13
|
+
thead time title tr track u ul var video wbr txt)
|
14
14
|
ATTRIBUTES = %w(accept acceptCharset accessKey action allowFullScreen allowTransparency alt
|
15
15
|
async autoComplete autoPlay cellPadding cellSpacing charSet checked classID
|
16
16
|
className cols colSpan content contentEditable contextMenu controls coords
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reactive-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|