Sha256: a8860cbe6d24c0b1b10dc4a930cd7e05e82bb20985dbced8c604ddd29c471636
Contents?: true
Size: 1.06 KB
Versions: 15
Compression:
Stored size: 1.06 KB
Contents
module RailsConnector module Migrations # CMS Migrations can alter the structure and content of the CMS and allow # other developers to simultaneously apply changes. Migrations provide a set # of methods to create, update or delete CMS objects, attributes and object # classes. # # @example Simple Migration # # class CreateTestAttribute < RailsConnector::Migrations::Migration # def up # create_attribute(:name => 'test', :type => 'string') # end # end class Migration include MigrationDsl attr_accessor :name attr_accessor :version def initialize(name, version) @name = name @version = version.to_i end def migrate announce 'migrating' time = Benchmark.measure { up } announce 'migrated (%.4fs)' % time.real; puts end private def announce(message) text = "#{version} #{name}: #{message}" length = [0, 75 - text.length].max puts('== %s %s' % [text, '=' * length]) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems