class Object

Public Instance Methods

delete_backups(f) click to toggle source
# File bin/mkvtoolhelper, line 14
def delete_backups f
        i = 0
        while File.exist?(f.path + ".backup#{i}") do
                FileUtils.rm "#{f.path}.backup#{i}"
                i += 1
        end
end
print_audio(group) click to toggle source
print_group(group) click to toggle source
print_subtitles(group) click to toggle source
process_groups(groups, kit) click to toggle source
# File bin/mkvtoolhelper, line 235
def process_groups groups, kit
        begin
                $kit = kit
                commands = [*kit[:commands], *$commands]
                $temp_commands = commands
                groups.each do |group|
                        $group = group
                        print_group group
                        kit[:print].call group
                        catch (:next) do
                                while line = Readline.readline("> ", true)
                                        accepting = commands.select { |c| c.accepts line }
                                        # sanity check
                                        raise "Multiple commands for '#{line}'" if accepting.size > 1
                                        if accepting.empty?
                                                puts "No matching command."
                                        else
                                                accepting.first.action!
                                        end
                                end
                        end
                end
        ensure
                $group = nil
                $kit = nil
        end
end
rotate_backups(f) click to toggle source
# File bin/mkvtoolhelper, line 8
def rotate_backups f
        i = 0
        i += 1 while File.exist?(f.path + ".backup#{i}")
        i.downto(1) { |i| FileUtils.mv "#{f.path}.backup#{i - 1}", "#{f.path}.backup#{i}" }
end