Sha256: 27fbbb75b7a76de5c71d978eb68dc54e3c13e4851b08c991a95b4546f895c875

Contents?: true

Size: 1.43 KB

Versions: 12

Compression:

Stored size: 1.43 KB

Contents

#! /usr/bin/env ruby

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

require 'optparse'
require 'esvg'

options = {
  core: false,
  fingerprint: false,
}

OptionParser.new do |opts|
  opts.on("-o", "--output PATH", String, "Where should JS/HTML files be written, (default: current directory)") do |path|
    options[:build] = 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("-b", "--build", String, "Append a build version, (-b 1.2.3 -> svgs-1.2.3.js)") do |version|
    options[:version] = version
  end

  opts.on("-f", "--fingerprint", "Fingerprint the build files") do
    options[:fingerprint] = true
  end

  opts.on("-C", "--core", "Write _esvg.js core javascript, Small utlities for working with svg embed") do
    options[:core] = true
  end

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

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

  opts.on("-z", "--gzip", "Write gzip compressed output") do
    options[:gzip] = true
  end

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

end.parse!

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

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

  options[:print] = true
  esvg = Esvg::Svgs.new(options).build
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
esvg-4.3.5 exe/esvg
esvg-4.3.4 exe/esvg
esvg-4.3.3 exe/esvg
esvg-4.3.2 exe/esvg
esvg-4.3.1 exe/esvg
esvg-4.3.0 exe/esvg
esvg-4.2.5 exe/esvg
esvg-4.2.4 exe/esvg
esvg-4.2.3 exe/esvg
esvg-4.2.2 exe/esvg
esvg-4.2.1 exe/esvg
esvg-4.2.0 exe/esvg