@@ -168,31 +168,6 @@ def extract_av_data_from_rst
168
168
av_data
169
169
end
170
170
171
- private
172
-
173
- def extract_metadata_from_line ( line )
174
- key , value = line . strip . split ( ': ' , 2 )
175
- [ key [ 1 ..] . to_sym , value ] if key && value
176
- end
177
-
178
- def extract_inlineav_name_from_line ( line )
179
- match = line . match ( /\. \. inlineav:: (\w +)/ )
180
- match [ 1 ] if match
181
- end
182
-
183
- def extract_avembed_data_from_line ( line )
184
- match = line . match ( /\. \. avembed:: Exercises\/ \w +\/ (\w +)\. html/ )
185
- match [ 1 ] if match
186
- end
187
-
188
- # helper method for extract_av_data_from_rst(), safely attempts to parse a JSON string, returning an empty hash as fallback
189
- def parse_json_options ( json_str )
190
- return { } if json_str . nil? # Ensures nil input returns an empty hash
191
- JSON . parse ( json_str || '{}' )
192
- rescue JSON ::ParserError
193
- { }
194
- end
195
-
196
171
# --------------------------------------------------------------------------------
197
172
198
173
# FIXME: shouldn't this method be removed? It appears to be out-dated?
@@ -326,4 +301,29 @@ def tree_view?
326
301
return self . options . include? tree_view
327
302
end
328
303
304
+ private
305
+
306
+ def extract_metadata_from_line ( line )
307
+ key , value = line . strip . split ( ': ' , 2 )
308
+ [ key [ 1 ..] . to_sym , value ] if key && value
309
+ end
310
+
311
+ def extract_inlineav_name_from_line ( line )
312
+ match = line . match ( /\. \. inlineav:: (\w +)/ )
313
+ match [ 1 ] if match
314
+ end
315
+
316
+ def extract_avembed_data_from_line ( line )
317
+ match = line . match ( /\. \. avembed:: Exercises\/ \w +\/ (\w +)\. html/ )
318
+ match [ 1 ] if match
319
+ end
320
+
321
+ # helper method for extract_av_data_from_rst(), safely attempts to parse a JSON string, returning an empty hash as fallback
322
+ def parse_json_options ( json_str )
323
+ return { } if json_str . nil? # Ensures nil input returns an empty hash
324
+ JSON . parse ( json_str || '{}' )
325
+ rescue JSON ::ParserError
326
+ { }
327
+ end
328
+
329
329
end
0 commit comments