wunderbar 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9da84e95d78148773cdc10411a6f2d3834882ac5
4
+ data.tar.gz: 132ffd6d3a48389bf68f8f5b6de90d87d709808d
5
+ SHA512:
6
+ metadata.gz: f5c86953491b1b2cee5a3e840c933166c3536fc633253c0da965b8288585a40f70ce662e6a3c5ccf616730f3fced6a67ba800939fbb83e55f53239a240b242d8
7
+ data.tar.gz: c621cf5d3f7ebe4551bcda858b3329349f38add5e6fd58e270725f7d4f4a6c9a4fce3af71a2075d878cfb4a6a6a566f58c44c2a16fb17112b7a31b1ad3b6219d
@@ -16,6 +16,16 @@ source = Dir[File.expand_path('../vendor/react-*.min.js', __FILE__)].
16
16
  Wunderbar::Asset.script name: 'react-min.js', file: source,
17
17
  react: ['global=this']
18
18
 
19
+ class Wunderbar::Asset
20
+ @@cached_scripts = {}
21
+ def self.convert(file)
22
+ cached = @@cached_scripts[file]
23
+ return cached if cached and cached.uptodate?
24
+ return nil unless File.exist? file
25
+ @@cached_scripts[file] = Ruby2JS.convert(File.read(file), file: file)
26
+ end
27
+ end
28
+
19
29
  class Wunderbar::ClientScriptNode < Wunderbar::ScriptNode
20
30
  end
21
31
 
@@ -72,10 +82,8 @@ class Wunderbar::XmlMarkup
72
82
  if File.exist? name
73
83
  result = File.read(name)
74
84
  else
75
- name = File.expand_path(src+'.rb', @_scope.settings.views.untaint)
76
- if File.exist? name
77
- result = Ruby2JS.convert(File.read(name), file: name)
78
- end
85
+ file = File.expand_path(src+'.rb', @_scope.settings.views.untaint)
86
+ result = Wunderbar::Asset.convert(file)
79
87
  end
80
88
  else
81
89
  result = Ruby2JS.convert(script.block, binding: script.binding)
@@ -126,27 +134,24 @@ class Ruby2JS::Serializer
126
134
  end
127
135
  end
128
136
 
129
- SCRIPTS = {}
130
137
  get %r{^/([-\w]+)\.js$} do |script|
131
- unless SCRIPTS[script] and SCRIPTS[script].uptodate?
132
- file = File.join(settings.views, "#{script}.js.rb")
133
- pass unless File.exist? file
134
- begin
135
- SCRIPTS[script] = Ruby2JS.convert(File.read(file), file: file)
136
- rescue
137
- # if conversion fails, use Wunderbar's error recovery
138
- _js :"#{script}"
139
- return
140
- end
138
+ file = File.join(settings.views, "#{script}.js.rb")
139
+ begin
140
+ js = Wunderbar::Asset.convert(file)
141
+ pass unless js
142
+ rescue
143
+ # if conversion fails, use Wunderbar's error recovery
144
+ _js :"#{script}"
145
+ return
141
146
  end
142
147
 
143
148
  response.headers['SourceMap'] = "#{script}.js.map"
144
149
 
145
- etag SCRIPTS[script].etag
150
+ etag js.etag
146
151
 
147
152
  content_type 'application/javascript;charset:utf8'
148
153
 
149
- SCRIPTS[script].to_s
154
+ js.to_s
150
155
  end
151
156
 
152
157
  get %r{^/((?:\w+\/)*[-\w]+)\.js.rb$} do |script|
@@ -156,11 +161,13 @@ get %r{^/((?:\w+\/)*[-\w]+)\.js.rb$} do |script|
156
161
  end
157
162
 
158
163
  get %r{^/([-\w]+)\.js.map$} do |script|
159
- pass unless SCRIPTS[script]
164
+ file = File.join(settings.views, "#{script}.js.rb")
165
+ js = Wunderbar::Asset.convert(file)
166
+ pass unless js
160
167
 
161
- etag SCRIPTS[script].sourcemap_etag
168
+ etag js.sourcemap_etag
162
169
 
163
- sourcemap = SCRIPTS[script].sourcemap
170
+ sourcemap = js.sourcemap
164
171
 
165
172
  content_type 'application/json;charset:utf8'
166
173
  base = settings.views + '/'
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/wunderbar.gemspec CHANGED
@@ -1,24 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ # stub: wunderbar 1.0.6 ruby lib
2
3
 
3
4
  Gem::Specification.new do |s|
4
5
  s.name = "wunderbar"
5
- s.version = "1.0.5"
6
+ s.version = "1.0.6"
6
7
 
7
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib"]
8
10
  s.authors = ["Sam Ruby"]
9
- s.date = "2015-05-04"
11
+ s.date = "2015-05-06"
10
12
  s.description = " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML, Unicode\n (utf-8), consistently indented, readable applications.'\n"
11
13
  s.email = "rubys@intertwingly.net"
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/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/react-0.13.2.min.js", "lib/wunderbar/vendor/jquery-1.11.2.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/vendor/eventsource.min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/websocket.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/listen.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/version.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/server.rb", "lib/wunderbar/eventsource.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"]
14
+ s.files = ["COPYING", "README.md", "lib/wunderbar", "lib/wunderbar.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs.rb", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/eventsource.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery.rb", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/listen.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/marked.rb", "lib/wunderbar/node.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/react.rb", "lib/wunderbar/script.rb", "lib/wunderbar/server.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/eventsource.min.js", "lib/wunderbar/vendor/jquery-1.11.2.min.js", "lib/wunderbar/vendor/marked.min.js", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/react-0.13.2.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/version.rb", "lib/wunderbar/websocket.rb", "wunderbar.gemspec"]
13
15
  s.homepage = "http://github.com/rubys/wunderbar"
14
16
  s.licenses = ["MIT"]
15
- s.require_paths = ["lib"]
16
17
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
17
- s.rubygems_version = "1.8.23.2"
18
+ s.rubygems_version = "2.4.5"
18
19
  s.summary = "HTML Generator and CGI application support"
19
20
 
20
21
  if s.respond_to? :specification_version then
21
- s.specification_version = 3
22
+ s.specification_version = 4
22
23
 
23
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
24
25
  s.add_runtime_dependency(%q<json>, [">= 0"])
metadata CHANGED
@@ -1,116 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wunderbar
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.0.5
4
+ version: 1.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sam Ruby
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-05-04 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
- none: false
21
20
  type: :runtime
22
- name: json
23
21
  prerelease: false
24
- requirement: !ruby/object:Gem::Requirement
22
+ version_requirements: !ruby/object:Gem::Requirement
25
23
  requirements:
26
- - - ! '>='
24
+ - - ">="
27
25
  - !ruby/object:Gem::Version
28
26
  version: '0'
29
- none: false
30
- description: ! " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML,
31
- Unicode\n (utf-8), consistently indented, readable applications.'\n"
27
+ description: |2
28
+ Wunderbar makes it easy to produce valid HTML5, wellformed XHTML, Unicode
29
+ (utf-8), consistently indented, readable applications.'
32
30
  email: rubys@intertwingly.net
33
31
  executables: []
34
32
  extensions: []
35
33
  extra_rdoc_files: []
36
34
  files:
37
- - wunderbar.gemspec
38
- - README.md
39
35
  - COPYING
36
+ - README.md
40
37
  - lib/wunderbar.rb
41
- - lib/wunderbar/script.rb
42
- - lib/wunderbar/jquery.rb
43
- - lib/wunderbar/underscore.rb
44
- - lib/wunderbar/polymer.rb
45
- - lib/wunderbar/jquery/filter.rb
46
- - lib/wunderbar/jquery/stupidtable.rb
47
- - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
48
- - lib/wunderbar/vendor/marked.min.js
49
- - lib/wunderbar/vendor/stupidtable.min.js
50
- - lib/wunderbar/vendor/bootstrap.min.js
51
- - lib/wunderbar/vendor/Markdown.Converter.js
52
- - lib/wunderbar/vendor/angular.min.js
53
- - lib/wunderbar/vendor/react-0.13.2.min.js
54
- - lib/wunderbar/vendor/jquery-1.11.2.min.js
55
- - lib/wunderbar/vendor/bootstrap-theme.min.css
56
- - lib/wunderbar/vendor/angular-resource.min.js
57
- - lib/wunderbar/vendor/bootstrap.min.css
58
- - lib/wunderbar/vendor/underscore-min.js
59
- - lib/wunderbar/vendor/eventsource.min.js
60
- - lib/wunderbar/vendor/angular-route.min.js
61
- - lib/wunderbar/websocket.rb
62
- - lib/wunderbar/environment.rb
63
- - lib/wunderbar/listen.rb
64
- - lib/wunderbar/pagedown.rb
65
- - lib/wunderbar/version.rb
66
- - lib/wunderbar/cgi-methods.rb
67
- - lib/wunderbar/server.rb
68
- - lib/wunderbar/eventsource.rb
69
38
  - lib/wunderbar/angularjs.rb
70
- - lib/wunderbar/logger.rb
39
+ - lib/wunderbar/angularjs/resource.rb
40
+ - lib/wunderbar/angularjs/route.rb
71
41
  - lib/wunderbar/asset.rb
72
42
  - lib/wunderbar/backtick.rb
73
- - lib/wunderbar/coffeescript.rb
74
- - lib/wunderbar/markdown.rb
75
- - lib/wunderbar/installation.rb
76
43
  - lib/wunderbar/bootstrap.rb
77
- - lib/wunderbar/job-control.rb
78
- - lib/wunderbar/sinatra.rb
79
- - lib/wunderbar/rails.rb
80
- - lib/wunderbar/angularjs/resource.rb
81
- - lib/wunderbar/angularjs/route.rb
82
- - lib/wunderbar/rack.rb
83
- - lib/wunderbar/coderay.rb
84
- - lib/wunderbar/builder.rb
85
- - lib/wunderbar/marked.rb
86
44
  - lib/wunderbar/bootstrap/theme.rb
45
+ - lib/wunderbar/builder.rb
46
+ - lib/wunderbar/cgi-methods.rb
47
+ - lib/wunderbar/coderay.rb
48
+ - lib/wunderbar/coffeescript.rb
87
49
  - lib/wunderbar/cssproxy.rb
50
+ - lib/wunderbar/environment.rb
51
+ - lib/wunderbar/eventsource.rb
88
52
  - lib/wunderbar/html-methods.rb
53
+ - lib/wunderbar/installation.rb
54
+ - lib/wunderbar/job-control.rb
55
+ - lib/wunderbar/jquery.rb
56
+ - lib/wunderbar/jquery/filter.rb
57
+ - lib/wunderbar/jquery/stupidtable.rb
58
+ - lib/wunderbar/listen.rb
59
+ - lib/wunderbar/logger.rb
60
+ - lib/wunderbar/markdown.rb
61
+ - lib/wunderbar/marked.rb
89
62
  - lib/wunderbar/node.rb
63
+ - lib/wunderbar/pagedown.rb
64
+ - lib/wunderbar/polymer.rb
65
+ - lib/wunderbar/rack.rb
66
+ - lib/wunderbar/rails.rb
90
67
  - lib/wunderbar/react.rb
68
+ - lib/wunderbar/script.rb
69
+ - lib/wunderbar/server.rb
70
+ - lib/wunderbar/sinatra.rb
71
+ - lib/wunderbar/underscore.rb
72
+ - lib/wunderbar/vendor/Markdown.Converter.js
73
+ - lib/wunderbar/vendor/angular-resource.min.js
74
+ - lib/wunderbar/vendor/angular-route.min.js
75
+ - lib/wunderbar/vendor/angular.min.js
76
+ - lib/wunderbar/vendor/bootstrap-theme.min.css
77
+ - lib/wunderbar/vendor/bootstrap.min.css
78
+ - lib/wunderbar/vendor/bootstrap.min.js
79
+ - lib/wunderbar/vendor/eventsource.min.js
80
+ - lib/wunderbar/vendor/jquery-1.11.2.min.js
81
+ - lib/wunderbar/vendor/marked.min.js
82
+ - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
83
+ - lib/wunderbar/vendor/react-0.13.2.min.js
84
+ - lib/wunderbar/vendor/stupidtable.min.js
85
+ - lib/wunderbar/vendor/underscore-min.js
86
+ - lib/wunderbar/version.rb
87
+ - lib/wunderbar/websocket.rb
88
+ - wunderbar.gemspec
91
89
  homepage: http://github.com/rubys/wunderbar
92
90
  licenses:
93
91
  - MIT
92
+ metadata: {}
94
93
  post_install_message:
95
94
  rdoc_options: []
96
95
  require_paths:
97
96
  - lib
98
97
  required_ruby_version: !ruby/object:Gem::Requirement
99
98
  requirements:
100
- - - ! '>='
99
+ - - ">="
101
100
  - !ruby/object:Gem::Version
102
101
  version: 1.9.3
103
- none: false
104
102
  required_rubygems_version: !ruby/object:Gem::Requirement
105
103
  requirements:
106
- - - ! '>='
104
+ - - ">="
107
105
  - !ruby/object:Gem::Version
108
106
  version: '0'
109
- none: false
110
107
  requirements: []
111
108
  rubyforge_project:
112
- rubygems_version: 1.8.23.2
109
+ rubygems_version: 2.4.5
113
110
  signing_key:
114
- specification_version: 3
111
+ specification_version: 4
115
112
  summary: HTML Generator and CGI application support
116
113
  test_files: []