Class: Avm::Files::Formatter::Formats::Html

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

Constant Summary collapse

VALID_BASENAMES =
%w[*.html *.html.erb].freeze
VALID_TYPES =
['html'].freeze

Instance Method Summary collapse

Methods inherited from GenericPlain

#internal_apply, #string_apply

Methods inherited from Base

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

Instance Method Details

#file_apply(path) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/avm/files/formatter/formats/html.rb', line 14

def file_apply(path)
  input = ::File.read(path)
  temppath = tempfile_path
  ::File.open(temppath, 'w') do |output|
    beautify path, input, output
  end
  ::FileUtils.mv(temppath, path)
  super(path)
end