Sha256: 630798d3cbd7c820c29b7b3200f53f25fd715ec73f73c9786f152eedc26012a3
Contents?: true
Size: 394 Bytes
Versions: 17
Compression:
Stored size: 394 Bytes
Contents
# -*- encoding : utf-8 -*- class JsonizeTinymce < Card::Migration::Core 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