angus 0.0.12 → 0.0.13.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/angus/generator/templates/config.ru.erb +2 -2
- data/lib/angus/generator/templates/definitions/messages.yml.erb +1 -1
- data/lib/angus/generator/templates/definitions/operations.yml.erb +14 -10
- data/lib/angus/generator/templates/definitions/service.yml.erb +1 -1
- data/lib/angus/generator/templates/services/service.rb.erb +1 -1
- data/lib/angus/generator/thor/resource.rb +8 -5
- data/lib/angus/version.rb +1 -1
- metadata +37 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52dfb62300b9cd894eb0c790f4aed070d537f66e
|
4
|
+
data.tar.gz: 8d162a39add6eabc1c96c3ab8f9699b7502f429f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a8dd6e0e7f172aebb653f2e1016c4df724c8db0cc9a3499ee49189dde2d0f3073597e2457add8534a766074673c6fe7468fca1722fc9186e5d36cc86fd8e86f
|
7
|
+
data.tar.gz: 798aaecae287b2a3481b887ecbfa68dc8bf952536263c38d11c5ce89e38df9162c23c6b755470e6acfa4bc531d1e33cf43846768e24d0383978b10c698b22e99
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
$LOAD_PATH << (File.dirname(__FILE__))
|
2
2
|
|
3
3
|
require 'bundler'
|
4
4
|
|
@@ -7,4 +7,4 @@ Bundler.setup
|
|
7
7
|
require 'angus'
|
8
8
|
require 'services/<%= underscore(app_name) %>'
|
9
9
|
|
10
|
-
run <%= classify(name) %>.new
|
10
|
+
run <%= classify(underscore(name)) %>.new
|
@@ -1,26 +1,30 @@
|
|
1
|
-
<% unless actions.nil?
|
2
|
-
<% actions.
|
1
|
+
<% unless actions.nil? -%>
|
2
|
+
<% actions.each_with_index do |action_name, index| -%>
|
3
|
+
<% unless index.zero? -%>
|
4
|
+
|
5
|
+
<% end -%>
|
3
6
|
<%= action_name %>:
|
4
7
|
name: '<%= action_name %>'
|
5
8
|
description: '<%= action_description(action_name) %>'
|
6
9
|
path: '<%= action_path(action_name) %>'
|
7
10
|
method: '<%= action_method(action_name) %>'
|
8
|
-
<%
|
11
|
+
<% if action_has_id_in_path?(action_name) -%>
|
12
|
+
|
9
13
|
uri:
|
10
|
-
|
11
|
-
|
12
|
-
<% end
|
14
|
+
- element: id
|
15
|
+
description: <%= resource_name %> id.
|
16
|
+
<% end -%>
|
13
17
|
|
14
18
|
response:
|
15
19
|
- element: '<%= response_element(action_name) %>'
|
16
20
|
description: '<%= response_description(action_name) %>'
|
17
21
|
required: <%= response_required(action_name) %>
|
18
22
|
type: <%= response_type(action_name) %>
|
23
|
+
<% if is_demo? -%>
|
19
24
|
|
20
|
-
<% if is_demo? %>
|
21
25
|
messages:
|
22
26
|
- key: <%= message_key(action_name) %>
|
23
27
|
description: '<%= message_description(action_name) %>'
|
24
|
-
<% end
|
25
|
-
<% end
|
26
|
-
<% end
|
28
|
+
<% end -%>
|
29
|
+
<% end -%>
|
30
|
+
<% end -%>
|
@@ -65,11 +65,10 @@ class Thor
|
|
65
65
|
if is_demo?
|
66
66
|
'/users'
|
67
67
|
elsif is_scaffold?
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
"#{underscore(resource_name)}"
|
68
|
+
if action_has_id_in_path?(action_name)
|
69
|
+
"/#{underscore(resource_name)}/:id"
|
70
|
+
else
|
71
|
+
"/#{underscore(resource_name)}"
|
73
72
|
end
|
74
73
|
end
|
75
74
|
end
|
@@ -91,6 +90,10 @@ class Thor
|
|
91
90
|
end
|
92
91
|
end
|
93
92
|
|
93
|
+
def action_has_id_in_path?(action_name)
|
94
|
+
%w[show update destroy].include?(action_name)
|
95
|
+
end
|
96
|
+
|
94
97
|
def response_element(action_name)
|
95
98
|
'users' if is_demo?
|
96
99
|
end
|
data/lib/angus/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.13.beta1
|
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-09-16 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: thor
|
@@ -305,9 +305,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
305
305
|
version: '0'
|
306
306
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
307
307
|
requirements:
|
308
|
-
- - "
|
308
|
+
- - ">"
|
309
309
|
- !ruby/object:Gem::Version
|
310
|
-
version:
|
310
|
+
version: 1.3.1
|
311
311
|
requirements: []
|
312
312
|
rubyforge_project:
|
313
313
|
rubygems_version: 2.2.2
|
@@ -315,48 +315,48 @@ signing_key:
|
|
315
315
|
specification_version: 4
|
316
316
|
summary: A web services summary
|
317
317
|
test_files:
|
318
|
-
- spec/support/matchers/have_in_message_matcher.rb
|
319
|
-
- spec/support/matchers/have_error_response_matcher.rb
|
320
|
-
- spec/support/matchers/have_success_response_matcher.rb
|
321
318
|
- spec/spec_helper.rb
|
322
|
-
- spec/angus/request_handler_spec.rb
|
323
|
-
- spec/angus/middleware/exception_handler_spec.rb
|
324
|
-
- spec/angus/rspec/examples/describe_errors_spec.rb
|
325
|
-
- spec/functional/filters/exceptions/user_errors.rb
|
326
|
-
- spec/functional/filters/models/user.rb
|
327
|
-
- spec/functional/filters/resources/users.rb
|
328
|
-
- spec/functional/filters/services/filters.rb
|
329
|
-
- spec/functional/filters/definitions/representations.yml
|
330
|
-
- spec/functional/filters/definitions/users/operations.yml
|
331
|
-
- spec/functional/filters/definitions/messages.yml
|
332
|
-
- spec/functional/filters/definitions/service.yml
|
333
|
-
- spec/functional/no_resources_spec.rb
|
334
319
|
- spec/functional/empty_resource_spec.rb
|
335
|
-
- spec/functional/
|
336
|
-
- spec/functional/
|
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
|
337
328
|
- spec/functional/basic/resources/users.rb
|
338
|
-
- spec/functional/basic/
|
339
|
-
- spec/functional/basic/
|
329
|
+
- spec/functional/basic/models/user.rb
|
330
|
+
- spec/functional/basic/exceptions/user_errors.rb
|
340
331
|
- spec/functional/basic/definitions/users/operations.yml
|
332
|
+
- spec/functional/basic/definitions/representations.yml
|
341
333
|
- spec/functional/basic/definitions/messages.yml
|
342
334
|
- spec/functional/basic/definitions/service.yml
|
335
|
+
- 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
|
343
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
|
346
|
+
- spec/functional/filters/definitions/messages.yml
|
347
|
+
- spec/functional/filters/definitions/service.yml
|
348
|
+
- spec/functional/filters/services/filters.rb
|
349
|
+
- spec/functional/no_resources_spec.rb
|
344
350
|
- spec/functional/empty_resource/resources/users.rb
|
345
|
-
- spec/functional/empty_resource/services/empty_resource.rb
|
346
|
-
- spec/functional/empty_resource/definitions/representations.yml
|
347
351
|
- spec/functional/empty_resource/definitions/users/operations.yml
|
352
|
+
- spec/functional/empty_resource/definitions/representations.yml
|
348
353
|
- spec/functional/empty_resource/definitions/messages.yml
|
349
354
|
- spec/functional/empty_resource/definitions/service.yml
|
350
|
-
- spec/functional/
|
351
|
-
- spec/functional/type_validation/resources/admins.rb
|
352
|
-
- spec/functional/type_validation/services/type_validation.rb
|
353
|
-
- spec/functional/type_validation/definitions/admins/operations.yml
|
354
|
-
- spec/functional/type_validation/definitions/representations.yml
|
355
|
-
- spec/functional/type_validation/definitions/messages.yml
|
356
|
-
- spec/functional/type_validation/definitions/service.yml
|
355
|
+
- spec/functional/empty_resource/services/empty_resource.rb
|
357
356
|
- spec/functional/basic_spec.rb
|
358
|
-
- spec/
|
359
|
-
- spec/
|
360
|
-
- spec/
|
361
|
-
- spec/
|
362
|
-
- spec/
|
357
|
+
- spec/angus/request_handler_spec.rb
|
358
|
+
- spec/angus/middleware/exception_handler_spec.rb
|
359
|
+
- spec/angus/rspec/examples/describe_errors_spec.rb
|
360
|
+
- spec/support/matchers/have_in_message_matcher.rb
|
361
|
+
- spec/support/matchers/have_success_response_matcher.rb
|
362
|
+
- spec/support/matchers/have_error_response_matcher.rb
|