Skip to content

Commit 1fb23b6

Browse files
committed
Require Roar 1.0.
1 parent 4224234 commit 1fb23b6

12 files changed

+34
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Next
22
----
33

4+
* Require Roar 1.0 - [@dblock](https://github.com/dblock).
45
* Your contribution here.
56

67
0.2.0 (12/18/2014)

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ group :development do
77
end
88

99
group :test do
10-
gem 'rspec', '~> 3.0'
10+
gem 'rspec', '~> 3.1'
1111
gem 'rack-test'
1212
end
1313

1414
group :development, :test do
1515
gem 'rubocop', '0.28.0'
16+
gem 'nokogiri', '1.6.3.1'
1617
end

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ gem 'roar'
2424
gem 'grape-roar'
2525
```
2626

27+
If you're upgrading from an older version of this gem, please see [UPGRADING](UPGRADING.md).
28+
2729
Usage
2830
-----
2931

@@ -42,8 +44,8 @@ You can use Grape's `present` keyword after including Grape::Roar::Representer i
4244

4345
```ruby
4446
module ProductRepresenter
45-
include Roar::Representer::JSON
46-
include Roar::Representer::Feature::Hypermedia
47+
include Roar::JSON
48+
include Roar::Hypermedia
4749
include Grape::Roar::Representer
4850

4951
property :title
@@ -61,8 +63,8 @@ Presenting collections works the same way. The following example returns an embe
6163

6264
```ruby
6365
module ProductsRepresenter
64-
include Roar::Representer::JSON::HAL
65-
include Roar::Representer::Feature::Hypermedia
66+
include Roar::JSON::HAL
67+
include Roar::Hypermedia
6668
include Grape::Roar::Representer
6769

6870
collection :entries, extend: ProductPresenter, as: :products, embedded: true
@@ -81,8 +83,8 @@ The formatter invokes `to_json` on presented objects and provides access to the
8183

8284
```ruby
8385
module ProductRepresenter
84-
include Roar::Representer::JSON
85-
include Roar::Representer::Feature::Hypermedia
86+
include Roar::JSON
87+
include Roar::Hypermedia
8688
include Grape::Roar::Representer
8789

8890
link :self do |opts|
@@ -98,8 +100,8 @@ If you prefer to use a decorator class instead of modules.
98100

99101
```ruby
100102
class ProductRepresenter < Grape::Roar::Decorator
101-
include Roar::Representer::JSON
102-
include Roar::Representer::Feature::Hypermedia
103+
include Roar::JSON
104+
include Roar::Hypermedia
103105

104106
link :self do |opts|
105107
"#{request(opts).url}/#{represented.id}"

UPGRADING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Upgrading Grape-Roar
2+
====================
3+
4+
### Upgrading to >= 0.3.0
5+
6+
This version requires Roar 1.0 or newer. Make presenter changes according to the [roar changelog](https://github.com/apotonick/roar/blob/master/CHANGES.markdown), specifically replace `Roar::Representer::Feature::Hypermedia` with `Roar::Hypermedia` and `Roar::Representer::JSON` with `Roar::JSON`.
7+

grape-roar.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Gem::Specification.new do |gem|
1616
gem.version = Grape::Roar::VERSION
1717

1818
gem.add_dependency 'grape'
19-
gem.add_dependency 'roar'
19+
gem.add_dependency 'roar', '>= 1.0'
2020
end

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
require 'grape'
88

99
require 'roar'
10-
require 'roar/representer/json'
11-
require 'roar/representer/feature/hypermedia'
10+
require 'roar/json'
11+
require 'roar/hypermedia'
1212

1313
require 'grape/roar'
1414
require 'rack/test'

spec/support/article.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'support/article_representer'
22

33
class Article
4-
include Roar::Representer::JSON
4+
include Roar::JSON
55
include ArticleRepresenter
66

77
attr_accessor :title, :id

spec/support/article_representer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module ArticleRepresenter
2-
include Roar::Representer::JSON
3-
include Roar::Representer::Feature::Hypermedia
2+
include Roar::JSON
3+
include Roar::Hypermedia
44

55
property :title
66
property :id

spec/support/order.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'support/order_representer'
22

33
class Order
4-
include Roar::Representer::JSON
4+
include Roar::JSON
55
include OrderRepresenter
66

77
attr_accessor :id, :client_id, :articles

spec/support/order_representer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
require 'support/article'
22

33
module OrderRepresenter
4-
include Roar::Representer::JSON
5-
include Roar::Representer::Feature::Hypermedia
4+
include Roar::JSON
5+
include Roar::Hypermedia
66

77
property :id
88
property :client_id

0 commit comments

Comments
 (0)