Sha256: a8c34b7f45ad09380862db7009b32b317829d1f44c6e7ca7900a875525788fa1
Contents?: true
Size: 392 Bytes
Versions: 7
Compression:
Stored size: 392 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
7 entries across 7 versions & 1 rubygems