sinatra_resource 0.3.2 → 0.3.3

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.
@@ -17,14 +17,17 @@ module SinatraResource
17
17
  # @param [String] child_id
18
18
  #
19
19
  # @return [MongoMapper::Document]
20
- def check_related?(parent, association, child_id)
21
- unless parent.send(association).find { |x| x.id == child_id }
22
- error 404, convert(body_for(:not_found))
23
- end
20
+ def check_related?(parent, child_assoc, child_id)
21
+ children = parent.send(child_assoc)
22
+ find_child!(children, child_id)
23
+ true
24
24
  end
25
25
 
26
26
  # Create a document from params. If not valid, returns 400.
27
27
  #
28
+ # @param [Class] model
29
+ # a class that includes MongoMapper::Document
30
+ #
28
31
  # @return [MongoMapper::Document]
29
32
  def create_document!(model)
30
33
  document = model.new(params)
@@ -36,9 +39,43 @@ module SinatraResource
36
39
  end
37
40
  document
38
41
  end
42
+
43
+ # Create a nested document from params. If not valid, returns 400.
44
+ #
45
+ # @param [Class] child_model
46
+ # a class that includes either:
47
+ # * MongoMapper::Document
48
+ # * MongoMapper::EmbeddedDocument
49
+ #
50
+ # @param [String] child_id
51
+ #
52
+ # @return [MongoMapper::Document]
53
+ def create_nested_document!(parent, child_assoc, child_model)
54
+ child = child_model.new(params)
55
+ if child_model.embeddable?
56
+ parent.send(child_assoc) << child
57
+ unless parent.valid?
58
+ error 400, convert(body_for(:invalid_document, child))
59
+ end
60
+ unless parent.save
61
+ error 400, convert(body_for(:internal_server_error))
62
+ end
63
+ else
64
+ unless child.valid?
65
+ error 400, convert(body_for(:invalid_document, child))
66
+ end
67
+ unless child.save
68
+ error 400, convert(body_for(:internal_server_error))
69
+ end
70
+ end
71
+ child
72
+ end
39
73
 
40
74
  # Delete a document with +id+.
41
75
  #
76
+ # @param [Class] model
77
+ # a class that includes MongoMapper::Document
78
+ #
42
79
  # @param [String] id
43
80
  #
44
81
  # @return [MongoMapper::Document]
@@ -48,8 +85,65 @@ module SinatraResource
48
85
  document
49
86
  end
50
87
 
88
+ # Delete a nested document.
89
+ #
90
+ # @param [MongoMapper::Document] parent
91
+ #
92
+ # @param [Symbol] child_assoc
93
+ # association (a method) from parent to child
94
+ #
95
+ # @param [Class] child_model
96
+ # a class that includes either:
97
+ # * MongoMapper::Document
98
+ # * MongoMapper::EmbeddedDocument
99
+ #
100
+ # @param [String] id
101
+ #
102
+ # @return [MongoMapper::Document]
103
+ def delete_nested_document!(parent, child_assoc, child_model, child_id)
104
+ if child_model.embeddable?
105
+ children = parent.send(child_assoc)
106
+ child = find_child!(children, child_id)
107
+ children.delete(child)
108
+ unless parent.save
109
+ error 400, convert(body_for(:internal_server_error))
110
+ end
111
+ child
112
+ else
113
+ delete_document!(child_model, child_id)
114
+ end
115
+ end
116
+
117
+ # Find document with +child_id+ in +children+.
118
+ #
119
+ # @params [<MongoMapper::EmbeddedDocument>] children
120
+ #
121
+ # @params [String] child_id
122
+ #
123
+ # @return [MongoMapper::EmbeddedDocument]
124
+ def find_child(children, child_id)
125
+ raise Error, "children not true" unless children
126
+ children.detect { |x| x.id == child_id }
127
+ end
128
+
129
+ # Find document with +child_id+ in +children+ or raise 404.
130
+ #
131
+ # @params [<MongoMapper::EmbeddedDocument>] children
132
+ #
133
+ # @params [String] child_id
134
+ #
135
+ # @return [MongoMapper::EmbeddedDocument]
136
+ def find_child!(children, child_id)
137
+ child = find_child(children, child_id)
138
+ error 404, convert(body_for(:not_found)) unless child
139
+ child
140
+ end
141
+
51
142
  # Find a document with +id+. If not found, returns 404.
52
143
  #
144
+ # @param [Class] model
145
+ # a class that includes MongoMapper::Document
146
+ #
53
147
  # @param [String] id
54
148
  #
55
149
  # @return [MongoMapper::Document]
@@ -61,6 +155,51 @@ module SinatraResource
61
155
  document
62
156
  end
63
157
 
158
+ # Find a nested document. If not found, returns nil.
159
+ #
160
+ # @param [MongoMapper::Document] parent_document
161
+ #
162
+ # @param [Symbol] association
163
+ #
164
+ # @param [Class] child_model
165
+ # a class that includes either:
166
+ # * MongoMapper::Document
167
+ # * MongoMapper::EmbeddedDocument
168
+ #
169
+ # @param [String] child_id
170
+ #
171
+ # @return [MongoMapper::Document]
172
+ def find_nested_document(parent, child_assoc, child_model, child_id)
173
+ if child_model.embeddable?
174
+ children = parent.send(child_assoc)
175
+ find_child(children, child_id)
176
+ else
177
+ child_model.find_by_id(child_id)
178
+ end
179
+ end
180
+
181
+ # Find a nested document. If not found, returns 404.
182
+ #
183
+ # @param [MongoMapper::Document] parent_document
184
+ #
185
+ # @param [Symbol] association
186
+ #
187
+ # @param [Class] child_model
188
+ # a class that includes either:
189
+ # * MongoMapper::Document
190
+ # * MongoMapper::EmbeddedDocument
191
+ #
192
+ # @param [String] child_id
193
+ #
194
+ # @return [MongoMapper::Document]
195
+ def find_nested_document!(parent, child_assoc, child_model, child_id)
196
+ document = find_nested_document(parent, child_assoc, child_model, child_id)
197
+ unless document
198
+ error 404, convert(body_for(:not_found))
199
+ end
200
+ document
201
+ end
202
+
64
203
  # Find +model+ documents: find all documents if no params, otherwise
65
204
  # find selected documents.
66
205
  #
@@ -72,11 +211,44 @@ module SinatraResource
72
211
  return(model.all) if params.empty?
73
212
  model.all(make_conditions(params, model))
74
213
  end
214
+
215
+ # Find nested +child_model+ documents: find all documents if no
216
+ # params, otherwise find selected documents.
217
+ #
218
+ # @param [MongoMapper::Document] parent
219
+ #
220
+ # @param [Symbol] child_assoc
221
+ # association (a method) from parent to child
222
+ #
223
+ # @param [Class] child_model
224
+ # a class that includes either:
225
+ # * MongoMapper::Document
226
+ # * MongoMapper::EmbeddedDocument
227
+ #
228
+ # @return [Array<MongoMapper::Document>]
229
+ def find_nested_documents!(parent, child_assoc, child_model)
230
+ documents = if child_model.embeddable?
231
+ children = parent.send(child_assoc)
232
+ if params.empty?
233
+ children
234
+ else
235
+ children.all(make_conditions(params, child_model))
236
+ end
237
+ else
238
+ children = if params.empty?
239
+ child_model.all
240
+ else
241
+ child_model.all(make_conditions(params, child_model))
242
+ end
243
+ select_related(parent, child_assoc, children)
244
+ end
245
+ end
75
246
 
76
247
  # Delegates to application, who should use custom logic to related
77
248
  # +parent+ and +child+.
78
249
  #
79
250
  # @param [MongoMapper::Document] parent
251
+ # a class that includes MongoMapper::Document
80
252
  #
81
253
  # @param [MongoMapper::Document] child
82
254
  #
@@ -89,27 +261,10 @@ module SinatraResource
89
261
  child
90
262
  end
91
263
 
92
- # Select only the +children+ that are related to the +parent+ by
93
- # way of the +association+.
94
- #
95
- # @param [MongoMapper::Document] parent
96
- #
97
- # @param [Symbol] association
98
- #
99
- # @param [Array<MongoMapper::Document>] children
100
- #
101
- # @return [MongoMapper::Document]
102
- def select_related(parent, association, children)
103
- children.select do |child|
104
- parent.send(association).find { |x| x.id == child.id }
105
- end
106
- # TODO: this has O^2 complexity because of the nesting.
107
- # I think it is reducible to O.
108
- end
109
-
110
264
  # Update a document with +id+ from params. If not valid, returns 400.
111
265
  #
112
- # @param [Hash] model
266
+ # @param [Class] model
267
+ # a class that includes MongoMapper::Document
113
268
  #
114
269
  # @param [String] id
115
270
  #
@@ -122,6 +277,37 @@ module SinatraResource
122
277
  document
123
278
  end
124
279
 
280
+ # Update a nested document with params. If not valid, returns 400.
281
+ #
282
+ # @param [MongoMapper::Document] parent
283
+ #
284
+ # @param [Symbol] child_assoc
285
+ # association (a method) from parent to child
286
+ #
287
+ # @param [Class] child_model
288
+ # a class that includes either:
289
+ # * MongoMapper::Document
290
+ # * MongoMapper::EmbeddedDocument
291
+ #
292
+ # @param [String] child_id
293
+ #
294
+ # @return [MongoMapper::Document]
295
+ def update_nested_document!(parent, child_assoc, child_model, child_id)
296
+ if child_model.embeddable?
297
+ children = parent.send(child_assoc)
298
+ child = find_child!(children, child_id)
299
+ child_index = children.index(child)
300
+ child.attributes = params
301
+ children[child_index] = child
302
+ unless parent.save
303
+ error 400, convert(body_for(:internal_server_error))
304
+ end
305
+ child
306
+ else
307
+ update_document!(child_model, child_id)
308
+ end
309
+ end
310
+
125
311
  protected
126
312
 
127
313
  PATTERNS = [
@@ -144,7 +330,45 @@ module SinatraResource
144
330
  def make_conditions(params, model)
145
331
  filter_string = params["filter"]
146
332
  return {} unless filter_string
147
- QS_FILTER.parse(filter_string)
333
+ unsafe = QS_FILTER.parse(filter_string)
334
+ sanitize(unsafe, model)
335
+ end
336
+
337
+ # Filter out +conditions+ that do not have corresponding keys in
338
+ # +model+. This is part of the process that prevents a user from
339
+ # searching for parameters that they do not have access to.
340
+ #
341
+ # TODO: in order for this model to do the job stated above, it will
342
+ # need to get access to the current role as well.
343
+ #
344
+ # @param [Hash] conditions
345
+ # A hash of unsanitized conditions
346
+ #
347
+ # @param [Class] model
348
+ # a class that includes MongoMapper::Document
349
+ #
350
+ # @return [Hash]
351
+ def sanitize(conditions, model)
352
+ conditions # TODO: incomplete
353
+ end
354
+
355
+ # Select only the +children+ that are related to the +parent+ by
356
+ # way of the +association+.
357
+ #
358
+ # @param [MongoMapper::Document] parent
359
+ # a class that includes MongoMapper::Document
360
+ #
361
+ # @param [Symbol] association
362
+ #
363
+ # @param [Array<MongoMapper::Document>] children
364
+ #
365
+ # @return [MongoMapper::Document]
366
+ def select_related(parent, child_assoc, children)
367
+ children.select do |child|
368
+ parent.send(child_assoc).find { |x| x.id == child.id }
369
+ end
370
+ # Note: This has O^2 complexity because of the nesting.
371
+ # Can it be done more quickly?
148
372
  end
149
373
 
150
374
  # Returns a typecasted +value+. (Uses +model+ and +key_string+ to
data/lib/builder.rb CHANGED
@@ -5,11 +5,11 @@ module SinatraResource
5
5
  def initialize(klass)
6
6
  @klass = klass
7
7
 
8
- @resource_config = @klass.resource_config
9
- @child_association = @resource_config[:child_association]
10
- @model = @resource_config[:model]
11
- @parent = @resource_config[:parent]
12
- @path = @resource_config[:path]
8
+ @resource_config = @klass.resource_config
9
+ @child_assoc = @resource_config[:child_assoc]
10
+ @model = @resource_config[:model]
11
+ @parent = @resource_config[:parent]
12
+ @path = @resource_config[:path]
13
13
  if @parent
14
14
  @parent_resource_config = @parent.resource_config
15
15
  @parent_model = @parent_resource_config[:model]
@@ -31,26 +31,26 @@ module SinatraResource
31
31
  if !@parent
32
32
  @klass.get '/:id/?' do
33
33
  id = params.delete("id")
34
- role = get_role(model, id)
34
+ role = role_for(model, id)
35
35
  document = document_for_get_one(role, model, resource_config, true, id, nil, nil)
36
36
  resource = build_resource(role, document, resource_config)
37
37
  display(:read, resource, resource_config)
38
38
  end
39
39
  else
40
- association = @child_association
40
+ child_assoc = @child_assoc
41
41
  parent_model = @parent_model
42
42
  parent_resource_config = @parent_resource_config
43
43
  path = @path
44
44
  @parent.get "/:parent_id/#{path}/:id/?" do
45
45
  id = params.delete("id")
46
46
  parent_id = params.delete("parent_id")
47
- parent_role = get_role(parent_model, parent_id)
47
+ parent_role = role_for(parent_model, parent_id)
48
48
  parent_document = document_for_get_one(parent_role, parent_model, parent_resource_config, false, parent_id, nil, nil)
49
49
  # ------
50
- role = get_role(model, id)
51
- document = document_for_get_one(role, model, resource_config, true, id, parent_document, association)
50
+ role = role_for_nested(parent_document, child_assoc, model, id)
51
+ document = document_for_get_one(role, model, resource_config, true, id, parent_document, child_assoc)
52
52
  resource = build_resource(role, document, resource_config)
53
- display(:read, resource, resource_config)
53
+ display(:read, resource, resource_config, parent_id)
54
54
  end
55
55
  end
56
56
  end
@@ -60,25 +60,25 @@ module SinatraResource
60
60
  resource_config = @resource_config
61
61
  if !@parent
62
62
  @klass.get '/?' do
63
- role = get_role(model)
63
+ role = lookup_role(nil)
64
64
  documents = documents_for_get_many(role, model, resource_config, true, nil, nil)
65
65
  resources = build_resources(documents, resource_config)
66
66
  display(:list, resources, resource_config)
67
67
  end
68
68
  else
69
- association = @child_association
69
+ child_assoc = @child_assoc
70
70
  parent_model = @parent_model
71
71
  parent_resource_config = @parent_resource_config
72
72
  path = @path
73
73
  @parent.get "/:parent_id/#{path}/?" do
74
74
  parent_id = params.delete("parent_id")
75
- parent_role = get_role(parent_model, parent_id)
75
+ parent_role = role_for(parent_model, parent_id)
76
76
  parent_document = document_for_get_one(parent_role, parent_model, parent_resource_config, false, parent_id, nil, nil)
77
77
  # ------
78
- role = get_role(model)
79
- documents = documents_for_get_many(role, model, resource_config, true, parent_document, association)
78
+ role = lookup_role(nil)
79
+ documents = documents_for_get_many(role, model, resource_config, true, parent_document, child_assoc)
80
80
  resources = build_resources(documents, resource_config)
81
- display(:list, resources, resource_config)
81
+ display(:list, resources, resource_config, parent_id)
82
82
  end
83
83
  end
84
84
  end
@@ -88,25 +88,25 @@ module SinatraResource
88
88
  resource_config = @resource_config
89
89
  if !@parent
90
90
  @klass.post '/?' do
91
- role = get_role(model)
91
+ role = lookup_role(nil)
92
92
  document = document_for_post(role, model, resource_config, true, nil, nil)
93
93
  resource = build_resource(role, document, resource_config)
94
94
  display(:create, resource, resource_config)
95
95
  end
96
96
  else
97
- association = @child_association
97
+ child_assoc = @child_assoc
98
98
  parent_model = @parent_model
99
99
  parent_resource_config = @parent_resource_config
100
100
  path = @path
101
101
  @parent.post "/:parent_id/#{path}/?" do
102
102
  parent_id = params.delete("parent_id")
103
- parent_role = get_role(parent_model, parent_id)
103
+ parent_role = role_for(parent_model, parent_id)
104
104
  parent_document = document_for_get_one(parent_role, parent_model, parent_resource_config, false, parent_id, nil, nil)
105
105
  # ------
106
- role = get_role(model)
107
- document = document_for_post(role, model, resource_config, true, parent_document, association)
106
+ role = lookup_role(nil)
107
+ document = document_for_post(role, model, resource_config, true, parent_document, child_assoc)
108
108
  resource = build_resource(role, document, resource_config)
109
- display(:create, resource, resource_config)
109
+ display(:create, resource, resource_config, parent_id)
110
110
  end
111
111
  end
112
112
  end
@@ -117,26 +117,26 @@ module SinatraResource
117
117
  if !@parent
118
118
  @klass.put '/:id/?' do
119
119
  id = params.delete("id")
120
- role = get_role(model, id)
120
+ role = role_for(model, id)
121
121
  document = document_for_put(role, model, resource_config, true, id, nil, nil)
122
122
  resource = build_resource(role, document, resource_config)
123
123
  display(:update, resource, resource_config)
124
124
  end
125
125
  else
126
- association = @child_association
126
+ child_assoc = @child_assoc
127
127
  parent_model = @parent_model
128
128
  parent_resource_config = @parent_resource_config
129
129
  path = @path
130
130
  @parent.put "/:parent_id/#{path}/:id/?" do
131
131
  id = params.delete("id")
132
132
  parent_id = params.delete("parent_id")
133
- parent_role = get_role(parent_model, parent_id)
133
+ parent_role = role_for(parent_model, parent_id)
134
134
  parent_document = document_for_get_one(parent_role, parent_model, parent_resource_config, false, parent_id, id, id)
135
135
  # ------
136
- role = get_role(model, id)
137
- document = document_for_put(role, model, resource_config, true, id, parent_document, association)
136
+ role = role_for_nested(parent_document, child_assoc, model, id)
137
+ document = document_for_put(role, model, resource_config, true, id, parent_document, child_assoc)
138
138
  resource = build_resource(role, document, resource_config)
139
- display(:update, resource, resource_config)
139
+ display(:update, resource, resource_config, parent_id)
140
140
  end
141
141
  end
142
142
  end
@@ -147,24 +147,24 @@ module SinatraResource
147
147
  if !@parent
148
148
  @klass.delete '/:id/?' do
149
149
  id = params.delete("id")
150
- role = get_role(model, id)
150
+ role = role_for(model, id)
151
151
  document_for_delete(role, model, resource_config, true, id, nil, nil)
152
152
  display(:delete, "", resource_config)
153
153
  end
154
154
  else
155
- association = @child_association
155
+ child_assoc = @child_assoc
156
156
  parent_model = @parent_model
157
157
  parent_resource_config = @parent_resource_config
158
158
  path = @path
159
159
  @parent.delete "/:parent_id/#{path}/:id/?" do
160
160
  id = params.delete("id")
161
161
  parent_id = params.delete("parent_id")
162
- parent_role = get_role(parent_model, parent_id)
162
+ parent_role = role_for(parent_model, parent_id)
163
163
  parent_document = document_for_get_one(parent_role, parent_model, parent_resource_config, false, parent_id, nil, nil)
164
164
  # ------
165
- role = get_role(model, id)
166
- document_for_delete(role, model, resource_config, true, id, parent_document, association)
167
- display(:delete, "", resource_config)
165
+ role = role_for_nested(parent_document, child_assoc, model, id)
166
+ document_for_delete(role, model, resource_config, true, id, parent_document, child_assoc)
167
+ display(:delete, "", resource_config, parent_id)
168
168
  end
169
169
  end
170
170
  end
data/lib/resource.rb CHANGED
@@ -17,7 +17,7 @@ module SinatraResource
17
17
  # Specify a callback.
18
18
  #
19
19
  # @param [Symbol] method
20
- # A symbol that refers to a method on the parent.
20
+ # A symbol that refers to a method on the model.
21
21
  #
22
22
  # @return [undefined]
23
23
  def callback(name, &block)
@@ -30,18 +30,20 @@ module SinatraResource
30
30
  @resource_config[:callbacks][name] = block
31
31
  end
32
32
 
33
- # Specify the association +method+ on +parent+ that points to the
34
- # current (child) +model+.
33
+ # Specify the association +method+ of a parent model that points to
34
+ # its child model.
35
+ #
36
+ # Required for all nested resources.
35
37
  #
36
38
  # @param [Symbol] method
37
39
  # A symbol that refers to a method on the parent.
38
40
  #
39
41
  # @return [undefined]
40
42
  def child_association(method)
41
- if @resource_config[:child_association]
43
+ if @resource_config[:child_assoc]
42
44
  raise DefinitionError, "child_association already declared in #{self}"
43
45
  end
44
- @resource_config[:child_association] = method
46
+ @resource_config[:child_assoc] = method
45
47
  end
46
48
 
47
49
  # Build the Sinatra actions based on the DSL statements in this class.
@@ -89,7 +91,7 @@ module SinatraResource
89
91
  end
90
92
  @resource_config[:parent] = resource
91
93
  end
92
-
94
+
93
95
  # Specify the path. If not specified, SinatraResource will infer the path
94
96
  # from the resource class (see the +default_path+ method.)
95
97
  #
@@ -215,25 +217,25 @@ module SinatraResource
215
217
  # For internal use. Initializes internal data structure.
216
218
  def setup
217
219
  @resource_config = {
218
- :callbacks => {
219
- :before_create => nil,
220
- :after_create => nil,
221
- :before_update => nil,
222
- :after_update => nil,
223
- :before_destroy => nil,
224
- :after_destroy => nil,
220
+ :callbacks => {
221
+ :before_create => nil,
222
+ :after_create => nil,
223
+ :before_update => nil,
224
+ :after_update => nil,
225
+ :before_destroy => nil,
226
+ :after_destroy => nil,
225
227
  },
226
- :child_association => nil,
227
- :model => nil,
228
- :parent => nil,
229
- :path => nil, # default_path,
230
- :permission => {},
231
- :properties => {},
232
- :relation => {
233
- :create => nil,
234
- :delete => nil,
228
+ :child_assoc => nil,
229
+ :model => nil,
230
+ :parent => nil,
231
+ :path => nil,
232
+ :permission => {},
233
+ :properties => {},
234
+ :relation => {
235
+ :create => nil,
236
+ :delete => nil,
235
237
  },
236
- :roles => nil,
238
+ :roles => nil,
237
239
  }
238
240
  end
239
241
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_resource}
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David James"]
12
- s.date = %q{2009-10-28}
12
+ s.date = %q{2009-10-29}
13
13
  s.description = %q{A DSL for creating RESTful actions with Sinatra and MongoMapper. It embraces the Resource Oriented Architecture as explained by Leonard Richardson and Sam Ruby.}
14
14
  s.email = %q{djames@sunlightfoundation.com}
15
15
  s.extra_rdoc_files = [
@@ -35,11 +35,13 @@ Gem::Specification.new do |s|
35
35
  "examples/datacatalog/models/category.rb",
36
36
  "examples/datacatalog/models/note.rb",
37
37
  "examples/datacatalog/models/source.rb",
38
+ "examples/datacatalog/models/usage.rb",
38
39
  "examples/datacatalog/models/user.rb",
39
40
  "examples/datacatalog/resources/categories.rb",
40
41
  "examples/datacatalog/resources/categories_sources.rb",
41
42
  "examples/datacatalog/resources/notes.rb",
42
43
  "examples/datacatalog/resources/sources.rb",
44
+ "examples/datacatalog/resources/sources_usages.rb",
43
45
  "examples/datacatalog/resources/users.rb",
44
46
  "examples/datacatalog/tasks/db.rake",
45
47
  "examples/datacatalog/tasks/test.rake",
@@ -81,6 +83,11 @@ Gem::Specification.new do |s|
81
83
  "examples/datacatalog/test/resources/sources/sources_get_one_test.rb",
82
84
  "examples/datacatalog/test/resources/sources/sources_post_test.rb",
83
85
  "examples/datacatalog/test/resources/sources/sources_put_test.rb",
86
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_delete_test.rb",
87
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_get_many_test.rb",
88
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_get_one_test.rb",
89
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_post_test.rb",
90
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_put_test.rb",
84
91
  "examples/datacatalog/test/resources/users/users_delete_test.rb",
85
92
  "examples/datacatalog/test/resources/users/users_get_many_test.rb",
86
93
  "examples/datacatalog/test/resources/users/users_get_one_test.rb",
@@ -124,11 +131,13 @@ Gem::Specification.new do |s|
124
131
  "examples/datacatalog/models/category.rb",
125
132
  "examples/datacatalog/models/note.rb",
126
133
  "examples/datacatalog/models/source.rb",
134
+ "examples/datacatalog/models/usage.rb",
127
135
  "examples/datacatalog/models/user.rb",
128
136
  "examples/datacatalog/resources/categories.rb",
129
137
  "examples/datacatalog/resources/categories_sources.rb",
130
138
  "examples/datacatalog/resources/notes.rb",
131
139
  "examples/datacatalog/resources/sources.rb",
140
+ "examples/datacatalog/resources/sources_usages.rb",
132
141
  "examples/datacatalog/resources/users.rb",
133
142
  "examples/datacatalog/test/helpers/assertions/assert_include.rb",
134
143
  "examples/datacatalog/test/helpers/assertions/assert_not_include.rb",
@@ -168,6 +177,11 @@ Gem::Specification.new do |s|
168
177
  "examples/datacatalog/test/resources/sources/sources_get_one_test.rb",
169
178
  "examples/datacatalog/test/resources/sources/sources_post_test.rb",
170
179
  "examples/datacatalog/test/resources/sources/sources_put_test.rb",
180
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_delete_test.rb",
181
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_get_many_test.rb",
182
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_get_one_test.rb",
183
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_post_test.rb",
184
+ "examples/datacatalog/test/resources/sources_usages/sources_usages_put_test.rb",
171
185
  "examples/datacatalog/test/resources/users/users_delete_test.rb",
172
186
  "examples/datacatalog/test/resources/users/users_get_many_test.rb",
173
187
  "examples/datacatalog/test/resources/users/users_get_one_test.rb",