windsor 0.0.4 → 0.0.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.
data/README.rdoc CHANGED
@@ -1,3 +1,3 @@
1
1
  = Windsor
2
2
 
3
- This project rocks and uses MIT-LICENSE.
3
+ This project rocks and uses Apache2 license.
@@ -165,16 +165,16 @@ class WindsorController < ApplicationController
165
165
  pagination = {
166
166
  :total_items => total_items,
167
167
  :max_page_size => @max_page_size,
168
- :links => [
169
- { :rel => 'first', :href => page_link(1) },
170
- { :rel => 'last', :href => page_link(total_pages.to_s)}
171
- ]
168
+ :links => {
169
+ :first => { :href => page_link(1) },
170
+ :last => { :href => page_link(total_pages.to_s)}
171
+ }
172
172
  }
173
173
  unless current_page_index == last_page_index
174
- pagination[:links] << { :rel => 'next', :href => page_link((current_page_index + 2)) }
174
+ pagination[:links][:next] = { :href => page_link((current_page_index + 2)) }
175
175
  end
176
176
  if current_page_index >= 1
177
- pagination[:links] << { :rel => 'previous', :href => page_link(current_page_index) }
177
+ pagination[:links][:previous] = { :href => page_link(current_page_index) }
178
178
  end
179
179
  return pagination
180
180
  end
@@ -219,10 +219,10 @@ class WindsorController < ApplicationController
219
219
  end
220
220
 
221
221
  def add_link(object, href, rel)
222
- unless object['links'].is_a?(Array)
223
- object['links'] = []
222
+ unless object['links'].is_a?(Hash)
223
+ object['links'] = {}
224
224
  end
225
- object['links'] << { 'rel' => rel, 'href' => href }
225
+ object['links'][rel] = { 'href' => href }
226
226
  end
227
227
 
228
228
  def prepare_representation(object)
@@ -1,3 +1,3 @@
1
1
  module Windsor
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: windsor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-31 00:00:00.000000000 Z
13
+ date: 2012-09-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &2168491180 !ruby/object:Gem::Requirement
17
+ requirement: &2153480480 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.1.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2168491180
25
+ version_requirements: *2153480480
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: sqlite3
28
- requirement: &2168490760 !ruby/object:Gem::Requirement
28
+ requirement: &2153480060 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2168490760
36
+ version_requirements: *2153480060
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &2168490300 !ruby/object:Gem::Requirement
39
+ requirement: &2153479600 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2168490300
47
+ version_requirements: *2153479600
48
48
  description: Windsor is a plugin for building RESTful APIs in Rails.
49
49
  email:
50
50
  - sam@samdecesare.com