angus-sdoc 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,9 +19,9 @@ module Angus
19
19
  # @return [String] the path of the operation.
20
20
  attr_accessor :path
21
21
 
22
- # @!attribute [rw] method
22
+ # @!attribute [rw] http_method
23
23
  # @return [String] the HTTP method of the operation.
24
- attr_accessor :method
24
+ attr_accessor :http_method
25
25
 
26
26
  # @!attribute [rw] messages
27
27
  # @return [Hash<String, Message>] the messages associated with the operation.
@@ -11,9 +11,9 @@ module Angus
11
11
  # @return [String] the path of the operation.
12
12
  attr_accessor :path
13
13
 
14
- # @!attribute [rw] method
14
+ # @!attribute [rw] http_method
15
15
  # @return [String] the HTTP method of the operation.
16
- attr_accessor :method
16
+ attr_accessor :http_method
17
17
 
18
18
  # @!attribute [rw] service_name
19
19
  # @return [String] the service name of the operation.
@@ -52,14 +52,12 @@ module Angus
52
52
  # Possible values are the *_LEVEL constants from {Message}
53
53
  #
54
54
  # @return [Message] the message or nil if no one matches.
55
- def message(key, level)
56
- msg = nil
57
-
58
- @operations.find do |operation|
59
- msg = operation.message(key.to_s, level)
55
+ def message(key, level = nil)
56
+ message = self.messages.find do |message_key, message|
57
+ message_key == key && (!level || message.level.downcase == level)
60
58
  end
61
59
 
62
- msg
60
+ message.last if message
63
61
  end
64
62
 
65
63
  # Merge the following definitions:
@@ -156,7 +156,7 @@ module Angus
156
156
  proxy_op.code_name = code_name
157
157
 
158
158
  proxy_op.path = fields['path']
159
- proxy_op.method = fields['method']
159
+ proxy_op.http_method = fields['method']
160
160
  proxy_op.service_name = fields['service']
161
161
 
162
162
  proxy_op
@@ -221,7 +221,7 @@ module Angus
221
221
  operation.code_name = code_name
222
222
  operation.description = op_metadata['description']
223
223
  operation.path = op_metadata['path']
224
- operation.method = op_metadata['method']
224
+ operation.http_method = op_metadata['method']
225
225
 
226
226
  op_metadata['uri'] ||= []
227
227
  operation.uri_elements = op_metadata['uri'].map do |element_hash|
@@ -91,7 +91,7 @@ module Angus
91
91
  :name => operation_definition.name,
92
92
  :description => operation_definition.description,
93
93
  :path => operation_definition.path,
94
- :method => operation_definition.method
94
+ :method => operation_definition.http_method
95
95
  }
96
96
 
97
97
  if operation_definition.uri_elements && !operation_definition.uri_elements.empty?
@@ -140,7 +140,7 @@ module Angus
140
140
  def proxy_operation_for_json(proxy_operation_definition)
141
141
  {
142
142
  :path => proxy_operation_definition.path,
143
- :method => proxy_operation_definition.method,
143
+ :method => proxy_operation_definition.http_method,
144
144
  :service => proxy_operation_definition.service_name
145
145
  }
146
146
  end
@@ -77,7 +77,7 @@
77
77
  <tbody>
78
78
  <tr>
79
79
  <td>M&eacute;todo</td>
80
- <td><%= operation.method %></td>
80
+ <td><%= operation.http_method %></td>
81
81
  </tr>
82
82
  <tr>
83
83
  <td>URI</td>
@@ -256,7 +256,7 @@
256
256
  <td>
257
257
  <%= operation.code_name %>
258
258
  </td>
259
- <td><%= operation.method %></td>
259
+ <td><%= operation.http_method %></td>
260
260
  <td><%= operation.path %></td>
261
261
  <td><%= operation.service_name %></td>
262
262
  </tr>
@@ -1,5 +1,5 @@
1
1
  module Angus
2
2
  module SDoc
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,186 +1,176 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angus-sdoc
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.3
4
+ version: 0.0.4
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Pablo Ifran
9
9
  - Adrian Gomez
10
10
  - Gianfranco Zas
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-11-01 00:00:00.000000000 Z
14
+ date: 2013-11-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
18
- version_requirements: !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
19
+ none: false
19
20
  requirements:
20
- - - ">="
21
+ - - ! '>='
21
22
  - !ruby/object:Gem::Version
22
- version: !binary |-
23
- MA==
23
+ version: '0'
24
+ type: :development
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
24
27
  none: false
25
- requirement: !ruby/object:Gem::Requirement
26
28
  requirements:
27
- - - ">="
29
+ - - ! '>='
28
30
  - !ruby/object:Gem::Version
29
- version: !binary |-
30
- MA==
31
- none: false
32
- prerelease: false
33
- type: :development
31
+ version: '0'
34
32
  - !ruby/object:Gem::Dependency
35
33
  name: yard
36
- version_requirements: !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
37
36
  requirements:
38
37
  - - '='
39
38
  - !ruby/object:Gem::Version
40
39
  version: 0.8.7
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
41
43
  none: false
42
- requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - '='
45
46
  - !ruby/object:Gem::Version
46
47
  version: 0.8.7
47
- none: false
48
- prerelease: false
49
- type: :development
50
48
  - !ruby/object:Gem::Dependency
51
49
  name: rspec
52
- version_requirements: !ruby/object:Gem::Requirement
50
+ requirement: !ruby/object:Gem::Requirement
51
+ none: false
53
52
  requirements:
54
- - - "~>"
53
+ - - ~>
55
54
  - !ruby/object:Gem::Version
56
55
  version: '2.12'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
57
59
  none: false
58
- requirement: !ruby/object:Gem::Requirement
59
60
  requirements:
60
- - - "~>"
61
+ - - ~>
61
62
  - !ruby/object:Gem::Version
62
63
  version: '2.12'
63
- none: false
64
- prerelease: false
65
- type: :development
66
64
  - !ruby/object:Gem::Dependency
67
65
  name: factory_girl
68
- version_requirements: !ruby/object:Gem::Requirement
66
+ requirement: !ruby/object:Gem::Requirement
67
+ none: false
69
68
  requirements:
70
- - - ">="
69
+ - - ! '>='
71
70
  - !ruby/object:Gem::Version
72
- version: !binary |-
73
- MA==
71
+ version: '0'
72
+ type: :development
73
+ prerelease: false
74
+ version_requirements: !ruby/object:Gem::Requirement
74
75
  none: false
75
- requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ">="
77
+ - - ! '>='
78
78
  - !ruby/object:Gem::Version
79
- version: !binary |-
80
- MA==
81
- none: false
82
- prerelease: false
83
- type: :development
79
+ version: '0'
84
80
  - !ruby/object:Gem::Dependency
85
81
  name: json_expressions
86
- version_requirements: !ruby/object:Gem::Requirement
82
+ requirement: !ruby/object:Gem::Requirement
83
+ none: false
87
84
  requirements:
88
- - - ">="
85
+ - - ! '>='
89
86
  - !ruby/object:Gem::Version
90
- version: !binary |-
91
- MA==
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
92
91
  none: false
93
- requirement: !ruby/object:Gem::Requirement
94
92
  requirements:
95
- - - ">="
93
+ - - ! '>='
96
94
  - !ruby/object:Gem::Version
97
- version: !binary |-
98
- MA==
99
- none: false
100
- prerelease: false
101
- type: :development
95
+ version: '0'
102
96
  - !ruby/object:Gem::Dependency
103
97
  name: simplecov
104
- version_requirements: !ruby/object:Gem::Requirement
98
+ requirement: !ruby/object:Gem::Requirement
99
+ none: false
105
100
  requirements:
106
101
  - - '='
107
102
  - !ruby/object:Gem::Version
108
103
  version: 0.7.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
109
107
  none: false
110
- requirement: !ruby/object:Gem::Requirement
111
108
  requirements:
112
109
  - - '='
113
110
  - !ruby/object:Gem::Version
114
111
  version: 0.7.1
115
- none: false
116
- prerelease: false
117
- type: :development
118
112
  - !ruby/object:Gem::Dependency
119
113
  name: simplecov-rcov
120
- version_requirements: !ruby/object:Gem::Requirement
114
+ requirement: !ruby/object:Gem::Requirement
115
+ none: false
121
116
  requirements:
122
117
  - - '='
123
118
  - !ruby/object:Gem::Version
124
119
  version: 0.2.3
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
125
123
  none: false
126
- requirement: !ruby/object:Gem::Requirement
127
124
  requirements:
128
125
  - - '='
129
126
  - !ruby/object:Gem::Version
130
127
  version: 0.2.3
131
- none: false
132
- prerelease: false
133
- type: :development
134
128
  - !ruby/object:Gem::Dependency
135
129
  name: simplecov-rcov-text
136
- version_requirements: !ruby/object:Gem::Requirement
130
+ requirement: !ruby/object:Gem::Requirement
131
+ none: false
137
132
  requirements:
138
133
  - - '='
139
134
  - !ruby/object:Gem::Version
140
135
  version: 0.0.2
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
141
139
  none: false
142
- requirement: !ruby/object:Gem::Requirement
143
140
  requirements:
144
141
  - - '='
145
142
  - !ruby/object:Gem::Version
146
143
  version: 0.0.2
147
- none: false
148
- prerelease: false
149
- type: :development
150
144
  - !ruby/object:Gem::Dependency
151
145
  name: ci_reporter
152
- version_requirements: !ruby/object:Gem::Requirement
146
+ requirement: !ruby/object:Gem::Requirement
147
+ none: false
153
148
  requirements:
154
- - - ">="
149
+ - - ! '>='
155
150
  - !ruby/object:Gem::Version
156
- version: !binary |-
157
- MA==
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
158
155
  none: false
159
- requirement: !ruby/object:Gem::Requirement
160
156
  requirements:
161
- - - ">="
157
+ - - ! '>='
162
158
  - !ruby/object:Gem::Version
163
- version: !binary |-
164
- MA==
165
- none: false
166
- prerelease: false
167
- type: :development
168
- description: |2
169
- Used to read the documentation of a service built in angus (but also is able to read any kind
170
- of documentation that follow the angus structure), and generate an object representation of
171
- that documentation.
159
+ version: '0'
160
+ description: ! " Used to read the documentation of a service built in angus (but
161
+ also is able to read any kind\n of documentation that follow the angus structure),
162
+ and generate an object representation of\n that documentation.\n"
172
163
  email:
173
164
  - angus@moove-it.com
174
165
  executables: []
175
166
  extensions: []
176
167
  extra_rdoc_files: []
177
168
  files:
169
+ - lib/angus/exceptions/invalid_service_message.rb
170
+ - lib/angus/exceptions/base.rb
178
171
  - lib/angus/definitions_utils.rb
179
172
  - lib/angus/definitions_reader.rb
180
173
  - lib/angus/sdoc.rb
181
- - lib/angus/base.rb
182
- - lib/angus/exceptions/invalid_service_message.rb
183
- - lib/angus/exceptions/base.rb
184
174
  - lib/angus/definitions/proxy_operation.rb
185
175
  - lib/angus/definitions/representation.rb
186
176
  - lib/angus/definitions/glossary_term.rb
@@ -193,37 +183,36 @@ files:
193
183
  - lib/angus/definitions/request_element.rb
194
184
  - lib/angus/definitions/base.rb
195
185
  - lib/angus/definitions/service.rb
186
+ - lib/angus/base.rb
187
+ - lib/angus/sdoc/templates/styles.erb
188
+ - lib/angus/sdoc/templates/doc.erb
196
189
  - lib/angus/sdoc/version.rb
197
190
  - lib/angus/sdoc/json_formatter.rb
198
191
  - lib/angus/sdoc/html_formatter.rb
199
- - lib/angus/sdoc/templates/styles.erb
200
- - lib/angus/sdoc/templates/doc.erb
201
192
  homepage: http://www.moove-it.com/angus
202
193
  licenses:
203
194
  - MIT
204
- post_install_message:
195
+ post_install_message:
205
196
  rdoc_options: []
206
197
  require_paths:
207
198
  - lib
208
199
  required_ruby_version: !ruby/object:Gem::Requirement
200
+ none: false
209
201
  requirements:
210
- - - ">="
202
+ - - ! '>='
211
203
  - !ruby/object:Gem::Version
212
- version: !binary |-
213
- MA==
214
- none: false
204
+ version: '0'
215
205
  required_rubygems_version: !ruby/object:Gem::Requirement
206
+ none: false
216
207
  requirements:
217
- - - ">="
208
+ - - ! '>='
218
209
  - !ruby/object:Gem::Version
219
- version: !binary |-
220
- MA==
221
- none: false
210
+ version: '0'
222
211
  requirements: []
223
- rubyforge_project:
224
- rubygems_version: 1.8.24
225
- signing_key:
212
+ rubyforge_project:
213
+ rubygems_version: 1.8.25
214
+ signing_key:
226
215
  specification_version: 3
227
216
  summary: Read documentation of services built on angus
228
217
  test_files: []
229
- has_rdoc:
218
+ has_rdoc: