wunderbar 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/wunderbar/react.rb +6 -0
- data/lib/wunderbar/render.rb +1 -1
- data/lib/wunderbar/version.rb +1 -1
- data/lib/wunderbar/vue.rb +15 -2
- data/wunderbar.gemspec +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: efc6697133eb061d2cfa7a864669dada66b69340af39bb64ff120e3f9678c8ed
|
4
|
+
data.tar.gz: 483ef47514305d740b55016fe43887c680369c0d9b446fa00481de54e2ca7959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9861d04f5c6b1104999c297a4248b668c8dfa3ba8139b8bb256a7dd74d2e0e394ad82ff93921b846a231da78c6359d6d5edc789a92825885c1ba4a364860343
|
7
|
+
data.tar.gz: 5c24836c64c00712a6d267f88d28c8addedcfe296fedea031ec8aa09fe40df696402f17013c86ebae5bef3189bee7893ca222bc599b52b23c3be7b4c1566d8f2
|
data/lib/wunderbar/react.rb
CHANGED
@@ -16,6 +16,12 @@ class Wunderbar::Render
|
|
16
16
|
"ReactDOMServer.renderToString(#{common})"
|
17
17
|
end
|
18
18
|
|
19
|
+
# return all nodes on server rendering, as there is no wrapper element
|
20
|
+
# like there is for vue
|
21
|
+
def self.extract(nodes)
|
22
|
+
nodes
|
23
|
+
end
|
24
|
+
|
19
25
|
def self.client(common, element, target)
|
20
26
|
"ReactDOM.render(#{common}, #{element})"
|
21
27
|
end
|
data/lib/wunderbar/render.rb
CHANGED
data/lib/wunderbar/version.rb
CHANGED
data/lib/wunderbar/vue.rb
CHANGED
@@ -18,13 +18,26 @@ class Wunderbar::Render
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.server(common)
|
21
|
-
"VueServer.renderToString(new Vue({render: function($h) {
|
21
|
+
"VueServer.renderToString(new Vue({render: function($h) {
|
22
|
+
return $h('div', #{common})}}))"
|
23
|
+
end
|
24
|
+
|
25
|
+
# unwrap children from div wrapper inserted by self.server
|
26
|
+
def self.extract(nodes)
|
27
|
+
if
|
28
|
+
nodes.length == 1 and nodes.first.name == 'div' and
|
29
|
+
nodes.first.attrs['data-server-rendered'].to_s == 'true'
|
30
|
+
then
|
31
|
+
nodes.first.children
|
32
|
+
else
|
33
|
+
nodes
|
34
|
+
end
|
22
35
|
end
|
23
36
|
|
24
37
|
def self.client(common, element, target)
|
25
38
|
wrap = "$h(#{target.name.inspect}, " +
|
26
39
|
"{attrs: {#{target.attrs.map {|name, value|
|
27
|
-
"#{name}: #{value.inspect}"}.join(', ')}}},
|
40
|
+
"#{name}: #{value.inspect}"}.join(', ')}}}, #{common})"
|
28
41
|
"new Vue({el: #{element}, render: function($h) {return #{wrap}}})"
|
29
42
|
end
|
30
43
|
|
data/wunderbar.gemspec
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: wunderbar 1.3.
|
2
|
+
# stub: wunderbar 1.3.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "wunderbar".freeze
|
6
|
-
s.version = "1.3.
|
6
|
+
s.version = "1.3.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Sam Ruby".freeze]
|
11
|
-
s.date = "2019-
|
11
|
+
s.date = "2019-06-07"
|
12
12
|
s.description = " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML, Unicode\n (utf-8), consistently indented, readable applications.'\n".freeze
|
13
13
|
s.email = "rubys@intertwingly.net".freeze
|
14
14
|
s.files = ["COPYING".freeze, "README.md".freeze, "lib/wunderbar".freeze, "lib/wunderbar.rb".freeze, "lib/wunderbar/asset.rb".freeze, "lib/wunderbar/backtick.rb".freeze, "lib/wunderbar/bootstrap".freeze, "lib/wunderbar/bootstrap.rb".freeze, "lib/wunderbar/bootstrap/theme.rb".freeze, "lib/wunderbar/builder.rb".freeze, "lib/wunderbar/cgi-methods.rb".freeze, "lib/wunderbar/coderay.rb".freeze, "lib/wunderbar/coffeescript.rb".freeze, "lib/wunderbar/cssproxy.rb".freeze, "lib/wunderbar/environment.rb".freeze, "lib/wunderbar/eventsource.rb".freeze, "lib/wunderbar/html-methods.rb".freeze, "lib/wunderbar/installation.rb".freeze, "lib/wunderbar/job-control.rb".freeze, "lib/wunderbar/jquery".freeze, "lib/wunderbar/jquery.rb".freeze, "lib/wunderbar/jquery/filter.rb".freeze, "lib/wunderbar/jquery/stupidtable.rb".freeze, "lib/wunderbar/listen.rb".freeze, "lib/wunderbar/logger.rb".freeze, "lib/wunderbar/markdown.rb".freeze, "lib/wunderbar/marked.rb".freeze, "lib/wunderbar/node.rb".freeze, "lib/wunderbar/pagedown.rb".freeze, "lib/wunderbar/polymer.rb".freeze, "lib/wunderbar/rack.rb".freeze, "lib/wunderbar/rails.rb".freeze, "lib/wunderbar/react.rb".freeze, "lib/wunderbar/render.rb".freeze, "lib/wunderbar/script.rb".freeze, "lib/wunderbar/server.rb".freeze, "lib/wunderbar/sinatra.rb".freeze, "lib/wunderbar/underscore.rb".freeze, "lib/wunderbar/vendor".freeze, "lib/wunderbar/vendor/Markdown.Converter.js".freeze, "lib/wunderbar/vendor/bootstrap-theme.min.css".freeze, "lib/wunderbar/vendor/bootstrap.min.css".freeze, "lib/wunderbar/vendor/bootstrap.min.js".freeze, "lib/wunderbar/vendor/eventsource.min.js".freeze, "lib/wunderbar/vendor/jquery-3.2.1.min.js".freeze, "lib/wunderbar/vendor/marked.min.js".freeze, "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js".freeze, "lib/wunderbar/vendor/react-dom-server.min.js".freeze, "lib/wunderbar/vendor/react-dom.min.js".freeze, "lib/wunderbar/vendor/react-with-addons.min.js".freeze, "lib/wunderbar/vendor/stupidtable.min.js".freeze, "lib/wunderbar/vendor/underscore-min.js".freeze, "lib/wunderbar/vendor/vue-server.min.js".freeze, "lib/wunderbar/vendor/vue.min.js".freeze, "lib/wunderbar/version.rb".freeze, "lib/wunderbar/vue.rb".freeze, "lib/wunderbar/websocket.rb".freeze, "wunderbar.gemspec".freeze]
|
15
15
|
s.homepage = "http://github.com/rubys/wunderbar".freeze
|
16
16
|
s.licenses = ["MIT".freeze]
|
17
17
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze)
|
18
|
-
s.rubygems_version = "2.
|
18
|
+
s.rubygems_version = "2.7.6".freeze
|
19
19
|
s.summary = "HTML Generator and CGI application support".freeze
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wunderbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.7.6
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: HTML Generator and CGI application support
|