Sha256: e5ca0cb20c504d95bbced0a189da48e4d57b4d33e40303ace9a8f456be89d07c

Contents?: true

Size: 1.65 KB

Versions: 12

Compression:

Stored size: 1.65 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("--seed", "Seed cache file with optimized svgs") do
    options[:seed] = true
  end

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

  opts.on("--test", "test func") do
    options[:test] = true
  end

end.parse!

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

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

  options[:print] = true

  if options[:seed]
    Esvg.seed_cache(options)
  else
    esvg = Esvg.new(options).build
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
esvg-4.6.2 exe/esvg
esvg-4.6.1 exe/esvg
esvg-4.6.0 exe/esvg
esvg-4.5.0 exe/esvg
esvg-4.4.3 exe/esvg
esvg-4.4.2 exe/esvg
esvg-4.4.1 exe/esvg
esvg-4.4.0 exe/esvg
esvg-4.3.9 exe/esvg
esvg-4.3.8 exe/esvg
esvg-4.3.7 exe/esvg
esvg-4.3.6 exe/esvg