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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cfb040951e1ad1f610d820f53eb70c852634209
4
- data.tar.gz: 0cd23ef733ce5f3ee4f20eb8bf57846ba23d3bab
3
+ metadata.gz: 181d3d097086d53427ff96763aae47980a9d41d3
4
+ data.tar.gz: 43752a6a8837edf41e83cb3c49f41c9d49c37c76
5
5
  SHA512:
6
- metadata.gz: 1c03eca824b4cb992e1ce10f1e07386959e30951c0ab1b42b274a97920e9dff8c223fecdc843f278c391892d6f5da5bc283e203d9a2a850407c24e92577611fd
7
- data.tar.gz: 06e1dd0fbf5b5383d019cf3346d7b37f5f2d4d1899b5c124b1082b215410083f8275f8e993812d9514569b4c4af7a6ae76d01d8431a441bc737526e4d0019a50
6
+ metadata.gz: 3de95187baa40f0eaa1760859c89340fcc5bea858cb71aa57c7bd09683526060875d9b97156db0ab0e574308d9ecf5e25d6654ae5b47f5288f434f96334375e9
7
+ data.tar.gz: d9d9435a264ee38eaffdd70817a6a0074f214e483861d16bfd75a0d008c1292e9c4be110d3188908519c5db0dd5d10bb928053d95db9f75988150f5636b6f319
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ gems/
1
2
  *.gem
2
3
  *.rbc
3
4
  .bundle
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)
@@ -1,3 +1,3 @@
1
1
  module SvgHeartsYou
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg_hearts_you
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathanael Beisiegel