jsonapi-resources 0.7.1.beta1 → 0.7.1.beta2
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.
- checksums.yaml +4 -4
- data/README.md +248 -74
- data/lib/jsonapi-resources.rb +5 -3
- data/lib/jsonapi/acts_as_resource_controller.rb +77 -14
- data/lib/jsonapi/configuration.rb +77 -16
- data/lib/jsonapi/error.rb +12 -0
- data/lib/jsonapi/error_codes.rb +2 -0
- data/lib/jsonapi/exceptions.rb +29 -9
- data/lib/jsonapi/formatter.rb +29 -4
- data/lib/jsonapi/link_builder.rb +18 -18
- data/lib/jsonapi/mime_types.rb +25 -6
- data/lib/jsonapi/naive_cache.rb +30 -0
- data/lib/jsonapi/operation.rb +10 -342
- data/lib/jsonapi/operation_dispatcher.rb +87 -0
- data/lib/jsonapi/operation_result.rb +2 -1
- data/lib/jsonapi/paginator.rb +6 -2
- data/lib/jsonapi/processor.rb +283 -0
- data/lib/jsonapi/relationship.rb +6 -4
- data/lib/jsonapi/{request.rb → request_parser.rb} +46 -35
- data/lib/jsonapi/resource.rb +88 -13
- data/lib/jsonapi/resource_controller.rb +2 -14
- data/lib/jsonapi/resource_controller_metal.rb +17 -0
- data/lib/jsonapi/resource_serializer.rb +62 -47
- data/lib/jsonapi/resources/version.rb +1 -1
- data/lib/jsonapi/response_document.rb +13 -2
- data/lib/jsonapi/routing_ext.rb +49 -11
- metadata +37 -129
- data/.gitignore +0 -22
- data/.travis.yml +0 -9
- data/Gemfile +0 -23
- data/Rakefile +0 -20
- data/jsonapi-resources.gemspec +0 -29
- data/lib/jsonapi/active_record_operations_processor.rb +0 -35
- data/lib/jsonapi/operations_processor.rb +0 -120
- data/locales/en.yml +0 -80
- data/test/config/database.yml +0 -5
- data/test/controllers/controller_test.rb +0 -3312
- data/test/fixtures/active_record.rb +0 -1486
- data/test/fixtures/author_details.yml +0 -9
- data/test/fixtures/book_authors.yml +0 -3
- data/test/fixtures/book_comments.yml +0 -12
- data/test/fixtures/books.yml +0 -7
- data/test/fixtures/categories.yml +0 -35
- data/test/fixtures/comments.yml +0 -21
- data/test/fixtures/comments_tags.yml +0 -20
- data/test/fixtures/companies.yml +0 -4
- data/test/fixtures/craters.yml +0 -9
- data/test/fixtures/customers.yml +0 -11
- data/test/fixtures/documents.yml +0 -3
- data/test/fixtures/expense_entries.yml +0 -13
- data/test/fixtures/facts.yml +0 -11
- data/test/fixtures/hair_cuts.yml +0 -3
- data/test/fixtures/iso_currencies.yml +0 -17
- data/test/fixtures/line_items.yml +0 -37
- data/test/fixtures/makes.yml +0 -2
- data/test/fixtures/moons.yml +0 -6
- data/test/fixtures/numeros_telefone.yml +0 -3
- data/test/fixtures/order_flags.yml +0 -7
- data/test/fixtures/people.yml +0 -31
- data/test/fixtures/pictures.yml +0 -15
- data/test/fixtures/planet_types.yml +0 -19
- data/test/fixtures/planets.yml +0 -47
- data/test/fixtures/posts.yml +0 -102
- data/test/fixtures/posts_tags.yml +0 -59
- data/test/fixtures/preferences.yml +0 -14
- data/test/fixtures/products.yml +0 -3
- data/test/fixtures/purchase_orders.yml +0 -23
- data/test/fixtures/sections.yml +0 -8
- data/test/fixtures/tags.yml +0 -39
- data/test/fixtures/vehicles.yml +0 -17
- data/test/fixtures/web_pages.yml +0 -3
- data/test/helpers/assertions.rb +0 -13
- data/test/helpers/functional_helpers.rb +0 -59
- data/test/helpers/value_matchers.rb +0 -60
- data/test/helpers/value_matchers_test.rb +0 -40
- data/test/integration/requests/namespaced_model_test.rb +0 -13
- data/test/integration/requests/request_test.rb +0 -932
- data/test/integration/routes/routes_test.rb +0 -218
- data/test/integration/sti_fields_test.rb +0 -18
- data/test/lib/generators/jsonapi/controller_generator_test.rb +0 -25
- data/test/lib/generators/jsonapi/resource_generator_test.rb +0 -30
- data/test/test_helper.rb +0 -342
- data/test/unit/formatters/dasherized_key_formatter_test.rb +0 -8
- data/test/unit/jsonapi_request/jsonapi_request_test.rb +0 -199
- data/test/unit/operation/operations_processor_test.rb +0 -528
- data/test/unit/pagination/offset_paginator_test.rb +0 -245
- data/test/unit/pagination/paged_paginator_test.rb +0 -242
- data/test/unit/resource/resource_test.rb +0 -560
- data/test/unit/serializer/include_directives_test.rb +0 -113
- data/test/unit/serializer/link_builder_test.rb +0 -244
- data/test/unit/serializer/polymorphic_serializer_test.rb +0 -383
- data/test/unit/serializer/response_document_test.rb +0 -61
- data/test/unit/serializer/serializer_test.rb +0 -1939
@@ -54,6 +54,10 @@ module JSONAPI
|
|
54
54
|
if JSONAPI.configuration.top_level_meta_include_record_count && result.respond_to?(:record_count)
|
55
55
|
meta[JSONAPI.configuration.top_level_meta_record_count_key] = result.record_count
|
56
56
|
end
|
57
|
+
|
58
|
+
if JSONAPI.configuration.top_level_meta_include_page_count && result.respond_to?(:page_count)
|
59
|
+
meta[JSONAPI.configuration.top_level_meta_page_count_key] = result.page_count
|
60
|
+
end
|
57
61
|
end
|
58
62
|
|
59
63
|
meta.deep_transform_keys { |key| @key_formatter.format(key) }
|
@@ -90,10 +94,17 @@ module JSONAPI
|
|
90
94
|
query_params[:page] = params
|
91
95
|
|
92
96
|
request = @options[:request]
|
93
|
-
|
97
|
+
if request.params[:fields]
|
98
|
+
query_params[:fields] = request.params[:fields].respond_to?(:to_unsafe_hash) ? request.params[:fields].to_unsafe_hash : request.params[:fields]
|
99
|
+
end
|
100
|
+
|
94
101
|
query_params[:include] = request.params[:include] if request.params[:include]
|
95
102
|
query_params[:sort] = request.params[:sort] if request.params[:sort]
|
96
|
-
|
103
|
+
|
104
|
+
if request.params[:filter]
|
105
|
+
query_params[:filter] = request.params[:filter].respond_to?(:to_unsafe_hash) ? request.params[:filter].to_unsafe_hash : request.params[:filter]
|
106
|
+
end
|
107
|
+
|
97
108
|
query_params
|
98
109
|
end
|
99
110
|
|
data/lib/jsonapi/routing_ext.rb
CHANGED
@@ -33,13 +33,27 @@ module ActionDispatch
|
|
33
33
|
end
|
34
34
|
|
35
35
|
resource @resource_type, options do
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
# :nocov:
|
37
|
+
if @scope.respond_to? :[]=
|
38
|
+
# Rails 4
|
39
|
+
@scope[:jsonapi_resource] = @resource_type
|
40
|
+
|
41
|
+
if block_given?
|
42
|
+
yield
|
43
|
+
else
|
44
|
+
jsonapi_relationships
|
45
|
+
end
|
40
46
|
else
|
41
|
-
|
47
|
+
# Rails 5
|
48
|
+
jsonapi_resource_scope(SingletonResource.new(@resource_type, api_only?, @scope[:shallow], options), @resource_type) do
|
49
|
+
if block_given?
|
50
|
+
yield
|
51
|
+
else
|
52
|
+
jsonapi_relationships
|
53
|
+
end
|
54
|
+
end
|
42
55
|
end
|
56
|
+
# :nocov:
|
43
57
|
end
|
44
58
|
end
|
45
59
|
|
@@ -69,7 +83,8 @@ module ActionDispatch
|
|
69
83
|
options[:path] = format_route(@resource_type)
|
70
84
|
|
71
85
|
if res.resource_key_type == :uuid
|
72
|
-
options[:constraints]
|
86
|
+
options[:constraints] ||= {}
|
87
|
+
options[:constraints][:id] ||= /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
|
73
88
|
end
|
74
89
|
|
75
90
|
if options[:except]
|
@@ -87,13 +102,26 @@ module ActionDispatch
|
|
87
102
|
end
|
88
103
|
|
89
104
|
resources @resource_type, options do
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
105
|
+
# :nocov:
|
106
|
+
if @scope.respond_to? :[]=
|
107
|
+
# Rails 4
|
108
|
+
@scope[:jsonapi_resource] = @resource_type
|
109
|
+
if block_given?
|
110
|
+
yield
|
111
|
+
else
|
112
|
+
jsonapi_relationships
|
113
|
+
end
|
94
114
|
else
|
95
|
-
|
115
|
+
# Rails 5
|
116
|
+
jsonapi_resource_scope(Resource.new(@resource_type, api_only?, @scope[:shallow], options), @resource_type) do
|
117
|
+
if block_given?
|
118
|
+
yield
|
119
|
+
else
|
120
|
+
jsonapi_relationships
|
121
|
+
end
|
122
|
+
end
|
96
123
|
end
|
124
|
+
# :nocov:
|
97
125
|
end
|
98
126
|
end
|
99
127
|
|
@@ -206,6 +234,16 @@ module ActionDispatch
|
|
206
234
|
action: 'get_related_resources', via: [:get]
|
207
235
|
end
|
208
236
|
|
237
|
+
protected
|
238
|
+
# :nocov:
|
239
|
+
def jsonapi_resource_scope(resource, resource_type) #:nodoc:
|
240
|
+
@scope = @scope.new(scope_level_resource: resource, jsonapi_resource: resource_type)
|
241
|
+
|
242
|
+
controller(resource.resource_scope) { yield }
|
243
|
+
ensure
|
244
|
+
@scope = @scope.parent
|
245
|
+
end
|
246
|
+
# :nocov:
|
209
247
|
private
|
210
248
|
|
211
249
|
def resource_type_with_module_prefix(resource = nil)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.1.
|
4
|
+
version: 0.7.1.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Gebhardt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -95,6 +95,20 @@ dependencies:
|
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: concurrent-ruby-ext
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: rails
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,6 +123,20 @@ dependencies:
|
|
109
123
|
- - ">="
|
110
124
|
- !ruby/object:Gem::Version
|
111
125
|
version: '4.0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: concurrent-ruby
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
112
140
|
description: A resource-centric approach to implementing the controllers, routes,
|
113
141
|
and serializers needed to support the JSON API spec.
|
114
142
|
email:
|
@@ -118,20 +146,14 @@ executables: []
|
|
118
146
|
extensions: []
|
119
147
|
extra_rdoc_files: []
|
120
148
|
files:
|
121
|
-
- ".gitignore"
|
122
|
-
- ".travis.yml"
|
123
|
-
- Gemfile
|
124
149
|
- LICENSE.txt
|
125
150
|
- README.md
|
126
|
-
- Rakefile
|
127
|
-
- jsonapi-resources.gemspec
|
128
151
|
- lib/generators/jsonapi/USAGE
|
129
152
|
- lib/generators/jsonapi/controller_generator.rb
|
130
153
|
- lib/generators/jsonapi/resource_generator.rb
|
131
154
|
- lib/generators/jsonapi/templates/jsonapi_controller.rb
|
132
155
|
- lib/generators/jsonapi/templates/jsonapi_resource.rb
|
133
156
|
- lib/jsonapi-resources.rb
|
134
|
-
- lib/jsonapi/active_record_operations_processor.rb
|
135
157
|
- lib/jsonapi/acts_as_resource_controller.rb
|
136
158
|
- lib/jsonapi/callbacks.rb
|
137
159
|
- lib/jsonapi/configuration.rb
|
@@ -142,78 +164,22 @@ files:
|
|
142
164
|
- lib/jsonapi/include_directives.rb
|
143
165
|
- lib/jsonapi/link_builder.rb
|
144
166
|
- lib/jsonapi/mime_types.rb
|
167
|
+
- lib/jsonapi/naive_cache.rb
|
145
168
|
- lib/jsonapi/operation.rb
|
169
|
+
- lib/jsonapi/operation_dispatcher.rb
|
146
170
|
- lib/jsonapi/operation_result.rb
|
147
171
|
- lib/jsonapi/operation_results.rb
|
148
|
-
- lib/jsonapi/operations_processor.rb
|
149
172
|
- lib/jsonapi/paginator.rb
|
173
|
+
- lib/jsonapi/processor.rb
|
150
174
|
- lib/jsonapi/relationship.rb
|
151
|
-
- lib/jsonapi/
|
175
|
+
- lib/jsonapi/request_parser.rb
|
152
176
|
- lib/jsonapi/resource.rb
|
153
177
|
- lib/jsonapi/resource_controller.rb
|
178
|
+
- lib/jsonapi/resource_controller_metal.rb
|
154
179
|
- lib/jsonapi/resource_serializer.rb
|
155
180
|
- lib/jsonapi/resources/version.rb
|
156
181
|
- lib/jsonapi/response_document.rb
|
157
182
|
- lib/jsonapi/routing_ext.rb
|
158
|
-
- locales/en.yml
|
159
|
-
- test/config/database.yml
|
160
|
-
- test/controllers/controller_test.rb
|
161
|
-
- test/fixtures/active_record.rb
|
162
|
-
- test/fixtures/author_details.yml
|
163
|
-
- test/fixtures/book_authors.yml
|
164
|
-
- test/fixtures/book_comments.yml
|
165
|
-
- test/fixtures/books.yml
|
166
|
-
- test/fixtures/categories.yml
|
167
|
-
- test/fixtures/comments.yml
|
168
|
-
- test/fixtures/comments_tags.yml
|
169
|
-
- test/fixtures/companies.yml
|
170
|
-
- test/fixtures/craters.yml
|
171
|
-
- test/fixtures/customers.yml
|
172
|
-
- test/fixtures/documents.yml
|
173
|
-
- test/fixtures/expense_entries.yml
|
174
|
-
- test/fixtures/facts.yml
|
175
|
-
- test/fixtures/hair_cuts.yml
|
176
|
-
- test/fixtures/iso_currencies.yml
|
177
|
-
- test/fixtures/line_items.yml
|
178
|
-
- test/fixtures/makes.yml
|
179
|
-
- test/fixtures/moons.yml
|
180
|
-
- test/fixtures/numeros_telefone.yml
|
181
|
-
- test/fixtures/order_flags.yml
|
182
|
-
- test/fixtures/people.yml
|
183
|
-
- test/fixtures/pictures.yml
|
184
|
-
- test/fixtures/planet_types.yml
|
185
|
-
- test/fixtures/planets.yml
|
186
|
-
- test/fixtures/posts.yml
|
187
|
-
- test/fixtures/posts_tags.yml
|
188
|
-
- test/fixtures/preferences.yml
|
189
|
-
- test/fixtures/products.yml
|
190
|
-
- test/fixtures/purchase_orders.yml
|
191
|
-
- test/fixtures/sections.yml
|
192
|
-
- test/fixtures/tags.yml
|
193
|
-
- test/fixtures/vehicles.yml
|
194
|
-
- test/fixtures/web_pages.yml
|
195
|
-
- test/helpers/assertions.rb
|
196
|
-
- test/helpers/functional_helpers.rb
|
197
|
-
- test/helpers/value_matchers.rb
|
198
|
-
- test/helpers/value_matchers_test.rb
|
199
|
-
- test/integration/requests/namespaced_model_test.rb
|
200
|
-
- test/integration/requests/request_test.rb
|
201
|
-
- test/integration/routes/routes_test.rb
|
202
|
-
- test/integration/sti_fields_test.rb
|
203
|
-
- test/lib/generators/jsonapi/controller_generator_test.rb
|
204
|
-
- test/lib/generators/jsonapi/resource_generator_test.rb
|
205
|
-
- test/test_helper.rb
|
206
|
-
- test/unit/formatters/dasherized_key_formatter_test.rb
|
207
|
-
- test/unit/jsonapi_request/jsonapi_request_test.rb
|
208
|
-
- test/unit/operation/operations_processor_test.rb
|
209
|
-
- test/unit/pagination/offset_paginator_test.rb
|
210
|
-
- test/unit/pagination/paged_paginator_test.rb
|
211
|
-
- test/unit/resource/resource_test.rb
|
212
|
-
- test/unit/serializer/include_directives_test.rb
|
213
|
-
- test/unit/serializer/link_builder_test.rb
|
214
|
-
- test/unit/serializer/polymorphic_serializer_test.rb
|
215
|
-
- test/unit/serializer/response_document_test.rb
|
216
|
-
- test/unit/serializer/serializer_test.rb
|
217
183
|
homepage: https://github.com/cerebris/jsonapi-resources
|
218
184
|
licenses:
|
219
185
|
- MIT
|
@@ -234,66 +200,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
200
|
version: 1.3.1
|
235
201
|
requirements: []
|
236
202
|
rubyforge_project:
|
237
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.5.1
|
238
204
|
signing_key:
|
239
205
|
specification_version: 4
|
240
206
|
summary: Easily support JSON API in Rails.
|
241
|
-
test_files:
|
242
|
-
- test/config/database.yml
|
243
|
-
- test/controllers/controller_test.rb
|
244
|
-
- test/fixtures/active_record.rb
|
245
|
-
- test/fixtures/author_details.yml
|
246
|
-
- test/fixtures/book_authors.yml
|
247
|
-
- test/fixtures/book_comments.yml
|
248
|
-
- test/fixtures/books.yml
|
249
|
-
- test/fixtures/categories.yml
|
250
|
-
- test/fixtures/comments.yml
|
251
|
-
- test/fixtures/comments_tags.yml
|
252
|
-
- test/fixtures/companies.yml
|
253
|
-
- test/fixtures/craters.yml
|
254
|
-
- test/fixtures/customers.yml
|
255
|
-
- test/fixtures/documents.yml
|
256
|
-
- test/fixtures/expense_entries.yml
|
257
|
-
- test/fixtures/facts.yml
|
258
|
-
- test/fixtures/hair_cuts.yml
|
259
|
-
- test/fixtures/iso_currencies.yml
|
260
|
-
- test/fixtures/line_items.yml
|
261
|
-
- test/fixtures/makes.yml
|
262
|
-
- test/fixtures/moons.yml
|
263
|
-
- test/fixtures/numeros_telefone.yml
|
264
|
-
- test/fixtures/order_flags.yml
|
265
|
-
- test/fixtures/people.yml
|
266
|
-
- test/fixtures/pictures.yml
|
267
|
-
- test/fixtures/planet_types.yml
|
268
|
-
- test/fixtures/planets.yml
|
269
|
-
- test/fixtures/posts.yml
|
270
|
-
- test/fixtures/posts_tags.yml
|
271
|
-
- test/fixtures/preferences.yml
|
272
|
-
- test/fixtures/products.yml
|
273
|
-
- test/fixtures/purchase_orders.yml
|
274
|
-
- test/fixtures/sections.yml
|
275
|
-
- test/fixtures/tags.yml
|
276
|
-
- test/fixtures/vehicles.yml
|
277
|
-
- test/fixtures/web_pages.yml
|
278
|
-
- test/helpers/assertions.rb
|
279
|
-
- test/helpers/functional_helpers.rb
|
280
|
-
- test/helpers/value_matchers.rb
|
281
|
-
- test/helpers/value_matchers_test.rb
|
282
|
-
- test/integration/requests/namespaced_model_test.rb
|
283
|
-
- test/integration/requests/request_test.rb
|
284
|
-
- test/integration/routes/routes_test.rb
|
285
|
-
- test/integration/sti_fields_test.rb
|
286
|
-
- test/lib/generators/jsonapi/controller_generator_test.rb
|
287
|
-
- test/lib/generators/jsonapi/resource_generator_test.rb
|
288
|
-
- test/test_helper.rb
|
289
|
-
- test/unit/formatters/dasherized_key_formatter_test.rb
|
290
|
-
- test/unit/jsonapi_request/jsonapi_request_test.rb
|
291
|
-
- test/unit/operation/operations_processor_test.rb
|
292
|
-
- test/unit/pagination/offset_paginator_test.rb
|
293
|
-
- test/unit/pagination/paged_paginator_test.rb
|
294
|
-
- test/unit/resource/resource_test.rb
|
295
|
-
- test/unit/serializer/include_directives_test.rb
|
296
|
-
- test/unit/serializer/link_builder_test.rb
|
297
|
-
- test/unit/serializer/polymorphic_serializer_test.rb
|
298
|
-
- test/unit/serializer/response_document_test.rb
|
299
|
-
- test/unit/serializer/serializer_test.rb
|
207
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
.ruby-version
|
7
|
-
Gemfile.lock
|
8
|
-
InstalledFiles
|
9
|
-
_yardoc
|
10
|
-
coverage
|
11
|
-
doc/
|
12
|
-
lib/bundler/man
|
13
|
-
pkg
|
14
|
-
rdoc
|
15
|
-
spec/reports
|
16
|
-
test/tmp
|
17
|
-
test/version_tmp
|
18
|
-
tmp
|
19
|
-
coverage
|
20
|
-
test/log
|
21
|
-
test_db
|
22
|
-
test_db-journal
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
platforms :ruby do
|
6
|
-
gem 'sqlite3', '1.3.10'
|
7
|
-
end
|
8
|
-
|
9
|
-
platforms :jruby do
|
10
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
11
|
-
end
|
12
|
-
|
13
|
-
version = ENV['RAILS_VERSION'] || 'default'
|
14
|
-
|
15
|
-
case version
|
16
|
-
when 'master'
|
17
|
-
gem 'rails', { git: 'https://github.com/rails/rails.git' }
|
18
|
-
gem 'arel', { git: 'https://github.com/rails/arel.git' }
|
19
|
-
when 'default'
|
20
|
-
gem 'rails', '>= 4.2'
|
21
|
-
else
|
22
|
-
gem 'rails', "~> #{version}"
|
23
|
-
end
|
data/Rakefile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
require 'bundler/gem_tasks'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require './test/test_helper.rb'
|
5
|
-
|
6
|
-
TestApp.load_tasks
|
7
|
-
|
8
|
-
task default: :test
|
9
|
-
|
10
|
-
desc 'Run tests in isolated processes'
|
11
|
-
namespace :test do
|
12
|
-
task :isolated do
|
13
|
-
Dir[test_task.pattern].each do |file|
|
14
|
-
cmd = ['ruby']
|
15
|
-
test_task.libs.each { |l| cmd << '-I' << l }
|
16
|
-
cmd << file
|
17
|
-
sh cmd.join(' ')
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/jsonapi-resources.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'jsonapi/resources/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'jsonapi-resources'
|
8
|
-
spec.version = JSONAPI::Resources::VERSION
|
9
|
-
spec.authors = ['Dan Gebhardt', 'Larry Gebhardt']
|
10
|
-
spec.email = ['dan@cerebris.com', 'larry@cerebris.com']
|
11
|
-
spec.summary = 'Easily support JSON API in Rails.'
|
12
|
-
spec.description = 'A resource-centric approach to implementing the controllers, routes, and serializers needed to support the JSON API spec.'
|
13
|
-
spec.homepage = 'https://github.com/cerebris/jsonapi-resources'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ['lib']
|
20
|
-
spec.required_ruby_version = '>= 2.0'
|
21
|
-
|
22
|
-
spec.add_development_dependency 'bundler', '~> 1.5'
|
23
|
-
spec.add_development_dependency 'rake'
|
24
|
-
spec.add_development_dependency 'minitest'
|
25
|
-
spec.add_development_dependency 'minitest-spec-rails'
|
26
|
-
spec.add_development_dependency 'simplecov'
|
27
|
-
spec.add_development_dependency 'pry'
|
28
|
-
spec.add_dependency 'rails', '>= 4.0'
|
29
|
-
end
|