module Cassie::Schema::Migration::DSL::Announcing

Public Instance Methods

announce(msg) click to toggle source
# File lib/cassie/schema/migration/dsl/announcing.rb, line 20
def announce(msg)
  announcing_stream << msg + "\n"
end
announcing_stream() click to toggle source
# File lib/cassie/schema/migration/dsl/announcing.rb, line 16
def announcing_stream
  self.class.announcing_stream
end

Protected Instance Methods

announce_migration(message) click to toggle source

Generates output labeled with name of migration and a line that goes up to 75 characters long in the terminal

# File lib/cassie/schema/migration/dsl/announcing.rb, line 34
def announce_migration(message)
  text = "#{name}: #{message}"
  length = [0, 75 - text.length].max

  announce("== %s %s" % [text, "=" * length])
end
announce_operation(message) click to toggle source
# File lib/cassie/schema/migration/dsl/announcing.rb, line 41
def announce_operation(message)
  announce("      -> " + message)
end
announce_suboperation(message) click to toggle source
# File lib/cassie/schema/migration/dsl/announcing.rb, line 45
def announce_suboperation(message)
  announce("        > " + message)
end
name() click to toggle source
# File lib/cassie/schema/migration/dsl/announcing.rb, line 49
def name
  version.description || version.number
end