paperclip-compression 0.3.1 → 0.3.2

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGNmZDUxNjczYWNmZTU0ODY2ZGJhY2FlMTFkODdmYjgxYzFjZDBjZQ==
4
+ MzY5NDE1NjVmYjhmMzVjM2UxNzRhZDMyMGI4MmE0YmUxYTUwM2RiNQ==
5
5
  data.tar.gz: !binary |-
6
- NDc5YWNhYmQ0NjEyNjFlOTdmMzc4MmFmZjkzNjk4MjE3NDIxYzRiNg==
6
+ MjAyNzNmMGFjNmZkMmE3ZTVlM2I1ZDM3NGE3Y2ViYjA0YzJhM2U4ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MGQ2NDg4MzY0NTQzYTUyMDc0ZTEyZDU1ZTQ4MjY0OGFjYzcyNmVkNGM2YmIy
10
- MWM2ZjBlOGNjZjQ1YjA2MzE3OTEwYjQxNWEyMDdlYWUyNmYyMTc5MmUxZTI1
11
- ZmRiODA3M2YwMTMxYjY0NzQ0NzU5MzlhODE3ZmM1ZmU4ZjYyOTU=
9
+ MzdiZDE4YmE1NjFkZjFkODdiNDFiOTk2Y2QxMzgyZDI2ZGY4OGY4NjFhZjcz
10
+ NmRmMDBiNWU0MDQ0YmZjMTcwNjg2ZTZmYWUyZDAzOGQzYWIyYWM5OThhOTA5
11
+ MzNlZjRiY2JlM2FlN2Q5YTRlMDM2M2NlMDEyN2I2YTZhZGI2ODE=
12
12
  data.tar.gz: !binary |-
13
- MTZiNjE4MDVjYjczNTgyMjdkOWZkODg4YjQ5Mjc1YWJlNWYzMzdjYWZjNjM4
14
- MmU4Yzg3M2Q4OGZkNzNjMGY0MDQ5NzM1YWJjMTBhOWFmZmQzM2FkNzM5NmMw
15
- MzI5ZDk5MDBiZjEyMGFkNDI4ZTE1NmIyNDg1NDVhMWE1MDYzZDg=
13
+ ZTAzY2FmODViMmExYzg4OTRkZWJmYWJmYTY2OTliNmUwZDY4NjM5ZGRlMzMz
14
+ MGEwMDMxNDc1M2NiZjEwYzg4YWJhYzMwZTc2NzY3ZDgyMTE1MzZiNTQ4YzFl
15
+ ZmEyNWVkMGUzNDEwNDBjNTJhNGE1MTgxMGI1ZDVjNmFkYzEyODA=
@@ -1,5 +1,6 @@
1
1
  require 'paperclip'
2
2
  require 'os'
3
+ require 'image_spec'
3
4
  require 'paperclip-compression/paperclip/compression'
4
5
  require 'paperclip-compression/base'
5
6
  require 'paperclip-compression/jpeg'
@@ -2,11 +2,11 @@ module PaperclipCompression
2
2
  class Base
3
3
 
4
4
  def initialize(file, options = {})
5
- @file = file
6
- @options = options
7
- @whiny = options.has_key?(:whiny) ? options[:whiny] : true
8
- current_format = File.extname(file.path)
9
- @basename = File.basename(file.path, current_format)
5
+ @file = file
6
+ @options = options
7
+ @whiny = options.has_key?(:whiny) ? options[:whiny] : true
8
+ current_extension = File.extname(file.path)
9
+ @basename = File.basename(file.path, current_extension)
10
10
  end
11
11
 
12
12
  def self.make(file, options = {})
@@ -6,8 +6,7 @@ module PaperclipCompression
6
6
  def initialize(file, options = {})
7
7
  super(file, options)
8
8
 
9
- format = options[:format]
10
- @dst = Tempfile.new([@basename, format ? ".#{format}" : ''])
9
+ @dst = Tempfile.new(@basename)
11
10
  @dst.binmode
12
11
 
13
12
  @src_path = File.expand_path(@file.path)
@@ -3,7 +3,7 @@ module Paperclip
3
3
  class Compression < Processor
4
4
 
5
5
  def make
6
- case @attachment.content_type
6
+ case ImageSpec.new(@file).content_type
7
7
  when 'image/jpeg' then make_jpeg
8
8
  when 'image/png' then make_png
9
9
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-compression
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - İ. Emre Kutlu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-18 00:00:00.000000000 Z
11
+ date: 2013-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paperclip
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.9.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-imagespec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.3.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.3.1
41
55
  description: JPEG and PNG compression for Paperclip gem
42
56
  email: emrekutlu@gmail.com
43
57
  executables: []