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 CHANGED
@@ -1,4 +1,4 @@
1
1
  pkg/*
2
2
  *.gem
3
3
  .bundle
4
- Gemfile.lock
4
+ Gemfile*.lock
data/.travis.yml CHANGED
@@ -1,13 +1,8 @@
1
- rvm: 1.9.3
1
+ rvm:
2
+ - 1.9.3
3
+ - 1.8.7
2
4
  notifications:
3
5
  irc: "irc.freenode.org#cells"
4
- matrix:
5
- include:
6
- - rvm: 1.9.3
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
@@ -1,3 +1,7 @@
1
+ # 0.11.15
2
+
3
+ * Fixing [#66](https://github.com/apotonick/roar/issues/66).
4
+
1
5
  # 0.11.14
2
6
 
3
7
  * Fixing Gemfile.
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', '>= 1.3.1'
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', '>= 1.4.0'
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
@@ -1 +1,3 @@
1
- Roar::Decorator = Representable::Decorator
1
+ class Roar::Decorator < Representable::Decorator
2
+ extend Roar::Representer::InheritableArray
3
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Roar
2
- VERSION = "0.11.14"
2
+ VERSION = "0.11.15"
3
3
  end
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
@@ -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 Module.new do
226
- include Roar::Representer::JSON
227
- include Roar::Representer::Feature::Hypermedia
228
-
229
- property :bla
230
-
231
- link( :self) {"bo"}
232
- end
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
- end).to_json
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.14
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-10 00:00:00.000000000 Z
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: '0'
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: '0'
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.24
149
+ rubygems_version: 1.8.25
150
150
  signing_key:
151
151
  specification_version: 3
152
152
  summary: Resource-oriented architectures in Ruby.