tribune / svgo_wrapper

This is a simple wrapper for Kir Belevich's `svgo` tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SvgoWrapper

This is a simple wrapper for the svgo command line tool.

Installation

Add this line to your application's Gemfile:

gem "svgo_wrapper"

And then execute:

$ bundle

Or install it yourself as:

$ gem install svgo_wrapper

Usage

require "svgo_wrapper"

# Create a wrapper with enabled and disabled plugins.
# All attributes are optional.
wrapper = SvgoWrapper.new enabled: :removeTitle,
                          disabled: [:convertColors, :removeMetadata],
                          timeout: 10 # seconds

# Parse image data
wrapper.optimize_images_data " <svg> </svg> "  #=> "<svg/>\n"

About

This is a simple wrapper for Kir Belevich's `svgo` tool.

License:MIT License


Languages

Language:Ruby 100.0%