inline_svg 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of inline_svg might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -1
- data/lib/inline_svg/action_view/helpers.rb +2 -4
- data/lib/inline_svg/finds_asset_paths.rb +1 -1
- data/lib/inline_svg/version.rb +1 -1
- data/lib/inline_svg/webpack_asset_finder.rb +21 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ebc9f8de24984925fe3457d98efeb29198bbda5551f83b5c2afad97bf61fa8c
|
4
|
+
data.tar.gz: 0ab9a31d27a0a97e4aafb1691af4e9e8c0f03074637237819ba611c73d24b82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e909570434548e33cfc76627819b636b0f28e24b485165b44a467dd7e49c191ccccb082240bd5fec0ae7bd2cfc2686011b56dc3b96ed938530353c6196e8dce8
|
7
|
+
data.tar.gz: d509b78518354a7b1e40cf481cc4cc4b7ea350d006b5268d2106b9700e2ad2eea7e4431ee674b9e7276a1c11ae61f4903cc9e101ffe40e9a902f870d9429c36b
|
data/CHANGELOG.md
CHANGED
@@ -3,8 +3,19 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
5
|
## [Unreleased][unreleased]
|
6
|
+
|
6
7
|
- Nothing
|
7
8
|
|
9
|
+
## [1.7.0] - 2020-02-13
|
10
|
+
### Added
|
11
|
+
- WebpackAssetFinder serves files from dev server if one is running. [#111](https://github.com/jamesmartin/inline_svg/pull/111). Thanks, [@connorshea](https://github.com/connorshea)
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- Using Webpacker and Asset Pipeline in a single App could result in SVGs not
|
15
|
+
being found because the wrong `AssetFinder` was used.
|
16
|
+
[#114](https://github.com/jamesmartin/inline_svg/pull/114). Thanks,
|
17
|
+
[@kylefox](https://github.com/kylefox)
|
18
|
+
|
8
19
|
## [1.6.0] - 2019-11-13
|
9
20
|
### Added
|
10
21
|
- Support Webpack via the new `inline_svg_pack_tag` helper and deprecate `inline_svg` helper in preparation for v2.0.
|
@@ -220,7 +231,9 @@ transformations](https://github.com/jamesmartin/inline_svg/blob/master/README.md
|
|
220
231
|
### Added
|
221
232
|
- Basic Railtie and view helper to inline SVG documents to Rails views.
|
222
233
|
|
223
|
-
[unreleased]: https://github.com/jamesmartin/inline_svg/compare/v1.
|
234
|
+
[unreleased]: https://github.com/jamesmartin/inline_svg/compare/v1.7.0...HEAD
|
235
|
+
[1.7.0]: https://github.com/jamesmartin/inline_svg/compare/v1.6.0...v1.7.0
|
236
|
+
[1.6.0]: https://github.com/jamesmartin/inline_svg/compare/v1.5.2...v1.6.0
|
224
237
|
[1.5.2]: https://github.com/jamesmartin/inline_svg/compare/v1.5.1...v1.5.2
|
225
238
|
[1.5.1]: https://github.com/jamesmartin/inline_svg/compare/v1.5.0...v1.5.1
|
226
239
|
[1.5.0]: https://github.com/jamesmartin/inline_svg/compare/v1.4.0...v1.5.0
|
@@ -69,11 +69,9 @@ module InlineSvg
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def with_asset_finder(asset_finder)
|
72
|
-
|
73
|
-
|
74
|
-
InlineSvg.configuration.asset_finder = asset_finder
|
72
|
+
Thread.current[:inline_svg_asset_finder] = asset_finder
|
75
73
|
output = yield
|
76
|
-
|
74
|
+
Thread.current[:inline_svg_asset_finder] = nil
|
77
75
|
|
78
76
|
output
|
79
77
|
end
|
data/lib/inline_svg/version.rb
CHANGED
@@ -9,11 +9,29 @@ module InlineSvg
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def pathname
|
12
|
-
public_path = Webpacker.config.public_path
|
13
12
|
file_path = Webpacker.instance.manifest.lookup(@filename)
|
14
|
-
return unless
|
13
|
+
return unless file_path
|
15
14
|
|
16
|
-
|
15
|
+
if Webpacker.dev_server.running?
|
16
|
+
asset = Net::HTTP.get(Webpacker.dev_server.host, file_path, Webpacker.dev_server.port)
|
17
|
+
|
18
|
+
begin
|
19
|
+
Tempfile.new(file_path).tap do |file|
|
20
|
+
file.binmode
|
21
|
+
file.write(asset)
|
22
|
+
file.rewind
|
23
|
+
end
|
24
|
+
rescue StandardError => e
|
25
|
+
Rails.logger.error "Error creating tempfile: #{e}"
|
26
|
+
raise
|
27
|
+
end
|
28
|
+
|
29
|
+
else
|
30
|
+
public_path = Webpacker.config.public_path
|
31
|
+
return unless public_path
|
32
|
+
|
33
|
+
File.join(public_path, file_path)
|
34
|
+
end
|
17
35
|
end
|
18
36
|
end
|
19
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_svg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|