Class: EhbrsRubyUtils::Vg::Patchers::BaseApplier

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/vg/patchers/base_applier.rb

Direct Known Subclasses

IpsApplier, VcdiffApplier

Instance Method Summary collapse

Instance Method Details

#apply(source_path, output_path) ⇒ Object

Parameters:

  • source_path (Pathname)
  • output_path (Pathname)

Raises:

  • (RuntimeError)

    Se o arquivo de saída não é criado.



13
14
15
16
17
18
19
20
21
22
# File 'lib/ehbrs_ruby_utils/vg/patchers/base_applier.rb', line 13

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

#command(source_path, output_path) ⇒ EacRubyUtils::Envs::Command

Parameters:

  • source_path (Pathname)
  • output_path (Pathname)

Returns:

  • (EacRubyUtils::Envs::Command)


27
28
29
# File 'lib/ehbrs_ruby_utils/vg/patchers/base_applier.rb', line 27

def command(source_path, output_path)
  raise_abstract_method __method__, source_path, output_path
end