Class: CaTissue::CLI::Migrate

Inherits:
Command
  • Object
show all
Defined in:
lib/catissue/cli/migrate.rb

Constant Summary collapse

SPECS =

The migration option specifications.

The :unique option ensures that the migrated objects do not conflict with existing or future objects. This is used for testing a migration dry run. It is recommended that the trial run protocol is set to a test protocol as well.

[
  [:input, 'INPUT', 'Source file to migrate'],
  [:target, '-t', '--target CLASS', 'Migration target class'],
  [:mapping, '-m', '--mapping FILE[,FILE...]', Array, 'The input field => caTissue attribute mapping file(s)'],
  [:filters, '--filters FILE[,FILE...]', Array, 'The input value => caTissue value mapping file(s)'],
  [:defaults, '-d', '--defaults FILE[,FILE...]', Array, 'The caTissue attribute default value file(s)'],
  [:shims, '-s', '--shims FILE[,FILE...]', Array, 'Migration customization shim file(s) to load'],
  [:controlled_values, '-k', '--controlled_values', 'Enable controlled value lookup'],
  [:bad, '-b', '--bad FILE', 'Write each invalid record to the given file and continue migration'],
  [:extract, '-x', '--extract FILE', 'Call the migration target extract method to write to the given extract'],
  [:create, '-c', '--create', 'Always create the migration target'],
  [:unique, '-u', '--unique', 'Make the migrated objects unique for testing'],
  [:from, '--from N', Integer, 'Starting input record'],
  [:to, '--to N', Integer, 'Ending input record'],
]

Instance Method Summary collapse

Constructor Details

#initialize(specs = [], &block) ⇒ Migrate

Creates a CaTissue::CLI::Migrate command with the SPECS command line specifications as well as the optional specifications parameter.



34
35
36
# File 'lib/catissue/cli/migrate.rb', line 34

def initialize(specs=[], &block)
  super(specs.concat(SPECS)) { |opts| migrate(opts, &block) }
end