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

Version Path
card-1.92.2 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.92.1 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.92 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.91 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.21.0 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.20.4 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.20.3 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.20.2 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.20.1 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.20.0 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.19.6 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.19.5 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.19.4 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.19.3 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.19.2 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.19.1 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb
card-1.19.0 db/migrate_core_cards/20130920214038_jsonize_tinymce.rb