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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 873526b73751d1c4ab2a24f49ea3f72e222327f1
4
- data.tar.gz: d8fd53ae6da7f8569bd4ed3a25d3074b356b5348
3
+ metadata.gz: 990380d8f420155eafb025e1c1eb0047609a71f3
4
+ data.tar.gz: aee9da81c4b597622ef35c13efa5c8ea9b573033
5
5
  SHA512:
6
- metadata.gz: 7da3b1614a2fb2cbce7b377ad866ac669103b906490598a308c6bd39eb37d4768603ce84867207432862878a9afacc1e2e05b1afd6d3e5dc06ffd53bc6bedc8d
7
- data.tar.gz: a1b84d889051c958cc618f3f95dbd851ed05c153bf47cafb38679f704ec5d0249ebc351f97cad6cdbb0c5e84c4fc1ed2a83898b190ad23f2d1f1d3d7213a1df9
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.0...HEAD
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
- * `id`: set a ID attribute on the SVG
69
- * `class`: set a CSS class attribute on the SVG
70
- * `data`: add data attributes to the SVG (supply as a hash)
71
- * `size`: set width and height attributes on the SVG
72
- * Can also be set using `height` and/or `width` attributes, which take
73
- precedence over `size`
74
- * Supplied as "{Width} * {Height}" or "{Number}", so "30px*45px" becomes `width="30px"`
75
- and `height="45px"`, and "50%" becomes `width="50%"` and `height="50%"`
76
- * `title`: add a \<title\> node inside the top level of the SVG document
77
- * `desc`: add a \<desc\> node inside the top level of the SVG document
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
 
@@ -1,7 +1,8 @@
1
1
  module InlineSvg
2
2
  class FindsAssetPaths
3
3
  def self.by_filename(filename)
4
- configured_asset_finder.find_asset(filename)
4
+ asset = configured_asset_finder.find_asset(filename)
5
+ asset && asset.pathname
5
6
  end
6
7
 
7
8
  def self.configured_asset_finder
@@ -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
- InlineSvg.configure do |config|
9
- config.asset_finder = app.instance_variable_get(:@assets) # In most cases this will be the Sprockets::Environment instance of the Rails app.
10
- end
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
@@ -1,3 +1,3 @@
1
1
  module InlineSvg
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -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.1
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-30 00:00:00.000000000 Z
11
+ date: 2015-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler