esvg 2.8.7 → 2.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/exe/esvg +10 -2
  3. data/lib/esvg/svg.rb +10 -4
  4. data/lib/esvg/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 024f0bbd1df2c2dbd045bd632801f1160bb85317
4
- data.tar.gz: 555c4cdfedee44c6fb56ef8f56d35fa3dbe0b980
3
+ metadata.gz: 6158cde2155dd544488ee09f7ee14094e61c0a74
4
+ data.tar.gz: 093adddf985e571ea56f4a5459b3f209dd905fc0
5
5
  SHA512:
6
- metadata.gz: b70387215bb00af1982291c9163a9c2f769aa744002d103f9307dc6cbbfb3df261ac452452654281f2b17ae03646774057dba985d2ef19fbc7a1696b5dbac18f
7
- data.tar.gz: 97e83f19a08a193cff6192398795515b83545713831b094759479364e24f0cda827b7abe547a9c47a05887a75ef3a500229eed067d59cfa913ded52886ba88b1
6
+ metadata.gz: cd644a99896b618e21229e439efc4df2684f7d0a4f859672b72fa582dc14c378e38349ac1099a047b2d5b47960482fbd74a016f813d4453120b957a29ebe37db
7
+ data.tar.gz: f730a2c8f16945e965322ef424250183a5d4d74a46afcee8c9829795807822db9302e16708936592eec12b4999b46ce6eb64d866d4f8644876d3807efd33564d
data/exe/esvg CHANGED
@@ -20,6 +20,10 @@ OptionParser.new do |opts|
20
20
  options[:config_file] = path
21
21
  end
22
22
 
23
+ opts.on("-r", "--rails", "Use Rails defaults") do
24
+ options[:rails] = true
25
+ end
26
+
23
27
  opts.on("-O", "--optimize", "Optimize svgs with svgo") do |svgo|
24
28
  options[:optimize] = svgo
25
29
  end
@@ -28,7 +32,7 @@ OptionParser.new do |opts|
28
32
  options[:npm_path] = path
29
33
  end
30
34
 
31
- opts.on("-l", "--log", "Print version") do |version|
35
+ opts.on("-v", "--version", "Print version") do |version|
32
36
  options[:version] = true
33
37
  end
34
38
 
@@ -37,7 +41,11 @@ end.parse!
37
41
  if options[:version]
38
42
  puts "Esvg #{Esvg::VERSION}"
39
43
  else
40
- options[:path] = ARGV.shift
44
+
45
+ if path = ARGV.shift
46
+ options[:path] = path
47
+ end
48
+
41
49
  options[:cli] = true
42
50
  esvg = Esvg::SVG.new(options).write
43
51
  end
@@ -6,14 +6,12 @@ module Esvg
6
6
  attr_accessor :files, :svgs, :last_read
7
7
 
8
8
  CONFIG = {
9
- path: Dir.pwd,
10
9
  base_class: 'svg-icon',
11
10
  namespace: 'icon',
12
11
  optimize: false,
13
12
  npm_path: false,
14
13
  namespace_before: true,
15
14
  font_size: '1em',
16
- output_path: Dir.pwd,
17
15
  verbose: false,
18
16
  format: 'js',
19
17
  throttle_read: 4,
@@ -21,7 +19,9 @@ module Esvg
21
19
  }
22
20
 
23
21
  CONFIG_RAILS = {
24
- path: "app/assets/esvg"
22
+ path: "app/assets/esvg",
23
+ js_path: "app/assets/javascripts/esvg.js",
24
+ css_path: "app/assets/stylesheets/esvg.css"
25
25
  }
26
26
 
27
27
  def initialize(options={})
@@ -39,13 +39,19 @@ module Esvg
39
39
  paths = [options[:config_file], 'config/esvg.yml', 'esvg.yml'].compact
40
40
 
41
41
  config = CONFIG
42
- config.merge!(CONFIG_RAILS) if Esvg.rails?
42
+
43
+ if Esvg.rails? || options[:rails]
44
+ config.merge!(CONFIG_RAILS)
45
+ end
43
46
 
44
47
  if path = paths.select{ |p| File.exist?(p)}.first
45
48
  config.merge!(symbolize_keys(YAML.load(File.read(path) || {})))
46
49
  end
47
50
 
48
51
  config.merge!(options)
52
+
53
+ config[:path] ||= Dir.pwd
54
+ config[:output_path] ||= Dir.pwd
49
55
 
50
56
  if config[:cli]
51
57
  config[:path] = File.expand_path(config[:path])
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.8.7"
2
+ VERSION = "2.8.8"
3
3
  end
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.8.7
4
+ version: 2.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler