FIX: Ning json can have square brackets instead of commas

This commit is contained in:
Neil Lalonde 2015-02-06 13:47:01 -05:00
parent 9584990477
commit ef482591bf
1 changed files with 5 additions and 0 deletions

View File

@ -51,7 +51,12 @@ class ImportScripts::Ning < ImportScripts::Base
def repair_json(arg)
arg.gsub!(/^\(/, "") # content of file is surround by ( )
arg.gsub!(/\)$/, "")
arg.gsub!(/\}\{/, "},{") # missing commas sometimes!
arg.gsub!("}]{", "},{") # surprise square brackets
arg.gsub!("}[{", "},{") # :troll:
arg
end