wunderbar 0.19.0 → 0.19.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZGRmMDMxMzI4Y2JkMWZjYjIyNjZiYzhkMzY2YjEzNjcwODhjODQxZA==
5
+ data.tar.gz: !binary |-
6
+ OTAyMGVlNzBjMDllYzFlMmI2ZDgwM2ZlNzkxYzlkMTBiMmFiMWEyMQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Mjk1MGUzMWZmZTVhMzRjOTg1OWU3YWI2ODkwNThlMWUzN2U0NzRmNGU3OGJk
10
+ N2NiMzQ0MDgzYmQ3ZjIxMTk3MzNjOTMxMzdiZmMyOTdhZjJlZDNmNjhkMzA2
11
+ YTg2MDllNDY3YTkzZTZiOTlhMDJmNGZmMWJjNWM0ODUwY2FlNjU=
12
+ data.tar.gz: !binary |-
13
+ ODM2ODg1ZjkyNDBkMjg0NDg0ODc3YTk5NTVmZjc1ZjNiMmNjODQ4ODNhYjEx
14
+ YWQ0ZjczYjY3ODlhZmYzM2IxYzFlYWJiNTkxMTdlOWVkOWI4MDA4NDc5MGZh
15
+ Yzk2NmZhZjllYTU4ZTZlNzY5ZTU4MGJjNGU2ZWFmODI5MzdlZTY=
data/README.md CHANGED
@@ -18,6 +18,9 @@ Wunderbar's JSON support is inspired by David Heinemeier Hansson's
18
18
 
19
19
  A [tutorial](https://github.com/rubys/wunderbar/blob/master/docs/Introduction1.md) is under development.
20
20
 
21
+ Additional functionality is provided by
22
+ [extensions](https://github.com/rubys/wunderbar/blob/master/docs/Extensions.md).
23
+
21
24
  Overview
22
25
  ---
23
26
 
@@ -392,13 +395,6 @@ Also, the following environment variables are set if they aren't already:
392
395
  Finally, the (Ruby 1.9.x) default external and internal encodings are set to
393
396
  UTF-8. For Ruby 1.8, `$KCODE` is set to `U`
394
397
 
395
- Builder extensions
396
- ---
397
- * `indented_text!`: matches text indentation to markup
398
- * `indented_data!`: useful for script and styles in HTML syntax
399
- * `disable_indentation!`: temporarily disable insertion of whitespace
400
- * `margin!`: insert blank lines between tags
401
-
402
398
  Logging:
403
399
  ---
404
400
  * `_.debug`: debug messages
@@ -1,3 +1,14 @@
1
+ #
2
+ # Web frameworks often require a set of JavaScript and/or CSS stylesheet files
3
+ # to be pulled in. Asset support makes it easy to deploy such files to be
4
+ # deployed statically; and furthermore to automatically insert the relevant
5
+ # <script src> or <link rel="stylesheet"> lines to the <head> section of your
6
+ # HTML.
7
+ #
8
+ # For examples, see angularjs.rb, jquery.rb, opal.rb, pagedown.rb, or
9
+ # polymer.rb.
10
+ #
11
+
1
12
  require 'fileutils'
2
13
 
3
14
  module Wunderbar
@@ -5,7 +5,8 @@ module Wunderbar
5
5
 
6
6
  # produce json
7
7
  def json(scope, &block)
8
- headers = { 'type' => 'application/json', 'Cache-Control' => 'no-cache' }
8
+ headers = { 'type' => 'application/json', 'charset' => 'UTF-8',
9
+ 'Cache-Control' => 'no-cache' }
9
10
  builder = JsonBuilder.new(scope)
10
11
  output = builder.encode(&block)
11
12
  headers['status'] = "404 Not Found" if output == {}
@@ -41,7 +41,7 @@ module Wunderbar
41
41
 
42
42
  def initialize(scope)
43
43
  @_scope = scope
44
- @x = XmlMarkup.new :scope => scope, :indent => 2
44
+ @_x = XmlMarkup.new :scope => scope, :indent => 2
45
45
  end
46
46
 
47
47
  def html(*args, &block)
@@ -49,7 +49,7 @@ module Wunderbar
49
49
  args << {} if args.empty?
50
50
  if Hash === args.first
51
51
  args.first[:xmlns] ||= 'http://www.w3.org/1999/xhtml'
52
- @x.width = args.first.delete(:_width).to_i if args.first[:_width]
52
+ @_x.width = args.first.delete(:_width).to_i if args.first[:_width]
53
53
  end
54
54
 
55
55
  if ''.respond_to? :encoding
@@ -58,7 +58,7 @@ module Wunderbar
58
58
  bom = "\xEF\xBB\xBF"
59
59
  end
60
60
 
61
- @x.declare! :DOCTYPE, :html
61
+ @_x.declare! :DOCTYPE, :html
62
62
  html = tag! :html, *args do
63
63
  set_variables_from_params
64
64
  instance_eval(&block)
@@ -89,7 +89,7 @@ module Wunderbar
89
89
  end
90
90
  end
91
91
 
92
- @x.instance_eval {@node = html}
92
+ @_x.instance_eval {@node = html}
93
93
  head = _head_ if not head
94
94
  body = _body nil if not body
95
95
  html.children.unshift(head.parent.children.delete(head))
@@ -115,7 +115,7 @@ module Wunderbar
115
115
  head.children.insert 1, head.children.delete_at(title)
116
116
  end
117
117
 
118
- bom + @x.target!
118
+ bom + @_x.target!
119
119
  end
120
120
 
121
121
  def _html(*args, &block)
@@ -134,7 +134,7 @@ module Wunderbar
134
134
  end
135
135
 
136
136
  if name.sub!(/_$/,'')
137
- @x.spaced!
137
+ @_x.spaced!
138
138
  return __send__ "_#{name}", *args, &block if respond_to? "_#{name}"
139
139
  end
140
140
 
@@ -150,7 +150,7 @@ module Wunderbar
150
150
  end
151
151
 
152
152
  if flag == '!'
153
- @x.compact! { tag! name, *args, &block }
153
+ @_x.compact! { tag! name, *args, &block }
154
154
  elsif flag == '?'
155
155
  # capture exceptions, produce filtered tracebacks
156
156
  tag!(name, *args) do
@@ -186,7 +186,7 @@ module Wunderbar
186
186
  end
187
187
 
188
188
  def tag!(name, *args, &block)
189
- node = @x.tag! name, *args, &block
189
+ node = @_x.tag! name, *args, &block
190
190
  if !block and args.empty?
191
191
  CssProxy.new(self, node)
192
192
  else
@@ -195,7 +195,7 @@ module Wunderbar
195
195
  end
196
196
 
197
197
  def proxiable_tag!(name, *args, &block)
198
- node = @x.tag! name, *args, &block
198
+ node = @_x.tag! name, *args, &block
199
199
  if !block
200
200
  CssProxy.new(self, node)
201
201
  else
@@ -243,7 +243,7 @@ module Wunderbar
243
243
  if args.length >= 1 and String === args.first and args.first.include? "\n"
244
244
  text = args.shift
245
245
  tag! :p, *args do
246
- @x.indented_text! text
246
+ @_x.indented_text! text
247
247
  end
248
248
  else
249
249
  super
@@ -266,7 +266,7 @@ module Wunderbar
266
266
 
267
267
  def _pre(*args, &block)
268
268
  args.first.chomp! if String === args.first and args.first.end_with? "\n"
269
- @x.compact! { tag! :pre, *args, &block }
269
+ @_x.compact! { tag! :pre, *args, &block }
270
270
  end
271
271
 
272
272
  def _ul(*args, &block)
@@ -300,7 +300,7 @@ module Wunderbar
300
300
  end
301
301
 
302
302
  def _!(text)
303
- @x.text! text.to_s.chomp
303
+ @_x.text! text.to_s.chomp
304
304
  end
305
305
 
306
306
  def _(text=nil, &block)
@@ -309,10 +309,10 @@ module Wunderbar
309
309
  if text.respond_to? :html_safe? and text.html_safe?
310
310
  _ {text}
311
311
  else
312
- @x.indented_text! text.to_s
312
+ @_x.indented_text! text.to_s
313
313
  end
314
314
  end
315
- return @x
315
+ return @_x
316
316
  end
317
317
 
318
318
  children = block.call
@@ -349,24 +349,24 @@ module Wunderbar
349
349
  children.unshift head
350
350
  end
351
351
  else
352
- return @x.indented_text! children
352
+ return @_x.indented_text! children
353
353
  end
354
354
  end
355
355
 
356
- @x[*children]
356
+ @_x[*children]
357
357
  end
358
358
 
359
359
  def __(text=nil)
360
360
  if text
361
- @x.spaced!
362
- @x.indented_text! text
361
+ @_x.spaced!
362
+ @_x.indented_text! text
363
363
  else
364
- @x.text! ""
364
+ @_x.text! ""
365
365
  end
366
366
  end
367
367
 
368
368
  def clear!
369
- @x.clear!
369
+ @_x.clear!
370
370
  end
371
371
 
372
372
  def self.flatten?(children)
@@ -1,9 +1,11 @@
1
1
  require 'wunderbar'
2
2
 
3
- begin
4
- require 'ruby2js/filter/jquery'
5
- require 'wunderbar/script'
6
- rescue LoadError
3
+ unless defined? Opal
4
+ begin
5
+ require 'ruby2js/filter/jquery'
6
+ require 'wunderbar/script'
7
+ rescue LoadError
8
+ end
7
9
  end
8
10
 
9
11
  source = Dir[File.expand_path('../vendor/jquery-*.min.js', __FILE__)].
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 19
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/wunderbar.gemspec CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "wunderbar"
5
- s.version = "0.19.0"
5
+ s.version = "0.19.1"
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 = "2013-12-07"
9
+ s.date = "2013-12-11"
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", "lib/wunderbar/asset.rb", "lib/wunderbar/script.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/websocket.rb", "lib/wunderbar/opal.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/node.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/jquery-1.10.2.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/angularjs.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/opal", "lib/wunderbar/opal/browser.rb", "lib/wunderbar/opal/jquery.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/version.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/server.rb", "lib/wunderbar.rb"]
12
+ s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/logger.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/jquery-1.10.2.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/markdown.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/server.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/version.rb", "lib/wunderbar/node.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/script.rb", "lib/wunderbar/websocket.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/opal", "lib/wunderbar/opal/browser.rb", "lib/wunderbar/opal/jquery.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/angularjs.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/opal.rb", "lib/wunderbar/installation.rb"]
13
13
  s.homepage = "http://github.com/rubys/wunderbar"
14
14
  s.licenses = ["MIT"]
15
15
  s.require_paths = ["lib"]
16
- s.rubygems_version = "1.8.11"
16
+ s.rubygems_version = "2.0.7"
17
17
  s.summary = "HTML Generator and CGI application support"
18
18
 
19
19
  if s.respond_to? :specification_version then
20
- s.specification_version = 3
20
+ s.specification_version = 4
21
21
 
22
22
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
23
23
  s.add_runtime_dependency(%q<json>, [">= 0"])
metadata CHANGED
@@ -1,27 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wunderbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
5
- prerelease:
4
+ version: 0.19.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sam Ruby
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-07 00:00:00.000000000 Z
11
+ date: 2013-12-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: json
16
- requirement: &11053300 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *11053300
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  description: ! " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML,
26
28
  Unicode\n (utf-8), consistently indented, readable applications. This includes\n
27
29
  \ output that conforms to the Polyglot specification and the emerging\n results
@@ -34,67 +36,66 @@ files:
34
36
  - wunderbar.gemspec
35
37
  - README.md
36
38
  - COPYING
37
- - lib/wunderbar/asset.rb
38
- - lib/wunderbar/script.rb
39
- - lib/wunderbar/environment.rb
40
- - lib/wunderbar/installation.rb
41
- - lib/wunderbar/websocket.rb
42
- - lib/wunderbar/opal.rb
39
+ - lib/wunderbar.rb
40
+ - lib/wunderbar/logger.rb
41
+ - lib/wunderbar/coderay.rb
42
+ - lib/wunderbar/rails.rb
43
+ - lib/wunderbar/builder.rb
43
44
  - lib/wunderbar/coffeescript.rb
44
- - lib/wunderbar/jquery.rb
45
- - lib/wunderbar/sinatra.rb
46
- - lib/wunderbar/node.rb
47
- - lib/wunderbar/vendor/angular.min.js
48
- - lib/wunderbar/vendor/angular-route.min.js
49
45
  - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
50
- - lib/wunderbar/vendor/Markdown.Converter.js
46
+ - lib/wunderbar/vendor/angular-resource.min.js
51
47
  - lib/wunderbar/vendor/jquery-1.10.2.min.js
48
+ - lib/wunderbar/vendor/Markdown.Converter.js
49
+ - lib/wunderbar/vendor/angular-route.min.js
50
+ - lib/wunderbar/vendor/angular.min.js
52
51
  - lib/wunderbar/vendor/stupidtable.min.js
53
- - lib/wunderbar/vendor/angular-resource.min.js
54
- - lib/wunderbar/angularjs.rb
52
+ - lib/wunderbar/markdown.rb
53
+ - lib/wunderbar/environment.rb
55
54
  - lib/wunderbar/pagedown.rb
55
+ - lib/wunderbar/server.rb
56
+ - lib/wunderbar/polymer.rb
57
+ - lib/wunderbar/version.rb
58
+ - lib/wunderbar/node.rb
59
+ - lib/wunderbar/asset.rb
60
+ - lib/wunderbar/script.rb
61
+ - lib/wunderbar/websocket.rb
62
+ - lib/wunderbar/jquery/stupidtable.rb
56
63
  - lib/wunderbar/angularjs/route.rb
57
64
  - lib/wunderbar/angularjs/resource.rb
58
- - lib/wunderbar/logger.rb
59
- - lib/wunderbar/job-control.rb
60
- - lib/wunderbar/rack.rb
61
65
  - lib/wunderbar/opal/browser.rb
62
66
  - lib/wunderbar/opal/jquery.rb
63
- - lib/wunderbar/polymer.rb
64
- - lib/wunderbar/cgi-methods.rb
65
- - lib/wunderbar/jquery/stupidtable.rb
66
- - lib/wunderbar/cssproxy.rb
67
- - lib/wunderbar/version.rb
68
- - lib/wunderbar/coderay.rb
69
67
  - lib/wunderbar/html-methods.rb
70
- - lib/wunderbar/rails.rb
71
- - lib/wunderbar/builder.rb
72
- - lib/wunderbar/markdown.rb
73
- - lib/wunderbar/server.rb
74
- - lib/wunderbar.rb
68
+ - lib/wunderbar/job-control.rb
69
+ - lib/wunderbar/cssproxy.rb
70
+ - lib/wunderbar/angularjs.rb
71
+ - lib/wunderbar/jquery.rb
72
+ - lib/wunderbar/cgi-methods.rb
73
+ - lib/wunderbar/sinatra.rb
74
+ - lib/wunderbar/rack.rb
75
+ - lib/wunderbar/opal.rb
76
+ - lib/wunderbar/installation.rb
75
77
  homepage: http://github.com/rubys/wunderbar
76
78
  licenses:
77
79
  - MIT
80
+ metadata: {}
78
81
  post_install_message:
79
82
  rdoc_options: []
80
83
  require_paths:
81
84
  - lib
82
85
  required_ruby_version: !ruby/object:Gem::Requirement
83
- none: false
84
86
  requirements:
85
87
  - - ! '>='
86
88
  - !ruby/object:Gem::Version
87
89
  version: '0'
88
90
  required_rubygems_version: !ruby/object:Gem::Requirement
89
- none: false
90
91
  requirements:
91
92
  - - ! '>='
92
93
  - !ruby/object:Gem::Version
93
94
  version: '0'
94
95
  requirements: []
95
96
  rubyforge_project:
96
- rubygems_version: 1.8.11
97
+ rubygems_version: 2.0.7
97
98
  signing_key:
98
- specification_version: 3
99
+ specification_version: 4
99
100
  summary: HTML Generator and CGI application support
100
101
  test_files: []