builder 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/Rakefile +1 -1
- data/lib/blankslate.rb +2 -0
- data/lib/builder/xmlbase.rb +1 -1
- data/test/testblankslate.rb +2 -1
- data/test/testmarkupbuilder.rb +6 -0
- metadata +3 -3
data/CHANGES
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
= Change Log
|
2
2
|
|
3
|
+
== Version 2.1.2
|
4
|
+
|
5
|
+
* Fixed bug where private methods in kernel could leak through using
|
6
|
+
tag!(). Thanks to Hagen Overdick for finding and diagnosing this
|
7
|
+
bug.
|
8
|
+
|
9
|
+
|
3
10
|
== Version 2.1.1
|
4
11
|
|
5
12
|
* Fixed typo in XmlMarkup class docs (ident => indent). (from Martin
|
data/Rakefile
CHANGED
data/lib/blankslate.rb
CHANGED
@@ -33,6 +33,8 @@ class BlankSlate
|
|
33
33
|
@hidden_methods[name] || superclass.find_hidden_method(name)
|
34
34
|
end
|
35
35
|
|
36
|
+
# Redefine a previously hidden method so that it may be called on a blank
|
37
|
+
# slate object.
|
36
38
|
def reveal(name)
|
37
39
|
bound_method = nil
|
38
40
|
unbound_method = find_hidden_method(name)
|
data/lib/builder/xmlbase.rb
CHANGED
@@ -28,7 +28,7 @@ module Builder
|
|
28
28
|
# is the tag name, the arguements are the same as the tags
|
29
29
|
# implemented via <tt>method_missing</tt>.
|
30
30
|
def tag!(sym, *args, &block)
|
31
|
-
|
31
|
+
method_missing(sym.to_sym, *args, &block)
|
32
32
|
end
|
33
33
|
|
34
34
|
# Create XML markup based on the name of the method. This method
|
data/test/testblankslate.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'test/preload'
|
5
5
|
require 'builder/blankslate'
|
6
|
+
require 'stringio'
|
6
7
|
|
7
8
|
# Methods to be introduced into the Object class late.
|
8
9
|
module LateObject
|
@@ -147,7 +148,7 @@ class TestBlankSlate < Test::Unit::TestCase
|
|
147
148
|
assert_raise(NoMethodError) { @bs.late_kernel }
|
148
149
|
end
|
149
150
|
|
150
|
-
def
|
151
|
+
def test_revealing_previously_hidden_methods_are_callable
|
151
152
|
with_to_s = Class.new(BlankSlate) do
|
152
153
|
reveal :to_s
|
153
154
|
end
|
data/test/testmarkupbuilder.rb
CHANGED
@@ -91,6 +91,11 @@ class TestMarkup < Test::Unit::TestCase
|
|
91
91
|
assert_equal %{<non-ruby-token id="1"><ok/></non-ruby-token>}, @xml.target!
|
92
92
|
end
|
93
93
|
|
94
|
+
def test_tag_can_handle_private_method
|
95
|
+
@xml.tag!("loop", :id=>1) { |x| x.ok }
|
96
|
+
assert_equal %{<loop id="1"><ok/></loop>}, @xml.target!
|
97
|
+
end
|
98
|
+
|
94
99
|
def test_no_explicit_marker
|
95
100
|
@xml.p { |x| x.b("HI") }
|
96
101
|
assert_equal "<p><b>HI</b></p>", @xml.target!
|
@@ -441,3 +446,4 @@ class TestIndentedXmlMarkup < Test::Unit::TestCase
|
|
441
446
|
end
|
442
447
|
|
443
448
|
end
|
449
|
+
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.4.1
|
3
3
|
specification_version: 1
|
4
4
|
name: builder
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 2.1.
|
7
|
-
date: 2007-
|
6
|
+
version: 2.1.2
|
7
|
+
date: 2007-06-15 00:00:00 -04:00
|
8
8
|
summary: Builders for MarkUp.
|
9
9
|
require_paths:
|
10
10
|
- lib
|