wunderbar 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -317,3 +317,11 @@ Additionally, the following options are supported:
317
317
  * `--debug`, `--info`, `--warn`, `--error`, `--fatal`: set log level
318
318
  * `--install=`path: produce an suexec-callable wrapper script
319
319
  * `--rescue` or `--backtrace` cause wrapper script to capture errors
320
+
321
+ Optional dependencies:
322
+ ---
323
+
324
+ The following gems, if installed, will produce cleaner and prettier output:
325
+
326
+ * `nokogiri` cleans up HTML fragments inserted via `<<`
327
+ * `escape` prettier quoting of `system` commands
@@ -186,6 +186,14 @@ module Wunderbar
186
186
  def comment(*args)
187
187
  @_builder.comment! *args
188
188
  end
189
+
190
+ # insert verbatim
191
+ def <<(string)
192
+ require 'nokogiri'
193
+ @_builder << Nokogiri::HTML::fragment(string).to_xml
194
+ rescue LoadError
195
+ @_builder << string
196
+ end
189
197
  end
190
198
 
191
199
  class BuilderBase
@@ -110,6 +110,18 @@ class HtmlMarkup < Wunderbar::BuilderBase
110
110
  end
111
111
  end
112
112
 
113
+ def <<(string)
114
+ STDERR.puts @xhtml
115
+ if @xhtml
116
+ begin
117
+ require 'nokogiri'
118
+ string = Nokogiri::HTML::fragment(string).to_xml
119
+ rescue LoadError
120
+ end
121
+ end
122
+ super(string)
123
+ end
124
+
113
125
  def _exception(*args)
114
126
  exception = args.first
115
127
  if exception.respond_to? :backtrace
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 10
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/wunderbar.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "wunderbar"
5
- s.version = "0.10.2"
5
+ s.version = "0.10.3"
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"]
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/installation.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/server.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/version.rb"]
13
13
  s.homepage = "http://github.com/rubys/wunderbar"
14
14
  s.require_paths = ["lib"]
15
- s.rubygems_version = "1.8.15"
15
+ s.rubygems_version = "1.8.21"
16
16
  s.summary = "HTML Generator and CGI application support"
17
17
 
18
18
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,47 +1,60 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: wunderbar
3
- version: !ruby/object:Gem::Version
4
- version: 0.10.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 49
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 10
9
+ - 3
10
+ version: 0.10.3
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Sam Ruby
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-04-13 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-04-13 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: builder
16
- requirement: &6685180 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '3.0'
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 7
29
+ segments:
30
+ - 3
31
+ - 0
32
+ version: "3.0"
22
33
  type: :runtime
23
- prerelease: false
24
- version_requirements: *6685180
25
- - !ruby/object:Gem::Dependency
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
26
36
  name: json
27
- requirement: &6684680 !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
28
39
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
33
47
  type: :runtime
34
- prerelease: false
35
- version_requirements: *6684680
36
- description: ! " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML,
37
- Unicode\n (utf-8), consistently indented, readable applications. This includes\n
38
- \ output that conforms to the Polyglot specification and the emerging\n results
39
- from the XML Error Recovery Community Group.\n"
48
+ version_requirements: *id002
49
+ 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"
40
50
  email: rubys@intertwingly.net
41
51
  executables: []
52
+
42
53
  extensions: []
54
+
43
55
  extra_rdoc_files: []
44
- files:
56
+
57
+ files:
45
58
  - wunderbar.gemspec
46
59
  - README.md
47
60
  - COPYING
@@ -60,26 +73,36 @@ files:
60
73
  - lib/wunderbar/version.rb
61
74
  homepage: http://github.com/rubys/wunderbar
62
75
  licenses: []
76
+
63
77
  post_install_message:
64
78
  rdoc_options: []
65
- require_paths:
79
+
80
+ require_paths:
66
81
  - lib
67
- required_ruby_version: !ruby/object:Gem::Requirement
82
+ required_ruby_version: !ruby/object:Gem::Requirement
68
83
  none: false
69
- requirements:
70
- - - ! '>='
71
- - !ruby/object:Gem::Version
72
- version: '0'
73
- required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ hash: 3
88
+ segments:
89
+ - 0
90
+ version: "0"
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
92
  none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ hash: 3
97
+ segments:
98
+ - 0
99
+ version: "0"
79
100
  requirements: []
101
+
80
102
  rubyforge_project:
81
- rubygems_version: 1.8.15
103
+ rubygems_version: 1.8.21
82
104
  signing_key:
83
105
  specification_version: 3
84
106
  summary: HTML Generator and CGI application support
85
107
  test_files: []
108
+