builder 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of builder might be problematic. Click here for more details.
- data/CHANGES +4 -0
- data/README +2 -2
- data/Rakefile +1 -1
- data/lib/builder/xmlmarkup.rb +13 -1
- data/test/testmarkupbuilder.rb +10 -0
- metadata +5 -3
data/CHANGES
CHANGED
data/README
CHANGED
@@ -19,7 +19,7 @@ Builder::XmlEvents:: Generate XML events (i.e. SAX-like)
|
|
19
19
|
== Usage
|
20
20
|
|
21
21
|
require 'rubygems'
|
22
|
-
require_gem 'builder', '~> 1.2
|
22
|
+
require_gem 'builder', '~> 1.2'
|
23
23
|
|
24
24
|
builder = Builder::XmlMarkup.new
|
25
25
|
xml = builder.person { |b| b.name("Jim"); b.phone("555-1234") }
|
@@ -145,4 +145,4 @@ incompatibility are:
|
|
145
145
|
Author:: Jim Weirich
|
146
146
|
Email:: jim@weirichhouse.org
|
147
147
|
Home Page:: http://onestepback.org
|
148
|
-
License::
|
148
|
+
License:: MIT Licence (http://www.opensource.org/licenses/mit-license.html)
|
data/Rakefile
CHANGED
data/lib/builder/xmlmarkup.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#--
|
3
|
-
# Copyright 2004 by Jim Weirich (jim@weirichhouse.org).
|
3
|
+
# Copyright 2004, 2005 by Jim Weirich (jim@weirichhouse.org).
|
4
4
|
# All rights reserved.
|
5
5
|
|
6
6
|
# Permission is granted for use, copying, modification, distribution,
|
@@ -239,6 +239,18 @@ module Builder
|
|
239
239
|
[:version, :encoding, :standalone])
|
240
240
|
end
|
241
241
|
|
242
|
+
# Insert a CDATA section into the XML markup.
|
243
|
+
#
|
244
|
+
# For example:
|
245
|
+
#
|
246
|
+
# xml.cdata!("text to be included in cdata")
|
247
|
+
# #=> <![CDATA[text to be included in cdata]]>
|
248
|
+
#
|
249
|
+
def cdata!(text)
|
250
|
+
_ensure_no_block block_given?
|
251
|
+
_special("<![CDATA[", "]]>", text, nil)
|
252
|
+
end
|
253
|
+
|
242
254
|
private
|
243
255
|
|
244
256
|
# NOTE: All private methods of a builder object are prefixed when
|
data/test/testmarkupbuilder.rb
CHANGED
@@ -263,6 +263,16 @@ class TestSpecialMarkup < Test::Unit::TestCase
|
|
263
263
|
@xml.comment!(:element) { |x| x.hi }
|
264
264
|
end
|
265
265
|
end
|
266
|
+
|
267
|
+
def test_cdata
|
268
|
+
@xml.cdata!("TEST")
|
269
|
+
assert_equal "<![CDATA[TEST]]>\n", @xml.target!
|
270
|
+
end
|
271
|
+
|
272
|
+
def test_cdata_with_ampersand
|
273
|
+
@xml.cdata!("TEST&CHECK")
|
274
|
+
assert_equal "<![CDATA[TEST&CHECK]]>\n", @xml.target!
|
275
|
+
end
|
266
276
|
end
|
267
277
|
|
268
278
|
class TestIndentedXmlMarkup < Test::Unit::TestCase
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.
|
2
|
+
rubygems_version: 0.8.10.4
|
3
3
|
specification_version: 1
|
4
4
|
name: builder
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.2.
|
7
|
-
date: 2005-01-
|
6
|
+
version: 1.2.4
|
7
|
+
date: 2005-07-01 00:00:00 -04:00
|
8
8
|
summary: Builders for MarkUp.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -26,6 +26,8 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
26
26
|
version: 0.0.0
|
27
27
|
version:
|
28
28
|
platform: ruby
|
29
|
+
signing_key:
|
30
|
+
cert_chain:
|
29
31
|
authors:
|
30
32
|
- Jim Weirich
|
31
33
|
files:
|