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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68cf19f866d0d344943d3d4844e0329bce1e52f2
4
- data.tar.gz: 01126b6a0e25132737e68be1799fc3cbc8a5fe0a
3
+ metadata.gz: 189d061f804203f7f8e6c0067ac5645758e98530
4
+ data.tar.gz: 6c7a1aa38771f9ef73be7f3b77839129039130cf
5
5
  SHA512:
6
- metadata.gz: 8b865ce911bec5cb84129cf9f48877bd43355ac7a666af16987bb8be422fa5d48256777b9071affba1c89a9a25d2bcdfb914f1d43a84a3928c221bec3235722c
7
- data.tar.gz: 638361f7f4520e682211cb09a75393af11919e960eb620e69b2aadfaea128a62152b049c4f09a207a037ac7b8f6b259ece2b2bcd2458c9c5bef5d9c080c12b9f
6
+ metadata.gz: 4150332a37bca33fccdc141476db52280ef35298afba506741234ee263329dba681405b1a29ab44644e47f8d5482464075d4915957e48f3c3c5a435c5e5a6dc6
7
+ data.tar.gz: 7e682811edda69acb9142cdf3b354ed4cc0ddd29d7e531739b098481aa0a5c13f8acd2731c257660edd334eb867daa7c879d1591232f91ad7253e328cf4d9e1b
@@ -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.0'
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'
@@ -3,12 +3,14 @@ require 'esvg'
3
3
  module Esvg
4
4
  module Helpers
5
5
 
6
- def use_svg(name, options={})
7
- if esvg_files.exist?(name, options[:fallback])
8
- esvg_files.use(name, options).html_safe
9
- elsif Cyborg.plugin.svgs.icons.exist?(name, options[:fallback])
10
- Cyborg.plugin.svgs.use(name, options).html_safe
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
- @svg = Esvg::SVG.new({
12
+ end
13
+
14
+ def esvg
15
+ @svg ||= Esvg::SVG.new({
13
16
  config_file: File.join(plugin.root, 'config', 'esvg.yml'),
14
- source: path,
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
- icons.use(*args)
43
+ esvg.use(*args)
45
44
  end
46
45
 
47
46
  def build_paths
48
- @svg.build_paths.map { |file| file.sub("-#{plugin.version}",'') }
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
- @svg.read_files
53
+ esvg.read_files
55
54
 
56
- return if @svg.svgs.empty?
55
+ return if esvg.svgs.empty?
57
56
 
58
- if files = @svg.build
57
+ if files = esvg.build
59
58
  files.each do |file|
60
59
  puts build_success(file)
61
60
  end
@@ -1,3 +1,3 @@
1
1
  module Cyborg
2
- VERSION = "0.5.24"
2
+ VERSION = "0.5.26"
3
3
  end
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.24
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-17 00:00:00.000000000 Z
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.0'
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.0'
40
+ version: '4.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: listen
43
43
  requirement: !ruby/object:Gem::Requirement