inline_svg 0.9.1 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 531cbb7571d96241484ed757b76633654f153f41
4
- data.tar.gz: 0266d52dd58d93a2f10ce83b13ccdb74ae638292
3
+ metadata.gz: f8cc9c7834d90be148c6dab54da0583e310c6be7
4
+ data.tar.gz: 7d56a72f24be4e162b998b49b8494ec5abf004b6
5
5
  SHA512:
6
- metadata.gz: 0fda6e949182512f4cf42d7301511b056d9db7ce22b0ac56f44e22d74c0ebbc2c2d6c291b1b0e01a407f307105bcf4be0f6a4b60d84714875ddc4ddce6c166f0
7
- data.tar.gz: 97343026ab606662d7010e53695156b555c339362ecde1f1d4d35c07c8fff271141f8236fe465b93684110cd7da7acd86538a33ada8070b0f33640c2a03adb83
6
+ metadata.gz: d2b1f8ecb2a936f8e1a8297b3766c0f11dac1318aca92f9f1ac6a43790fa268cd78aaf10b841ca2890e2493c3f27b7caaf32d8671a8df14cf4e114ca953a6c1f
7
+ data.tar.gz: 5b90cc6cb9531ea88ad2c0326156453c9ef335949311c5288a8a9f75098a2bdb2e9ce784598cbaca17e64acccafe763a99ffe121439abdc9c135f68e10c6a88e
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
  ## [Unreleased][unreleased]
6
6
  - Nothing
7
7
 
8
+ ## [0.10.0] - 2016-07-24
9
+ ### Added
10
+ - Rails 5 support [#43](https://github.com/jamesmartin/inline_svg/pull/43)
11
+ - Support for `Sprockets::Asset`
12
+ [#45](https://github.com/jamesmartin/inline_svg/pull/45)
13
+
8
14
  ## [0.9.1] - 2016-07-18
9
15
  ### Fixed
10
16
  - Provide a hint when the .svg extension is omitted from the filename
@@ -101,8 +107,9 @@ transformations](https://github.com/jamesmartin/inline_svg/blob/master/README.md
101
107
  ### Added
102
108
  - Basic Railtie and view helper to inline SVG documents to Rails views.
103
109
 
104
- [unreleased]: https://github.com/jamesmartin/inline_svg/compare/v0.9.1...HEAD
105
- [0.9.1]: https://github.com/jamesmartin/inline_svg/compare/v0.8.0...v0.9.1
110
+ [unreleased]: https://github.com/jamesmartin/inline_svg/compare/v0.10.0...HEAD
111
+ [0.10.0]: https://github.com/jamesmartin/inline_svg/compare/v0.9.1...v0.10.0
112
+ [0.9.1]: https://github.com/jamesmartin/inline_svg/compare/v0.9.0...v0.9.1
106
113
  [0.9.0]: https://github.com/jamesmartin/inline_svg/compare/v0.8.0...v0.9.0
107
114
  [0.8.0]: https://github.com/jamesmartin/inline_svg/compare/v0.7.0...v0.8.0
108
115
  [0.7.0]: https://github.com/jamesmartin/inline_svg/compare/v0.6.4...v0.7.0
data/inline_svg.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "rspec", "~> 3.2"
24
24
  spec.add_development_dependency "rspec_junit_formatter", "0.2.2"
25
25
 
26
- spec.add_runtime_dependency "activesupport", "~> 4.0"
26
+ spec.add_runtime_dependency "activesupport", ">= 4.0"
27
27
  spec.add_runtime_dependency "nokogiri", "~> 1.6", '~> 1.6'
28
28
  spec.add_runtime_dependency "loofah", ">= 2.0"
29
29
  end
@@ -2,7 +2,7 @@ module InlineSvg
2
2
  class FindsAssetPaths
3
3
  def self.by_filename(filename)
4
4
  asset = configured_asset_finder.find_asset(filename)
5
- asset && asset.pathname
5
+ asset.try(:pathname) || asset.try(:filename)
6
6
  end
7
7
 
8
8
  def self.configured_asset_finder
@@ -1,3 +1,3 @@
1
1
  module InlineSvg
2
- VERSION = "0.9.1"
2
+ VERSION = "0.10.0"
3
3
  end
@@ -2,16 +2,47 @@ require 'pathname'
2
2
  require_relative '../lib/inline_svg'
3
3
 
4
4
  describe InlineSvg::FindsAssetPaths do
5
- it "returns fully qualified file paths from Sprockets" do
6
- sprockets = double('SprocketsDouble')
5
+ context "when sprockets finder returns an object which supports only the pathname method" do
6
+ it "returns fully qualified file paths from Sprockets" do
7
+ sprockets = double('SprocketsDouble')
7
8
 
8
- expect(sprockets).to receive(:find_asset).with('some-file').
9
- and_return(double(pathname: Pathname('/full/path/to/some-file')))
9
+ expect(sprockets).to receive(:find_asset).with('some-file').
10
+ and_return(double(pathname: Pathname('/full/path/to/some-file')))
10
11
 
11
- InlineSvg.configure do |config|
12
- config.asset_finder = sprockets
12
+ InlineSvg.configure do |config|
13
+ config.asset_finder = sprockets
14
+ end
15
+
16
+ expect(InlineSvg::FindsAssetPaths.by_filename('some-file')).to eq Pathname('/full/path/to/some-file')
17
+ end
18
+ end
19
+
20
+ context "when sprockets finder returns an object which supports only the filename method" do
21
+ it "returns fully qualified file paths from Sprockets" do
22
+ sprockets = double('SprocketsDouble')
23
+
24
+ expect(sprockets).to receive(:find_asset).with('some-file').
25
+ and_return(double(filename: Pathname('/full/path/to/some-file')))
26
+
27
+ InlineSvg.configure do |config|
28
+ config.asset_finder = sprockets
29
+ end
30
+
31
+ expect(InlineSvg::FindsAssetPaths.by_filename('some-file')).to eq Pathname('/full/path/to/some-file')
13
32
  end
33
+ end
34
+
35
+ context "when asset is not found" do
36
+ it "returns nil" do
37
+ sprockets = double('SprocketsDouble')
14
38
 
15
- expect(InlineSvg::FindsAssetPaths.by_filename('some-file')).to eq Pathname('/full/path/to/some-file')
39
+ expect(sprockets).to receive(:find_asset).with('some-file').and_return(nil)
40
+
41
+ InlineSvg.configure do |config|
42
+ config.asset_finder = sprockets
43
+ end
44
+
45
+ expect(InlineSvg::FindsAssetPaths.by_filename('some-file')).to be_nil
46
+ end
16
47
  end
17
48
  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.9.1
4
+ version: 0.10.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: 2016-07-18 00:00:00.000000000 Z
11
+ date: 2016-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '4.0'
83
83
  - !ruby/object:Gem::Dependency