panda-processor 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: '019d97834373750a6d448a0e889a395a0047032b'
4
+ data.tar.gz: a86955b1508b49f0f7dbdd6b7223b77e540e6d16
5
+ SHA512:
6
+ metadata.gz: 89ac603ca4f88964c53f336952377459aa2b060bd5d7c1a14a22a00aab2a46d1a68f49309370b5fb8b7daf71a5f007cfb96e6eebcc8a4c6b7cea0355a41f653b
7
+ data.tar.gz: 7e9a9b435922874d18ce9e46c6d967e8d13657a72dbbf37335a4a25b5c256e1ee3795cf655108777e6e7ce875abfaaed5036d7ce41c3ff812be939ce24b201cb
@@ -0,0 +1,16 @@
1
+ class PandaProcessor < Paperclip::Processor
2
+ def make
3
+ begin
4
+ Tinify.key = Rails.application.secrets.panda_api_key
5
+ source = Tinify.from_file(File.expand_path(file.path))
6
+ source.to_file(File.expand_path(file.path))
7
+ file
8
+ rescue Tinify::AccountError, Tinify::ServerError, Tinify::ConnectionError => e
9
+ puts 'CUSTOM TinifyError: ' + e.message
10
+ file
11
+ rescue => e
12
+ Rollbar.error(e)
13
+ file
14
+ end
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: panda-processor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Bartosz Gaj
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-02-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Paperclip tiny png processor
14
+ email: bartosz.gaj@eengine.pl
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - panda-processor/lib/panda-processor.rb
20
+ homepage: http://rubygems.org/gems/panda
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.11
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Panda
44
+ test_files: []