@@ -136,9 +136,9 @@ def validate_configuration
136136 def extract_av_data_from_rst
137137 av_data = { }
138138 parsed_options = parse_json_options ( self . options )
139- lang = parsed_options [ 'lang' ] || 'en'
139+ lang = parsed_options [ 'lang' ] || 'en'
140140 rst_folder = File . join ( 'public' , 'OpenDSA' , 'RST' , lang )
141-
141+
142142 # Check if rst_folder to prevent Dir.glob from failing
143143 return av_data unless Dir . exist? ( rst_folder )
144144
@@ -166,29 +166,8 @@ def extract_av_data_from_rst
166166 av_data
167167 end
168168
169- def get_clone ( currentUser )
170- return clone ( currentUser )
171- end
172- private
173-
174- def extract_metadata_from_line ( line )
175- key , value = line . strip . split ( ': ' , 2 )
176- [ key [ 1 ..] . to_sym , value ] if key && value
177- end
178-
179- def extract_inlineav_name_from_line ( line )
180- match = line . match ( /\. \. inlineav:: (\w +)/ )
181- match [ 1 ] if match # Returns the inlineav short name or nil if no match
182- end
183-
184- def extract_avembed_data_from_line ( line )
185- match = line . match ( /\. \. avembed:: Exercises\/ \w +\/ (\w +)\. html/ )
186- match [ 1 ] if match # Returns the 3rd level word or nil if no match
187- end
188-
189-
190169
191- # --------------------------------------------------------------------------------
170+ # --------------------------------------------------------------------------------
192171 # FIXME: shouldn't this method be removed? It appears to be out-dated?
193172 # FIXME: the real code is now in views/inst_books/show.json.builder
194173 def to_builder
@@ -330,20 +309,20 @@ def extract_metadata_from_line(line)
330309
331310 def extract_inlineav_name_from_line ( line )
332311 match = line . match ( /\. \. inlineav:: (\w +)/ )
333- match [ 1 ] if match
312+ match [ 1 ] if match
334313 end
335314
336315 def extract_avembed_data_from_line ( line )
337316 match = line . match ( /\. \. avembed:: Exercises\/ \w +\/ (\w +)\. html/ )
338- match [ 1 ] if match
317+ match [ 1 ] if match
339318 end
340319
341320 # helper method for extract_av_data_from_rst(), safely attempts to parse a JSON string, returning an empty hash as fallback
342321 def parse_json_options ( json_str )
343322 return { } if json_str . nil? # Ensures nil input returns an empty hash
344- JSON . parse ( json_str || '{}' )
323+ JSON . parse ( json_str || '{}' )
345324 rescue JSON ::ParserError
346- { }
325+ { }
347326 end
348327
349328end
0 commit comments