roar 0.11.14 → 0.11.15
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/.travis.yml +6 -11
- data/CHANGES.markdown +4 -0
- data/README.textile +4 -0
- data/gemfiles/Gemfile.representable-1.3 +2 -1
- data/gemfiles/Gemfile.representable-1.4 +2 -1
- data/lib/roar/decorator.rb +3 -1
- data/lib/roar/representer.rb +3 -1
- data/lib/roar/version.rb +1 -1
- data/roar.gemspec +1 -1
- data/test/hypermedia_test.rb +19 -10
- metadata +5 -5
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,13 +1,8 @@
|
|
1
|
-
rvm:
|
1
|
+
rvm:
|
2
|
+
- 1.9.3
|
3
|
+
- 1.8.7
|
2
4
|
notifications:
|
3
5
|
irc: "irc.freenode.org#cells"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
gemfile: gemfiles/Gemfile.representable-1.3
|
8
|
-
- rvm: 1.8.7
|
9
|
-
gemfile: gemfiles/Gemfile.representable-1.3
|
10
|
-
- rvm: 1.9.3
|
11
|
-
gemfile: gemfiles/Gemfile.representable-1.4
|
12
|
-
- rvm: 1.8.7
|
13
|
-
gemfile: gemfiles/Gemfile.representable-1.4
|
6
|
+
gemfile:
|
7
|
+
- gemfiles/Gemfile.representable-1.3
|
8
|
+
- gemfiles/Gemfile.representable-1.4
|
data/CHANGES.markdown
CHANGED
data/README.textile
CHANGED
@@ -300,3 +300,7 @@ h2. Support
|
|
300
300
|
|
301
301
|
Questions? Need help? Free 1st Level Support on irc.freenode.org#roar !
|
302
302
|
We also have a "mailing list":https://groups.google.com/forum/?fromgroups#!forum/roar-talk, yiha!
|
303
|
+
|
304
|
+
h2. License
|
305
|
+
|
306
|
+
Roar is released under the "MIT License":http://www.opensource.org/licenses/MIT.
|
@@ -2,11 +2,12 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec :path => '../'
|
4
4
|
|
5
|
-
gem 'representable', '
|
5
|
+
gem 'representable', '~> 1.3.1'
|
6
6
|
group :test do
|
7
7
|
gem 'faraday'
|
8
8
|
gem 'turn'
|
9
9
|
gem 'virtus'
|
10
10
|
gem "sinatra", "~> 1.3.2"
|
11
11
|
gem "sham_rack", "~> 1.3.0"
|
12
|
+
gem "json"
|
12
13
|
end
|
@@ -2,11 +2,12 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec :path => '../'
|
4
4
|
|
5
|
-
gem 'representable', '
|
5
|
+
gem 'representable', '~> 1.4.1'
|
6
6
|
group :test do
|
7
7
|
gem 'faraday'
|
8
8
|
gem 'turn'
|
9
9
|
gem 'virtus'
|
10
10
|
gem "sinatra", "~> 1.3.2"
|
11
11
|
gem "sham_rack", "~> 1.3.0"
|
12
|
+
gem 'json'
|
12
13
|
end
|
data/lib/roar/decorator.rb
CHANGED
data/lib/roar/representer.rb
CHANGED
@@ -19,7 +19,7 @@ module Roar
|
|
19
19
|
|
20
20
|
def inherit(parent)
|
21
21
|
super
|
22
|
-
|
22
|
+
|
23
23
|
parent.inheritable_arrays.keys.each do |k|
|
24
24
|
inheritable_array(k).push *parent.inheritable_array(k).clone
|
25
25
|
end
|
@@ -30,11 +30,13 @@ module Roar
|
|
30
30
|
def self.included(base)
|
31
31
|
base.class_eval do
|
32
32
|
include Representable
|
33
|
+
extend InheritableArray # this adds InheritableArray::representable_attrs to the module, e.g. when a representer includes a representer, we don't work with the instance method, yet.
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
37
|
include InheritableArray
|
37
38
|
|
39
|
+
|
38
40
|
private
|
39
41
|
def before_serialize(*)
|
40
42
|
end
|
data/lib/roar/version.rb
CHANGED
data/roar.gemspec
CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_runtime_dependency "representable", ">= 1.2.8"
|
23
23
|
|
24
24
|
s.add_development_dependency "rake"
|
25
|
-
s.add_development_dependency "test_xml"
|
25
|
+
s.add_development_dependency "test_xml", ">= 0.1.4"
|
26
26
|
s.add_development_dependency "minitest", ">= 2.8.1"
|
27
27
|
end
|
data/test/hypermedia_test.rb
CHANGED
@@ -215,23 +215,32 @@ class HyperlinkTest < MiniTest::Spec
|
|
215
215
|
end)
|
216
216
|
|
217
217
|
parent.representable_attrs.inheritable_array(:links) << "park" # modify parent array.
|
218
|
-
|
218
|
+
|
219
219
|
end.representable_attrs.inheritable_array(:links).must_equal(["bar", "stadium"])
|
220
220
|
end
|
221
221
|
|
222
222
|
it "doesn't mess up with inheritable_array" do # FIXME: remove this test when uber is out.
|
223
223
|
OpenStruct.new.extend( Module.new do
|
224
224
|
include Roar::Representer::JSON
|
225
|
-
include
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
225
|
+
include(Module.new do
|
226
|
+
include Roar::Representer::JSON
|
227
|
+
include Roar::Representer::Feature::Hypermedia
|
228
|
+
|
229
|
+
property :bla
|
230
|
+
|
231
|
+
link( :self) {"bo"}
|
232
|
+
|
233
|
+
#puts "hey ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
234
|
+
#puts representable_attrs.inheritable_array(:links).inspect
|
235
|
+
end)
|
236
|
+
|
237
|
+
|
238
|
+
#puts representable_attrs.inheritable_array(:links).inspect
|
239
|
+
|
233
240
|
property :blow
|
234
|
-
|
241
|
+
include Roar::Representer::Feature::Hypermedia
|
242
|
+
link(:bla) { "boo" }
|
243
|
+
end).to_hash.must_equal({"links"=>[{:rel=>:self, :href=>"bo"}, {:rel=>:bla, :href=>"boo"}]})
|
235
244
|
|
236
245
|
|
237
246
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.15
|
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: 2013-04-
|
12
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: representable
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 0.1.4
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.1.4
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: minitest
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project: roar
|
149
|
-
rubygems_version: 1.8.
|
149
|
+
rubygems_version: 1.8.25
|
150
150
|
signing_key:
|
151
151
|
specification_version: 3
|
152
152
|
summary: Resource-oriented architectures in Ruby.
|