Class: Migr8::Actions::ShowAction

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

Constant Summary collapse

NAME =
"show"
DESC =
"show migration file with expanding variables"
OPTS =
["-x:  load values of migration from history table in DB"]
ARGS =
"[version]"

Instance Method Summary collapse

Methods inherited from Action

#cmdopterr, find_by_name, #get_command, inherited, #parse, #parser, #repository, #short_usage, subclasses, #usage

Instance Method Details

#run(options, args) ⇒ Object



1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
# File 'lib/migr8.rb', line 1609

def run(options, args)
  load_from_db = options['x']
  args.length <= 1  or
    raise cmdopterr("#{NAME}: too much arguments.")
  version = args.first   # nil when args is empty
  #
  repo = repository()
  op = RepositoryOperation.new(repo)
  _wrap do
    puts op.show(version, load_from_db)
  end
end