rocket_pants 1.9.2 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1258392398768b3bcc4753af9b0019fc6782c25f
4
- data.tar.gz: 0bf635b614213ec2e6b5340d44fbec8988560575
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDhmNzVjODAxNTU5ZjA2ZmFkMTRjOGViNTRhOWZjMmE0ZDJhMWI4Nw==
5
+ data.tar.gz: !binary |-
6
+ OTQxYTc0YmQyZDlmZmY5MDBjYzBiN2JmMTI3YzA3MWUwMjlhY2FhZg==
5
7
  SHA512:
6
- metadata.gz: 0d7c53a3a3e384aa722f79f96a9123a917eb8dbc589a213cc467839c1d2d701250feb6dbeadbabdb6f96b7dbb3be310f2e6c3865fde645165d2278a914aaa93f
7
- data.tar.gz: 266b894e1cb524ac3358634412d71a1ed7fdcf6c2a7bd2dad6c444fb33b8e282e3296f49fb9a72f4c2aeee6238bb4706cf845e8f2c0dc49b1e9cb3d38743cdb6
8
+ metadata.gz: !binary |-
9
+ NDUxN2RkODUyMTNkYjlkNzViMGU5Y2RjZmFhYzU2MzQ0ZWViMmVmMWZjOThk
10
+ MTZmNzhkN2FmZmJmNDJkNDFlNTY2MTdiNTUwZTU2M2UyMzhjNmU2NzkwOTVl
11
+ NTI0NTYyNjZkNjg5M2NhYTRiZmRjYjljOGI0OTI5NmI4NzE4YTc=
12
+ data.tar.gz: !binary |-
13
+ YWFlZWRkZTJhM2Q1ZmEwNDZhYzUwMTgwNDI1ODBjZmMyNTRkYzk2NDE3ZjJm
14
+ MmUzOTcyZmNmNTIyM2E4MzAwYjFlM2I0Y2Q0ZWZjMjZkNGFmYzM1YjRlYWUx
15
+ MzRmMTAwMDkxZDQyMTcwZDU2Yzc3ZTVlNDAxZDMxNzExNGQxYTE=
@@ -25,6 +25,10 @@ module RocketPants
25
25
  end
26
26
  end
27
27
 
28
+ def self.invalid?(object)
29
+ object.respond_to?(:invalid?) && object.invalid?
30
+ end
31
+
28
32
  def self.paginated?(object)
29
33
  !pagination_type(object).nil?
30
34
  end
@@ -49,7 +53,7 @@ module RocketPants
49
53
  {
50
54
  :current => current,
51
55
  :previous => (current > 1 ? (current - 1) : nil),
52
- :next => (current == total ? nil : (current + 1)),
56
+ :next => (current >= total ? nil : (current + 1)),
53
57
  :per_page => per_page,
54
58
  :pages => total,
55
59
  :count => collection.total_count
@@ -152,7 +156,11 @@ module RocketPants
152
156
  elsif Respondable.collection?(object)
153
157
  collection object, options
154
158
  else
155
- resource object, options
159
+ if Respondable.invalid?(object)
160
+ error! :invalid_resource, object.errors
161
+ else
162
+ resource object, options
163
+ end
156
164
  end
157
165
  end
158
166
  alias expose exposes
metadata CHANGED
@@ -1,233 +1,233 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocket_pants
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darcy Laycock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-06 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
- - - "<"
20
+ - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.0'
30
- - - "<"
30
+ - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: railties
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
37
+ - - ! '>='
38
38
  - !ruby/object:Gem::Version
39
39
  version: '3.0'
40
- - - "<"
40
+ - - <
41
41
  - !ruby/object:Gem::Version
42
42
  version: '5.0'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
47
+ - - ! '>='
48
48
  - !ruby/object:Gem::Version
49
49
  version: '3.0'
50
- - - "<"
50
+ - - <
51
51
  - !ruby/object:Gem::Version
52
52
  version: '5.0'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: will_paginate
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ~>
58
58
  - !ruby/object:Gem::Version
59
59
  version: '3.0'
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - "~>"
64
+ - - ~>
65
65
  - !ruby/object:Gem::Version
66
66
  version: '3.0'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: hashie
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ">="
71
+ - - ! '>='
72
72
  - !ruby/object:Gem::Version
73
73
  version: '1.0'
74
- - - "<"
74
+ - - <
75
75
  - !ruby/object:Gem::Version
76
76
  version: '3'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - ! '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '1.0'
84
- - - "<"
84
+ - - <
85
85
  - !ruby/object:Gem::Version
86
86
  version: '3'
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: api_smith
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - ">="
91
+ - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  type: :runtime
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - ">="
98
+ - - ! '>='
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: moneta
103
103
  requirement: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">="
105
+ - - ! '>='
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  type: :runtime
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - ">="
112
+ - - ! '>='
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: rspec
117
117
  requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - "~>"
119
+ - - ~>
120
120
  - !ruby/object:Gem::Version
121
121
  version: '2.4'
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - "~>"
126
+ - - ~>
127
127
  - !ruby/object:Gem::Version
128
128
  version: '2.4'
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: rspec-rails
131
131
  requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - "~>"
133
+ - - ~>
134
134
  - !ruby/object:Gem::Version
135
135
  version: '2.4'
136
136
  type: :development
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - "~>"
140
+ - - ~>
141
141
  - !ruby/object:Gem::Version
142
142
  version: '2.4'
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: rr
145
145
  requirement: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - "~>"
147
+ - - ~>
148
148
  - !ruby/object:Gem::Version
149
149
  version: '1.0'
150
150
  type: :development
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
- - - "~>"
154
+ - - ~>
155
155
  - !ruby/object:Gem::Version
156
156
  version: '1.0'
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: webmock
159
159
  requirement: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ">="
161
+ - - ! '>='
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  type: :development
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
167
167
  requirements:
168
- - - ">="
168
+ - - ! '>='
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: activerecord
173
173
  requirement: !ruby/object:Gem::Requirement
174
174
  requirements:
175
- - - ">="
175
+ - - ! '>='
176
176
  - !ruby/object:Gem::Version
177
177
  version: '3.0'
178
- - - "<"
178
+ - - <
179
179
  - !ruby/object:Gem::Version
180
180
  version: '5.0'
181
181
  type: :development
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - ! '>='
186
186
  - !ruby/object:Gem::Version
187
187
  version: '3.0'
188
- - - "<"
188
+ - - <
189
189
  - !ruby/object:Gem::Version
190
190
  version: '5.0'
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: sqlite3
193
193
  requirement: !ruby/object:Gem::Requirement
194
194
  requirements:
195
- - - ">="
195
+ - - ! '>='
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  type: :development
199
199
  prerelease: false
200
200
  version_requirements: !ruby/object:Gem::Requirement
201
201
  requirements:
202
- - - ">="
202
+ - - ! '>='
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
205
  - !ruby/object:Gem::Dependency
206
206
  name: reversible_data
207
207
  requirement: !ruby/object:Gem::Requirement
208
208
  requirements:
209
- - - "~>"
209
+ - - ~>
210
210
  - !ruby/object:Gem::Version
211
211
  version: '1.0'
212
212
  type: :development
213
213
  prerelease: false
214
214
  version_requirements: !ruby/object:Gem::Requirement
215
215
  requirements:
216
- - - "~>"
216
+ - - ~>
217
217
  - !ruby/object:Gem::Version
218
218
  version: '1.0'
219
219
  - !ruby/object:Gem::Dependency
220
220
  name: kaminari
221
221
  requirement: !ruby/object:Gem::Requirement
222
222
  requirements:
223
- - - ">="
223
+ - - ! '>='
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  type: :development
227
227
  prerelease: false
228
228
  version_requirements: !ruby/object:Gem::Requirement
229
229
  requirements:
230
- - - ">="
230
+ - - ! '>='
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
233
  description: Rocket Pants adds JSON API love to Rails and ActionController, making
@@ -273,17 +273,17 @@ require_paths:
273
273
  - lib
274
274
  required_ruby_version: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - ">="
276
+ - - ! '>='
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
279
  required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  requirements:
281
- - - ">="
281
+ - - ! '>='
282
282
  - !ruby/object:Gem::Version
283
283
  version: 1.3.6
284
284
  requirements: []
285
285
  rubyforge_project:
286
- rubygems_version: 2.2.2
286
+ rubygems_version: 2.3.0
287
287
  signing_key:
288
288
  specification_version: 4
289
289
  summary: JSON API love for Rails and ActionController