Sha256: 27b7de58adc58b02c12c9e310f0b624bfa82b5eefaca0979bf0f7cf738c50817

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

#! /usr/bin/env ruby

$LOAD_PATH.unshift(File.expand_path("../lib", File.dirname(__FILE__)))

require 'optparse'
require 'esvg'

options = {}

OptionParser.new do |opts|
  opts.on("-f", "--format TYPE", String, "Options: css, js, html (defaults to js)") do |format|
    options[:format] = format
  end

  opts.on("-o", "--output PATH", String, "Where should JS/SCSS/HTML files be written, (default: current directory)") do |path|
    options[:output_path] = path
  end

  opts.on("-c", "--config PATH", String, "Path to a config file (default: esvg.yml, config/esvg.yml)") do |path|
    options[:config_file] = path
  end

  opts.on("-r", "--rails", "Use Rails defaults") do
    options[:rails] = true
  end

  opts.on("-O", "--optimize", "Optimize svgs with svgo") do |svgo|
    options[:optimize] = svgo
  end

  opts.on("-v", "--version", "Print version") do |version|
    options[:version] = true
  end

end.parse!

if options[:version]
  puts "Esvg #{Esvg::VERSION}"
else

  if path = ARGV.shift
    options[:path] = path
  end

  options[:cli] = true
  esvg = Esvg::SVG.new(options).write
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
esvg-2.9.2 exe/esvg
esvg-2.9.1 exe/esvg
esvg-2.9.0 exe/esvg
esvg-2.8.10 exe/esvg