builder 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ module Builder
2
2
  VERSION_NUMBERS = [
3
3
  VERSION_MAJOR = 3,
4
4
  VERSION_MINOR = 0,
5
- VERSION_BUILD = 3,
5
+ VERSION_BUILD = 4,
6
6
  ]
7
7
  VERSION = VERSION_NUMBERS.join(".")
8
8
  end
@@ -44,6 +44,8 @@ module Builder
44
44
  when ::Hash
45
45
  attrs ||= {}
46
46
  attrs.merge!(arg)
47
+ when nil
48
+ # do nothing
47
49
  else
48
50
  text ||= ''
49
51
  text << arg.to_s
@@ -64,7 +66,7 @@ module Builder
64
66
  _end_tag(sym)
65
67
  _newline
66
68
  end
67
- elsif text.nil? || text.empty?
69
+ elsif text.nil?
68
70
  _indent
69
71
  _start_tag(sym, attrs, true)
70
72
  _newline
@@ -36,7 +36,7 @@ class TestMarkup < Test::Unit::TestCase
36
36
 
37
37
  def test_empty_value
38
38
  @xml.value("")
39
- assert_equal "<value/>", @xml.target!
39
+ assert_equal "<value></value>", @xml.target!
40
40
  end
41
41
 
42
42
  def test_nil_value
@@ -44,6 +44,11 @@ class TestMarkup < Test::Unit::TestCase
44
44
  assert_equal "<value/>", @xml.target!
45
45
  end
46
46
 
47
+ def test_no_value
48
+ @xml.value()
49
+ assert_equal "<value/>", @xml.target!
50
+ end
51
+
47
52
  def test_nested
48
53
  @xml.outer { |x| x.inner("x") }
49
54
  assert_equal "<outer><inner>x</inner></outer>", @xml.target!
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.0.3
4
+ version: 3.0.4
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-09 00:00:00.000000000 Z
12
+ date: 2012-10-16 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
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 1.8.15
86
+ rubygems_version: 1.8.24
87
87
  signing_key:
88
88
  specification_version: 3
89
89
  summary: Builders for MarkUp.