representable 1.7.2 → 1.7.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 585370fa8b9543301be8e4a6804f2aff74639f1d
4
- data.tar.gz: dd72e65cd02b0e5215a49957335088aab429be8d
3
+ metadata.gz: d73d9f923aac538f7a199d7c1f7c3f2e93de49fe
4
+ data.tar.gz: dd4330ac4acfef6810635ed20dc31e0a9752b445
5
5
  SHA512:
6
- metadata.gz: 0164fdb08a11640bb6d3a42b24f5ea97f8d0c35b995abd4129adfe859ae4d6fde41767d01298bf969f41771fcb90a50f0824dde32f062fd15765dc6b827e5241
7
- data.tar.gz: bf1a835d25ec7ac0d3e5c1465c634ef4ec3e67af5ef914adf7a92c6ff378f0b7d42e51b24a0621bc642a708231c17d552e7695a2f3dcae7d28c8d84139fedd39
6
+ metadata.gz: 8bd96f1c18ed6c3fc0d191cbb64a76b5163d81d40f98f4a0a8631697fee4cc9685f7448a48f6ed2a01a3f1f1905570d7cf9cb09980257c220f1c84b5f046d6ac
7
+ data.tar.gz: 7a40442475d412225a7009b411359c90be019d5c6fa6163f9cbb75bb548f0fc90d0694ace4fabe293a59ae7af473cd1ebd80b97dcab30c931962a3b2c3e44ba1
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ h2. 17.3
2
+
3
+ * Fix segfaulting with XML by passing the document to nested objects. Reported by @timoschilling and fixed by @canadaduane.
4
+
1
5
  h2. 1.7.2
2
6
 
3
7
  * `Representable#update_properties_from` is private now.
@@ -1,3 +1,3 @@
1
1
  module Representable
2
- VERSION = "1.7.2"
2
+ VERSION = "1.7.3"
3
3
  end
@@ -51,9 +51,10 @@ module Representable
51
51
 
52
52
  # Returns a Nokogiri::XML object representing this object.
53
53
  def to_node(options={})
54
+ options[:doc] ||= Nokogiri::XML::Document.new
54
55
  root_tag = options[:wrap] || representation_wrap
55
56
 
56
- create_representation_with(Nokogiri::XML::Node.new(root_tag.to_s, Nokogiri::XML::Document.new), options, PropertyBinding)
57
+ create_representation_with(Nokogiri::XML::Node.new(root_tag.to_s, options[:doc]), options, PropertyBinding)
57
58
  end
58
59
 
59
60
  def to_xml(*args)
@@ -18,10 +18,9 @@ class GenericTest < MiniTest::Spec
18
18
  new_album.songs.must_equal [] # DISCUSS: do we really want this?
19
19
  end
20
20
 
21
- it "leaves properties untouched" do
21
+ it "overrides property with empty array" do
22
22
  album.from_hash({})
23
- # TODO: test property.
24
- album.songs.must_equal ["Fuck Armageddon"] # DISCUSS: do we really want this?
23
+ album.songs.must_equal [] # DISCUSS: do we really want this?
25
24
  end
26
25
  end
27
26
 
@@ -190,6 +189,7 @@ class GenericTest < MiniTest::Spec
190
189
  end
191
190
  end
192
191
 
192
+
193
193
  describe "mix :extend and inline representers" do
194
194
  representer! do
195
195
  rpr_module = Module.new do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: representable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: 1.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-14 00:00:00.000000000 Z
11
+ date: 2013-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri