builder 2.1.1 → 2.1.2

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/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
@@ -21,7 +21,7 @@ end
21
21
 
22
22
  CLOBBER.include('pkg')
23
23
 
24
- CURRENT_VERSION = '2.1.1'
24
+ CURRENT_VERSION = '2.1.2'
25
25
  PKG_VERSION = ENV['REL'] ? ENV['REL'] : CURRENT_VERSION
26
26
 
27
27
  SRC_RB = FileList['lib/**/*.rb']
@@ -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)
@@ -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
- self.__send__(sym, *args, &block)
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
@@ -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 test_revealing_previously_hidden_methods_is_ok
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
@@ -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
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.1
7
- date: 2007-03-01 00:00:00 -05:00
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