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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 94fc2b82b048fcdf5561c4764554cabe6a28df63
4
- data.tar.gz: 6a16efca47491680cd4330afc8fd0a1e5d8c5da5
2
+ SHA256:
3
+ metadata.gz: efc6697133eb061d2cfa7a864669dada66b69340af39bb64ff120e3f9678c8ed
4
+ data.tar.gz: 483ef47514305d740b55016fe43887c680369c0d9b446fa00481de54e2ca7959
5
5
  SHA512:
6
- metadata.gz: 52321292277def7fb17d371bad3d593d318a9c61a9880d379fd63c2e8301bc7def79e12c30af35250bad2885aff879ee09510cd9f49089f1910e1cbdc583465f
7
- data.tar.gz: 07b8be504eeb533235440be6871d18d438bdb6e79d535ffd0883f98cb12e0df4210760ff62e3a53b25a89fa276f93b7d9464b2aff788c74b9923d77cd5495a5c
6
+ metadata.gz: c9861d04f5c6b1104999c297a4248b668c8dfa3ba8139b8bb256a7dd74d2e0e394ad82ff93921b846a231da78c6359d6d5edc789a92825885c1ba4a364860343
7
+ data.tar.gz: 5c24836c64c00712a6d267f88d28c8addedcfe296fedea031ec8aa09fe40df696402f17013c86ebae5bef3189bee7893ca222bc599b52b23c3be7b4c1566d8f2
@@ -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
@@ -131,7 +131,7 @@ class Wunderbar::XmlMarkup
131
131
  html = Wunderbar::Render.eval(scripts, server)
132
132
 
133
133
  # insert results into target
134
- nodes = builder._ { html }
134
+ nodes = Wunderbar::Render.extract(builder._ { html })
135
135
 
136
136
  begin
137
137
  if nodes.length == 1
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 3
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
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) {return #{common}}}))"
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(', ')}}}, [#{common}])"
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.1 ruby lib
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.1"
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-03-06"
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.5.2.3".freeze
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.1
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-03-06 00:00:00.000000000 Z
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.5.2.3
109
+ rubygems_version: 2.7.6
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: HTML Generator and CGI application support