camaleon_image_optimizer 0.3.2 → 0.3.3

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
  SHA256:
3
- metadata.gz: f33fac74bfc9382ef00affbcde4f0e76f529cf952951e98f334cbf3ba1498e0b
4
- data.tar.gz: 2a76e96bec4dbc6a827918cd75178a93eb622ac4c9764e24adbbb4c47e4fae1f
3
+ metadata.gz: 7bce400abe10be5ac285e3ac2a46522f3e61e3baa493c3c9bbe04ebb92a9f1bf
4
+ data.tar.gz: abdbcce351bb19a11b9482eca084ab23f9e6b81ce8c96d6bba62faac67f8c162
5
5
  SHA512:
6
- metadata.gz: 53b62becdb349921339c9a5d27bbe9650e329d9fc5482a3a323eb270a05181f7af9b166498e0ec5312206959d88c51e65f772e91b100d2e6d9b21b44922b79f8
7
- data.tar.gz: f0908a34d397ece5315b887c7d91f152fbb3b351a2100f0c3135600b3bc23bf9b1770b5708659f5bfe88c9c805e64654953e0a5ac78e7bac07668b91d5872db2
6
+ metadata.gz: df2ca6913877f97fa01d12a918ffb23d88e103f632e77533bba044c87f25cf9b56704207bca718d383c8128fe57e6223455bed32097fc36b104343853704c271
7
+ data.tar.gz: b112c50eb7e55f777752960f69d5ac270eaf1ecb14bd3602441cd0dadbb10b7185050064e9122a0663d56d8531affcbf288602b23531c494d54a4bd7b39ae4a1
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/brian-kephart/camaleon_image_optimizer.svg?branch=master)](https://travis-ci.org/brian-kephart/camaleon_image_optimizer)
2
+
1
3
  # Camaleon Image Optimizer
2
4
  This is a convenient image optimizer plugin for Camaleon CMS. Compressing images improves load times and thus SEO. It uses the [image_optim gem](https://github.com/toy/image_optim) under the hood. This gem contains multiple utilities for compressing GIF, JPEG, PNG, and SVG files. My experience has been that GIFs JPEGs are easily crushable with these tools, but using multiple PNG compressors is extremely slow. Thus, only one of the PNG compressors is enabled here.
3
5
 
@@ -41,5 +43,8 @@ SVGO_BIN='node_modules/svgo/bin/svgo'
41
43
  ## Usage
42
44
  Just activate the plugin in Camaleon's admin panel.
43
45
 
46
+ ## Contributing
47
+ See CONTRIBUTING.md
48
+
44
49
  ## License
45
50
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
- APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
17
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
18
18
  load 'rails/tasks/engine.rake'
19
19
 
20
20
  load 'rails/tasks/statistics.rake'
@@ -1,11 +1,9 @@
1
1
  class Plugins::CamaleonImageOptimizer::AdminController < CamaleonCms::Apps::PluginsAdminController
2
2
  include Plugins::CamaleonImageOptimizer::MainHelper
3
- def index
4
- end
3
+ def index; end
5
4
 
6
5
  # show settings form
7
- def settings
8
- end
6
+ def settings; end
9
7
 
10
8
  # save values from settings form
11
9
  def save_settings
@@ -1,16 +1,16 @@
1
+ # This modules public methods are called via hooks defined in config/camaleon_plugin.json
1
2
  module Plugins::CamaleonImageOptimizer::MainHelper
2
3
  require 'image_optim'
3
4
 
4
5
  def self.included(klass)
5
- # klass.helper_method [:my_helper_method] rescue "" # here your methods accessible from views
6
+ # klass.helper_method [:my_helper_method] rescue "" # methods accessible from views
6
7
  end
7
8
 
8
9
  def camaleon_image_optimizer_on_active(plugin)
9
10
  camaleon_image_optimizer_options plugin
10
11
  end
11
12
 
12
- def camaleon_image_optimizer_on_inactive(plugin)
13
- end
13
+ def camaleon_image_optimizer_on_inactive(plugin); end
14
14
 
15
15
  def camaleon_image_optimizer_on_upgrade(plugin)
16
16
  camaleon_image_optimizer_options plugin
@@ -26,7 +26,7 @@ module Plugins::CamaleonImageOptimizer::MainHelper
26
26
  settings[:uploaded_io] = File.open settings[:uploaded_io].path
27
27
  end
28
28
 
29
- private
29
+ private
30
30
 
31
31
  def camaleon_image_optimizer_options(plugin)
32
32
  plugin.set_option('quality', camaleon_image_optimizer_default_settings['jpegoptim']['max_quality']) unless plugin.get_option('quality').present?
@@ -41,13 +41,12 @@ private
41
41
  end
42
42
  end
43
43
 
44
+ # default settings in config/image_optim.yml
44
45
  def camaleon_image_optimizer_default_settings
45
46
  @camaleon_image_optimizer_default_settings ||= begin
46
- # default settings in config/image_optim.yml
47
47
  spec = Gem::Specification.find_by_name 'camaleon_image_optimizer'
48
48
  gem_root = Pathname.new spec.gem_dir
49
49
  YAML.load_file gem_root.join('config', 'image_optim.yml')
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -1,17 +1,19 @@
1
- Rails.application.routes.draw do
1
+ require 'plugin_routes'
2
+ require 'camaleon_cms/engine'
2
3
 
3
- scope PluginRoutes.system_info["relative_url_root"] do
4
- #Admin Panel
5
- scope :admin, as: 'admin', path: PluginRoutes.system_info['admin_path_name'] do
6
- namespace 'plugins' do
7
- namespace 'camaleon_image_optimizer' do
8
- controller :admin do
9
- get :index
10
- get :settings
11
- post :save_settings
12
- end
4
+ Rails.application.routes.draw do
5
+ scope PluginRoutes.system_info['relative_url_root'] do
6
+ # Admin Panel
7
+ scope :admin, as: 'admin', path: PluginRoutes.system_info['admin_path_name'] do
8
+ namespace 'plugins' do
9
+ namespace 'camaleon_image_optimizer' do
10
+ controller :admin do
11
+ get :index
12
+ get :settings
13
+ post :save_settings
13
14
  end
14
15
  end
15
16
  end
16
17
  end
17
18
  end
19
+ end
@@ -1,4 +1,4 @@
1
- require "camaleon_image_optimizer/engine"
1
+ require 'camaleon_image_optimizer/engine'
2
2
 
3
3
  module CamaleonImageOptimizer
4
4
  end
@@ -1,3 +1,3 @@
1
1
  module CamaleonImageOptimizer
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camaleon_image_optimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Kephart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-16 00:00:00.000000000 Z
11
+ date: 2018-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: camaleon_cms
@@ -52,20 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.56'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.56'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: sqlite3
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ">="
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: 1.3.13
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ">="
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0'
82
+ version: 1.3.13
69
83
  description: Compress uploaded images for faster page loads and better SEO.
70
84
  email:
71
85
  - briantkephart@gmail.com
@@ -99,9 +113,9 @@ require_paths:
99
113
  - lib
100
114
  required_ruby_version: !ruby/object:Gem::Requirement
101
115
  requirements:
102
- - - ">="
116
+ - - "~>"
103
117
  - !ruby/object:Gem::Version
104
- version: '0'
118
+ version: '2.3'
105
119
  required_rubygems_version: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - ">="
@@ -109,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
123
  version: '0'
110
124
  requirements: []
111
125
  rubyforge_project:
112
- rubygems_version: 2.7.5
126
+ rubygems_version: 2.7.6
113
127
  signing_key:
114
128
  specification_version: 4
115
129
  summary: Compress uploaded images for faster page loads and better SEO.