Sha256: c2f6bbd20d0c40eac4a4323659e5e6478f684c6e164c2733f95a741125292e43

Contents?: true

Size: 568 Bytes

Versions: 1

Compression:

Stored size: 568 Bytes

Contents

module BatchManager
  class Executor
    include BatchManager::Utils

    def self.exec(batch_file, options)
      batch_file_path = batch_full_path(batch_file)
      if File.exist?(batch_file_path)
        batch_status = BatchManager::BatchStatus.new(batch_file_path)
        if options[:force] || batch_status.can_run?
          @wet = options[:wet]
          eval File.read(batch_file_path)
          batch_status.update_schema
        else
          raise "Cannot run this batch."
        end
      else
        raise "File not exist."
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
batch_manager-0.1.3 lib/batch_manager/executor.rb