builder 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/builder/version.rb +1 -1
- data/lib/builder/xmlbase.rb +4 -4
- data/test/test_method_caching.rb +6 -0
- metadata +2 -2
data/lib/builder/version.rb
CHANGED
data/lib/builder/xmlbase.rb
CHANGED
@@ -177,11 +177,11 @@ module Builder
|
|
177
177
|
# method_missing is very slow, this speeds up document generation
|
178
178
|
# significantly.
|
179
179
|
def cache_method_call(sym)
|
180
|
-
|
181
|
-
|
182
|
-
tag!(
|
180
|
+
class << self; self; end.class_eval do
|
181
|
+
define_method(sym) do |*args, &block|
|
182
|
+
tag!(sym, *args, &block)
|
183
183
|
end
|
184
|
-
|
184
|
+
end
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
data/test/test_method_caching.rb
CHANGED
@@ -28,6 +28,12 @@ class TestMethodCaching < Test::Unit::TestCase
|
|
28
28
|
Builder::XmlBase.cache_method_calls = true
|
29
29
|
end
|
30
30
|
|
31
|
+
def test_caching_does_not_break_weird_symbols
|
32
|
+
xml = Builder::XmlMarkup.new
|
33
|
+
xml.__send__("work-order", 1)
|
34
|
+
assert_equal "<work-order>1</work-order>", xml.target!
|
35
|
+
end
|
36
|
+
|
31
37
|
def test_method_call_caching
|
32
38
|
xml = Builder::XmlMarkup.new
|
33
39
|
xml.cache_me
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'Builder provides a number of builder objects that make creating structured
|
15
15
|
data
|