wunderbar 0.24.1 → 0.24.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,7 +55,9 @@ class Wunderbar::XmlMarkup
55
55
  result = File.read(name)
56
56
  else
57
57
  name = File.join(@_scope.settings.views.untaint, src+'.rb')
58
- result = Ruby2JS.convert(File.read(name)) if File.exist? name
58
+ if File.exist? name
59
+ result = Ruby2JS.convert(File.read(name), file: name)
60
+ end
59
61
  end
60
62
  else
61
63
  result = Ruby2JS.convert(script.block, binding: script.binding)
@@ -64,13 +66,19 @@ class Wunderbar::XmlMarkup
64
66
  result
65
67
  end
66
68
 
67
- # concatenate and execute scripts on server
68
- scripts = ['global=this'] + Wunderbar::Asset.scripts + scripts
69
- context = ExecJS.compile(scripts.compact.join(";\n"))
70
-
71
- # insert results into target
72
69
  builder = Wunderbar::HtmlMarkup.new({})
73
- target.children += builder._ { context.eval(server) }
70
+ begin
71
+ # concatenate and execute scripts on server
72
+ scripts = ['global=this'] + Wunderbar::Asset.scripts + scripts
73
+ context = ExecJS.compile(scripts.compact.join(";\n"))
74
+
75
+ # insert results into target
76
+ nodes = builder._ { context.eval(server) }
77
+ nodes.each {|node| node.parent = target}
78
+ target.children += nodes
79
+ rescue ExecJS::ProgramError => e
80
+ target.children << builder._pre(e.message).node?
81
+ end
74
82
 
75
83
  # add client side script
76
84
  tag! 'script', Wunderbar::ScriptNode, client
@@ -83,7 +83,7 @@ module Wunderbar
83
83
  def evaluate(scope, locals, &block)
84
84
  scope.content_type self.class.default_mime_type, charset: 'utf-8'
85
85
  begin
86
- Ruby2JS.convert(data, ivars: locals, file: file)
86
+ Ruby2JS.convert(block ? block : data, ivars: locals, file: file)
87
87
  rescue Parser::SyntaxError => exception
88
88
  scope.response.status = 500
89
89
  location = exception.diagnostic.location
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 24
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/wunderbar.gemspec CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "wunderbar"
5
- s.version = "0.24.1"
5
+ s.version = "0.24.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sam Ruby"]
9
- s.date = "2015-02-11"
9
+ s.date = "2015-02-17"
10
10
  s.description = " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML, Unicode\n (utf-8), consistently indented, readable applications. This includes\n output that conforms to the Polyglot specification and the emerging\n results from the XML Error Recovery Community Group.\n"
11
11
  s.email = "rubys@intertwingly.net"
12
- s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/rack.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/node.rb", "lib/wunderbar/websocket.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/version.rb", "lib/wunderbar/angularjs.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/react.rb", "lib/wunderbar/script.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/marked.min.js", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/vendor/jquery-1.11.0.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/react-0.12.2.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/rails.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/marked.rb", "lib/wunderbar/server.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/markdown.rb"]
12
+ s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/script.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/react-0.12.2.min.js", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/marked.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/jquery-1.11.0.min.js", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/websocket.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/version.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/server.rb", "lib/wunderbar/angularjs.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/marked.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/node.rb", "lib/wunderbar/react.rb"]
13
13
  s.homepage = "http://github.com/rubys/wunderbar"
14
14
  s.licenses = ["MIT"]
15
15
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wunderbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.1
4
+ version: 0.24.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-11 00:00:00.000000000 Z
12
+ date: 2015-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -40,53 +40,53 @@ files:
40
40
  - README.md
41
41
  - COPYING
42
42
  - lib/wunderbar.rb
43
- - lib/wunderbar/rack.rb
44
- - lib/wunderbar/backtick.rb
45
- - lib/wunderbar/node.rb
46
- - lib/wunderbar/websocket.rb
47
- - lib/wunderbar/job-control.rb
48
- - lib/wunderbar/bootstrap/theme.rb
49
- - lib/wunderbar/version.rb
50
- - lib/wunderbar/angularjs.rb
51
- - lib/wunderbar/coderay.rb
52
- - lib/wunderbar/installation.rb
53
- - lib/wunderbar/cssproxy.rb
54
- - lib/wunderbar/react.rb
55
43
  - lib/wunderbar/script.rb
56
- - lib/wunderbar/vendor/angular.min.js
44
+ - lib/wunderbar/jquery.rb
45
+ - lib/wunderbar/underscore.rb
46
+ - lib/wunderbar/polymer.rb
47
+ - lib/wunderbar/jquery/filter.rb
48
+ - lib/wunderbar/jquery/stupidtable.rb
49
+ - lib/wunderbar/vendor/react-0.12.2.min.js
50
+ - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
51
+ - lib/wunderbar/vendor/marked.min.js
57
52
  - lib/wunderbar/vendor/stupidtable.min.js
53
+ - lib/wunderbar/vendor/bootstrap.min.js
54
+ - lib/wunderbar/vendor/Markdown.Converter.js
55
+ - lib/wunderbar/vendor/angular.min.js
56
+ - lib/wunderbar/vendor/bootstrap-theme.min.css
57
+ - lib/wunderbar/vendor/jquery-1.11.0.min.js
58
58
  - lib/wunderbar/vendor/angular-resource.min.js
59
- - lib/wunderbar/vendor/marked.min.js
60
59
  - lib/wunderbar/vendor/bootstrap.min.css
61
- - lib/wunderbar/vendor/angular-route.min.js
62
- - lib/wunderbar/vendor/jquery-1.11.0.min.js
63
- - lib/wunderbar/vendor/Markdown.Converter.js
64
- - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
65
60
  - lib/wunderbar/vendor/underscore-min.js
66
- - lib/wunderbar/vendor/bootstrap.min.js
67
- - lib/wunderbar/vendor/react-0.12.2.min.js
68
- - lib/wunderbar/vendor/bootstrap-theme.min.css
69
- - lib/wunderbar/rails.rb
70
- - lib/wunderbar/asset.rb
71
- - lib/wunderbar/builder.rb
72
- - lib/wunderbar/sinatra.rb
73
- - lib/wunderbar/underscore.rb
74
- - lib/wunderbar/bootstrap.rb
75
- - lib/wunderbar/cgi-methods.rb
76
- - lib/wunderbar/jquery/stupidtable.rb
77
- - lib/wunderbar/jquery/filter.rb
78
- - lib/wunderbar/coffeescript.rb
79
- - lib/wunderbar/polymer.rb
80
- - lib/wunderbar/html-methods.rb
61
+ - lib/wunderbar/vendor/angular-route.min.js
62
+ - lib/wunderbar/websocket.rb
63
+ - lib/wunderbar/environment.rb
81
64
  - lib/wunderbar/pagedown.rb
82
- - lib/wunderbar/logger.rb
83
- - lib/wunderbar/marked.rb
65
+ - lib/wunderbar/version.rb
66
+ - lib/wunderbar/cgi-methods.rb
84
67
  - lib/wunderbar/server.rb
85
- - lib/wunderbar/jquery.rb
86
- - lib/wunderbar/angularjs/route.rb
87
- - lib/wunderbar/angularjs/resource.rb
88
- - lib/wunderbar/environment.rb
68
+ - lib/wunderbar/angularjs.rb
69
+ - lib/wunderbar/logger.rb
70
+ - lib/wunderbar/asset.rb
71
+ - lib/wunderbar/backtick.rb
72
+ - lib/wunderbar/coffeescript.rb
89
73
  - lib/wunderbar/markdown.rb
74
+ - lib/wunderbar/installation.rb
75
+ - lib/wunderbar/bootstrap.rb
76
+ - lib/wunderbar/job-control.rb
77
+ - lib/wunderbar/sinatra.rb
78
+ - lib/wunderbar/rails.rb
79
+ - lib/wunderbar/angularjs/resource.rb
80
+ - lib/wunderbar/angularjs/route.rb
81
+ - lib/wunderbar/rack.rb
82
+ - lib/wunderbar/coderay.rb
83
+ - lib/wunderbar/builder.rb
84
+ - lib/wunderbar/marked.rb
85
+ - lib/wunderbar/bootstrap/theme.rb
86
+ - lib/wunderbar/cssproxy.rb
87
+ - lib/wunderbar/html-methods.rb
88
+ - lib/wunderbar/node.rb
89
+ - lib/wunderbar/react.rb
90
90
  homepage: http://github.com/rubys/wunderbar
91
91
  licenses:
92
92
  - MIT