Skip to content

Commit e6a295e

Browse files
committed
extract rails part to image_optim_rails, resolves #127
1 parent 03b442b commit e6a295e

File tree

8 files changed

+8
-239
lines changed

8 files changed

+8
-239
lines changed

.travis.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ script: |
1818
set -ex
1919
if [ -n "$RUBOCOP" ]; then
2020
bundle exec rubocop
21-
elif [ -n "$RAILS_VERSION" ] && [ -z "$CODECLIMATE" ]; then
22-
bundle exec image_optim --info
23-
bundle exec rspec spec/image_optim/railtie_spec.rb
2421
else
2522
bundle exec image_optim --info
2623
bundle exec rspec
@@ -40,13 +37,7 @@ before_install: |
4037
matrix:
4138
fast_finish: true
4239
include:
43-
- env: RAILS_VERSION='~> 3.2' SPROCKETS_VERSION='~> 2.0'
44-
rvm: default
45-
- env: RAILS_VERSION='~> 3.2'
46-
rvm: default
47-
- env: RAILS_VERSION='~> 4.0' SPROCKETS_RAILS_VERSION='~> 2.0'
48-
rvm: '2'
49-
- env: RAILS_VERSION='~> 4.0' CODECLIMATE=1
40+
- env: CODECLIMATE=true
5041
rvm: '2'
5142
- env: RUBOCOP=true
5243
rvm: '2'

CHANGELOG.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## unreleased
44

5+
* Rails image assets optimization is extracted into [image\_optim\_rails gem](https://github.com/toy/image_optim_rails) [#127](https://github.com/toy/image_optim/issues/127) [@toy](https://github.com/toy)
56
* Add proper handling of `ImageOptim.respond_to?` [@toy](https://github.com/toy)
67
* Fix an issue not working OptiPNG `interlace` option [#136](https://github.com/toy/image_optim/pull/136) [@mrk21](https://github.com/mrk21)
78
* Minimize number of file system calls in default implementation of `optimized?` [#137](https://github.com/toy/image_optim/issues/137) [@toy](https://github.com/toy)

Gemfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,3 @@ gemspec
55
if ENV['CODECLIMATE']
66
gem 'codeclimate-test-reporter', :group => :test, :require => nil
77
end
8-
9-
%w[
10-
rails
11-
sprockets
12-
sprockets-rails
13-
].each do |gem_name|
14-
version = ENV[gem_name.tr('-', '_').upcase + '_VERSION']
15-
gem gem_name, version if version
16-
end

README.markdown

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,7 @@ image_optim.optimize_images_data(datas)
241241

242242
### From rails
243243

244-
`ImageOptim::Railtie` will automatically register sprockets preprocessor unless you set `config.assets.image_optim = false` or `config.assets.compress = false` (later for partial rails 3 compatibility).
245-
246-
You can provide options for image_optim used for preprocessor through config `config.assets.image_optim = {nice: 20, svgo: false}` (ruby1.8 style: `{:nice => 20, :svgo => false}`).
247-
Check available options in [options section](#options).
248-
249-
Image optimization can be time consuming, so depending on your deployment process you may prefer to optimize original asset files.
244+
Rails image assets optimization is extracted into [image\_optim\_rails gem](https://github.com/toy/image_optim_rails).
250245

251246
## Configuration
252247

image_optim.gemspec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ Gem::Specification.new do |s|
1515
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
1616
s.require_paths = %w[lib]
1717

18+
s.post_install_message = <<-EOF
19+
Rails image assets optimization is extracted into image_optim_rails gem
20+
You can safely remove `config.assets.image_optim = false` if you are not going to use that gem
21+
EOF
22+
1823
s.add_dependency 'fspath', '~> 3.0'
1924
s.add_dependency 'image_size', '~> 1.3'
2025
s.add_dependency 'exifr', '~> 1.2', '>= 1.2.2'

lib/image_optim.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require 'image_optim/image_meta'
66
require 'image_optim/optimized_path'
77
require 'image_optim/path'
8-
require 'image_optim/railtie' if defined?(Rails)
98
require 'image_optim/worker'
109
require 'in_threads'
1110
require 'shellwords'

lib/image_optim/railtie.rb

Lines changed: 0 additions & 66 deletions
This file was deleted.

spec/image_optim/railtie_spec.rb

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)