esvg 2.4.3 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/exe/esvg +12 -3
- data/lib/esvg/svg.rb +12 -3
- data/lib/esvg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 286447567ec0661d4c3e9b4731cee656077ef12f
|
4
|
+
data.tar.gz: fe5bebe1a92c7fbc693e098d90de34cc3ecbd160
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 696665b75357ee9df61d7cd5a6d9e608fb6599ff21f1c297c73787acd6494fffd9a47de9ac6180439313e1a1b2f29d4ddbcbe2dbef5443a7fda8912302f6e89d
|
7
|
+
data.tar.gz: a98ff82d5493befd179a41d838a8ec5ca1859917b10811fac1414f1d2c0def3f0fd0a2cceb03faf51c0ef4814c8f284fb5b914c3a25e5c3d700c6e7134eec8af
|
data/CHANGELOG.md
CHANGED
data/exe/esvg
CHANGED
@@ -27,8 +27,17 @@ OptionParser.new do |opts|
|
|
27
27
|
opts.on("-n", "--npm", String, "Path to node_modules director") do |path|
|
28
28
|
options[:npm_path] = path
|
29
29
|
end
|
30
|
-
end.parse!
|
31
30
|
|
32
|
-
|
31
|
+
opts.on("-l", "--log", "Print version") do |version|
|
32
|
+
options[:version] = true
|
33
|
+
end
|
34
|
+
|
35
|
+
end.parse!
|
33
36
|
|
34
|
-
|
37
|
+
if options[:version]
|
38
|
+
puts "Esvg #{Esvg::VERSION}"
|
39
|
+
else
|
40
|
+
options[:path] = ARGV.shift
|
41
|
+
options[:cli] = true
|
42
|
+
esvg = Esvg::SVG.new(options).write
|
43
|
+
end
|
data/lib/esvg/svg.rb
CHANGED
@@ -43,7 +43,7 @@ module Esvg
|
|
43
43
|
|
44
44
|
config.merge!(options)
|
45
45
|
|
46
|
-
if config[:
|
46
|
+
if config[:cli]
|
47
47
|
config[:path] = File.expand_path(config[:path])
|
48
48
|
config[:output_path] = File.expand_path(config[:output_path])
|
49
49
|
end
|
@@ -78,9 +78,11 @@ module Esvg
|
|
78
78
|
files[f] = File.mtime(f)
|
79
79
|
end
|
80
80
|
|
81
|
+
puts "Read #{files.size} files from #{config[:path]}" if config[:cli]
|
82
|
+
|
81
83
|
process_files
|
82
84
|
|
83
|
-
if files.empty? && config[:
|
85
|
+
if files.empty? && config[:cli]
|
84
86
|
puts "No svgs found at #{config[:path]}"
|
85
87
|
end
|
86
88
|
end
|
@@ -182,13 +184,20 @@ module Esvg
|
|
182
184
|
case config[:format]
|
183
185
|
when "html"
|
184
186
|
write_html
|
187
|
+
puts "Written to #{log_path config[:html_path]}" if config[:cli]
|
185
188
|
when "js"
|
186
189
|
write_js
|
190
|
+
puts "Written to #{log_path config[:js_path]}" if config[:cli]
|
187
191
|
when "css"
|
188
192
|
write_css
|
193
|
+
puts "Written to #{log_path config[:css_path]}" if config[:cli]
|
189
194
|
end
|
190
195
|
end
|
191
196
|
|
197
|
+
def log_path(path)
|
198
|
+
File.expand_path(path).sub(File.expand_path(Dir.pwd), '').sub(/^\//,'')
|
199
|
+
end
|
200
|
+
|
192
201
|
def write_svg(svg)
|
193
202
|
path = File.join(config[:path], '.esvg-cache')
|
194
203
|
write_file path, svg
|
@@ -300,7 +309,7 @@ module Esvg
|
|
300
309
|
if (element) {
|
301
310
|
return '<svg class="#{config[:base_class]} '+svgName+' '+(classnames || '')+'" '+this.dimensions(element)+'><use xlink:href="#'+svgName+'"/></svg>'
|
302
311
|
} else {
|
303
|
-
console.error('File not found: "'+name+'.svg" at #{File.join(config[:path],'')}')
|
312
|
+
console.error('File not found: "'+name+'.svg" at #{log_path(File.join(config[:path],''))}/')
|
304
313
|
}
|
305
314
|
},
|
306
315
|
iconName: function(name) {
|
data/lib/esvg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esvg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|