esvg 4.1.3 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c1378eba2bb78c0e78bb47634ce226935e07001
4
- data.tar.gz: 9f699245f1c27a8224da803dea8b0a34fcf02c3e
3
+ metadata.gz: 0ae517da47ee60db35c611e898f86051c94ae2e7
4
+ data.tar.gz: 51fd9c6f0831b6594dcaeaeb82f9b4696ca7cbce
5
5
  SHA512:
6
- metadata.gz: a298cc095d0232f47f89215b4445d729f4bb13dea6a80448a567df8e764bdee6fe020505a694f89a28af8f50e59bb8b1a5cf7c51a985bf2e5b90b3e8926ab172
7
- data.tar.gz: 4a676118e110091861353ef39ad04f5a3fa77b8109be0031aa1fc8355759c0571325b6e820c321b78c06c3ffb84364170b1fe30330a0dfaee64a47fbb346d010
6
+ metadata.gz: c2532d228b98c02a82dea9a4a382abb79e8c42f41949e19027d776604b461360b23bfc35904de6ff654eefd93d71abacb52df12bd0271495540f457e94955bea
7
+ data.tar.gz: b59bd5bf162fc2860f39068eea7aa35cca338139b31e8756018407bfc6eec8def25ae632c703830b1922b7e5fc3d8bf8790d2546039347d37abfd061d77d5197
data/exe/esvg CHANGED
@@ -5,7 +5,10 @@ $LOAD_PATH.unshift(File.expand_path("../lib", File.dirname(__FILE__)))
5
5
  require 'optparse'
6
6
  require 'esvg'
7
7
 
8
- options = {}
8
+ options = {
9
+ core: false,
10
+ fingerprint: false,
11
+ }
9
12
 
10
13
  OptionParser.new do |opts|
11
14
  opts.on("-o", "--output PATH", String, "Where should JS/HTML files be written, (default: current directory)") do |path|
@@ -16,6 +19,18 @@ OptionParser.new do |opts|
16
19
  options[:config_file] = path
17
20
  end
18
21
 
22
+ opts.on("-b", "--build", String, "Append a build version, (-b 1.2.3 -> svgs-1.2.3.js)") do |version|
23
+ options[:version] = version
24
+ end
25
+
26
+ opts.on("-f", "--fingerprint", "Fingerprint the build files") do
27
+ options[:fingerprint] = true
28
+ end
29
+
30
+ opts.on("-C", "--core", "Write _esvg.js core javascript, Small utlities for working with svg embed") do
31
+ options[:core] = true
32
+ end
33
+
19
34
  opts.on("-r", "--rails", "Use Rails defaults") do
20
35
  options[:rails] = true
21
36
  end
@@ -24,8 +39,8 @@ OptionParser.new do |opts|
24
39
  options[:optimize] = true
25
40
  end
26
41
 
27
- opts.on("-z", "--gzip", "Write gzipped output") do
28
- options[:compress] = true
42
+ opts.on("-z", "--gzip", "Write gzip compressed output") do
43
+ options[:gzip] = true
29
44
  end
30
45
 
31
46
  opts.on("-v", "--version", "Print version") do
data/lib/esvg.rb CHANGED
@@ -34,7 +34,7 @@ module Esvg
34
34
  def precompile_assets
35
35
  if rails? && defined?(Rake)
36
36
  ::Rake::Task['assets:precompile'].enhance do
37
- build(compress: true, print: true)
37
+ build(gzip: true, print: true)
38
38
  end
39
39
  end
40
40
  end
data/lib/esvg/svg.rb CHANGED
@@ -14,7 +14,8 @@ module Esvg
14
14
  core: true,
15
15
  namespace_before: true,
16
16
  optimize: false,
17
- compress: false,
17
+ gzip: false,
18
+ fingerprint: true,
18
19
  throttle_read: 4,
19
20
  flatten: [],
20
21
  alias: {}
@@ -525,7 +526,13 @@ module Esvg
525
526
  if name.start_with?('_') # Is it an asset?
526
527
  File.join config[:assets], "#{name}.js"
527
528
  else # or a build file?
528
- File.join config[:build], "#{name}-#{version(key)}.js"
529
+
530
+ # User doesn't want a fingerprinted build file
531
+ if !config[:fingerprint]
532
+ File.join config[:build], "#{name}.js"
533
+ else
534
+ File.join config[:build], "#{name}-#{version(key)}.js"
535
+ end
529
536
  end
530
537
  end
531
538
 
@@ -603,7 +610,7 @@ module Esvg
603
610
  end
604
611
 
605
612
  def compress(file)
606
- return if !config[:compress]
613
+ return if !config[:gzip]
607
614
 
608
615
  mtime = File.mtime(file)
609
616
  gz_file = "#{file}.gz"
data/lib/esvg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "4.1.3"
2
+ VERSION = "4.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esvg
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis