roar 0.11.12 → 0.11.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,4 +7,7 @@ matrix:
7
7
  gemfile: gemfiles/Gemfile.representable-1.3
8
8
  - rvm: 1.8.7
9
9
  gemfile: gemfiles/Gemfile.representable-1.3
10
-
10
+ - rvm: 1.9.3
11
+ gemfile: gemfiles/Gemfile.representable-1.4
12
+ - rvm: 1.8.7
13
+ gemfile: gemfiles/Gemfile.representable-1.4
@@ -1,3 +1,7 @@
1
+ # 0.11.13
2
+
3
+ * Adding `Roar::Decorator`, see [representable docs](https://github.com/apotonick/representable#decorator-vs-extend) for now.
4
+
1
5
  # 0.11.12
2
6
 
3
7
  * Moved `::inheritable_array` from `Hypermedia` to `Representer`.
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "http://rubygems.org"
3
3
  # Specify your gem's dependencies in roar.gemspec
4
4
  gemspec
5
5
 
6
- gem "representable", ">= 1.3.2"
6
+ gem "representable", :path => "../representable"#">= 1.3.2"
7
7
 
8
8
 
9
9
  group :test do
@@ -10,6 +10,8 @@ Roar comes with built-in JSON, JSON::HAL and XML support. It exposes a highly mo
10
10
 
11
11
  Roar is completely framework-agnostic and loves being used in web kits like Rails, Webmachine, Sinatra, Padrino, etc. Actually, Roar makes it fun designing real, hypermedia-driven, and resource-oriented systems that will even make Steve sleep happily at night so he finally gets some REST!
12
12
 
13
+ Note: This README sucks and will be updated this week (April 10, 2013).
14
+
13
15
  h2. Example
14
16
 
15
17
  Say your webshop consists of two completely separated apps. The REST backend, a Sinatra app, serves articles and processes orders. The frontend, being browsed by your clients, is a rich Rails application. It queries the services for articles, renders them nicely and reads or writes orders with REST calls. That being said, the frontend turns out to be a pure REST client.
@@ -0,0 +1,12 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :path => '../'
4
+
5
+ gem 'representable', '>= 1.4.0'
6
+ group :test do
7
+ gem 'faraday'
8
+ gem 'turn'
9
+ gem 'virtus'
10
+ gem "sinatra", "~> 1.3.2"
11
+ gem "sham_rack", "~> 1.3.0"
12
+ end
@@ -0,0 +1 @@
1
+ Roar::Decorator = Representable::Decorator
@@ -1,3 +1,3 @@
1
1
  module Roar
2
- VERSION = "0.11.12"
2
+ VERSION = "0.11.13"
3
3
  end
@@ -0,0 +1,21 @@
1
+ require 'test_helper'
2
+
3
+ class DecoratorTest < MiniTest::Spec
4
+
5
+
6
+ describe "Decorator" do
7
+ it "exposes ::prepare" do
8
+ if Representable::VERSION.split(".")[1] == "4"
9
+ require 'roar/decorator'
10
+
11
+ class SongRepresentation < Roar::Decorator
12
+ include Roar::Representer::JSON
13
+
14
+ property :name
15
+ end
16
+
17
+ SongRepresentation.prepare(OpenStruct.new(:name => "Not The Same")).to_hash.must_equal({"name"=>"Not The Same"})
18
+ end
19
+ end
20
+ end
21
+ 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.12
4
+ version: 0.11.13
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-02-28 00:00:00.000000000 Z
12
+ date: 2013-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: representable
@@ -92,7 +92,9 @@ files:
92
92
  - Rakefile
93
93
  - TODO.markdown
94
94
  - gemfiles/Gemfile.representable-1.3
95
+ - gemfiles/Gemfile.representable-1.4
95
96
  - lib/roar.rb
97
+ - lib/roar/decorator.rb
96
98
  - lib/roar/representer.rb
97
99
  - lib/roar/representer/feature/client.rb
98
100
  - lib/roar/representer/feature/coercion.rb
@@ -110,6 +112,7 @@ files:
110
112
  - test/client_test.rb
111
113
  - test/coercion_feature_test.rb
112
114
  - test/collection_json_test.rb
115
+ - test/decorator_test.rb
113
116
  - test/fake_server.rb
114
117
  - test/faraday_http_transport_test.rb
115
118
  - test/hal_json_test.rb