sprockets-image_compressor_holder 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.travis.yml +8 -0
- data/CHANGELOG.md +39 -0
- data/Gemfile +4 -0
- data/README.md +45 -0
- data/Rakefile +6 -0
- data/bin/jpegoptim.i386.linux +0 -0
- data/bin/jpegoptim.x86_64.linux +0 -0
- data/bin/pngcrush.i386.linux +0 -0
- data/bin/pngcrush.x86_64.linux +0 -0
- data/lib/sprockets-image_compressor.rb +1 -0
- data/lib/sprockets/image_compressor.rb +5 -0
- data/lib/sprockets/image_compressor/base.rb +33 -0
- data/lib/sprockets/image_compressor/integration.rb +128 -0
- data/lib/sprockets/image_compressor/jpg_compressor.rb +24 -0
- data/lib/sprockets/image_compressor/png_compressor.rb +32 -0
- data/lib/sprockets/image_compressor/railtie.rb +9 -0
- data/lib/sprockets/image_compressor/version.rb +5 -0
- data/spec/compressors/jpg_compressor_spec.rb +40 -0
- data/spec/compressors/png_compressor_spec.rb +47 -0
- data/spec/fixtures/largejpg.jpg +0 -0
- data/spec/fixtures/largepng.png +0 -0
- data/spec/fixtures/smalljpg.jpg +0 -0
- data/spec/fixtures/smallpng.png +0 -0
- data/spec/fixtures/test.css +3 -0
- data/spec/integration/sprockets_integration_spec.rb +33 -0
- data/sprockets-image_compressor.gemspec +28 -0
- metadata +153 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: efb078028d8af5713ba2f1aed4396e0cdbefda21
|
4
|
+
data.tar.gz: 790b170766c6c92f81c434905282b934ca87d6b4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 70fcdd1369e4ba5b1b2230bea6068b73693bac8e4973f99bfadd55e7564ea2648388590a22fea688f1148b74b7a73f43d5aafb9e14806766ada522337a307b68
|
7
|
+
data.tar.gz: 6956c8fdc7fc12eced7734ab9fd6a83513c76bde43bd187a04ba4b498f79a637681b6edd360f3e1a0dfe4a0bc82386216947a29fcf6d199b3d00109fd277c9ee
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
0.2.4 (05/18/2014)
|
2
|
+
-------------------------
|
3
|
+
* Bugfix: jpgs weren't being opened in binary mode. Thanks, @JakeTheSnake3p0!
|
4
|
+
|
5
|
+
0.2.3 (04/10/2014)
|
6
|
+
-------------------------
|
7
|
+
* Bugfix: Return original file and warn if compression fails. Thanks, @tomchentw!
|
8
|
+
|
9
|
+
0.2.2 (09/20/2013)
|
10
|
+
-------------------------
|
11
|
+
|
12
|
+
* Bugfix: Work on Rails 4. Thanks, @dkubb!
|
13
|
+
|
14
|
+
0.2.1 (07/20/2012)
|
15
|
+
-------------------------
|
16
|
+
|
17
|
+
* Bugfix: Work with Sprockets::Rails. Thanks, @florentmorin!
|
18
|
+
* Bugfix: Include license in gemspec. Thanks, @sunny!
|
19
|
+
|
20
|
+
0.2.0 (01/28/2012)
|
21
|
+
-------------------------
|
22
|
+
|
23
|
+
* Feature: Fallback to vendored binaries if pngcrush and/or jpegoptim aren't installed on the system. Works on Heroku, now!
|
24
|
+
|
25
|
+
0.1.2 (01/26/2012)
|
26
|
+
-------------------------
|
27
|
+
|
28
|
+
* Bugfix: Works on Rails 3.1 and 3.2 on Ruby 1.9
|
29
|
+
|
30
|
+
0.1.1 (12/26/2011)
|
31
|
+
-------------------------
|
32
|
+
|
33
|
+
* Bugfix: Make sure we're using binary encoding when dealing with the image files
|
34
|
+
* Bugfix: Add basic sprockets integration tests
|
35
|
+
|
36
|
+
0.1.0 (09/21/2011)
|
37
|
+
-------------------------
|
38
|
+
|
39
|
+
* Initial public release!
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Image compressor processor for Sprockets
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/botandrose/sprockets-image_compressor.svg?branch=master)](https://travis-ci.org/botandrose/sprockets-image_compressor)
|
4
|
+
|
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).
|
6
|
+
|
7
|
+
## Integration with Rails 3.1+
|
8
|
+
|
9
|
+
Just add this gem to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'sprockets-image_compressor'
|
13
|
+
````
|
14
|
+
|
15
|
+
The gem ships with a Railtie which will automatically register the compressor preprocessors.
|
16
|
+
|
17
|
+
## Now with vendored binary fallbacks / Heroku support!
|
18
|
+
|
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!
|
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
|
+
|
32
|
+
## TODO
|
33
|
+
|
34
|
+
* Provide configuration hooks
|
35
|
+
* Test Railtie
|
36
|
+
|
37
|
+
## Credits
|
38
|
+
|
39
|
+
* @nhogle for help with compiling and packaging the jpegoptim and pngcrush binaries
|
40
|
+
* @florentmorin for compatibility with sprockets-rails
|
41
|
+
* @dkubb for compatibility with Rails 4
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
(MIT License) - Copyright (c) 2012 Micah Geisel
|
data/Rakefile
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
require "sprockets/image_compressor"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "tempfile"
|
2
|
+
|
3
|
+
module Sprockets
|
4
|
+
module ImageCompressor
|
5
|
+
GEM_ROOT = File.expand_path File.join(File.dirname(__FILE__), "../../../")
|
6
|
+
|
7
|
+
class Base
|
8
|
+
def binary_path
|
9
|
+
@binary_path ||= begin
|
10
|
+
try_vendored_binaries || try_system_binary or raise """
|
11
|
+
Can't find an installed version of #{@name}, and none of the vendored binaries seem to work.
|
12
|
+
Please install #{@name}, or open an issue on the project page at https://github.com/botandrose/sprockets-image_compressor
|
13
|
+
"""
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def try_system_binary
|
20
|
+
system_binary = `which #{@name}`.chomp
|
21
|
+
system_binary if system_binary.length > 0
|
22
|
+
end
|
23
|
+
|
24
|
+
def try_vendored_binaries
|
25
|
+
# use the first vendored binary that doesn't shit the bed when we ask for its version
|
26
|
+
vendored_binaries = Dir["#{GEM_ROOT}/bin/#{@name}.*"].sort
|
27
|
+
vendored_binaries.find do |path|
|
28
|
+
system("#{path} -version 2> /dev/null > /dev/null")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
module Sprockets
|
2
|
+
module ImageCompressor
|
3
|
+
class Integration
|
4
|
+
def self.setup env
|
5
|
+
monkey_patch_older_sprockets!
|
6
|
+
|
7
|
+
env.register_mime_type 'image/png', '.png'
|
8
|
+
env.register_postprocessor 'image/png', :png_compressor do |context, data|
|
9
|
+
PngCompressor.new.compress data
|
10
|
+
end
|
11
|
+
|
12
|
+
env.register_mime_type 'image/jpeg', '.jpg'
|
13
|
+
env.register_postprocessor 'image/jpeg', :jpg_compressor do |context, data|
|
14
|
+
JpgCompressor.new.compress data
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# Rails locks down Sprockets to an older version, which will cause the image compressor to barf on ruby 1.9.
|
19
|
+
# Monkey patch in binary fixes from Sprockets 2.2.0.
|
20
|
+
def self.monkey_patch_older_sprockets!
|
21
|
+
return unless Sprockets::VERSION =~ /2\.[01]\.\d/ # Sprockets version >= 2.0.0 and < 2.2.0
|
22
|
+
return unless "".respond_to?(:valid_encoding?) # is ruby 1.9?
|
23
|
+
|
24
|
+
Sprockets::BundledAsset.class_eval do
|
25
|
+
def build_dependency_context_and_body
|
26
|
+
start_time = Time.now.to_f
|
27
|
+
|
28
|
+
context = blank_context
|
29
|
+
|
30
|
+
# Read original data once and pass it along to `Context`
|
31
|
+
mime_type = environment.mime_types(pathname.extname)
|
32
|
+
encoding = environment.encoding_for_mime_type(mime_type)
|
33
|
+
if encoding && "".respond_to?(:valid_encoding?)
|
34
|
+
data = Sprockets::Utils.read_unicode(pathname, encoding)
|
35
|
+
else
|
36
|
+
data = Sprockets::Utils.read_unicode(pathname)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Prime digest cache with data, since we happen to have it
|
40
|
+
environment.file_digest(pathname, data)
|
41
|
+
|
42
|
+
# Runs all processors on `Context`
|
43
|
+
body = context.evaluate(pathname, :data => data)
|
44
|
+
|
45
|
+
@dependency_context, @body = context, body
|
46
|
+
|
47
|
+
elapsed_time = ((Time.now.to_f - start_time) * 1000).to_i
|
48
|
+
logger.info "Compiled #{logical_path} (#{elapsed_time}ms) (pid #{Process.pid})"
|
49
|
+
|
50
|
+
return context, body
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
Sprockets::Context.class_eval do
|
55
|
+
def evaluate(path, options = {})
|
56
|
+
pathname = resolve(path)
|
57
|
+
attributes = environment.attributes_for(pathname)
|
58
|
+
processors = options[:processors] || attributes.processors
|
59
|
+
|
60
|
+
if options[:data]
|
61
|
+
result = options[:data]
|
62
|
+
else
|
63
|
+
mime_type = environment.mime_types(pathname.extname)
|
64
|
+
encoding = environment.encoding_for_mime_type(mime_type)
|
65
|
+
if encoding && "".respond_to?(:valid_encoding?)
|
66
|
+
result = Sprockets::Utils.read_unicode(pathname, encoding)
|
67
|
+
else
|
68
|
+
result = Sprockets::Utils.read_unicode(pathname)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
processors.each do |processor|
|
73
|
+
begin
|
74
|
+
template = processor.new(pathname.to_s) { result }
|
75
|
+
result = template.render(self, {})
|
76
|
+
rescue Exception => e
|
77
|
+
annotate_exception! e
|
78
|
+
raise
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
result
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
Sprockets::Mime.module_eval do
|
87
|
+
# Mime types that should be opened with BINARY encoding.
|
88
|
+
def binary_mime_types
|
89
|
+
@binary_mime_types ||= [ %r{^(image|audio|video)/} ]
|
90
|
+
end
|
91
|
+
|
92
|
+
# Returns the correct encoding for a given mime type, while falling
|
93
|
+
# back on the default external encoding, if it exists.
|
94
|
+
def encoding_for_mime_type(type)
|
95
|
+
encoding = "BINARY" if binary_mime_types.any? { |matcher| matcher === type }
|
96
|
+
encoding ||= default_external_encoding if respond_to?(:default_external_encoding)
|
97
|
+
encoding
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
Sprockets::Utils.module_eval do
|
102
|
+
def self.utf8_bom_pattern
|
103
|
+
@ut8_bom_pattern ||= Regexp.new("\\A\uFEFF".encode('utf-8'))
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.read_unicode(pathname, external_encoding = Encoding.default_external)
|
107
|
+
pathname.open("r:#{external_encoding}") do |f|
|
108
|
+
f.read.tap do |data|
|
109
|
+
# Eager validate the file's encoding. In most cases we
|
110
|
+
# expect it to be UTF-8 unless `default_external` is set to
|
111
|
+
# something else. An error is usually raised if the file is
|
112
|
+
# saved as UTF-16 when we expected UTF-8.
|
113
|
+
if !data.valid_encoding?
|
114
|
+
raise EncodingError, "#{pathname} has a invalid " +
|
115
|
+
"#{data.encoding} byte sequence"
|
116
|
+
|
117
|
+
# If the file is UTF-8 and theres a BOM, strip it for safe concatenation.
|
118
|
+
elsif data.encoding.name == "UTF-8" && data =~ utf8_bom_pattern
|
119
|
+
data.sub!(utf8_bom_pattern, "")
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "sprockets/image_compressor/base"
|
2
|
+
|
3
|
+
module Sprockets
|
4
|
+
module ImageCompressor
|
5
|
+
class JpgCompressor < Base
|
6
|
+
def initialize
|
7
|
+
@name = "convert"
|
8
|
+
end
|
9
|
+
|
10
|
+
def compress(content)
|
11
|
+
compressed_jpg_data = ""
|
12
|
+
Tempfile.open ["file", ".jpg"] do |file|
|
13
|
+
file.binmode
|
14
|
+
file.write content
|
15
|
+
file.close
|
16
|
+
|
17
|
+
out = `#{binary_path} -strip -interlace Plance #{file.path} 2>&1`
|
18
|
+
compressed_jpg_data = IO.binread(file.path)
|
19
|
+
end
|
20
|
+
compressed_jpg_data
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "sprockets/image_compressor/base"
|
2
|
+
|
3
|
+
module Sprockets
|
4
|
+
module ImageCompressor
|
5
|
+
class PngCompressor < Base
|
6
|
+
def initialize
|
7
|
+
@name = "pngcrush"
|
8
|
+
end
|
9
|
+
|
10
|
+
def compress(content)
|
11
|
+
compressed_png_data = ""
|
12
|
+
Tempfile.open ["in_file", ".png"] do |in_file|
|
13
|
+
in_file.binmode
|
14
|
+
out_file_path = in_file.path + ".optimized.png"
|
15
|
+
in_file.write content
|
16
|
+
in_file.close
|
17
|
+
|
18
|
+
out = `#{binary_path} -rem alla -rem text #{in_file.path} #{out_file_path} 2>&1`
|
19
|
+
compressed_png_data = IO.binread(out_file_path)
|
20
|
+
File.unlink out_file_path
|
21
|
+
end
|
22
|
+
compressed_png_data
|
23
|
+
|
24
|
+
rescue Errno::ENOENT => e
|
25
|
+
# error during compression so out_file not found
|
26
|
+
# return original content as a fallback
|
27
|
+
warn "sprockets-image_compressor: PNG compression failed... returning original."
|
28
|
+
content
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "sprockets/image_compressor"
|
2
|
+
|
3
|
+
describe Sprockets::ImageCompressor::JpgCompressor do
|
4
|
+
let(:compressor) { Sprockets::ImageCompressor::JpgCompressor.new }
|
5
|
+
let(:gem_root) { Sprockets::ImageCompressor::GEM_ROOT }
|
6
|
+
|
7
|
+
describe "#binary_path" do
|
8
|
+
context "when jpegoptim is installed" do
|
9
|
+
before do
|
10
|
+
compressor.should_receive(:`).with("which jpegoptim").and_return("/path/to/jpegoptim\n")
|
11
|
+
end
|
12
|
+
|
13
|
+
it "prefers the system's binary" do
|
14
|
+
compressor.binary_path.should == "/path/to/jpegoptim"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "when jpegoptim is missing and we're on a supported system" do
|
19
|
+
before do
|
20
|
+
compressor.should_receive(:`).with("which jpegoptim").and_return("")
|
21
|
+
compressor.should_receive(:system).and_return(true)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "falls back to a vendored binary" do
|
25
|
+
compressor.binary_path.should include("#{gem_root}/bin/jpegoptim")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context "when jpegoptim is missing and we're on an unsupported system" do
|
30
|
+
before do
|
31
|
+
compressor.should_receive(:`).with("which jpegoptim").and_return("")
|
32
|
+
compressor.should_receive(:system).twice.and_return(false)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "raises hell" do
|
36
|
+
lambda { compressor.binary_path }.should raise_exception
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "sprockets/image_compressor"
|
2
|
+
|
3
|
+
describe Sprockets::ImageCompressor::PngCompressor do
|
4
|
+
let(:compressor) { Sprockets::ImageCompressor::PngCompressor.new }
|
5
|
+
let(:gem_root) { Sprockets::ImageCompressor::GEM_ROOT }
|
6
|
+
|
7
|
+
describe "#binary_path" do
|
8
|
+
context "when pngcrush is installed" do
|
9
|
+
before do
|
10
|
+
compressor.should_receive(:`).with("which pngcrush").and_return("/path/to/pngcrush\n")
|
11
|
+
end
|
12
|
+
|
13
|
+
it "prefers the system's binary" do
|
14
|
+
compressor.binary_path.should == "/path/to/pngcrush"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "when pngcrush is missing and we're on a supported system" do
|
19
|
+
before do
|
20
|
+
compressor.should_receive(:`).with("which pngcrush").and_return("")
|
21
|
+
compressor.should_receive(:system).and_return(true)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "falls back to a vendored binary" do
|
25
|
+
compressor.binary_path.should include("#{gem_root}/bin/pngcrush")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context "when pngcrush is missing and we're an unsupported system" do
|
30
|
+
before do
|
31
|
+
compressor.should_receive(:`).with("which pngcrush").and_return("")
|
32
|
+
compressor.should_receive(:system).twice.and_return(false)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "raises hell" do
|
36
|
+
lambda { compressor.binary_path }.should raise_exception
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "#compress" do
|
42
|
+
it "returns uncompressable content as-is with a warning" do
|
43
|
+
compressor.should_receive(:warn)
|
44
|
+
compressor.compress("asdf").should == "asdf"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "rack/test"
|
2
|
+
require "sprockets"
|
3
|
+
require "sprockets/image_compressor"
|
4
|
+
|
5
|
+
describe "sprockets integration" do
|
6
|
+
include Rack::Test::Methods
|
7
|
+
|
8
|
+
let(:app) do
|
9
|
+
Sprockets::Environment.new.tap do |env|
|
10
|
+
Sprockets::ImageCompressor::Integration.setup env
|
11
|
+
env.append_path "spec/fixtures"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should compress pngs" do
|
16
|
+
big_response = get "/largepng.png"
|
17
|
+
small_response = get "/smallpng.png"
|
18
|
+
big_response.headers["Content-Length"].should == small_response.headers["Content-Length"]
|
19
|
+
big_response.body.should == small_response.body
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should compress jpgs" do
|
23
|
+
big_response = get "/largejpg.jpg"
|
24
|
+
small_response = get "/smalljpg.jpg"
|
25
|
+
big_response.headers["Content-Length"].should == small_response.headers["Content-Length"]
|
26
|
+
big_response.body.should == small_response.body
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should still serve text assets" do
|
30
|
+
response = get "/test.css"
|
31
|
+
response.status.should == 200
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "sprockets/image_compressor/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "sprockets-image_compressor_holder"
|
7
|
+
s.version = Sprockets::Imagecompressor::VERSION
|
8
|
+
s.authors = ["Micah Geisel"]
|
9
|
+
s.email = ["micah@botandrose.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Losslessly compress images in the Rails asset pipeline}
|
12
|
+
s.description = %q{Losslessly compress images in the Rails asset pipeline}
|
13
|
+
s.license = "MIT"
|
14
|
+
|
15
|
+
s.rubyforge_project = "sprockets-image_compressor_holder"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_runtime_dependency "sprockets"
|
23
|
+
|
24
|
+
s.add_development_dependency "rspec"
|
25
|
+
s.add_development_dependency "rack-test"
|
26
|
+
s.add_development_dependency "byebug"
|
27
|
+
s.add_development_dependency "rake"
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sprockets-image_compressor_holder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Micah Geisel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sprockets
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rack-test
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
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'
|
83
|
+
description: Losslessly compress images in the Rails asset pipeline
|
84
|
+
email:
|
85
|
+
- micah@botandrose.com
|
86
|
+
executables:
|
87
|
+
- jpegoptim.i386.linux
|
88
|
+
- jpegoptim.x86_64.linux
|
89
|
+
- pngcrush.i386.linux
|
90
|
+
- pngcrush.x86_64.linux
|
91
|
+
extensions: []
|
92
|
+
extra_rdoc_files: []
|
93
|
+
files:
|
94
|
+
- ".gitignore"
|
95
|
+
- ".travis.yml"
|
96
|
+
- CHANGELOG.md
|
97
|
+
- Gemfile
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- bin/jpegoptim.i386.linux
|
101
|
+
- bin/jpegoptim.x86_64.linux
|
102
|
+
- bin/pngcrush.i386.linux
|
103
|
+
- bin/pngcrush.x86_64.linux
|
104
|
+
- lib/sprockets-image_compressor.rb
|
105
|
+
- lib/sprockets/image_compressor.rb
|
106
|
+
- lib/sprockets/image_compressor/base.rb
|
107
|
+
- lib/sprockets/image_compressor/integration.rb
|
108
|
+
- lib/sprockets/image_compressor/jpg_compressor.rb
|
109
|
+
- lib/sprockets/image_compressor/png_compressor.rb
|
110
|
+
- lib/sprockets/image_compressor/railtie.rb
|
111
|
+
- lib/sprockets/image_compressor/version.rb
|
112
|
+
- spec/compressors/jpg_compressor_spec.rb
|
113
|
+
- spec/compressors/png_compressor_spec.rb
|
114
|
+
- spec/fixtures/largejpg.jpg
|
115
|
+
- spec/fixtures/largepng.png
|
116
|
+
- spec/fixtures/smalljpg.jpg
|
117
|
+
- spec/fixtures/smallpng.png
|
118
|
+
- spec/fixtures/test.css
|
119
|
+
- spec/integration/sprockets_integration_spec.rb
|
120
|
+
- sprockets-image_compressor.gemspec
|
121
|
+
homepage: ''
|
122
|
+
licenses:
|
123
|
+
- MIT
|
124
|
+
metadata: {}
|
125
|
+
post_install_message:
|
126
|
+
rdoc_options: []
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
requirements: []
|
140
|
+
rubyforge_project: sprockets-image_compressor_holder
|
141
|
+
rubygems_version: 2.4.6
|
142
|
+
signing_key:
|
143
|
+
specification_version: 4
|
144
|
+
summary: Losslessly compress images in the Rails asset pipeline
|
145
|
+
test_files:
|
146
|
+
- spec/compressors/jpg_compressor_spec.rb
|
147
|
+
- spec/compressors/png_compressor_spec.rb
|
148
|
+
- spec/fixtures/largejpg.jpg
|
149
|
+
- spec/fixtures/largepng.png
|
150
|
+
- spec/fixtures/smalljpg.jpg
|
151
|
+
- spec/fixtures/smallpng.png
|
152
|
+
- spec/fixtures/test.css
|
153
|
+
- spec/integration/sprockets_integration_spec.rb
|