premailer-rails 1.10.0 → 1.10.1

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
  SHA256:
3
- metadata.gz: 77899a5ba8ec23d6cf40d3b3d630f7872e92cbc959ba64ac528b31a658ae6f13
4
- data.tar.gz: 4d13e28457b824306a517a7cff731fd83713654367562c9a7192e8a632d62aa2
3
+ metadata.gz: d357c2bb12826ea8c9a41f2148d0d3134f85edb088dc0f4db2cabacc510b19a2
4
+ data.tar.gz: 9e422201f804fd5bc5f0b917f5fee8a12d436b43504d1ef8974b6dee8a14c2b0
5
5
  SHA512:
6
- metadata.gz: fc27f934b5772cc632cb7424013d31176afcdf47e60696479eb712c4ee85abe24a5d2524848e862e5a1489aea0778a789b1f2e96dc308df5caeb91a06f763e96
7
- data.tar.gz: c3de5ed3a8625350eff2c07b30ed01cf418f6bb0a820e2244ad1e5c1018f495d8270e699539e21fbcac2e31c43d5e9fc36202b867b4d784c8955f8ea6338d13d
6
+ metadata.gz: 2c6413d57d5203bf15f2d4741677fd06bf1394a1b2ad13d4dc444eeff9dc1185cfe55b4fb49a3bb546cc2a0996a1ef96d22dc62c3ab6e04ce0fb245edf664c3d
7
+ data.tar.gz: d2351334be6a458ed5f1a9d18a39d7f526e5991a88454e64916c1fdeeed0cdac395b0940936c489245d2a204123ea020b6c56f995df735687ee6987a684f24fe
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.10.1
4
+
5
+ - Catch error when sprockets can't find asset (@kirs, #209)
6
+
3
7
  ## v1.10.0
4
8
 
5
9
  - Drop support for hpricot now that premailer-rails also doesn't support it
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.10.0
1
+ 1.10.1
@@ -9,7 +9,7 @@ class Premailer
9
9
 
10
10
  file = file_name(url)
11
11
  ::Rails.application.assets_manifest.find_sources(file).first
12
- rescue Errno::ENOENT => _error
12
+ rescue Errno::ENOENT, TypeError => _error
13
13
  end
14
14
 
15
15
  def file_name(url)
@@ -113,6 +113,23 @@ describe Premailer::Rails::CSSHelper do
113
113
  end
114
114
  end
115
115
 
116
+ context "when find_sources raises TypeError" do
117
+ let(:response) { 'content of base.css' }
118
+ let(:uri) { URI('http://example.com/assets/base.css') }
119
+
120
+ it "falls back to Net::HTTP" do
121
+ expect(Rails.application.assets_manifest).to \
122
+ receive(:find_sources)
123
+ .with('base.css')
124
+ .and_raise(TypeError)
125
+
126
+ allow(Net::HTTP).to \
127
+ receive(:get).with(uri).and_return(response)
128
+ expect(css_for_url('http://example.com/assets/base.css')).to \
129
+ eq(response)
130
+ end
131
+ end
132
+
116
133
  context "when find_sources raises Errno::ENOENT" do
117
134
  let(:response) { 'content of base.css' }
118
135
  let(:uri) { URI('http://example.com/assets/base.css') }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: premailer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipe Fatio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-15 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: premailer