Sha256: c01a69cb58490fb4470627b903ae64d00549e7a82883b406b9a7674244c2e03c
Contents?: true
Size: 917 Bytes
Versions: 117
Compression:
Stored size: 917 Bytes
Contents
module Scrivito module Migrations class Migration def self.next_migration_number(current_migration_number) migration_number = current_migration_number + 1 [Time.now.utc.strftime('%Y%m%d%H%M%S'), '%.14d' % migration_number].max end attr_accessor :name attr_accessor :version attr_accessor :filename attr_accessor :scope def initialize(name, version, filename, scope) @name = name @version = version.to_i @filename = filename @scope = scope.to_s 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
117 entries across 117 versions & 1 rubygems