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: 52dfb62300b9cd894eb0c790f4aed070d537f66e
4
- data.tar.gz: 8d162a39add6eabc1c96c3ab8f9699b7502f429f
3
+ metadata.gz: 0186f917aedde0df96b6f5691bbeaf4ffd186d31
4
+ data.tar.gz: b98f2b08e8316181f8d800e99ba54b299d07d398
5
5
  SHA512:
6
- metadata.gz: 4a8dd6e0e7f172aebb653f2e1016c4df724c8db0cc9a3499ee49189dde2d0f3073597e2457add8534a766074673c6fe7468fca1722fc9186e5d36cc86fd8e86f
7
- data.tar.gz: 798aaecae287b2a3481b887ecbfa68dc8bf952536263c38d11c5ce89e38df9162c23c6b755470e6acfa4bc531d1e33cf43846768e24d0383978b10c698b22e99
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
- type: <%= response_type(action_name) %>
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(action_name)
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.beta1'
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.beta1
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-09-16 00:00:00.000000000 Z
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.5
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.5
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/spec_helper.rb
319
- - spec/functional/empty_resource_spec.rb
320
- - spec/functional/type_validation_spec.rb
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/no_resources/definitions/representations.yml
337
- - spec/functional/no_resources/definitions/messages.yml
338
- - spec/functional/no_resources/definitions/service.yml
339
- - spec/functional/no_resources/services/no_resources.rb
340
- - spec/functional/filters_spec.rb
341
- - spec/functional/filters/resources/users.rb
342
- - spec/functional/filters/models/user.rb
343
- - spec/functional/filters/exceptions/user_errors.rb
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/empty_resource/resources/users.rb
351
- - spec/functional/empty_resource/definitions/users/operations.yml
352
- - spec/functional/empty_resource/definitions/representations.yml
353
- - spec/functional/empty_resource/definitions/messages.yml
354
- - spec/functional/empty_resource/definitions/service.yml
355
- - spec/functional/empty_resource/services/empty_resource.rb
356
- - spec/functional/basic_spec.rb
357
- - spec/angus/request_handler_spec.rb
358
- - spec/angus/middleware/exception_handler_spec.rb
359
- - spec/angus/rspec/examples/describe_errors_spec.rb
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