Sha256: 99d4e3ae3454f9689455dd6b29cfcb4ed268d2492a9da55cdbc3a6648b0518b9

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Ehbrs
  module Tools
    module Vg
      module Patches
        class BaseApplier
          acts_as_abstract
          common_constructor :patch_path

          # @param source_path [Pathname]
          # @param output_path [Pathname]
          # @raise [RuntimeError] Se o arquivo de saída não é criado.
          def apply(source_path, output_path)
            source_path = source_path.to_pathname
            output_path = output_path.to_pathname
            command(source_path, output_path).system!

            return if output_path.exist?

            fatal_error("Applier returned without error, but output file \"#{output_path}\"" \
                        'does not exist')
          end

          # @param source_path [Pathname]
          # @param output_path [Pathname]
          # @return [EacRubyUtils::Envs::Command]
          def command(source_path, output_path)
            raise_abstract_method __method__, source_path, output_path
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ehbrs-tools-0.43.1 lib/ehbrs/tools/vg/patches/base_applier.rb
ehbrs-tools-0.43.0 lib/ehbrs/tools/vg/patches/base_applier.rb