angus 0.0.13.beta1 → 0.0.13.beta3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0186f917aedde0df96b6f5691bbeaf4ffd186d31
|
4
|
+
data.tar.gz: b98f2b08e8316181f8d800e99ba54b299d07d398
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 223c68ba16e11933c76a47605da7369741909bce4290cd37645a586b7a96fc57b76caebfae7a65bdc6e702438d1f205194c542538c0e31b4771a1b404216d849
|
7
|
+
data.tar.gz: 4741ca50f180b0b28c929d4df6501004399830aa951cf74d4028062c625c61211acb5bb1eecfa75b8800279b264354cf28eb329692a91fe1e67e6607c8285919
|
@@ -19,7 +19,7 @@
|
|
19
19
|
- element: '<%= response_element(action_name) %>'
|
20
20
|
description: '<%= response_description(action_name) %>'
|
21
21
|
required: <%= response_required(action_name) %>
|
22
|
-
|
22
|
+
<%= response_type %>: <%= element_type(action_name) %>
|
23
23
|
<% if is_demo? -%>
|
24
24
|
|
25
25
|
messages:
|
@@ -106,7 +106,15 @@ class Thor
|
|
106
106
|
true if is_demo?
|
107
107
|
end
|
108
108
|
|
109
|
-
def response_type
|
109
|
+
def response_type
|
110
|
+
if is_demo?
|
111
|
+
'elements_type'
|
112
|
+
else
|
113
|
+
'type'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def element_type(action_name)
|
110
118
|
'user_profile' if is_demo?
|
111
119
|
end
|
112
120
|
|
@@ -58,7 +58,7 @@ module Angus
|
|
58
58
|
end
|
59
59
|
elsif error.respond_to?(:error_key)
|
60
60
|
messages << { :level => level, :key => error.error_key,
|
61
|
-
:dsc => error_message(error) }
|
61
|
+
:dsc => error_message(error) }.merge(additional_message_attributes(error))
|
62
62
|
else
|
63
63
|
messages << { :level => level, :key => error.class.name, :dsc => error.message }
|
64
64
|
end
|
@@ -85,6 +85,14 @@ module Angus
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
def additional_message_attributes(error)
|
89
|
+
error_definition = error_definition(error)
|
90
|
+
|
91
|
+
error_definition.fields.inject({}) do |attributes, field|
|
92
|
+
attributes.merge!({ field.name => error.send(field.name)})
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
88
96
|
# Returns the error definition.
|
89
97
|
#
|
90
98
|
# If the error does not responds to error_key nil will be returned, see EvolutionError.
|
data/lib/angus/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Angus
|
2
|
-
VERSION = '0.0.13.
|
3
|
-
end
|
2
|
+
VERSION = '0.0.13.beta3'
|
3
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.13.
|
4
|
+
version: 0.0.13.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Ifran
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2014-
|
18
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: thor
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version: '0.0'
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.0.
|
43
|
+
version: 0.0.7
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
version: '0.0'
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.0.
|
53
|
+
version: 0.0.7
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: angus-router
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -315,48 +315,48 @@ signing_key:
|
|
315
315
|
specification_version: 4
|
316
316
|
summary: A web services summary
|
317
317
|
test_files:
|
318
|
-
- spec/
|
319
|
-
- spec/
|
320
|
-
- spec/
|
321
|
-
- spec/functional/type_validation/resources/admins.rb
|
322
|
-
- spec/functional/type_validation/models/admin.rb
|
323
|
-
- spec/functional/type_validation/definitions/admins/operations.yml
|
324
|
-
- spec/functional/type_validation/definitions/representations.yml
|
325
|
-
- spec/functional/type_validation/definitions/messages.yml
|
326
|
-
- spec/functional/type_validation/definitions/service.yml
|
327
|
-
- spec/functional/type_validation/services/type_validation.rb
|
328
|
-
- spec/functional/basic/resources/users.rb
|
329
|
-
- spec/functional/basic/models/user.rb
|
330
|
-
- spec/functional/basic/exceptions/user_errors.rb
|
331
|
-
- spec/functional/basic/definitions/users/operations.yml
|
332
|
-
- spec/functional/basic/definitions/representations.yml
|
318
|
+
- spec/angus/middleware/exception_handler_spec.rb
|
319
|
+
- spec/angus/request_handler_spec.rb
|
320
|
+
- spec/angus/rspec/examples/describe_errors_spec.rb
|
333
321
|
- spec/functional/basic/definitions/messages.yml
|
322
|
+
- spec/functional/basic/definitions/representations.yml
|
334
323
|
- spec/functional/basic/definitions/service.yml
|
324
|
+
- spec/functional/basic/definitions/users/operations.yml
|
325
|
+
- spec/functional/basic/exceptions/user_errors.rb
|
326
|
+
- spec/functional/basic/models/user.rb
|
327
|
+
- spec/functional/basic/resources/users.rb
|
335
328
|
- spec/functional/basic/services/basic.rb
|
336
|
-
- spec/functional/
|
337
|
-
- spec/functional/
|
338
|
-
- spec/functional/
|
339
|
-
- spec/functional/
|
340
|
-
- spec/functional/
|
341
|
-
- spec/functional/
|
342
|
-
- spec/functional/
|
343
|
-
- spec/functional/
|
344
|
-
- spec/functional/filters/definitions/users/operations.yml
|
345
|
-
- spec/functional/filters/definitions/representations.yml
|
329
|
+
- spec/functional/basic_spec.rb
|
330
|
+
- spec/functional/empty_resource/definitions/messages.yml
|
331
|
+
- spec/functional/empty_resource/definitions/representations.yml
|
332
|
+
- spec/functional/empty_resource/definitions/service.yml
|
333
|
+
- spec/functional/empty_resource/definitions/users/operations.yml
|
334
|
+
- spec/functional/empty_resource/resources/users.rb
|
335
|
+
- spec/functional/empty_resource/services/empty_resource.rb
|
336
|
+
- spec/functional/empty_resource_spec.rb
|
346
337
|
- spec/functional/filters/definitions/messages.yml
|
338
|
+
- spec/functional/filters/definitions/representations.yml
|
347
339
|
- spec/functional/filters/definitions/service.yml
|
340
|
+
- spec/functional/filters/definitions/users/operations.yml
|
341
|
+
- spec/functional/filters/exceptions/user_errors.rb
|
342
|
+
- spec/functional/filters/models/user.rb
|
343
|
+
- spec/functional/filters/resources/users.rb
|
348
344
|
- spec/functional/filters/services/filters.rb
|
345
|
+
- spec/functional/filters_spec.rb
|
346
|
+
- spec/functional/no_resources/definitions/messages.yml
|
347
|
+
- spec/functional/no_resources/definitions/representations.yml
|
348
|
+
- spec/functional/no_resources/definitions/service.yml
|
349
|
+
- spec/functional/no_resources/services/no_resources.rb
|
349
350
|
- spec/functional/no_resources_spec.rb
|
350
|
-
- spec/functional/
|
351
|
-
- spec/functional/
|
352
|
-
- spec/functional/
|
353
|
-
- spec/functional/
|
354
|
-
- spec/functional/
|
355
|
-
- spec/functional/
|
356
|
-
- spec/functional/
|
357
|
-
- spec/
|
358
|
-
- spec/
|
359
|
-
- spec/
|
351
|
+
- spec/functional/type_validation/definitions/admins/operations.yml
|
352
|
+
- spec/functional/type_validation/definitions/messages.yml
|
353
|
+
- spec/functional/type_validation/definitions/representations.yml
|
354
|
+
- spec/functional/type_validation/definitions/service.yml
|
355
|
+
- spec/functional/type_validation/models/admin.rb
|
356
|
+
- spec/functional/type_validation/resources/admins.rb
|
357
|
+
- spec/functional/type_validation/services/type_validation.rb
|
358
|
+
- spec/functional/type_validation_spec.rb
|
359
|
+
- spec/spec_helper.rb
|
360
|
+
- spec/support/matchers/have_error_response_matcher.rb
|
360
361
|
- spec/support/matchers/have_in_message_matcher.rb
|
361
362
|
- spec/support/matchers/have_success_response_matcher.rb
|
362
|
-
- spec/support/matchers/have_error_response_matcher.rb
|