cyborg 0.5.24 → 0.5.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cyborg.gemspec +1 -1
- data/lib/cyborg/esvg.rb +7 -5
- data/lib/cyborg/plugin/assets/svgs.rb +10 -11
- data/lib/cyborg/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 189d061f804203f7f8e6c0067ac5645758e98530
|
4
|
+
data.tar.gz: 6c7a1aa38771f9ef73be7f3b77839129039130cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4150332a37bca33fccdc141476db52280ef35298afba506741234ee263329dba681405b1a29ab44644e47f8d5482464075d4915957e48f3c3c5a435c5e5a6dc6
|
7
|
+
data.tar.gz: 7e682811edda69acb9142cdf3b354ed4cc0ddd29d7e531739b098481aa0a5c13f8acd2731c257660edd334eb867daa7c879d1591232f91ad7253e328cf4d9e1b
|
data/cyborg.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_runtime_dependency 'sass', '~> 3.4'
|
22
|
-
spec.add_runtime_dependency 'esvg', '~> 4.
|
22
|
+
spec.add_runtime_dependency 'esvg', '~> 4.1'
|
23
23
|
spec.add_runtime_dependency 'listen', '~> 3.0.0'
|
24
24
|
spec.add_runtime_dependency 'block_helpers', '~> 0.3'
|
25
25
|
spec.add_runtime_dependency 'colorize', '~> 0.8'
|
data/lib/cyborg/esvg.rb
CHANGED
@@ -3,12 +3,14 @@ require 'esvg'
|
|
3
3
|
module Esvg
|
4
4
|
module Helpers
|
5
5
|
|
6
|
-
def use_svg(name, options={})
|
7
|
-
if
|
8
|
-
|
9
|
-
elsif Cyborg.plugin.svgs.
|
10
|
-
Cyborg.plugin.svgs.
|
6
|
+
def use_svg(name, options={}, &block)
|
7
|
+
files = if esvg.exist?(name, options[:fallback])
|
8
|
+
esvg
|
9
|
+
elsif Cyborg.plugin.svgs.esvg.exist?(name, options[:fallback])
|
10
|
+
Cyborg.plugin.svgs.esvg
|
11
11
|
end
|
12
|
+
|
13
|
+
use_svg_with_files(files, name, options, &block) if files
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -9,9 +9,12 @@ module Cyborg
|
|
9
9
|
@plugin = plugin
|
10
10
|
@base = path
|
11
11
|
|
12
|
-
|
12
|
+
end
|
13
|
+
|
14
|
+
def esvg
|
15
|
+
@svg ||= Esvg::SVG.new({
|
13
16
|
config_file: File.join(plugin.root, 'config', 'esvg.yml'),
|
14
|
-
source:
|
17
|
+
source: @base,
|
15
18
|
assets: plugin.paths[:javascripts],
|
16
19
|
version: plugin.version,
|
17
20
|
build: plugin.destination,
|
@@ -24,10 +27,6 @@ module Cyborg
|
|
24
27
|
|
25
28
|
end
|
26
29
|
|
27
|
-
def icons
|
28
|
-
@svg
|
29
|
-
end
|
30
|
-
|
31
30
|
def ext
|
32
31
|
"svg"
|
33
32
|
end
|
@@ -41,21 +40,21 @@ module Cyborg
|
|
41
40
|
end
|
42
41
|
|
43
42
|
def use(*args)
|
44
|
-
|
43
|
+
esvg.use(*args)
|
45
44
|
end
|
46
45
|
|
47
46
|
def build_paths
|
48
|
-
|
47
|
+
esvg.build_paths.map { |file| file.sub("-#{plugin.version}",'') }
|
49
48
|
end
|
50
49
|
|
51
50
|
def build
|
52
51
|
|
53
52
|
begin
|
54
|
-
|
53
|
+
esvg.read_files
|
55
54
|
|
56
|
-
return if
|
55
|
+
return if esvg.svgs.empty?
|
57
56
|
|
58
|
-
if files =
|
57
|
+
if files = esvg.build
|
59
58
|
files.each do |file|
|
60
59
|
puts build_success(file)
|
61
60
|
end
|
data/lib/cyborg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyborg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '4.
|
33
|
+
version: '4.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '4.
|
40
|
+
version: '4.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: listen
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|