sprockets-svg 1.2.0 → 1.3.0

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
  SHA1:
3
- metadata.gz: b42a572a73bd361164f32df1f502be95be3b9701
4
- data.tar.gz: bcee94585135c1536ca850faafbdb2e60b6d80db
3
+ metadata.gz: fee6af75119887732b4e97a8afaf1ec08ef1f3c1
4
+ data.tar.gz: 7c1a691014cff3c1b015bf61c4a5aabcbf29db6f
5
5
  SHA512:
6
- metadata.gz: 997fab96ba72f38a7daf36b2416017b1765992e07ad68aa354e6140f054e76d5a26e13973476a8cc22c815248dd657eba9f28ec205e84ff842408ce89a582f85
7
- data.tar.gz: 3bdaf83efda5ba224e182c75e17b7cdec93cc16a287ad4a07304640547f6bda27ced4d4056a3c678b8751b5b1548309ec58e51d76dc44c5336fb63801bb93a00
6
+ metadata.gz: 1a32892bca945d59c47911c913b93661115dcc065797b05f00f861a37acd105937058558e1da1a7b123fe9535642e0fb2cb4865b607040c6066d74eb71cde295
7
+ data.tar.gz: 5c68e3ad341762caf3fb705439a46c35b165c4c24dc949731d8650c5e764f751ca6b8e650198af074b46fdd00d7e9810d308433e1d61d7a0d4cee6eef47da9ad
@@ -4,7 +4,7 @@ language: ruby
4
4
  before_script:
5
5
  - gem install bundler
6
6
  rvm:
7
- - 2.0
8
- - 2.1.6
9
- - 2.2.5
10
- - 2.3.1
7
+ - 2.2.10
8
+ - 2.3.7
9
+ - 2.4.4
10
+ - 2.5.1
@@ -1,6 +1,6 @@
1
1
  require 'sprockets/svg/version'
2
2
  require 'chunky_png'
3
- require 'rmagick'
3
+ require 'mini_magick'
4
4
 
5
5
  module Sprockets
6
6
  module Svg
@@ -11,9 +11,9 @@ module Sprockets
11
11
  # TODO: integrate svgo instead: https://github.com/svg/svgo
12
12
  # See https://github.com/lautis/uglifier on how to integrate a npm package as a gem.
13
13
  def self.convert(svg_blob)
14
- image_list = Magick::Image.from_blob(svg_blob) { self.format = 'SVG' }
15
- image = image_list.first
16
- image.format = 'PNG'
14
+ stream = StringIO.new(svg_blob)
15
+ image = MiniMagick::Image.create('.svg', false) { |file| IO.copy_stream(stream, file) }
16
+ image.format('png')
17
17
  strip_png_metadata(image.to_blob)
18
18
  end
19
19
 
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Svg
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  end
@@ -69,15 +69,15 @@ describe 'Sprockets::Svg' do
69
69
  describe AssetsController, type: :controller do
70
70
 
71
71
  it 'rack' do
72
- get :test, file: 'facebook.png'
73
- expect(response).to be_success
72
+ get :test, params: { file: 'facebook.png' }
73
+ expect(response).to be_successful
74
74
  expect(response.body.force_encoding('utf-8')).to be_starts_with("\x89PNG\r\n".force_encoding('utf-8'))
75
75
  expect(response.headers['Content-Type']).to match %r{image/png}
76
76
  end
77
77
 
78
78
  it 'compile scss' do
79
- get :test, file: 'application.css'
80
- expect(response).to be_success
79
+ get :test, params: { file: 'application.css' }
80
+ expect(response).to be_successful
81
81
  expect(response.body).to match %r{url\(/assets/facebook-\w+\.svg\)}
82
82
  expect(response.body).to match %r{url\(/assets/facebook-\w+\.png\)}
83
83
  end
@@ -21,6 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'bundler', '~> 1.5'
22
22
  spec.add_dependency 'sprockets', '>= 3'
23
23
  spec.add_dependency 'nokogiri'
24
- spec.add_dependency 'rmagick'
24
+ spec.add_dependency 'mini_magick'
25
25
  spec.add_dependency 'chunky_png'
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rmagick
56
+ name: mini_magick
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="