Class: Migr8::BaseSkeleton

Inherits:
Object
  • Object
show all
Defined in:
lib/migr8.rb

Instance Method Summary collapse

Instance Method Details

#render(mig, opts = {}) ⇒ Object



596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/migr8.rb', line 596

def render(mig, opts={})
  plain = opts[:plain]
  buf = ""
  buf << "# -*- coding: utf-8 -*-\n"
  buf << "\n"
  buf << "version:     #{mig.version}\n"
  buf << "desc:        #{mig.desc}\n"
  buf << "author:      #{mig.author}\n"
  buf << "vars:\n"
  buf << _section_vars(mig, opts)  unless plain
  buf << "\n"
  buf << "up: |\n"
  buf << _section_up(mig, opts)    unless plain
  buf << "\n"
  buf << "down: |\n"
  buf << _section_down(mig, opts)  unless plain
  buf << "\n"
  return buf
end