Class: EasyHtmlGenerator::Generator::Minimize::Html
- Inherits:
-
Base
- Object
- Base
- EasyHtmlGenerator::Generator::Minimize::Html
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 Base
#dest_path, #do_file, #generate, #log, #log_running, #resolve_path_prefix, #should_do_file?, #src_path, #walk_files
Constructor Details
#initialize(project, config) ⇒ Html
Returns a new instance of Html.
10
11
12
13
14
15
|
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 10
def initialize(project, config)
super(project, config)
@config.src = project.config.paths.src.views
@config.dest = project.config.paths.dist.views
end
|
Class Method Details
.compress(input) ⇒ Object
29
30
31
|
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 29
def self.compress(input)
compressor.compress input
end
|
.compressor ⇒ Object
25
26
27
|
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 25
def self.compressor
@compressor ||= HtmlCompressor::Compressor.new
end
|
Instance Method Details
17
18
19
|
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 17
def do_input(input, *_args)
self.class.compress input
end
|
21
22
23
|
# File 'lib/easy_html_generator/generator/minimize/html.rb', line 21
def input_to_output_file(i)
super(i).gsub('.html', "#{@config.prefix_extension}.html")
end
|