paperclip-optimizer 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +20 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +85 -0
- data/Rakefile +1 -0
- data/fixtures/invalid.jpg +29 -0
- data/fixtures/invalid.png +29 -0
- data/fixtures/valid.jpg +0 -0
- data/fixtures/valid.png +0 -0
- data/lib/paperclip-optimizer.rb +31 -0
- data/lib/paperclip-optimizer/processor.rb +32 -0
- data/lib/paperclip-optimizer/version.rb +3 -0
- data/paperclip-optimizer.gemspec +30 -0
- data/spec/paperclip-optimizer_spec.rb +99 -0
- data/spec/schema.rb +8 -0
- data/spec/spec_helper.rb +50 -0
- metadata +198 -0
data/.gitignore
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
|
19
|
+
paperclip-optimizer.sublime-project
|
20
|
+
paperclip-optimizer.sublime-workspace
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
paperclip-optimizer
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-1.9.3-p392
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Jan-Christian Foeh
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
# PaperclipOptimizer
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/janfoeh/paperclip-optimizer.png)](https://travis-ci.org/janfoeh/paperclip-optimizer)
|
4
|
+
[![Dependency Status](https://gemnasium.com/janfoeh/paperclip-optimizer.png)](https://gemnasium.com/janfoeh/paperclip-optimizer)
|
5
|
+
|
6
|
+
PaperClipOptimizer is a processor for [Paperclip](https://github.com/thoughtbot/paperclip) that allows
|
7
|
+
you to optimize and minify uploaded JPG, PNG or GIF images.
|
8
|
+
|
9
|
+
It is just a thin wrapper around [ImageOptim](https://github.com/toy/image_optim),
|
10
|
+
which supports many external optimization libraries like
|
11
|
+
|
12
|
+
* [advpng](http://advancemame.sourceforge.net/doc-advpng.html) from
|
13
|
+
[AdvanceCOMP](http://advancemame.sourceforge.net/comp-readme.html)
|
14
|
+
* [gifsicle](http://www.lcdf.org/gifsicle/)
|
15
|
+
* [jpegoptim](http://www.kokkonen.net/tjko/projects.html)
|
16
|
+
* jpegtran from [Independent JPEG Group's JPEG library](http://www.ijg.org/)
|
17
|
+
* [optipng](http://optipng.sourceforge.net/)
|
18
|
+
* [pngcrush](http://pmt.sourceforge.net/pngcrush/)
|
19
|
+
* [pngout](http://www.advsys.net/ken/util/pngout.htm)
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
Add this line to your application's Gemfile after the Paperclip gem:
|
24
|
+
|
25
|
+
gem 'paperclip-optimizer'
|
26
|
+
|
27
|
+
And then execute:
|
28
|
+
|
29
|
+
$ bundle
|
30
|
+
|
31
|
+
See [ImageOptims README](https://github.com/toy/image_optim#binaries-location)
|
32
|
+
on how to install the various optimization libraries.
|
33
|
+
|
34
|
+
## Usage
|
35
|
+
|
36
|
+
Just add ```:paperclip_optimizer``` to Paperclips ```:processors``` - setting:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
class User < ActiveRecord::Base
|
40
|
+
attr_accessible :avatar
|
41
|
+
has_attached_file :avatar,
|
42
|
+
:styles => { :thumb => "100x100>" },
|
43
|
+
:default_url => "/images/:style/missing.png",
|
44
|
+
:processors => [:thumbnail, :paperclip_optimizer]
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
Remember to include the ```:thumbnail``` processor as well if you want to retain
|
49
|
+
Paperclips geometry functionality.
|
50
|
+
|
51
|
+
### Settings
|
52
|
+
|
53
|
+
By default, PaperclipOptimizer only enables _jpegtran_ and _optipng_. You can
|
54
|
+
pass configuration options to ImageOptim through the ```:styles``` hash:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
class User < ActiveRecord::Base
|
58
|
+
attr_accessible :avatar
|
59
|
+
has_attached_file :avatar,
|
60
|
+
:styles => {
|
61
|
+
:thumb => {
|
62
|
+
:geometry => "100x100>",
|
63
|
+
:paperclip_optimizer => {
|
64
|
+
:pngout => {
|
65
|
+
:strategy => 1
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
},
|
70
|
+
:default_url => "/images/:style/missing.png",
|
71
|
+
:processors => [:thumbnail, :paperclip_optimizer]
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
See [ImageOptims options](https://github.com/toy/image_optim#options) for
|
76
|
+
all available options.
|
77
|
+
|
78
|
+
## Contributing
|
79
|
+
|
80
|
+
1. Fork it
|
81
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
82
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
83
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
84
|
+
5. Create new Pull Request
|
85
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Paperclip::Optimizer
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'paperclip-optimizer'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install paperclip-optimizer
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Paperclip::Optimizer
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'paperclip-optimizer'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install paperclip-optimizer
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/fixtures/valid.jpg
ADDED
Binary file
|
data/fixtures/valid.png
ADDED
Binary file
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "paperclip-optimizer/version"
|
2
|
+
require "paperclip-optimizer/processor"
|
3
|
+
|
4
|
+
module PaperclipOptimizer
|
5
|
+
DEFAULT_SETTINGS = {
|
6
|
+
verbose: true,
|
7
|
+
pngcrush: false,
|
8
|
+
pngout: false,
|
9
|
+
advpng: false,
|
10
|
+
jpegoptim: false,
|
11
|
+
gifsicle: false
|
12
|
+
}.freeze
|
13
|
+
|
14
|
+
# Helper class for capturing ImageOptims error output and redirecting it
|
15
|
+
# to Paperclips logger instance
|
16
|
+
class StdErrCapture
|
17
|
+
def initialize(logger, log_level = :error)
|
18
|
+
@logger = logger
|
19
|
+
@log_level = log_level
|
20
|
+
end
|
21
|
+
|
22
|
+
def write(string)
|
23
|
+
@logger.send(@log_level, string)
|
24
|
+
end
|
25
|
+
|
26
|
+
alias_method "<<", :write
|
27
|
+
|
28
|
+
def flush; end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "paperclip"
|
2
|
+
require "image_optim"
|
3
|
+
|
4
|
+
module Paperclip
|
5
|
+
class PaperclipOptimizer < Processor
|
6
|
+
def make
|
7
|
+
settings = (@options[:paperclip_optimizer] || {}).reverse_merge(::PaperclipOptimizer::DEFAULT_SETTINGS)
|
8
|
+
|
9
|
+
src_path = File.expand_path(@file.path)
|
10
|
+
|
11
|
+
if settings[:verbose]
|
12
|
+
Paperclip.logger.info "optimizing #{src_path} with settings: #{settings.inspect}"
|
13
|
+
|
14
|
+
old_stderr = $stderr
|
15
|
+
$stderr = ::PaperclipOptimizer::StdErrCapture.new(Paperclip.logger)
|
16
|
+
end
|
17
|
+
|
18
|
+
begin
|
19
|
+
image_optim = ImageOptim.new(settings)
|
20
|
+
compressed_file_path = image_optim.optimize_image(src_path)
|
21
|
+
ensure
|
22
|
+
$stderr = old_stderr if settings[:verbose]
|
23
|
+
end
|
24
|
+
|
25
|
+
if compressed_file_path && File.exists?(compressed_file_path)
|
26
|
+
return File.open(compressed_file_path)
|
27
|
+
else
|
28
|
+
return @file
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'paperclip-optimizer/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "paperclip-optimizer"
|
8
|
+
spec.version = PaperclipOptimizer::VERSION
|
9
|
+
spec.authors = ["Jan-Christian Föh"]
|
10
|
+
spec.email = ["jan@programmanstalt.de"]
|
11
|
+
spec.description = %q{paperclip-optimizer is a processor for Paperclip that allows you to optimize and minify uploaded JPEG and PNG files.}
|
12
|
+
spec.summary = %q{Minify Paperclip JPEG and PNG attachments}
|
13
|
+
spec.homepage = "https://github.com/janfoeh/paperclip-optimizer"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.add_dependency "paperclip", "~> 3.4.1"
|
17
|
+
spec.add_dependency "image_optim", "~> 0.8"
|
18
|
+
|
19
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
20
|
+
spec.add_development_dependency "rake"
|
21
|
+
spec.add_development_dependency 'rspec'
|
22
|
+
spec.add_development_dependency 'rails'
|
23
|
+
spec.add_development_dependency 'sqlite3'
|
24
|
+
|
25
|
+
spec.add_runtime_dependency "paperclip"
|
26
|
+
|
27
|
+
spec.files = `git ls-files`.split($/)
|
28
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "fileutils"
|
3
|
+
|
4
|
+
describe Paperclip::PaperclipOptimizer do
|
5
|
+
|
6
|
+
def stubbed_upload_model(*args)
|
7
|
+
stubbed_model = Upload.dup
|
8
|
+
|
9
|
+
# prevent ActiveModel::Validations from blowing up when error messages are
|
10
|
+
# accessed on an anonymous class
|
11
|
+
stubbed_model.stub(:model_name => ActiveModel::Name.new(self, nil, "temp"))
|
12
|
+
stubbed_model.any_instance.stub(*args)
|
13
|
+
|
14
|
+
stubbed_model
|
15
|
+
end
|
16
|
+
|
17
|
+
before(:each) do
|
18
|
+
tmp_dir = File.join(File.dirname(__FILE__), 'tmp')
|
19
|
+
|
20
|
+
Dir.mkdir(tmp_dir) unless File.directory?(tmp_dir)
|
21
|
+
|
22
|
+
Dir.entries(tmp_dir).each do |f|
|
23
|
+
next unless f.end_with?(".jpg", ".png")
|
24
|
+
|
25
|
+
FileUtils.remove_entry_secure( File.join(tmp_dir, f) )
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it "creates smaller JPEGs" do
|
30
|
+
jpg = get_fixture(:jpg)
|
31
|
+
unoptimized_upload = Upload.new(:image => jpg)
|
32
|
+
jpg.close
|
33
|
+
unoptimized_upload.save
|
34
|
+
|
35
|
+
jpg = get_fixture(:jpg)
|
36
|
+
optimized_upload = stubbed_upload_model(
|
37
|
+
processor_settings: [:thumbnail, :paperclip_optimizer]
|
38
|
+
).new(:image => jpg)
|
39
|
+
jpg.close
|
40
|
+
optimized_upload.save
|
41
|
+
|
42
|
+
unoptimized_file_size = File.size(unoptimized_upload.image.path(:medium))
|
43
|
+
optimized_file_size = File.size(optimized_upload.image.path(:medium))
|
44
|
+
|
45
|
+
expect(optimized_file_size).to be < unoptimized_file_size
|
46
|
+
end
|
47
|
+
|
48
|
+
it "creates smaller PNGs" do
|
49
|
+
png = get_fixture(:png)
|
50
|
+
unoptimized_upload = Upload.new(:image => png)
|
51
|
+
unoptimized_upload.save
|
52
|
+
png.close
|
53
|
+
|
54
|
+
png = get_fixture(:png)
|
55
|
+
optimized_upload = stubbed_upload_model(
|
56
|
+
processor_settings: [:thumbnail, :paperclip_optimizer]
|
57
|
+
).new(:image => png)
|
58
|
+
png.close
|
59
|
+
optimized_upload.save
|
60
|
+
|
61
|
+
unoptimized_file_size = File.size(unoptimized_upload.image.path(:medium))
|
62
|
+
optimized_file_size = File.size(optimized_upload.image.path(:medium))
|
63
|
+
|
64
|
+
expect(optimized_file_size).to be < unoptimized_file_size
|
65
|
+
end
|
66
|
+
|
67
|
+
it "does not prevent invalid attachments from being saved" do
|
68
|
+
jpg = get_fixture(:jpg, "invalid")
|
69
|
+
upload = stubbed_upload_model(
|
70
|
+
processor_settings: [:paperclip_optimizer]
|
71
|
+
).new(:image => jpg)
|
72
|
+
jpg.close
|
73
|
+
upload.save
|
74
|
+
|
75
|
+
expect(upload.errors).to be_empty
|
76
|
+
expect(upload.persisted?).to be_true
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should allow disabled optimization options to be reenabled" do
|
80
|
+
settings = {
|
81
|
+
:gifsicle => {:interlace => true}
|
82
|
+
}.reverse_merge(::PaperclipOptimizer::DEFAULT_SETTINGS)
|
83
|
+
|
84
|
+
ImageOptim.should_receive(:new).with(settings).and_call_original
|
85
|
+
|
86
|
+
jpg = get_fixture(:jpg)
|
87
|
+
|
88
|
+
stubbed_upload_model(
|
89
|
+
processor_settings: [:paperclip_optimizer],
|
90
|
+
style_settings: {
|
91
|
+
medium: {
|
92
|
+
paperclip_optimizer: {
|
93
|
+
gifsicle: {:interlace => true}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
).new(:image => jpg)
|
98
|
+
end
|
99
|
+
end
|
data/spec/schema.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'paperclip'
|
2
|
+
require 'paperclip/railtie'
|
3
|
+
# require 'filemagic'
|
4
|
+
require 'paperclip-optimizer'
|
5
|
+
|
6
|
+
require 'rspec'
|
7
|
+
require 'rspec/autorun'
|
8
|
+
|
9
|
+
require "active_record"
|
10
|
+
|
11
|
+
# taken from https://github.com/tienle/docsplit-paperclip-processor/blob/master/spec/spec_helper.rb
|
12
|
+
|
13
|
+
ActiveRecord::Base.establish_connection(
|
14
|
+
"adapter" => "sqlite3",
|
15
|
+
"database" => ":memory:"
|
16
|
+
)
|
17
|
+
|
18
|
+
ActiveRecord::Base.logger = Logger.new(nil)
|
19
|
+
load(File.join(File.dirname(__FILE__), 'schema.rb'))
|
20
|
+
|
21
|
+
Paperclip::Railtie.insert
|
22
|
+
|
23
|
+
class Upload < ActiveRecord::Base
|
24
|
+
self.table_name = "uploads"
|
25
|
+
|
26
|
+
has_attached_file :image,
|
27
|
+
:storage => :filesystem,
|
28
|
+
:path => "./spec/tmp/:id.:extension",
|
29
|
+
:url => "/spec/tmp/:id.:extension",
|
30
|
+
:styles => lambda { |attachment| attachment.instance.style_settings },
|
31
|
+
:processors => lambda { |instance| instance.processor_settings }
|
32
|
+
|
33
|
+
def style_settings
|
34
|
+
{
|
35
|
+
medium: { geometry: "500x500>" }
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
def processor_settings
|
40
|
+
[:thumbnail]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def get_fixture(file_type = :jpg, valid = "valid")
|
45
|
+
file_name = "#{valid}.#{file_type.to_s}"
|
46
|
+
fixtures_dir = File.join(File.dirname(__FILE__), "../fixtures")
|
47
|
+
fixture_path = File.join(fixtures_dir, file_name)
|
48
|
+
|
49
|
+
File.open(fixture_path)
|
50
|
+
end
|
metadata
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: paperclip-optimizer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jan-Christian Föh
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-05-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: paperclip
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.4.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.4.1
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: image_optim
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0.8'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0.8'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: bundler
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.3'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rails
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: sqlite3
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: paperclip
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
description: paperclip-optimizer is a processor for Paperclip that allows you to optimize
|
143
|
+
and minify uploaded JPEG and PNG files.
|
144
|
+
email:
|
145
|
+
- jan@programmanstalt.de
|
146
|
+
executables: []
|
147
|
+
extensions: []
|
148
|
+
extra_rdoc_files: []
|
149
|
+
files:
|
150
|
+
- .gitignore
|
151
|
+
- .rspec
|
152
|
+
- .ruby-gemset
|
153
|
+
- .ruby-version
|
154
|
+
- .travis.yml
|
155
|
+
- Gemfile
|
156
|
+
- LICENSE.txt
|
157
|
+
- README.md
|
158
|
+
- Rakefile
|
159
|
+
- fixtures/invalid.jpg
|
160
|
+
- fixtures/invalid.png
|
161
|
+
- fixtures/valid.jpg
|
162
|
+
- fixtures/valid.png
|
163
|
+
- lib/paperclip-optimizer.rb
|
164
|
+
- lib/paperclip-optimizer/processor.rb
|
165
|
+
- lib/paperclip-optimizer/version.rb
|
166
|
+
- paperclip-optimizer.gemspec
|
167
|
+
- spec/paperclip-optimizer_spec.rb
|
168
|
+
- spec/schema.rb
|
169
|
+
- spec/spec_helper.rb
|
170
|
+
homepage: https://github.com/janfoeh/paperclip-optimizer
|
171
|
+
licenses:
|
172
|
+
- MIT
|
173
|
+
post_install_message:
|
174
|
+
rdoc_options: []
|
175
|
+
require_paths:
|
176
|
+
- lib
|
177
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
+
none: false
|
179
|
+
requirements:
|
180
|
+
- - ! '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
|
+
none: false
|
185
|
+
requirements:
|
186
|
+
- - ! '>='
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
requirements: []
|
190
|
+
rubyforge_project:
|
191
|
+
rubygems_version: 1.8.25
|
192
|
+
signing_key:
|
193
|
+
specification_version: 3
|
194
|
+
summary: Minify Paperclip JPEG and PNG attachments
|
195
|
+
test_files:
|
196
|
+
- spec/paperclip-optimizer_spec.rb
|
197
|
+
- spec/schema.rb
|
198
|
+
- spec/spec_helper.rb
|