roar 0.12.4 → 0.12.5
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.markdown +1 -0
- data/Gemfile +1 -1
- data/lib/roar/representer/feature/hypermedia.rb +1 -1
- data/lib/roar/representer/json.rb +1 -1
- data/lib/roar/representer/json/hal.rb +1 -1
- data/lib/roar/representer/xml.rb +1 -1
- data/lib/roar/version.rb +1 -1
- data/test/collection_json_test.rb +4 -2
- data/test/xml_representer_test.rb +1 -1
- 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: 07ecc948debf57f733cbd0afa35239bee7c3690d
|
|
4
|
+
data.tar.gz: 4595104d851b4a1acee53c2968e610c035fd25d1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e84a209d661459eaf5f4c666367112c45cb821ce5469e32536ff9a30714e45f8deb06b7b164f4684d27bbcc82906c98f12bccf935f4a72f8018e23c40b251dc1
|
|
7
|
+
data.tar.gz: eac108c9d10735a92ff60d38e21affa0465ef850ed1245084285f33fe7648000e8e68718672abd3da8838781892aef0e66eee9d119118524f23597bb0af4ed39
|
data/CHANGES.markdown
CHANGED
data/Gemfile
CHANGED
|
@@ -3,5 +3,5 @@ source "http://rubygems.org"
|
|
|
3
3
|
# Specify your gem's dependencies in roar.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
gem "representable", :path => "../representable"
|
|
7
7
|
gem "sinatra-contrib", :git => "git@github.com:apotonick/sinatra-contrib.git", :branch => "runner"
|
|
@@ -72,7 +72,7 @@ module Roar
|
|
|
72
72
|
private
|
|
73
73
|
def links_definition_options
|
|
74
74
|
# TODO: this method is never called.
|
|
75
|
-
[:links_array, {:
|
|
75
|
+
[:links_array, {:as => :link, :class => Feature::Hypermedia::Hyperlink, :collection => true,
|
|
76
76
|
:decorator_scope => true}] # TODO: merge with JSON.
|
|
77
77
|
end
|
|
78
78
|
|
|
@@ -46,7 +46,7 @@ module Roar
|
|
|
46
46
|
# TODO: move to instance method, or remove?
|
|
47
47
|
def links_definition_options
|
|
48
48
|
# FIXME: this doesn't belong into the generic JSON representer.
|
|
49
|
-
[:links_array, {:
|
|
49
|
+
[:links_array, {:as => :links, :class => Feature::Hypermedia::Hyperlink, :extend => HyperlinkRepresenter, :collection => true,
|
|
50
50
|
:decorator_scope => true}]
|
|
51
51
|
end
|
|
52
52
|
end
|
data/lib/roar/representer/xml.rb
CHANGED
|
@@ -39,7 +39,7 @@ module Roar
|
|
|
39
39
|
|
|
40
40
|
def links_definition_options
|
|
41
41
|
# FIXME: this doesn't belong into the generic XML representer.
|
|
42
|
-
[:links_array, {:
|
|
42
|
+
[:links_array, {:as => :link, :class => Feature::Hypermedia::Hyperlink, :collection => true, :extend => XML::HyperlinkRepresenter,
|
|
43
43
|
:decorator_scope => true}] # TODO: merge with JSON.
|
|
44
44
|
end
|
|
45
45
|
|
data/lib/roar/version.rb
CHANGED
|
@@ -34,9 +34,11 @@ class CollectionJsonTest < MiniTest::Spec
|
|
|
34
34
|
|
|
35
35
|
describe "#to_json" do
|
|
36
36
|
it "renders document" do
|
|
37
|
+
collection_key = Representable::VERSION =~ /^1.8/ ? "collection" : :collection
|
|
38
|
+
|
|
37
39
|
[song].extend(rpr).to_hash.must_equal(
|
|
38
40
|
{
|
|
39
|
-
|
|
41
|
+
collection_key=>{
|
|
40
42
|
"version"=>"1.0",
|
|
41
43
|
"href"=>"//songs/",
|
|
42
44
|
|
|
@@ -48,7 +50,7 @@ class CollectionJsonTest < MiniTest::Spec
|
|
|
48
50
|
},
|
|
49
51
|
|
|
50
52
|
"queries"=>[
|
|
51
|
-
{:rel=>:search, :href=>"//search",
|
|
53
|
+
{:rel=>:search, :href=>"//search",
|
|
52
54
|
:data=>[
|
|
53
55
|
{:name=>"q", :value=>""}
|
|
54
56
|
]
|
|
@@ -153,7 +153,7 @@ class XMLRepresenterFunctionalTest < MiniTest::Spec
|
|
|
153
153
|
|
|
154
154
|
self.representation_wrap= :order
|
|
155
155
|
property :id
|
|
156
|
-
collection :items, :class => ItemRepresenter, :
|
|
156
|
+
collection :items, :class => ItemRepresenter, :as => :item
|
|
157
157
|
attr_accessor :id, :items
|
|
158
158
|
end
|
|
159
159
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: roar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.12.
|
|
4
|
+
version: 0.12.5
|
|
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-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: representable
|