sass_inline_svg 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +6 -14
- data/lib/sass_inline_svg.rb +7 -7
- data/lib/sass_inline_svg/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
metadata.gz: !binary |-
|
|
9
|
-
NWEwM2E2MGI5OTk2NjQzYzFhMjQwZGYxNGExYjJmZWI3NzdhZDk1YjdjOWMx
|
|
10
|
-
M2JhMThmZWYwZjAyMmYyZmYyZjAxMjIwZGM4YjY4MWU4YWVjZmQwY2Y3OWI1
|
|
11
|
-
YWNlZTFkMGU2Y2U4YmU3MGFiZjI5NjBiMGQyNGJhYzc0MjM2ZWE=
|
|
12
|
-
data.tar.gz: !binary |-
|
|
13
|
-
ZjlhYTc5YWExZDBmYWRjOWVkOGFmYjJmNzk5ZWZmNmI2YWNmZDExODNhZGQx
|
|
14
|
-
YTJlNTgzZDJmN2ZkYjZjYWZkZjkyMzkzNzkxMDlkNmY1MmNmZTA3NmQ4N2E3
|
|
15
|
-
ZDI4NmZiMTc3YjExYWE3MWJkYjBkNjM1OWU1MGY2NGRiZjExZWE=
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: f5011117c77f0442fcdfe8c4fe5b796faf3524db
|
|
4
|
+
data.tar.gz: f6e50aecc447c45304bd29c38b38976034e0284c
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 4a9aaf7522c7122d714f86c965a7bebcf3adc3c249ee8b31f19e0d532de81761a7ebd693605707037a3ff0e2632d66baaab1a6231b00677d4c548365f3541e4d
|
|
7
|
+
data.tar.gz: 3fa6a0a9059905b44dfc711dacf3d0560079566cac3b2c9f0574746a11001720a51cb20331db563edaca44ffef1c89079d259a533fce9d005332ef323ce9bc3d
|
data/lib/sass_inline_svg.rb
CHANGED
|
@@ -11,18 +11,17 @@ module Sass::Script::Functions
|
|
|
11
11
|
|
|
12
12
|
def inline_svg(path, repl = nil)
|
|
13
13
|
assert_type path, :String
|
|
14
|
-
|
|
15
14
|
path = path.value.strip()
|
|
16
15
|
|
|
17
|
-
# Use Rails asset pipeline if in Rails context (and handle File not found):
|
|
16
|
+
# Use Soprockets / Rails asset pipeline if in Rails context (and handle File not found):
|
|
18
17
|
if defined?(Rails)
|
|
19
18
|
asset = Rails.application.assets.find_asset(path)
|
|
20
|
-
raise "File not found or cannot be read: #{path}" if asset.nil?
|
|
21
|
-
|
|
19
|
+
raise "File not found or cannot be read (Sprockets): #{path}" if asset.nil?
|
|
20
|
+
svg = asset.to_s
|
|
21
|
+
else # otherwise read file:
|
|
22
|
+
svg = _readFile(path).strip
|
|
22
23
|
end
|
|
23
24
|
|
|
24
|
-
svg = _readFile(path).strip
|
|
25
|
-
|
|
26
25
|
if repl && repl.respond_to?('to_h')
|
|
27
26
|
repl = repl.to_h
|
|
28
27
|
svg = svg.to_s
|
|
@@ -38,6 +37,7 @@ module Sass::Script::Functions
|
|
|
38
37
|
encoded = CGI::escape(svg).gsub("+", "%20")
|
|
39
38
|
encoded_url = "url('data:image/svg+xml;charset=utf-8," + encoded + "')"
|
|
40
39
|
Sass::Script::String.new(encoded_url)
|
|
40
|
+
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
|
|
@@ -49,7 +49,7 @@ module Sass::Script::Functions
|
|
|
49
49
|
f.read
|
|
50
50
|
end
|
|
51
51
|
else
|
|
52
|
-
raise Sass::SyntaxError, "File not found or cannot be read: #{path}"
|
|
52
|
+
raise Sass::SyntaxError, "File not found or cannot be read (native): #{path}"
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
metadata
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sass_inline_svg
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Franz Heidl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-06-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - ~>
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '1.5'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - ~>
|
|
24
|
+
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.5'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
description: Inline url-encoded SVG with Sass. Optional variable string replacement
|
|
@@ -46,7 +46,7 @@ executables: []
|
|
|
46
46
|
extensions: []
|
|
47
47
|
extra_rdoc_files: []
|
|
48
48
|
files:
|
|
49
|
-
- .gitignore
|
|
49
|
+
- ".gitignore"
|
|
50
50
|
- Gemfile
|
|
51
51
|
- LICENSE.txt
|
|
52
52
|
- README.md
|
|
@@ -65,17 +65,17 @@ require_paths:
|
|
|
65
65
|
- lib
|
|
66
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
67
|
requirements:
|
|
68
|
-
- -
|
|
68
|
+
- - ">="
|
|
69
69
|
- !ruby/object:Gem::Version
|
|
70
70
|
version: '0'
|
|
71
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- -
|
|
73
|
+
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '0'
|
|
76
76
|
requirements: []
|
|
77
77
|
rubyforge_project:
|
|
78
|
-
rubygems_version: 2.
|
|
78
|
+
rubygems_version: 2.4.5.1
|
|
79
79
|
signing_key:
|
|
80
80
|
specification_version: 4
|
|
81
81
|
summary: Inline url-encoded SVG with Sass
|