inline_svg 0.5.1 → 0.5.2
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 +10 -1
- data/README.md +11 -13
- data/lib/inline_svg/finds_asset_paths.rb +2 -1
- data/lib/inline_svg/railtie.rb +8 -3
- data/lib/inline_svg/version.rb +1 -1
- data/spec/finds_asset_paths_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 990380d8f420155eafb025e1c1eb0047609a71f3
|
4
|
+
data.tar.gz: aee9da81c4b597622ef35c13efa5c8ea9b573033
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 851ada722497615d1f383d2ea04a29cc041892846f0403e23493eb9146f2d1287cb0ddc72c228297fa6cf7c80b15971492c7fb03da23fdd636e7ce178fb519d5
|
7
|
+
data.tar.gz: 1a18dba4802def009dbfd927e03da8899530e29940de7efc7f9a73b0dc07fe8056e7451a0e105985bb9b7ae29e2a30e0f073cd819c837a525afc939f362cd9f0
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
## [Unreleased][unreleased]
|
6
6
|
Nothing.
|
7
7
|
|
8
|
+
## [0.5.2] - 2015-04-03
|
9
|
+
### Fixed
|
10
|
+
- Support Sprockets v2 and v3 (Sprockets::Asset no longer to_s to a filename)
|
11
|
+
|
8
12
|
## [0.5.1] - 2015-03-30
|
13
|
+
### Warning
|
14
|
+
*** This version is NOT comaptible with Sprockets >= 3.***
|
15
|
+
|
9
16
|
### Fixed
|
10
17
|
- Support for ActiveSupport (and hence, Rails) 4.2.x. Thanks, @jmarceli.
|
11
18
|
|
@@ -45,7 +52,9 @@ Nothing.
|
|
45
52
|
### Added
|
46
53
|
- Basic Railtie and view helper to inline SVG documents to Rails views.
|
47
54
|
|
48
|
-
[unreleased]: https://github.com/jamesmartin/inline_svg/compare/v0.5.
|
55
|
+
[unreleased]: https://github.com/jamesmartin/inline_svg/compare/v0.5.2...HEAD
|
56
|
+
[0.5.2]: https://github.com/jamesmartin/inline_svg/compare/v0.5.1...v0.5.2
|
57
|
+
[0.5.1]: https://github.com/jamesmartin/inline_svg/compare/v0.5.0...v0.5.1
|
49
58
|
[0.5.0]: https://github.com/jamesmartin/inline_svg/compare/v0.4.0...v0.5.0
|
50
59
|
[0.4.0]: https://github.com/jamesmartin/inline_svg/compare/v0.3.0...v0.4.0
|
51
60
|
[0.3.0]: https://github.com/jamesmartin/inline_svg/compare/v0.2.0...v0.3.0
|
data/README.md
CHANGED
@@ -64,19 +64,17 @@ blue:
|
|
64
64
|
}
|
65
65
|
```
|
66
66
|
|
67
|
-
## Options
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
* `nocomment`: remove comment tags (and other unsafe/unknown tags) from svg
|
79
|
-
(uses the [Loofah](https://github.com/flavorjones/loofah) gem)
|
67
|
+
## Options
|
68
|
+
|
69
|
+
key | description
|
70
|
+
:------- | :----------
|
71
|
+
`id` | set a ID attribute on the SVG
|
72
|
+
`class` | set a CSS class attribute on the SVG
|
73
|
+
`data` | add data attributes to the SVG (supply as a hash)
|
74
|
+
`size` | set width and height attributes on the SVG <br/> Can also be set using `height` and/or `width` attributes, which take precedence over `size` <br/> Supplied as "{Width} * {Height}" or "{Number}", so "30px*45px" becomes `width="30px"` and `height="45px"`, and "50%" becomes `width="50%"` and `height="50%"`
|
75
|
+
`title` | add a \<title\> node inside the top level of the SVG document
|
76
|
+
`desc` | add a \<desc\> node inside the top level of the SVG document
|
77
|
+
`nocomment` | remove comment tags (and other unsafe/unknown tags) from svg (uses the [Loofah](https://github.com/flavorjones/loofah) gem)
|
80
78
|
|
81
79
|
Example:
|
82
80
|
|
data/lib/inline_svg/railtie.rb
CHANGED
@@ -5,9 +5,14 @@ module InlineSvg
|
|
5
5
|
ActiveSupport.on_load :action_view do
|
6
6
|
require "inline_svg/action_view/helpers"
|
7
7
|
include InlineSvg::ActionView::Helpers
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
config.after_initialize do |app|
|
12
|
+
InlineSvg.configure do |config|
|
13
|
+
# In default Rails apps, this will be a fully operational
|
14
|
+
# Sprockets::Environment instance
|
15
|
+
config.asset_finder = app.instance_variable_get(:@assets)
|
11
16
|
end
|
12
17
|
end
|
13
18
|
end
|
data/lib/inline_svg/version.rb
CHANGED
@@ -5,12 +5,12 @@ describe InlineSvg::FindsAssetPaths do
|
|
5
5
|
sprockets = double('SprocketsDouble')
|
6
6
|
|
7
7
|
expect(sprockets).to receive(:find_asset).with('some-file').
|
8
|
-
and_return('/full/path/to/some-file')
|
8
|
+
and_return(double(pathname: Pathname('/full/path/to/some-file')))
|
9
9
|
|
10
10
|
InlineSvg.configure do |config|
|
11
11
|
config.asset_finder = sprockets
|
12
12
|
end
|
13
13
|
|
14
|
-
expect(InlineSvg::FindsAssetPaths.by_filename('some-file')).to eq '/full/path/to/some-file'
|
14
|
+
expect(InlineSvg::FindsAssetPaths.by_filename('some-file')).to eq Pathname('/full/path/to/some-file')
|
15
15
|
end
|
16
16
|
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: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03
|
11
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|