representable 1.7.7 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +42 -8
- data/README.md +208 -55
- data/Rakefile +0 -6
- data/lib/representable.rb +39 -43
- data/lib/representable/binding.rb +59 -37
- data/lib/representable/bindings/hash_bindings.rb +3 -4
- data/lib/representable/bindings/xml_bindings.rb +10 -10
- data/lib/representable/bindings/yaml_bindings.rb +2 -2
- data/lib/representable/coercion.rb +1 -1
- data/lib/representable/config.rb +11 -5
- data/lib/representable/definition.rb +67 -35
- data/lib/representable/deserializer.rb +23 -27
- data/lib/representable/hash.rb +15 -4
- data/lib/representable/hash/allow_symbols.rb +27 -0
- data/lib/representable/json.rb +0 -1
- data/lib/representable/json/collection.rb +0 -2
- data/lib/representable/mapper.rb +6 -13
- data/lib/representable/parse_strategies.rb +57 -0
- data/lib/representable/readable_writeable.rb +29 -0
- data/lib/representable/serializer.rb +9 -4
- data/lib/representable/version.rb +1 -1
- data/lib/representable/xml.rb +1 -1
- data/lib/representable/xml/collection.rb +0 -2
- data/lib/representable/yaml.rb +0 -1
- data/representable.gemspec +1 -0
- data/test/as_test.rb +43 -0
- data/test/class_test.rb +124 -0
- data/test/config_test.rb +13 -3
- data/test/decorator_scope_test.rb +28 -0
- data/test/definition_test.rb +46 -35
- data/test/exec_context_test.rb +93 -0
- data/test/generic_test.rb +0 -154
- data/test/getter_setter_test.rb +28 -0
- data/test/hash_bindings_test.rb +35 -35
- data/test/hash_test.rb +0 -20
- data/test/if_test.rb +78 -0
- data/test/inherit_test.rb +21 -1
- data/test/inheritance_test.rb +1 -1
- data/test/inline_test.rb +40 -2
- data/test/instance_test.rb +286 -0
- data/test/is_representable_test.rb +77 -0
- data/test/json_test.rb +6 -29
- data/test/nested_test.rb +30 -0
- data/test/parse_strategy_test.rb +249 -0
- data/test/pass_options_test.rb +27 -0
- data/test/prepare_test.rb +67 -0
- data/test/reader_writer_test.rb +19 -0
- data/test/representable_test.rb +25 -265
- data/test/stringify_hash_test.rb +41 -0
- data/test/test_helper.rb +12 -4
- data/test/wrap_test.rb +48 -0
- data/test/xml_bindings_test.rb +37 -37
- data/test/xml_test.rb +14 -14
- metadata +94 -30
- data/lib/representable/deprecations.rb +0 -4
- data/lib/representable/feature/readable_writeable.rb +0 -30
data/test/test_helper.rb
CHANGED
@@ -56,12 +56,12 @@ MiniTest::Spec.class_eval do
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
def render(object)
|
60
|
-
AssertableDocument.new(object.send("to_#{format}"), format)
|
59
|
+
def render(object, *args)
|
60
|
+
AssertableDocument.new(object.send("to_#{format}", *args), format)
|
61
61
|
end
|
62
62
|
|
63
|
-
def parse(object, input)
|
64
|
-
object.send("from_#{format}", input)
|
63
|
+
def parse(object, input, *args)
|
64
|
+
object.send("from_#{format}", input, *args)
|
65
65
|
end
|
66
66
|
|
67
67
|
class AssertableDocument
|
@@ -120,3 +120,11 @@ MiniTest::Spec.class_eval do
|
|
120
120
|
end
|
121
121
|
include TestMethods
|
122
122
|
end
|
123
|
+
|
124
|
+
class BaseTest < MiniTest::Spec
|
125
|
+
let (:new_album) { OpenStruct.new.extend(representer) }
|
126
|
+
let (:album) { OpenStruct.new(:songs => ["Fuck Armageddon"]).extend(representer) }
|
127
|
+
let (:song) { OpenStruct.new(:title => "Resist Stance") }
|
128
|
+
let (:song_representer) { Module.new do include Representable::Hash; property :title end }
|
129
|
+
|
130
|
+
end
|
data/test/wrap_test.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class WrapTest < MiniTest::Spec
|
4
|
+
class HardcoreBand
|
5
|
+
include Representable::Hash
|
6
|
+
end
|
7
|
+
|
8
|
+
class SoftcoreBand < HardcoreBand
|
9
|
+
end
|
10
|
+
|
11
|
+
let (:band) { HardcoreBand.new }
|
12
|
+
|
13
|
+
it "returns false per default" do
|
14
|
+
assert_equal nil, SoftcoreBand.new.send(:representation_wrap)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "infers a printable class name if set to true" do
|
18
|
+
HardcoreBand.representation_wrap = true
|
19
|
+
assert_equal "hardcore_band", band.send(:representation_wrap)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "can be set explicitely" do
|
23
|
+
HardcoreBand.representation_wrap = "breach"
|
24
|
+
assert_equal "breach", band.send(:representation_wrap)
|
25
|
+
end
|
26
|
+
|
27
|
+
for_formats(
|
28
|
+
:hash => [Representable::Hash, {"Blink182"=>{"genre"=>"Pop"}}, {"Blink182"=>{"genre"=>"Poppunk"}}],
|
29
|
+
:json => [Representable::JSON, "{\"Blink182\":{\"genre\":\"Pop\"}}", "{\"Blink182\":{\"genre\":\"Poppunk\"}}"],
|
30
|
+
:xml => [Representable::XML, "<Blink182><genre>Pop</genre></Blink182>", "<Blink182><genre>Poppunk</genre></Blink182>"],
|
31
|
+
# :yaml => [Representable::YAML, "---\nBlink182:\n"], # TODO: fix YAML.
|
32
|
+
) do |format, mod, output, input|
|
33
|
+
|
34
|
+
describe "[#{format}] dynamic wrap" do
|
35
|
+
let (:band) { representer.prepare(Struct.new(:name, :genre).new("Blink", "Pop")) }
|
36
|
+
let (:format) { format }
|
37
|
+
|
38
|
+
representer!(:module => mod) do
|
39
|
+
self.representation_wrap = lambda { |args| "#{name}#{args[:number]}" }
|
40
|
+
property :genre
|
41
|
+
end
|
42
|
+
|
43
|
+
it { render(band, {:number => 182}).must_equal_document(output) }
|
44
|
+
|
45
|
+
it { parse(band, input, {:number => 182}).genre.must_equal "Poppunk" } # TODO: better test. also, xml parses _any_ wrap.
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/test/xml_bindings_test.rb
CHANGED
@@ -11,92 +11,92 @@ class XMLBindingTest < MiniTest::Spec
|
|
11
11
|
property :name
|
12
12
|
self.representation_wrap = :song
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
class SongWithRepresenter < ::Song
|
16
16
|
include Representable
|
17
17
|
include SongRepresenter
|
18
18
|
self.representation_wrap = :song
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
before do
|
22
22
|
@doc = Nokogiri::XML::Document.new
|
23
23
|
@song = SongWithRepresenter.new("Thinning the Herd")
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
describe "PropertyBinding" do
|
27
27
|
describe "with plain text" do
|
28
28
|
before do
|
29
|
-
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song), nil)
|
29
|
+
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song), nil, nil)
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
it "extracts with #read" do
|
33
33
|
assert_equal "Thinning the Herd", @property.read(Nokogiri::XML("<song>Thinning the Herd</song>"))
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
it "inserts with #write" do
|
37
37
|
@property.write(@doc, "Thinning the Herd")
|
38
38
|
assert_xml_equal "<song>Thinning the Herd</song>", @doc.to_s
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
describe "with an object" do
|
43
43
|
before do
|
44
|
-
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song, :class => SongWithRepresenter), nil)
|
44
|
+
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song, :class => SongWithRepresenter), nil, nil)
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
it "extracts with #read" do
|
48
48
|
assert_equal @song, @property.read(Nokogiri::XML("<song><name>Thinning the Herd</name></song>"))
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
it "inserts with #write" do
|
52
52
|
@property.write(@doc, @song)
|
53
53
|
assert_xml_equal("<song><name>Thinning the Herd</name></song>", @doc.to_s)
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
describe "with an object and :extend" do
|
58
58
|
before do
|
59
|
-
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song, :class => Song, :extend => SongRepresenter), nil)
|
59
|
+
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song, :class => Song, :extend => SongRepresenter), nil, nil)
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
it "extracts with #read" do
|
63
63
|
assert_equal @song, @property.read(Nokogiri::XML("<song><name>Thinning the Herd</name></song>"))
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
it "inserts with #write" do
|
67
67
|
@property.write(@doc, @song)
|
68
68
|
assert_xml_equal("<song><name>Thinning the Herd</name></song>", @doc.to_s)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
72
|
-
|
73
|
-
|
72
|
+
|
73
|
+
|
74
74
|
describe "CollectionBinding" do
|
75
75
|
describe "with plain text items" do
|
76
76
|
before do
|
77
|
-
@property = Representable::XML::CollectionBinding.new(Representable::Definition.new(:song, :collection => true), nil)
|
77
|
+
@property = Representable::XML::CollectionBinding.new(Representable::Definition.new(:song, :collection => true), Struct.new(:song).new, nil)
|
78
78
|
end
|
79
|
-
|
79
|
+
|
80
80
|
it "extracts with #read" do
|
81
81
|
assert_equal ["The Gargoyle", "Bronx"], @property.read(Nokogiri::XML("<doc><song>The Gargoyle</song><song>Bronx</song></doc>").root)
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
it "inserts with #write" do
|
85
85
|
parent = Nokogiri::XML::Node.new("parent", @doc)
|
86
86
|
@property.write(parent, ["The Gargoyle", "Bronx"])
|
87
87
|
assert_xml_equal("<songs><song>The Gargoyle</song><song>Bronx</song></songs>", parent.to_s)
|
88
88
|
end
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
describe "with objects" do
|
92
92
|
before do
|
93
|
-
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song, :collection => true, :class => SongWithRepresenter), nil)
|
93
|
+
@property = Representable::XML::PropertyBinding.new(Representable::Definition.new(:song, :collection => true, :class => SongWithRepresenter), nil, nil)
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
it "extracts with #read" do
|
97
97
|
assert_equal @song, @property.read(Nokogiri::XML("<song><name>Thinning the Herd</name></song>"))
|
98
98
|
end
|
99
|
-
|
99
|
+
|
100
100
|
it "inserts with #write" do
|
101
101
|
@property.write(@doc, @song)
|
102
102
|
assert_xml_equal("<song><name>Thinning the Herd</name></song>", @doc.to_s)
|
@@ -106,43 +106,43 @@ class XMLBindingTest < MiniTest::Spec
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
109
|
-
|
110
|
-
|
109
|
+
|
110
|
+
|
111
111
|
describe "HashBinding" do
|
112
112
|
describe "with plain text items" do
|
113
113
|
before do
|
114
|
-
@property = Representable::XML::HashBinding.new(Representable::Definition.new(:songs, :hash => true), nil)
|
114
|
+
@property = Representable::XML::HashBinding.new(Representable::Definition.new(:songs, :hash => true), nil, nil)
|
115
115
|
end
|
116
|
-
|
116
|
+
|
117
117
|
it "extracts with #read" do
|
118
118
|
assert_equal({"first" => "The Gargoyle", "second" => "Bronx"} , @property.read(Nokogiri::XML("<songs><first>The Gargoyle</first><second>Bronx</second></songs>")))
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
it "inserts with #write" do
|
122
122
|
parent = Nokogiri::XML::Node.new("parent", @doc)
|
123
123
|
@property.write(parent, {"first" => "The Gargoyle", "second" => "Bronx"})
|
124
124
|
assert_xml_equal("<songs><first>The Gargoyle</first><second>Bronx</second></songs>", parent.to_s)
|
125
125
|
end
|
126
126
|
end
|
127
|
-
|
127
|
+
|
128
128
|
describe "with objects" do
|
129
129
|
before do
|
130
130
|
@property = Representable::XML::HashBinding.new(Representable::Definition.new(:songs, :hash => true, :class => Song, :extend => SongRepresenter), nil)
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|
134
|
-
|
135
|
-
|
134
|
+
|
135
|
+
|
136
136
|
describe "AttributeBinding" do
|
137
137
|
describe "with plain text items" do
|
138
138
|
before do
|
139
|
-
@property = Representable::XML::AttributeBinding.new(Representable::Definition.new(:name, :attribute => true), nil)
|
139
|
+
@property = Representable::XML::AttributeBinding.new(Representable::Definition.new(:name, :attribute => true), nil, nil)
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
it "extracts with #read" do
|
143
143
|
assert_equal "The Gargoyle", @property.read(Nokogiri::XML("<song name=\"The Gargoyle\" />").root)
|
144
144
|
end
|
145
|
-
|
145
|
+
|
146
146
|
it "inserts with #write" do
|
147
147
|
parent = Nokogiri::XML::Node.new("song", @doc)
|
148
148
|
@property.write(parent, "The Gargoyle")
|
@@ -153,13 +153,13 @@ class XMLBindingTest < MiniTest::Spec
|
|
153
153
|
|
154
154
|
describe "ContentBinding" do
|
155
155
|
before do
|
156
|
-
@property = Representable::XML::ContentBinding.new(Representable::Definition.new(:name, :content => true), nil)
|
156
|
+
@property = Representable::XML::ContentBinding.new(Representable::Definition.new(:name, :content => true), nil, nil)
|
157
157
|
end
|
158
|
-
|
158
|
+
|
159
159
|
it "extracts with #read" do
|
160
160
|
assert_equal "The Gargoyle", @property.read(Nokogiri::XML("<song>The Gargoyle</song>").root)
|
161
161
|
end
|
162
|
-
|
162
|
+
|
163
163
|
it "inserts with #write" do
|
164
164
|
parent = Nokogiri::XML::Node.new("song", @doc)
|
165
165
|
@property.write(parent, "The Gargoyle")
|
data/test/xml_test.rb
CHANGED
@@ -138,20 +138,20 @@ class XmlTest < MiniTest::Spec
|
|
138
138
|
|
139
139
|
describe "XML::Binding#build_for" do
|
140
140
|
it "returns AttributeBinding" do
|
141
|
-
assert_kind_of XML::AttributeBinding, XML::PropertyBinding.build_for(Def.new(:band, :
|
141
|
+
assert_kind_of XML::AttributeBinding, XML::PropertyBinding.build_for(Def.new(:band, :as => "band", :attribute => true), nil, nil)
|
142
142
|
end
|
143
143
|
|
144
144
|
it "returns PropertyBinding" do
|
145
|
-
assert_kind_of XML::PropertyBinding, XML::PropertyBinding.build_for(Def.new(:band, :class => Hash), nil)
|
146
|
-
assert_kind_of XML::PropertyBinding, XML::PropertyBinding.build_for(Def.new(:band, :
|
145
|
+
assert_kind_of XML::PropertyBinding, XML::PropertyBinding.build_for(Def.new(:band, :class => Hash), nil, nil)
|
146
|
+
assert_kind_of XML::PropertyBinding, XML::PropertyBinding.build_for(Def.new(:band, :as => :content), nil, nil)
|
147
147
|
end
|
148
148
|
|
149
149
|
it "returns CollectionBinding" do
|
150
|
-
assert_kind_of XML::CollectionBinding, XML::PropertyBinding.build_for(Def.new(:band, :collection => :true), nil)
|
150
|
+
assert_kind_of XML::CollectionBinding, XML::PropertyBinding.build_for(Def.new(:band, :collection => :true), nil, nil)
|
151
151
|
end
|
152
152
|
|
153
153
|
it "returns HashBinding" do
|
154
|
-
assert_kind_of XML::HashBinding, XML::PropertyBinding.build_for(Def.new(:band, :hash => :true), nil)
|
154
|
+
assert_kind_of XML::HashBinding, XML::PropertyBinding.build_for(Def.new(:band, :hash => :true), nil, nil)
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
@@ -166,7 +166,7 @@ class XmlTest < MiniTest::Spec
|
|
166
166
|
module AlbumRepresenter
|
167
167
|
include Representable::XML
|
168
168
|
property :best_song, :class => Song, :extend => SongRepresenter
|
169
|
-
collection :songs, :class => Song, :
|
169
|
+
collection :songs, :class => Song, :as => :song, :extend => SongRepresenter
|
170
170
|
representation_wrap = :album
|
171
171
|
end
|
172
172
|
|
@@ -213,11 +213,11 @@ end
|
|
213
213
|
|
214
214
|
|
215
215
|
class AttributesTest < MiniTest::Spec
|
216
|
-
describe ":
|
216
|
+
describe ":as => rel, :attribute => true" do
|
217
217
|
class Link
|
218
218
|
include Representable::XML
|
219
|
-
property :href, :
|
220
|
-
property :title, :
|
219
|
+
property :href, :as => "href", :attribute => true
|
220
|
+
property :title, :as => "title", :attribute => true
|
221
221
|
attr_accessor :href, :title
|
222
222
|
end
|
223
223
|
|
@@ -293,10 +293,10 @@ end
|
|
293
293
|
|
294
294
|
|
295
295
|
class CollectionTest < MiniTest::Spec
|
296
|
-
describe ":class => Band, :
|
296
|
+
describe ":class => Band, :as => :band, :collection => true" do
|
297
297
|
class Compilation
|
298
298
|
include Representable::XML
|
299
|
-
collection :bands, :class => Band, :
|
299
|
+
collection :bands, :class => Band, :as => :band
|
300
300
|
attr_accessor :bands
|
301
301
|
end
|
302
302
|
|
@@ -324,11 +324,11 @@ class CollectionTest < MiniTest::Spec
|
|
324
324
|
end
|
325
325
|
|
326
326
|
|
327
|
-
describe ":
|
327
|
+
describe ":as" do
|
328
328
|
let(:xml) {
|
329
329
|
Module.new do
|
330
330
|
include Representable::XML
|
331
|
-
collection :songs, :
|
331
|
+
collection :songs, :as => :song
|
332
332
|
end }
|
333
333
|
|
334
334
|
it "collects untyped items" do
|
@@ -349,7 +349,7 @@ class CollectionTest < MiniTest::Spec
|
|
349
349
|
let (:xml) {
|
350
350
|
Module.new do
|
351
351
|
include Representable::XML
|
352
|
-
collection :songs, :
|
352
|
+
collection :songs, :as => :song, :wrap => :songs
|
353
353
|
end }
|
354
354
|
|
355
355
|
describe "#from_xml" do
|
metadata
CHANGED
@@ -1,153 +1,167 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: representable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: uber
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: test_xml
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: 0.1.6
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: 0.1.6
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: minitest
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- - ~>
|
87
|
+
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: 5.0.0
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- - ~>
|
94
|
+
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: 5.0.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: mocha
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: 0.13.0
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: 0.13.0
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: mongoid
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: virtus
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- - ~>
|
129
|
+
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
131
|
version: 0.5.0
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- - ~>
|
136
|
+
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: 0.5.0
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: yajl-ruby
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
|
-
- -
|
143
|
+
- - ">="
|
130
144
|
- !ruby/object:Gem::Version
|
131
145
|
version: '0'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- -
|
150
|
+
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: json
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
|
-
- - ~>
|
157
|
+
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
159
|
version: 1.7.7
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
|
-
- - ~>
|
164
|
+
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: 1.7.7
|
153
167
|
description: Renders and parses JSON/XML/YAML documents from and to Ruby objects.
|
@@ -158,8 +172,8 @@ executables: []
|
|
158
172
|
extensions: []
|
159
173
|
extra_rdoc_files: []
|
160
174
|
files:
|
161
|
-
- .gitignore
|
162
|
-
- .travis.yml
|
175
|
+
- ".gitignore"
|
176
|
+
- ".travis.yml"
|
163
177
|
- CHANGES.md
|
164
178
|
- Gemfile
|
165
179
|
- LICENSE
|
@@ -177,16 +191,17 @@ files:
|
|
177
191
|
- lib/representable/decorator.rb
|
178
192
|
- lib/representable/decorator/coercion.rb
|
179
193
|
- lib/representable/definition.rb
|
180
|
-
- lib/representable/deprecations.rb
|
181
194
|
- lib/representable/deserializer.rb
|
182
|
-
- lib/representable/feature/readable_writeable.rb
|
183
195
|
- lib/representable/hash.rb
|
196
|
+
- lib/representable/hash/allow_symbols.rb
|
184
197
|
- lib/representable/hash/collection.rb
|
185
198
|
- lib/representable/hash_methods.rb
|
186
199
|
- lib/representable/json.rb
|
187
200
|
- lib/representable/json/collection.rb
|
188
201
|
- lib/representable/json/hash.rb
|
189
202
|
- lib/representable/mapper.rb
|
203
|
+
- lib/representable/parse_strategies.rb
|
204
|
+
- lib/representable/readable_writeable.rb
|
190
205
|
- lib/representable/serializer.rb
|
191
206
|
- lib/representable/version.rb
|
192
207
|
- lib/representable/xml.rb
|
@@ -194,23 +209,37 @@ files:
|
|
194
209
|
- lib/representable/xml/hash.rb
|
195
210
|
- lib/representable/yaml.rb
|
196
211
|
- representable.gemspec
|
212
|
+
- test/as_test.rb
|
213
|
+
- test/class_test.rb
|
197
214
|
- test/coercion_test.rb
|
198
215
|
- test/config_test.rb
|
216
|
+
- test/decorator_scope_test.rb
|
199
217
|
- test/decorator_test.rb
|
200
218
|
- test/definition_test.rb
|
201
219
|
- test/example.rb
|
220
|
+
- test/exec_context_test.rb
|
202
221
|
- test/generic_test.rb
|
222
|
+
- test/getter_setter_test.rb
|
203
223
|
- test/hash_bindings_test.rb
|
204
224
|
- test/hash_test.rb
|
225
|
+
- test/if_test.rb
|
205
226
|
- test/inherit_test.rb
|
206
227
|
- test/inheritance_test.rb
|
207
228
|
- test/inline_test.rb
|
229
|
+
- test/instance_test.rb
|
230
|
+
- test/is_representable_test.rb
|
208
231
|
- test/json_test.rb
|
209
232
|
- test/mongoid_test.rb
|
210
233
|
- test/nested_test.rb
|
234
|
+
- test/parse_strategy_test.rb
|
235
|
+
- test/pass_options_test.rb
|
236
|
+
- test/prepare_test.rb
|
237
|
+
- test/reader_writer_test.rb
|
211
238
|
- test/representable_test.rb
|
239
|
+
- test/stringify_hash_test.rb
|
212
240
|
- test/test_helper.rb
|
213
241
|
- test/test_helper_test.rb
|
242
|
+
- test/wrap_test.rb
|
214
243
|
- test/xml_bindings_test.rb
|
215
244
|
- test/xml_test.rb
|
216
245
|
- test/yaml_test.rb
|
@@ -223,19 +252,54 @@ require_paths:
|
|
223
252
|
- lib
|
224
253
|
required_ruby_version: !ruby/object:Gem::Requirement
|
225
254
|
requirements:
|
226
|
-
- -
|
255
|
+
- - ">="
|
227
256
|
- !ruby/object:Gem::Version
|
228
257
|
version: '0'
|
229
258
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
259
|
requirements:
|
231
|
-
- -
|
260
|
+
- - ">="
|
232
261
|
- !ruby/object:Gem::Version
|
233
262
|
version: '0'
|
234
263
|
requirements: []
|
235
264
|
rubyforge_project:
|
236
|
-
rubygems_version: 2.
|
265
|
+
rubygems_version: 2.2.1
|
237
266
|
signing_key:
|
238
267
|
specification_version: 4
|
239
268
|
summary: Renders and parses JSON/XML/YAML documents from and to Ruby objects. Includes
|
240
269
|
plain properties, collections, nesting, coercion and more.
|
241
|
-
test_files:
|
270
|
+
test_files:
|
271
|
+
- test/as_test.rb
|
272
|
+
- test/class_test.rb
|
273
|
+
- test/coercion_test.rb
|
274
|
+
- test/config_test.rb
|
275
|
+
- test/decorator_scope_test.rb
|
276
|
+
- test/decorator_test.rb
|
277
|
+
- test/definition_test.rb
|
278
|
+
- test/example.rb
|
279
|
+
- test/exec_context_test.rb
|
280
|
+
- test/generic_test.rb
|
281
|
+
- test/getter_setter_test.rb
|
282
|
+
- test/hash_bindings_test.rb
|
283
|
+
- test/hash_test.rb
|
284
|
+
- test/if_test.rb
|
285
|
+
- test/inherit_test.rb
|
286
|
+
- test/inheritance_test.rb
|
287
|
+
- test/inline_test.rb
|
288
|
+
- test/instance_test.rb
|
289
|
+
- test/is_representable_test.rb
|
290
|
+
- test/json_test.rb
|
291
|
+
- test/mongoid_test.rb
|
292
|
+
- test/nested_test.rb
|
293
|
+
- test/parse_strategy_test.rb
|
294
|
+
- test/pass_options_test.rb
|
295
|
+
- test/prepare_test.rb
|
296
|
+
- test/reader_writer_test.rb
|
297
|
+
- test/representable_test.rb
|
298
|
+
- test/stringify_hash_test.rb
|
299
|
+
- test/test_helper.rb
|
300
|
+
- test/test_helper_test.rb
|
301
|
+
- test/wrap_test.rb
|
302
|
+
- test/xml_bindings_test.rb
|
303
|
+
- test/xml_test.rb
|
304
|
+
- test/yaml_test.rb
|
305
|
+
has_rdoc:
|