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, "-i", "input", "Source file to migrate"],
  [:target, "-t", "--target CLASS", "Migration target class"],
  [:mapping, "-m", "--mapping FILE", "The input field => caTissue attribute mapping file"],
  [:defaults, "-d", "--defaults FILE", "The caTissue attribute => default value mapping file"],
  [:shims, "-s", "--shims FILE[,FILE...]", Array, "Migration customization shim files to load"],
  [:bad, "-b", "--bad FILE", "Write each invalid record to the given file and continue migration"],
  [:unique, "-u", "--unique", "Make the migrated objects unique for testing"],
  [:offset, "-o", "--offset N", Integer, "Number of input records to skip before starting the migration"]
]

Instance Method Summary collapse

Constructor Details

#initialize {|opts| ... } ⇒ Migrate

Creates a CaTissue::CLI::Migrate command with the given standard command line specifications as well as the SPECS command line specifications.

Yields:

  • (opts)

    optional migrator factory

Yield Parameters:

See Also:

  • CaRuby::Command#run


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

def initialize(&factory)
  super(SPECS) { |opts| migrate(opts, &factory) }
end