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 +4 -4
- data/CHANGES.md +4 -0
- data/lib/representable/version.rb +1 -1
- data/lib/representable/xml.rb +2 -1
- data/test/generic_test.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73d9f923aac538f7a199d7c1f7c3f2e93de49fe
|
4
|
+
data.tar.gz: dd4330ac4acfef6810635ed20dc31e0a9752b445
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd96f1c18ed6c3fc0d191cbb64a76b5163d81d40f98f4a0a8631697fee4cc9685f7448a48f6ed2a01a3f1f1905570d7cf9cb09980257c220f1c84b5f046d6ac
|
7
|
+
data.tar.gz: 7a40442475d412225a7009b411359c90be019d5c6fa6163f9cbb75bb548f0fc90d0694ace4fabe293a59ae7af473cd1ebd80b97dcab30c931962a3b2c3e44ba1
|
data/CHANGES.md
CHANGED
data/lib/representable/xml.rb
CHANGED
@@ -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,
|
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)
|
data/test/generic_test.rb
CHANGED
@@ -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 "
|
21
|
+
it "overrides property with empty array" do
|
22
22
|
album.from_hash({})
|
23
|
-
#
|
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.
|
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-
|
11
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|