Sha256: c6565b356362b0f0488cb768352118d26644ab84820ad3874e58161c744af729

Contents?: true

Size: 1.75 KB

Versions: 4

Compression:

Stored size: 1.75 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'thor'
require 'master_data_tool'

environment_path = "#{Dir.pwd}/config/environment"
require environment_path

module MasterDataTool
  class CLI < Thor
    option :dry_run, default: true, type: :boolean
    option :verify, default: true, type: :boolean
    option :only_import_tables, default: [], type: :array
    option :only_verify_tables, default: [], type: :array
    option :skip_no_change, default: true, type: :boolean
    desc 'import', 'import'
    def import
      dry_run = options[:dry_run]
      verify = options[:verify]
      only_import_tables = options[:only_import_tables]
      only_verify_tables = options[:only_verify_tables]
      skip_no_change = options[:skip_no_change]

      executor = MasterDataTool::Import::Executor.new(
        dry_run: dry_run,
        verify: verify,
        only_import_tables: only_import_tables,
        only_verify_tables: only_verify_tables,
        skip_no_change: skip_no_change
      )
      executor.execute
    end

    option :ignore_empty_table, default: true, type: :boolean
    option :ignore_tables, default: [], type: :array
    option :ignore_column_names, default: [], type: :array
    option :verbose, default: false, type: :boolean
    desc 'dump', 'dump'
    def dump
      ignore_empty_table = options[:ignore_empty_table]
      ignore_tables = options[:ignore_tables]
      ignore_column_names = options[:ignore_column_names]
      verbose = options[:verbose]

      executor = MasterDataTool::Dump::Executor.new(
        ignore_empty_table: ignore_empty_table,
        ignore_tables: ignore_tables,
        ignore_column_names: ignore_column_names,
        verbose: verbose
      )
      executor.execute
    end
  end
end

MasterDataTool::CLI.start(ARGV)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
master_data_tool-0.4.0 exe/master_data_tool
master_data_tool-0.3.0 exe/master_data_tool
master_data_tool-0.2.0 exe/master_data_tool
master_data_tool-0.1.0 exe/master_data_tool