Skip to content

Instantly share code, notes, and snippets.

@maxim maxim/1-ru.rb
Last active Nov 9, 2015

Embed
What would you like to do?
If ruby was in Russian
затребовать 'shellwords'
затребовать 'posix/spawn'
затребовать 'skeptick/error'
модуль Skeptick
класс Command
атр_читатель :shellwords
опр инициализировать(shellwords)
@shellwords = shellwords
конец
опр в_с
shellwords.соединить(' ')
конец
опр run(spawn_options = {})
opts = {}
opts[:chdir] = Skeptick.cd_path.в_с если Skeptick.cd_path
opts[:timeout] = Skeptick.timeout если Skeptick.timeout
opts.слиться(spawn_options)
если Skeptick.debug_mode?
Skeptick.log("Skeptick Command: #{в_с}")
конец
im_process = POSIX::Spawn::Child.new(*shellwords, opts)
если !im_process.success?
вызвать ImageMagickError,
"ImageMagick error\nCommand: #{в_с}\nSTDERR:\n#{im_process.err}"
конец
im_process.status
конец
конец
конец
require 'shellwords'
require 'posix/spawn'
require 'skeptick/error'
module Skeptick
class Command
attr_reader :shellwords
def initialize(shellwords)
@shellwords = shellwords
end
def to_s
shellwords.join(' ')
end
def run(spawn_options = {})
opts = {}
opts[:chdir] = Skeptick.cd_path.to_s if Skeptick.cd_path
opts[:timeout] = Skeptick.timeout if Skeptick.timeout
opts.merge(spawn_options)
if Skeptick.debug_mode?
Skeptick.log("Skeptick Command: #{to_s}")
end
im_process = POSIX::Spawn::Child.new(*shellwords, opts)
if !im_process.success?
raise ImageMagickError,
"ImageMagick error\nCommand: #{to_s}\nSTDERR:\n#{im_process.err}"
end
im_process.status
end
end
end
@budnik

This comment has been minimized.

Copy link

budnik commented Nov 9, 2015

Имена переменных и методов тоже нужно перевести.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.