rocket_pants 1.6.1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: de15f5de1d210d1116562936ec33d58eecb654ee
4
+ data.tar.gz: c831b9d27e6eda1965ef891d196e3d706571641e
5
+ SHA512:
6
+ metadata.gz: b975d08571bec5f214c8263c19809c3d83ff1f270114a98f5a3429f8f2159fa59fcf4941d29cf1860dbbc3c0d92a130a7d5fb64f4cd737ebf6660375d55e9bc3
7
+ data.tar.gz: de7bd82ed3aca6bbbf5f469acd5ef93eeb08988f0abc92c66424093a5102bb8f3bd03533d53de4a29166ca5ec5ec77dbbd0aa98b55606c29ea440db2bcc38a0d
@@ -29,6 +29,10 @@ module RocketPants
29
29
  !pagination_type(object).nil?
30
30
  end
31
31
 
32
+ def self.collection?(object)
33
+ object.is_a?(Array) || object.respond_to?(:to_ary)
34
+ end
35
+
32
36
  def self.extract_pagination(collection)
33
37
  case pagination_type(collection)
34
38
  when :will_paginate
@@ -141,7 +145,7 @@ module RocketPants
141
145
  def exposes(object, options = {})
142
146
  if Respondable.paginated?(object)
143
147
  paginated object, options
144
- elsif object.is_a?(Array)
148
+ elsif Respondable.collection?(object)
145
149
  collection object, options
146
150
  else
147
151
  resource object, options
metadata CHANGED
@@ -1,209 +1,237 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rocket_pants
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 6
8
- - 1
9
- version: 1.6.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.7.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Darcy Laycock
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2013-01-24 00:00:00 +08:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: actionpack
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 3
29
- - 0
30
- version: "3.0"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
31
23
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - - <
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
34
  name: railties
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '3.0'
40
+ - - <
41
+ - !ruby/object:Gem::Version
42
+ version: '5.0'
43
+ type: :runtime
35
44
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '3.0'
50
+ - - <
51
+ - !ruby/object:Gem::Version
52
+ version: '5.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: will_paginate
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
38
57
  - - ~>
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 3
42
- - 0
43
- version: "3.0"
58
+ - !ruby/object:Gem::Version
59
+ version: '3.0'
44
60
  type: :runtime
45
- version_requirements: *id002
46
- - !ruby/object:Gem::Dependency
47
- name: will_paginate
48
61
  prerelease: false
49
- requirement: &id003 !ruby/object:Gem::Requirement
50
- requirements:
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
51
64
  - - ~>
52
- - !ruby/object:Gem::Version
53
- segments:
54
- - 3
55
- - 0
56
- version: "3.0"
57
- type: :runtime
58
- version_requirements: *id003
59
- - !ruby/object:Gem::Dependency
65
+ - !ruby/object:Gem::Version
66
+ version: '3.0'
67
+ - !ruby/object:Gem::Dependency
60
68
  name: hashie
61
- prerelease: false
62
- requirement: &id004 !ruby/object:Gem::Requirement
63
- requirements:
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
64
71
  - - ~>
65
- - !ruby/object:Gem::Version
66
- segments:
67
- - 1
68
- - 0
69
- version: "1.0"
72
+ - !ruby/object:Gem::Version
73
+ version: '1.0'
70
74
  type: :runtime
71
- version_requirements: *id004
72
- - !ruby/object:Gem::Dependency
73
- name: api_smith
74
75
  prerelease: false
75
- requirement: &id005 !ruby/object:Gem::Requirement
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- segments:
80
- - 0
81
- version: "0"
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ~>
79
+ - !ruby/object:Gem::Version
80
+ version: '1.0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: api_smith
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
82
88
  type: :runtime
83
- version_requirements: *id005
84
- - !ruby/object:Gem::Dependency
85
- name: moneta
86
89
  prerelease: false
87
- requirement: &id006 !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- segments:
92
- - 0
93
- version: "0"
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ - !ruby/object:Gem::Dependency
96
+ name: moneta
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
94
102
  type: :runtime
95
- version_requirements: *id006
96
- - !ruby/object:Gem::Dependency
97
- name: rspec
98
103
  prerelease: false
99
- requirement: &id007 !ruby/object:Gem::Requirement
100
- requirements:
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: rspec
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
101
113
  - - ~>
102
- - !ruby/object:Gem::Version
103
- segments:
104
- - 2
105
- - 4
106
- version: "2.4"
114
+ - !ruby/object:Gem::Version
115
+ version: '2.4'
107
116
  type: :development
108
- version_requirements: *id007
109
- - !ruby/object:Gem::Dependency
110
- name: rspec-rails
111
117
  prerelease: false
112
- requirement: &id008 !ruby/object:Gem::Requirement
113
- requirements:
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ~>
121
+ - !ruby/object:Gem::Version
122
+ version: '2.4'
123
+ - !ruby/object:Gem::Dependency
124
+ name: rspec-rails
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
114
127
  - - ~>
115
- - !ruby/object:Gem::Version
116
- segments:
117
- - 2
118
- - 4
119
- version: "2.4"
128
+ - !ruby/object:Gem::Version
129
+ version: '2.4'
120
130
  type: :development
121
- version_requirements: *id008
122
- - !ruby/object:Gem::Dependency
123
- name: rr
124
131
  prerelease: false
125
- requirement: &id009 !ruby/object:Gem::Requirement
126
- requirements:
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
127
134
  - - ~>
128
- - !ruby/object:Gem::Version
129
- segments:
130
- - 1
131
- - 0
132
- version: "1.0"
135
+ - !ruby/object:Gem::Version
136
+ version: '2.4'
137
+ - !ruby/object:Gem::Dependency
138
+ name: rr
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ~>
142
+ - !ruby/object:Gem::Version
143
+ version: '1.0'
133
144
  type: :development
134
- version_requirements: *id009
135
- - !ruby/object:Gem::Dependency
136
- name: webmock
137
145
  prerelease: false
138
- requirement: &id010 !ruby/object:Gem::Requirement
139
- requirements:
140
- - - ">="
141
- - !ruby/object:Gem::Version
142
- segments:
143
- - 0
144
- version: "0"
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ~>
149
+ - !ruby/object:Gem::Version
150
+ version: '1.0'
151
+ - !ruby/object:Gem::Dependency
152
+ name: webmock
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
145
158
  type: :development
146
- version_requirements: *id010
147
- - !ruby/object:Gem::Dependency
148
- name: activerecord
149
159
  prerelease: false
150
- requirement: &id011 !ruby/object:Gem::Requirement
151
- requirements:
152
- - - ~>
153
- - !ruby/object:Gem::Version
154
- segments:
155
- - 3
156
- - 0
157
- version: "3.0"
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ - !ruby/object:Gem::Dependency
166
+ name: activerecord
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - '>='
170
+ - !ruby/object:Gem::Version
171
+ version: '3.0'
172
+ - - <
173
+ - !ruby/object:Gem::Version
174
+ version: '5.0'
158
175
  type: :development
159
- version_requirements: *id011
160
- - !ruby/object:Gem::Dependency
161
- name: sqlite3
162
176
  prerelease: false
163
- requirement: &id012 !ruby/object:Gem::Requirement
164
- requirements:
165
- - - ">="
166
- - !ruby/object:Gem::Version
167
- segments:
168
- - 0
169
- version: "0"
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '3.0'
182
+ - - <
183
+ - !ruby/object:Gem::Version
184
+ version: '5.0'
185
+ - !ruby/object:Gem::Dependency
186
+ name: sqlite3
187
+ requirement: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - '>='
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
170
192
  type: :development
171
- version_requirements: *id012
172
- - !ruby/object:Gem::Dependency
173
- name: reversible_data
174
193
  prerelease: false
175
- requirement: &id013 !ruby/object:Gem::Requirement
176
- requirements:
194
+ version_requirements: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - '>='
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ - !ruby/object:Gem::Dependency
200
+ name: reversible_data
201
+ requirement: !ruby/object:Gem::Requirement
202
+ requirements:
177
203
  - - ~>
178
- - !ruby/object:Gem::Version
179
- segments:
180
- - 1
181
- - 0
182
- version: "1.0"
204
+ - !ruby/object:Gem::Version
205
+ version: '1.0'
183
206
  type: :development
184
- version_requirements: *id013
185
- - !ruby/object:Gem::Dependency
186
- name: kaminari
187
207
  prerelease: false
188
- requirement: &id014 !ruby/object:Gem::Requirement
189
- requirements:
190
- - - ">="
191
- - !ruby/object:Gem::Version
192
- segments:
193
- - 0
194
- version: "0"
208
+ version_requirements: !ruby/object:Gem::Requirement
209
+ requirements:
210
+ - - ~>
211
+ - !ruby/object:Gem::Version
212
+ version: '1.0'
213
+ - !ruby/object:Gem::Dependency
214
+ name: kaminari
215
+ requirement: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - '>='
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
195
220
  type: :development
196
- version_requirements: *id014
197
- description: Rocket Pants adds JSON API love to Rails and ActionController, making it simpler to build API-oriented controllers.
198
- email:
221
+ prerelease: false
222
+ version_requirements: !ruby/object:Gem::Requirement
223
+ requirements:
224
+ - - '>='
225
+ - !ruby/object:Gem::Version
226
+ version: '0'
227
+ description: Rocket Pants adds JSON API love to Rails and ActionController, making
228
+ it simpler to build API-oriented controllers.
229
+ email:
199
230
  - sutto@sutto.net
200
231
  executables: []
201
-
202
232
  extensions: []
203
-
204
233
  extra_rdoc_files: []
205
-
206
- files:
234
+ files:
207
235
  - lib/rocket_pants/active_record.rb
208
236
  - lib/rocket_pants/base.rb
209
237
  - lib/rocket_pants/cache_middleware.rb
@@ -229,37 +257,27 @@ files:
229
257
  - lib/rocket_pants/tasks/rocket_pants.rake
230
258
  - lib/rocket_pants/test_helper.rb
231
259
  - lib/rocket_pants.rb
232
- has_rdoc: true
233
260
  homepage: http://github.com/filtersquad
234
261
  licenses: []
235
-
262
+ metadata: {}
236
263
  post_install_message:
237
264
  rdoc_options: []
238
-
239
- require_paths:
265
+ require_paths:
240
266
  - lib
241
- required_ruby_version: !ruby/object:Gem::Requirement
242
- requirements:
243
- - - ">="
244
- - !ruby/object:Gem::Version
245
- segments:
246
- - 0
247
- version: "0"
248
- required_rubygems_version: !ruby/object:Gem::Requirement
249
- requirements:
250
- - - ">="
251
- - !ruby/object:Gem::Version
252
- segments:
253
- - 1
254
- - 3
255
- - 6
267
+ required_ruby_version: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - '>='
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ required_rubygems_version: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - '>='
275
+ - !ruby/object:Gem::Version
256
276
  version: 1.3.6
257
277
  requirements: []
258
-
259
278
  rubyforge_project:
260
- rubygems_version: 1.3.6
279
+ rubygems_version: 2.0.0
261
280
  signing_key:
262
- specification_version: 3
281
+ specification_version: 4
263
282
  summary: JSON API love for Rails and ActionController
264
283
  test_files: []
265
-