alchemy_cms_picture_optim 0.1.1

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZWY1MjEwNDc4YjZmZWU1YTRlYzBlM2JiMGY0NzRlMjhlNzAyNmIzMw==
5
+ data.tar.gz: !binary |-
6
+ ODQyZWQ5YmUyN2Y4MjkxNmI0MDlhY2ZmZWUxNTUzZTgxZDQzZDI4YQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MDg2Y2RkMmIxMzcwNDFhYjU3MWUzZTQ4NWQ1MWEyYmU1Yzc1NzE4YjQ0NjA0
10
+ NTRiMWNmNmFlMGRhMTVlOGQzNTQ3NGJkMTYwMWEzNzFiZDg0Zjg4OGM4YWYy
11
+ YjU3OWQzNTg4MDA4OWNhZjFhYTY3ZWVkYmVlNzM2YWRmMzM5Y2E=
12
+ data.tar.gz: !binary |-
13
+ N2I0ZDQ3YjFlOTlmOGY0YjMwYjQzN2YxOTczMDk5MTA2ZjgyMGNkNTkxZTRj
14
+ NWQwMjIwZTJkODM5YWI2YmQxYzlmM2NjNmVkNDJjZDA4MjI5YTEzNWU2MWMy
15
+ NzlmMzM1ZGMxNTA5ZTQ1M2YyZWQ3YzBkYmM5MjM4Mjc5ZGY4Njk=
@@ -0,0 +1 @@
1
+ require 'alchemy_cms_picture_optim/railtie' if defined?(Rails)
@@ -0,0 +1,7 @@
1
+ module AlchemyCmsPictureOptim
2
+ class Railtie < Rails::Railtie
3
+ config.after_initialize do
4
+ require File.expand_path('../../alchemy_picture_optim_hook', __FILE__)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ require 'alchemy/picture'
2
+
3
+ module Alchemy
4
+ class Picture < ActiveRecord::Base
5
+
6
+ after_save do
7
+ begin
8
+ require 'image_optim'
9
+ image_optim = ImageOptim.new
10
+ image_optim.optimize_image!(Rails.root.join('uploads', 'pictures', image_file_uid))
11
+ rescue Exception => exception
12
+ Rails.logger.error "Error when optimizing the image: #{exception.message}"
13
+ p "Error when optimizing the image: #{exception.message}"
14
+ end
15
+ end
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: alchemy_cms_picture_optim
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Lucho Yankov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: alchemy_cms
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: image_optim
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Lossless optimization of the uploaded images using image_optim (make
42
+ sure to install all binary dependecies of image_optim)
43
+ email: lucho870601@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/alchemy_cms_picture_optim.rb
49
+ - lib/alchemy_cms_picture_optim/railtie.rb
50
+ - lib/alchemy_picture_optim_hook.rb
51
+ homepage: https://github.com/lucho870601/Alchemy-CMS-Picture-Optim
52
+ licenses:
53
+ - MIT
54
+ metadata: {}
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ requirements: []
70
+ rubyforge_project:
71
+ rubygems_version: 2.1.8
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: Image optimization hook for Alchemy CMS.
75
+ test_files: []