Class: Avm::Files::Formatter::Formats::Xml

Inherits:
GenericPlain show all
Defined in:
lib/avm/files/formatter/formats/xml.rb

Constant Summary collapse

VALID_BASENAMES =
%w[*.xml].freeze
VALID_TYPES =
['xml'].freeze

Instance Method Summary collapse

Methods inherited from GenericPlain

#file_apply, #string_apply

Methods inherited from Base

#apply, #match?, #name, #valid_basenames, #valid_types

Instance Method Details

#format_command(files) ⇒ Object



18
19
20
21
22
# File 'lib/avm/files/formatter/formats/xml.rb', line 18

def format_command(files)
  ::Avm::Executables.tidy.command.append(
    %w[-xml -modify --indent auto --indent-spaces 2 --wrap 100] + files
  )
end

#internal_apply(files) ⇒ Object



13
14
15
16
# File 'lib/avm/files/formatter/formats/xml.rb', line 13

def internal_apply(files)
  format_command(files).system!
  super(files)
end