sprockets-image_compressor 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/README.md +13 -0
- data/lib/sprockets/image_compressor/jpg_compressor.rb +1 -2
- data/lib/sprockets/image_compressor/png_compressor.rb +1 -4
- data/lib/sprockets/image_compressor/version.rb +1 -1
- data/sprockets-image_compressor.gemspec +1 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81df94dce44c7b5dc9574c4f67e129411a19715d
|
4
|
+
data.tar.gz: dcbd97c1609a7b2330b44b68f18c085b545892a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0200cb52f50b03b36692dbb1e2577ef6b900720dbd993bdc0f462dfaf588c921b0a8f71a7f6fad8798d537fe6d76c024600d966351c43618c3ae4b02d2c5a693
|
7
|
+
data.tar.gz: 6c04631bccf6435785a8f317e00a5d76b4321ebfa9615af0be50fa74534ecd96b22bfc18b9ee5537ee17f7ee249945553281f25d3e00f519922293c7c2d9385e
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Image compressor processor for Sprockets
|
2
2
|
|
3
|
+
[](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
|
@@ -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
|
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.
|
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-
|
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.
|
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
|