Sha256: c52722c78357dfe85ec190170ad73ca943d569b598c6aefa4acc0d15d591ee34

Contents?: true

Size: 1.66 KB

Versions: 45

Compression:

Stored size: 1.66 KB

Contents

# -*- encoding : utf-8 -*-

class BootswatchThemes < Card::Migration::Core
  def up
    themeless = Card.fetch "themeless bootstrap skin", new: { type_code: :skin }
    themeless.update_attributes! content: "[[style: jquery-ui-smoothness]]\n[[style: cards]]\n[[style: right sidebar]]\n[[style: bootstrap cards]]"
    bs = Card[:bootstrap_css]
    bs.update_attributes! codename: nil
    bs.delete!

    Card.create! name: "bootswatch shared", type_code: :scss, codename: "bootswatch_shared"
    Card.create! name: "bootswatch theme+*right+*structure", type_id: Card::ScssID, content: "{{_left+variables}}{{bootswatch shared}}{{_left+style}}"
    %w(bootstrap_default cerulean cosmo cyborg darkly flatly journal lumen paper readable sandstone simplex slate spacelab superhero united yeti).each do |theme_name|
      path = data_path "themes/#{theme_name}"
      theme = Card.fetch "#{theme_name} skin"
      if theme
        theme.update_attributes! type_id: Card::SkinID, content: "[[themeless bootstrap skin]]\n[[+bootswatch theme]]", subcards: {
          "+variables" => { type_id: Card::ScssID, content: File.read(File.join path, "_variables.scss") },
          "+style"     => { type_id: Card::ScssID, content: File.read(File.join path, "_bootswatch.scss") }
        }
      else
        Card.create! name: "#{theme_name.sub('_', ' ')} skin", type_id: Card::SkinID, content: "[[themeless bootstrap skin]]\n[[+bootswatch theme]]", subcards: {
          "+variables" => { type_id: Card::ScssID, content: File.read(File.join path, "_variables.scss") },
          "+style"     => { type_id: Card::ScssID, content: File.read(File.join path, "_bootswatch.scss") }
        }
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
card-1.96.7 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.96.6 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.96.5 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.96.4 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.96.3 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.96.2 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.96.1 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.96.0 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.95.3 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.95.2 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.95.1 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.95.0 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.94.1 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.94.0 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.93.13 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.93.12 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.93.11 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.93.10 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.93.9 db/migrate_core_cards/20150326205655_bootswatch_themes.rb
card-1.93.8 db/migrate_core_cards/20150326205655_bootswatch_themes.rb