Sha256: d0d5828689fde8b6c034bd7353f0ef4abe0cb82b08762f5f93bd7a6a5eb2608d
Contents?: true
Size: 391 Bytes
Versions: 17
Compression:
Stored size: 391 Bytes
Contents
# -*- encoding : utf-8 -*- class JsonizeTinymce < Card::CoreMigration def up card = Card[:tiny_mce] cleaned_rows = card.content.strip.split( /\s*\,\s+/ ).map do |row| key, val = row.split /\s*\:\s*/ val.gsub! /\"\s*\+\s*\"/, '' val.gsub! "'", '"' %("#{key}":#{val}) end card.content = %({\n#{ cleaned_rows.join ",\n" }\n}) card.save! end end
Version data entries
17 entries across 17 versions & 1 rubygems