sprockets-image_compressor 0.2.3 → 0.2.4

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: e2a326a020efcd3e6690d8ea8aa955eedbe6d335
4
- data.tar.gz: 722575c0af1fed23263fdc86f381ec899508d18b
3
+ metadata.gz: 81df94dce44c7b5dc9574c4f67e129411a19715d
4
+ data.tar.gz: dcbd97c1609a7b2330b44b68f18c085b545892a0
5
5
  SHA512:
6
- metadata.gz: 983994d84c2ba670d7290be7244ed236d714f9bd0e4d2f7df8ba8dae2201e70fccbbfe6244935fdae509f87a6dc3b461ccf47ca5eb21c051dd0eac5d68144736
7
- data.tar.gz: e02729f65fdfc1ee12f523442140443b6543233c649a2caf4cf29d3034e59c1c1b5c4ebbe8ad67454f8c8680969b56cc4139680847553821388a9bdb977bea45
6
+ metadata.gz: 0200cb52f50b03b36692dbb1e2577ef6b900720dbd993bdc0f462dfaf588c921b0a8f71a7f6fad8798d537fe6d76c024600d966351c43618c3ae4b02d2c5a693
7
+ data.tar.gz: 6c04631bccf6435785a8f317e00a5d76b4321ebfa9615af0be50fa74534ecd96b22bfc18b9ee5537ee17f7ee249945553281f25d3e00f519922293c7c2d9385e
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1
4
+ # 2.1.0 throws exception until issue is resolved: https://github.com/travis-ci/travis-ci/issues/2220
5
+ before_install:
6
+ - sudo apt-get update -qq
7
+ - sudo apt-get install -y jpegoptim pngcrush
8
+
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Image compressor processor for Sprockets
2
2
 
3
+ [![Build Status](https://travis-ci.org/botandrose/sprockets-image_compressor.svg?branch=master)](https://travis-ci.org/botandrose/sprockets-image_compressor)
4
+
3
5
  Sprockets preprocessor to losslessly compress .png and .jpg images using [pngcrush](http://pmt.sourceforge.net/pngcrush/) and [jpegoptim](http://www.kokkonen.net/tjko/projects.html).
4
6
 
5
7
  ## Integration with Rails 3.1+
@@ -16,6 +18,17 @@ The gem ships with a Railtie which will automatically register the compressor pr
16
18
 
17
19
  If the environment doesn't have pngcrush and/or jpegoptim installed, the gem will fall back on binaries packaged with the gem. Currently, only 32bit and 64bit linux binaries are included. Pull requests welcome for other architectures!
18
20
 
21
+ ## Gotchas
22
+
23
+ If you have other sprockets processors registered for images, e.g. `sprockets-webp`, the relative order that they are required can matter. Please load `sprockets-image_compressor` _before_ the others:
24
+
25
+ ```ruby
26
+ gem 'sprockets-image_compressor'
27
+ gem 'sprockets-webp'
28
+ ```
29
+
30
+ See [#15](https://github.com/botandrose/sprockets-image_compressor/issues/15) for more information.
31
+
19
32
  ## TODO
20
33
 
21
34
  * Provide configuration hooks
@@ -15,8 +15,7 @@ module Sprockets
15
15
  file.close
16
16
 
17
17
  out = `#{binary_path} --strip-all #{file.path} 2>&1`
18
- file.open
19
- compressed_jpg_data = file.read
18
+ compressed_jpg_data = IO.binread(file.path)
20
19
  end
21
20
  compressed_jpg_data
22
21
  end
@@ -16,10 +16,7 @@ module Sprockets
16
16
  in_file.close
17
17
 
18
18
  out = `#{binary_path} #{in_file.path} #{out_file_path} 2>&1`
19
-
20
- File.open out_file_path, "rb" do |out_file|
21
- compressed_png_data = out_file.read
22
- end
19
+ compressed_png_data = IO.binread(out_file_path)
23
20
  File.unlink out_file_path
24
21
  end
25
22
  compressed_png_data
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Imagecompressor
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
@@ -24,4 +24,5 @@ Gem::Specification.new do |s|
24
24
  s.add_development_dependency "rspec"
25
25
  s.add_development_dependency "rack-test"
26
26
  s.add_development_dependency "byebug"
27
+ s.add_development_dependency "rake"
27
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-image_compressor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
11
+ date: 2014-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Losslessly compress images in the Rails asset pipeline
70
84
  email:
71
85
  - micah@botandrose.com
@@ -78,6 +92,7 @@ extensions: []
78
92
  extra_rdoc_files: []
79
93
  files:
80
94
  - .gitignore
95
+ - .travis.yml
81
96
  - CHANGELOG.md
82
97
  - Gemfile
83
98
  - README.md
@@ -123,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
138
  version: '0'
124
139
  requirements: []
125
140
  rubyforge_project: sprockets-image_compressor
126
- rubygems_version: 2.2.0
141
+ rubygems_version: 2.2.2
127
142
  signing_key:
128
143
  specification_version: 4
129
144
  summary: Losslessly compress images in the Rails asset pipeline