Sha256: 964b8e735da65942d1db424713f40a74726289744041dc4659e43307d01b1f09
Contents?: true
Size: 557 Bytes
Versions: 12
Compression:
Stored size: 557 Bytes
Contents
class Ridgepole::ExternalSqlExecuter def initialize(script, logger) @script = script @logger = logger end def execute(sql) cmd = Shellwords.join([@script, sql, JSON.dump(ActiveRecord::Base.connection_config)]) @logger.info("Execute #{@script}") out, err, status = Open3.capture3(cmd) out.strip! err.strip! @logger.info("#{@script}: #{out}") unless out.empty? @logger.warn("[WARNING] #{@script}: #{err}") unless err.empty? unless status.success? raise "`#{@script}` execution failed" end end end
Version data entries
12 entries across 12 versions & 1 rubygems