Class: Nanoc::Gzip::Filter

Inherits:
Filter
  • Object
show all
Includes:
Nanoc::Gzip
Defined in:
lib/nanoc-gzip/gzip/filter.rb

Constant Summary

Constants included from Nanoc::Gzip

VERSION

Instance Method Summary collapse

Methods included from Nanoc::Gzip

#gzip

Instance Method Details

#run(str, options = {}) ⇒ String

Parameters:

  • str (String)

Returns:

  • (String)


11
12
13
14
15
16
17
# File 'lib/nanoc-gzip/gzip/filter.rb', line 11

def run(str, options = {})
  gzip(
    item.binary? ? File.binread(str) : str,
    options[:level],
    options[:strategy]
  )
end