Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nanoc-gzip.rb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoc-gzip.rb

  • 0.2.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

About

nanoc-gzip.rb is a nanoc filter that integrates gzip into nanoc. The filter can be combined with the nginx module gzip_static or its equivalent in other web servers.

Examples

Defaults

The following example demonstrates the compression of "app.js". The uncompressed version (app.js) and the compressed version (app.js.gz) are both written to disk:

# Rules
require "nanoc-gzip"
compile "/js/app.js" do
  write("/js/app.js")
  filter(:gzip)
  write("/js/app.js.gz")
end

Options

The filter can be configured with "level", and "strategy" options. Both are integer values. The default compression level is Zlib::BEST_COMPRESSION. And the default strategy is Zlib::DEFAULT_STRATEGY. The zlib manual documents what integers are accepted and what they represent. Example:

# Rules
require "nanoc-gzip"
compile "/js/app.js" do
  write("/js/app.js")
  filter(:gzip, {level: Zlib::BEST_SPEED, strategy: Zlib::HUFFMAN_ONLY})
  write("/js/app.js.gz")
end

Install

Rubygems.org

nanoc-gzip.rb can be installed via rubygems.org:

gem install nanoc-gzip.rb

Sources

License

BSD Zero Clause
See LICENSE

FAQs

Package last updated on 17 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc