svg_hearts_you 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +5 -0
- data/lib/svg_hearts_you/helpers.rb +3 -0
- data/lib/svg_hearts_you/version.rb +1 -1
- data/spec/module/svg_hearts_you_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 181d3d097086d53427ff96763aae47980a9d41d3
|
4
|
+
data.tar.gz: 43752a6a8837edf41e83cb3c49f41c9d49c37c76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3de95187baa40f0eaa1760859c89340fcc5bea858cb71aa57c7bd09683526060875d9b97156db0ab0e574308d9ecf5e25d6654ae5b47f5288f434f96334375e9
|
7
|
+
data.tar.gz: d9d9435a264ee38eaffdd70817a6a0074f214e483861d16bfd75a0d008c1292e9c4be110d3188908519c5db0dd5d10bb928053d95db9f75988150f5636b6f319
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -44,7 +44,12 @@ SvgHeartsYou.configure do |config|
|
|
44
44
|
end
|
45
45
|
```
|
46
46
|
|
47
|
+
If you are using middleman, you will need to activate the extension to include
|
48
|
+
the helpers (and optionally set the `svg_paths` this way as well). In config.rb:
|
47
49
|
|
50
|
+
```
|
51
|
+
activate :svg_hearts_you, svg_paths: '/some/absolute/path'
|
52
|
+
```
|
48
53
|
|
49
54
|
## Usage
|
50
55
|
|
@@ -35,6 +35,9 @@ module SvgHeartsYou
|
|
35
35
|
module Helpers
|
36
36
|
|
37
37
|
def svg_inline(filename, options={})
|
38
|
+
# Add .svg extension if missing
|
39
|
+
filename += '.svg' unless filename.end_with?('.svg')
|
40
|
+
|
38
41
|
svg_file = SvgHeartsYou::find_svg_file(filename)
|
39
42
|
|
40
43
|
doc = Nokogiri::HTML::DocumentFragment.parse(svg_file)
|
@@ -107,6 +107,11 @@ RSpec.describe SvgHeartsYou do
|
|
107
107
|
expect(svg_content).not_to include('<xml')
|
108
108
|
expect(svg_content).not_to include('DOCTYPE')
|
109
109
|
end
|
110
|
+
|
111
|
+
it 'can be called without the .svg extension' do
|
112
|
+
svg_content = subject.svg_inline 'sapphire'
|
113
|
+
expect(svg_content).to have_tag('svg')
|
114
|
+
end
|
110
115
|
end
|
111
116
|
|
112
117
|
describe '#svg_use' do
|