cyborg 0.5.26 → 0.5.27
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/plugin/assets/asset.rb +7 -2
- data/lib/cyborg/plugin/assets/svgs.rb +5 -6
- data/lib/cyborg/version.rb +1 -1
- metadata +4 -5
- data/lib/cyborg/esvg.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b45d00f802a4c65c09a2ea5d574a726410e1df
|
4
|
+
data.tar.gz: eb4eb6ff0a234be50bf7b7c6d9282ed6793ba9cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08ab6e220072db6a40e4ac548f53d2782b5a9aa1bc0167d9153cdc31007373a4132096a5ce5bb14b2020ab06f05c6b608e70d1da82086aefe18b25beb9a626e9
|
7
|
+
data.tar.gz: 0b8650afbd3ca547bd59679446f69e30826739ea2d283f49f35ae0a4c6bbce7eecfe377f76eaad8d0b063a4f03024303d0aa8a581dc4b772dc5101dfbea6bf65
|
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.2.2'
|
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'
|
@@ -6,6 +6,8 @@ module Cyborg
|
|
6
6
|
def initialize(plugin, base)
|
7
7
|
@base = base
|
8
8
|
@plugin = plugin
|
9
|
+
@throttle = 4
|
10
|
+
@last_build = nil
|
9
11
|
end
|
10
12
|
|
11
13
|
def find_files
|
@@ -125,11 +127,14 @@ module Cyborg
|
|
125
127
|
puts "Removed: #{file_event(removed)}".colorize(:light_red) unless removed.empty?
|
126
128
|
puts "Modified: #{file_event(modified)}".colorize(:light_yellow) unless modified.empty?
|
127
129
|
|
128
|
-
|
130
|
+
if !@last_build.nil? || Time.now.to_i - @last_build > @throttle
|
131
|
+
build
|
132
|
+
@last_build = Time.now.to_i
|
133
|
+
end
|
129
134
|
end
|
130
135
|
|
131
136
|
def file_event(files)
|
132
|
-
list = files.
|
137
|
+
list = files.flat_map { |f| f.sub(base+'/', '') }.join(" \n")
|
133
138
|
list = " \n#{files}" if 1 < files.size
|
134
139
|
|
135
140
|
list
|
@@ -4,15 +4,16 @@ module Cyborg
|
|
4
4
|
|
5
5
|
def initialize(plugin, path)
|
6
6
|
|
7
|
-
require '
|
7
|
+
require 'esvg'
|
8
8
|
|
9
9
|
@plugin = plugin
|
10
10
|
@base = path
|
11
|
+
@svg = esvg
|
11
12
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def esvg
|
15
|
-
@svg
|
16
|
+
@svg || Esvg.new({
|
16
17
|
config_file: File.join(plugin.root, 'config', 'esvg.yml'),
|
17
18
|
source: @base,
|
18
19
|
assets: plugin.paths[:javascripts],
|
@@ -24,7 +25,6 @@ module Cyborg
|
|
24
25
|
optimize: true,
|
25
26
|
print: false
|
26
27
|
})
|
27
|
-
|
28
28
|
end
|
29
29
|
|
30
30
|
def ext
|
@@ -48,11 +48,10 @@ module Cyborg
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def build
|
51
|
-
|
52
51
|
begin
|
53
|
-
esvg.
|
52
|
+
esvg.load_files
|
54
53
|
|
55
|
-
return if esvg.
|
54
|
+
return if esvg.symbols.empty?
|
56
55
|
|
57
56
|
if files = esvg.build
|
58
57
|
files.each do |file|
|
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.27
|
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-31 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:
|
33
|
+
version: 4.2.2
|
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:
|
40
|
+
version: 4.2.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: listen
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,7 +193,6 @@ files:
|
|
193
193
|
- lib/cyborg/command/help.rb
|
194
194
|
- lib/cyborg/command/npm.rb
|
195
195
|
- lib/cyborg/command/scaffold.rb
|
196
|
-
- lib/cyborg/esvg.rb
|
197
196
|
- lib/cyborg/helpers/asset_helpers.rb
|
198
197
|
- lib/cyborg/helpers/layout_helpers.rb
|
199
198
|
- lib/cyborg/middleware.rb
|
data/lib/cyborg/esvg.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'esvg'
|
2
|
-
|
3
|
-
module Esvg
|
4
|
-
module Helpers
|
5
|
-
|
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
|
-
end
|
12
|
-
|
13
|
-
use_svg_with_files(files, name, options, &block) if files
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|