Sha256: 6cff4d1ddb33f4b1439f9aabc30eacac78782241fe3868c8fc19f5db7a018353

Contents?: true

Size: 902 Bytes

Versions: 4

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

require 'csv'
require_relative "master_data_tool/version"
require_relative "master_data_tool/config"
require_relative "master_data_tool/master_data_status"
require_relative "master_data_tool/master_data"
require_relative "master_data_tool/report"
require_relative "master_data_tool/dump/executor"
require_relative "master_data_tool/import"

module MasterDataTool
  class Error < StandardError; end
  class DryRunError < StandardError; end
  class VerifyFailed < StandardError; end
  class NotLoadedError < StandardError; end

  class << self
    def config
      @config ||= Config.new
    end

    def configure
      yield config
    end

    def resolve_table_name(csv_path)
      # 0001_table_nameのように投入順序を制御可能にする
      csv_path.relative_path_from(config.master_data_dir).to_s.gsub(/^\d+_/, '').delete_suffix('.csv')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
master_data_tool-0.15.0 lib/master_data_tool.rb
master_data_tool-0.14.0 lib/master_data_tool.rb
master_data_tool-0.13.0 lib/master_data_tool.rb
master_data_tool-0.12.0 lib/master_data_tool.rb