Module: HtmlPress

Defined in:
lib/html_press.rb,
lib/html_press/html.rb,
lib/html_press/version.rb,
lib/html_press/html_entities.rb

Defined Under Namespace

Classes: Entities, Html

Constant Summary collapse

VERSION =
"0.8.1"

Class Method Summary collapse

Class Method Details

.compress(text, options = {}) ⇒ Object

for backward compatibility



14
15
16
# File 'lib/html_press.rb', line 14

def self.compress(text, options = {})
  HtmlPress::Html.new(options).press text
end

.entities_compressor(text) ⇒ Object



34
35
36
# File 'lib/html_press/html_entities.rb', line 34

def self.entities_compressor (text)
  Entities.new.minify(text)
end

.js_compressor(text, options = nil) ⇒ Object



18
19
20
21
22
# File 'lib/html_press.rb', line 18

def self.js_compressor (text, options = nil)
  options ||= {}
  options[:inline_script] = true
  MultiJs.compile(text, options).gsub(/;$/,'')
end

.press(text, options = {}) ⇒ Object



9
10
11
# File 'lib/html_press.rb', line 9

def self.press(text, options = {})
  HtmlPress::Html.new(options).press text
end