Class: EasyHtmlGenerator::Generator::Minimize::Html

Inherits:
Compile::Base show all
Defined in:
lib/easy_html_generator/generator/minimize/html.rb

Overview

this generator minifies html files from src folder and copies them to the dist folder

Instance Attribute Summary

Attributes inherited from Base

#config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Compile::Base

#do_file, #generate!, #walk_files, #watch_files

Methods inherited from Base

#enabled?, #file_changed?, #generate, #generate!, #initialize, #log, #log_running, #repetitive?, #store_file_hash, #tasks

Constructor Details

This class inherits a constructor from EasyHtmlGenerator::Generator::Base

Class Method Details

.compress(input) ⇒ Object



22
23
24
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 22

def self.compress(input)
  compressor.compress input
end

.compressorObject



18
19
20
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 18

def self.compressor
  @compressor ||= HtmlCompressor::Compressor.new
end

Instance Method Details

#do_input!(input, *_args) ⇒ Object



10
11
12
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 10

def do_input!(input, *_args)
  self.class.compress input
end

#input_to_output_file(input_file, config) ⇒ Object



14
15
16
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 14

def input_to_output_file(input_file, config)
  super(input_file, config).gsub(/\.html$/, "#{config.prefix_extension}.html")
end