12
12
gem "activesupport" , :require => [ "active_support/core_ext/hash" , "active_support/core_ext/string/inflections" ]
13
13
end
14
14
15
- SORT_ORDER = %w[ name description return_type deprecated args ]
15
+ SORT_ORDER = %w[ name description return_type return_description deprecated args ]
16
16
17
17
BUILD_DIR = Pathname . new ( "build/" )
18
18
SRC_DIR = Pathname . new ( "src/" )
25
25
globals_replacements = extra_docs [ "globals_replacements" ]
26
26
globals_deprecated_regex = Regexp . new ( extra_docs [ "globals_deprecated_regex" ] )
27
27
globals_optional_regex = Regexp . new ( extra_docs [ "globals_optional_regex" ] )
28
+ globals_type_description_regex = Regexp . new ( extra_docs [ "globals_type_description_regex" ] )
28
29
29
30
class ReturnTypes
30
31
def initialize ( )
@@ -178,7 +179,12 @@ def get_argument_type(arg, data)
178
179
return_type = rettypes . get_return_type ( data [ "name" ] , data )
179
180
data [ "return_type" ] = return_type unless return_type . nil?
180
181
end
181
- unless data . key? "return_type"
182
+ if data . key? "return_type"
183
+ if match = data [ "return_type" ] . match ( globals_type_description_regex )
184
+ data [ "return_type" ] = match [ 1 ]
185
+ data [ "return_description" ] = match [ 2 ]
186
+ end
187
+ else
182
188
puts "#{ global } .#{ name } : No return type"
183
189
end
184
190
data [ "deprecated" ] = true if !data . key? ( "deprecated" ) && data [ "name" ] . match? ( globals_deprecated_regex )
@@ -203,6 +209,13 @@ def get_argument_type(arg, data)
203
209
argument [ "type" ] ||= type_info
204
210
end
205
211
212
+ if argument . key? "type"
213
+ if match = argument [ "type" ] . match ( globals_type_description_regex )
214
+ argument [ "type" ] = match [ 1 ]
215
+ argument [ "type_description" ] = match [ 2 ]
216
+ end
217
+ end
218
+
206
219
if !argument . key? ( "type" ) && argument [ "name" ] != "..."
207
220
puts "#{ global } .#{ name } : Type of argument #{ argument . inspect } unknown"
208
221
end
0 commit comments