Sha256: 1e4697c14b655a399e8e8b98eef8773e59d23d325acc061e787325af23296735
Contents?: true
Size: 397 Bytes
Versions: 43
Compression:
Stored size: 397 Bytes
Contents
# -*- encoding : utf-8 -*- class JsonizeTinymce < Card::Migration::Core def up card = Card[:tiny_mce] cleaned_rows = card.db_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
43 entries across 43 versions & 1 rubygems