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 +4 -4
- data/exe/esvg +18 -3
- data/lib/esvg.rb +1 -1
- data/lib/esvg/svg.rb +10 -3
- data/lib/esvg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ae517da47ee60db35c611e898f86051c94ae2e7
|
4
|
+
data.tar.gz: 51fd9c6f0831b6594dcaeaeb82f9b4696ca7cbce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
28
|
-
options[:
|
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
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
|
-
|
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
|
-
|
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[:
|
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