ss-attachment_fu 3.3.0 → 3.4.0
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.
| 
         @@ -108,6 +108,7 @@ module Technoweenie # :nodoc: 
     | 
|
| 
       108 
108 
     | 
    
         
             
                      # Zoo Patch : Override saves the file into AWS directly
         
     | 
| 
       109 
109 
     | 
    
         
             
                      def save_to_storage
         
     | 
| 
       110 
110 
     | 
    
         
             
                        if save_attachment?
         
     | 
| 
      
 111 
     | 
    
         
            +
                          logger.info "uploading ... =========="
         
     | 
| 
       111 
112 
     | 
    
         
             
                          save_to_s3
         
     | 
| 
       112 
113 
     | 
    
         
             
                        end
         
     | 
| 
       113 
114 
     | 
    
         
             
                        @old_filename = nil
         
     | 
| 
         @@ -133,6 +134,7 @@ module Technoweenie # :nodoc: 
     | 
|
| 
       133 
134 
     | 
    
         
             
                                :content_type => img.content_type
         
     | 
| 
       134 
135 
     | 
    
         
             
                              )
         
     | 
| 
       135 
136 
     | 
    
         
             
                              img.update_attribute(:moved_to_s3,1)
         
     | 
| 
      
 137 
     | 
    
         
            +
                              logger.info "uploaded : #{img.public_filename} ====="
         
     | 
| 
       136 
138 
     | 
    
         
             
                              return true
         
     | 
| 
       137 
139 
     | 
    
         
             
                            rescue Exception => ex #Errno::ENOENT
         
     | 
| 
       138 
140 
     | 
    
         
             
                              return false
         
     | 
| 
         @@ -503,9 +503,13 @@ module Technoweenie # :nodoc: 
     | 
|
| 
       503 
503 
     | 
    
         
             
                          temp_file = temp_path || create_temp_file
         
     | 
| 
       504 
504 
     | 
    
         
             
                          attachment_options[:thumbnails].each { |suffix, size|
         
     | 
| 
       505 
505 
     | 
    
         
             
                            if size.is_a?(Symbol)
         
     | 
| 
       506 
     | 
    
         
            -
                              parent_type = polymorphic_parent_type
         
     | 
| 
       507 
     | 
    
         
            -
                              next unless parent_type && [parent_type, parent_type.tableize].include?(suffix.to_s) && respond_to?(size)
         
     | 
| 
      
 506 
     | 
    
         
            +
                              # parent_type = polymorphic_parent_type
         
     | 
| 
      
 507 
     | 
    
         
            +
                              # next unless parent_type && [parent_type, parent_type.tableize].include?(suffix.to_s) && respond_to?(size)
         
     | 
| 
      
 508 
     | 
    
         
            +
                              # the method aboves are not working
         
     | 
| 
      
 509 
     | 
    
         
            +
                              next unless respond_to?(size)
         
     | 
| 
      
 510 
     | 
    
         
            +
                              logger.info "uploading thumbnail #{size} ... ========"
         
     | 
| 
       508 
511 
     | 
    
         
             
                              size = send(size)
         
     | 
| 
      
 512 
     | 
    
         
            +
                              logger.info "uploading => #{size} ======="
         
     | 
| 
       509 
513 
     | 
    
         
             
                            end
         
     | 
| 
       510 
514 
     | 
    
         
             
                            if size.is_a?(Hash)
         
     | 
| 
       511 
515 
     | 
    
         
             
                              parent_type = polymorphic_parent_type
         
     | 
| 
         @@ -549,7 +553,9 @@ module Technoweenie # :nodoc: 
     | 
|
| 
       549 
553 
     | 
    
         
             
                    # Resizes the given processed img object with either the attachment resize options or the thumbnail resize options.
         
     | 
| 
       550 
554 
     | 
    
         
             
                    def resize_image_or_thumbnail!(img)
         
     | 
| 
       551 
555 
     | 
    
         
             
                      if (!respond_to?(:parent_id) || parent_id.nil?) && attachment_options[:resize_to] # parent image
         
     | 
| 
       552 
     | 
    
         
            -
                         
     | 
| 
      
 556 
     | 
    
         
            +
                        logger.info "===== check dimension => #{send(attachment_options[:resize_to])}"
         
     | 
| 
      
 557 
     | 
    
         
            +
                        return unless respond_to?(attachment_options[:resize_to])
         
     | 
| 
      
 558 
     | 
    
         
            +
                        resize_image(img, send(attachment_options[:resize_to]))
         
     | 
| 
       553 
559 
     | 
    
         
             
                      elsif thumbnail_resize_options # thumbnail
         
     | 
| 
       554 
560 
     | 
    
         
             
                        resize_image(img, evaluate_parameter(thumbnail_resize_options))
         
     | 
| 
       555 
561 
     | 
    
         
             
                      end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,71 +1,92 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ss-attachment_fu
         
     | 
| 
       3 
     | 
    
         
            -
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version 
         
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 23
         
     | 
| 
      
 5 
     | 
    
         
            +
              prerelease: 
         
     | 
| 
      
 6 
     | 
    
         
            +
              segments: 
         
     | 
| 
      
 7 
     | 
    
         
            +
              - 3
         
     | 
| 
      
 8 
     | 
    
         
            +
              - 4
         
     | 
| 
      
 9 
     | 
    
         
            +
              - 0
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 3.4.0
         
     | 
| 
       5 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
     | 
    
         
            -
            authors:
         
     | 
| 
      
 12 
     | 
    
         
            +
            authors: 
         
     | 
| 
       7 
13 
     | 
    
         
             
            - Rick Olson
         
     | 
| 
       8 
14 
     | 
    
         
             
            - Steven Pothoven
         
     | 
| 
       9 
15 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
16 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
17 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            date: 2015-09-15 00:00:00 +07:00
         
     | 
| 
      
 20 
     | 
    
         
            +
            default_executable: 
         
     | 
| 
       13 
21 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            description: This is a fork of Steven Pothoven's attachment_fu including custom some enhancements for Zoo Property
         
     | 
| 
       16 
24 
     | 
    
         
             
            email: m.yunan.helmy@gmail.com
         
     | 
| 
       17 
25 
     | 
    
         
             
            executables: []
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
       18 
27 
     | 
    
         
             
            extensions: []
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            extra_rdoc_files: 
         
     | 
| 
       20 
30 
     | 
    
         
             
            - README.rdoc
         
     | 
| 
       21 
     | 
    
         
            -
            files:
         
     | 
| 
       22 
     | 
    
         
            -
            - CHANGELOG
         
     | 
| 
       23 
     | 
    
         
            -
            - LICENSE
         
     | 
| 
       24 
     | 
    
         
            -
            - README.rdoc
         
     | 
| 
       25 
     | 
    
         
            -
            - amazon_s3.yml.tpl
         
     | 
| 
      
 31 
     | 
    
         
            +
            files: 
         
     | 
| 
       26 
32 
     | 
    
         
             
            - lib/geometry.rb
         
     | 
| 
       27 
33 
     | 
    
         
             
            - lib/ss-attachment_fu.rb
         
     | 
| 
       28 
34 
     | 
    
         
             
            - lib/technoweenie/attachment_fu.rb
         
     | 
| 
       29 
35 
     | 
    
         
             
            - lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb
         
     | 
| 
      
 36 
     | 
    
         
            +
            - lib/technoweenie/attachment_fu/backends/s3_backend.rb
         
     | 
| 
       30 
37 
     | 
    
         
             
            - lib/technoweenie/attachment_fu/backends/db_file_backend.rb
         
     | 
| 
       31 
38 
     | 
    
         
             
            - lib/technoweenie/attachment_fu/backends/file_system_backend.rb
         
     | 
| 
       32 
     | 
    
         
            -
            - lib/technoweenie/attachment_fu/ 
     | 
| 
      
 39 
     | 
    
         
            +
            - lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb
         
     | 
| 
       33 
40 
     | 
    
         
             
            - lib/technoweenie/attachment_fu/processors/core_image_processor.rb
         
     | 
| 
      
 41 
     | 
    
         
            +
            - lib/technoweenie/attachment_fu/processors/rmagick_processor.rb
         
     | 
| 
       34 
42 
     | 
    
         
             
            - lib/technoweenie/attachment_fu/processors/gd2_processor.rb
         
     | 
| 
       35 
43 
     | 
    
         
             
            - lib/technoweenie/attachment_fu/processors/image_science_processor.rb
         
     | 
| 
       36 
     | 
    
         
            -
            - lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb
         
     | 
| 
       37 
     | 
    
         
            -
            - lib/technoweenie/attachment_fu/processors/rmagick_processor.rb
         
     | 
| 
       38 
     | 
    
         
            -
            - rackspace_cloudfiles.yml.tpl
         
     | 
| 
       39 
     | 
    
         
            -
            - vendor/red_artisan/core_image/filters/color.rb
         
     | 
| 
       40 
44 
     | 
    
         
             
            - vendor/red_artisan/core_image/filters/effects.rb
         
     | 
| 
       41 
45 
     | 
    
         
             
            - vendor/red_artisan/core_image/filters/perspective.rb
         
     | 
| 
       42 
     | 
    
         
            -
            - vendor/red_artisan/core_image/filters/quality.rb
         
     | 
| 
       43 
46 
     | 
    
         
             
            - vendor/red_artisan/core_image/filters/scale.rb
         
     | 
| 
      
 47 
     | 
    
         
            +
            - vendor/red_artisan/core_image/filters/color.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - vendor/red_artisan/core_image/filters/quality.rb
         
     | 
| 
       44 
49 
     | 
    
         
             
            - vendor/red_artisan/core_image/filters/watermark.rb
         
     | 
| 
       45 
50 
     | 
    
         
             
            - vendor/red_artisan/core_image/processor.rb
         
     | 
| 
      
 51 
     | 
    
         
            +
            - CHANGELOG
         
     | 
| 
      
 52 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
      
 53 
     | 
    
         
            +
            - README.rdoc
         
     | 
| 
      
 54 
     | 
    
         
            +
            - amazon_s3.yml.tpl
         
     | 
| 
      
 55 
     | 
    
         
            +
            - rackspace_cloudfiles.yml.tpl
         
     | 
| 
      
 56 
     | 
    
         
            +
            has_rdoc: true
         
     | 
| 
       46 
57 
     | 
    
         
             
            homepage: https://github.com/yunanhelmy/attachment_fu
         
     | 
| 
       47 
58 
     | 
    
         
             
            licenses: []
         
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
       49 
60 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       50 
     | 
    
         
            -
            rdoc_options:
         
     | 
| 
      
 61 
     | 
    
         
            +
            rdoc_options: 
         
     | 
| 
       51 
62 
     | 
    
         
             
            - --inline-source
         
     | 
| 
       52 
63 
     | 
    
         
             
            - --charset=UTF-8
         
     | 
| 
       53 
     | 
    
         
            -
            require_paths:
         
     | 
| 
      
 64 
     | 
    
         
            +
            require_paths: 
         
     | 
| 
       54 
65 
     | 
    
         
             
            - lib
         
     | 
| 
       55 
     | 
    
         
            -
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       56 
     | 
    
         
            -
               
     | 
| 
       57 
     | 
    
         
            -
               
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
      
 66 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 67 
     | 
    
         
            +
              none: false
         
     | 
| 
      
 68 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 69 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 70 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 71 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
      
 72 
     | 
    
         
            +
                  segments: 
         
     | 
| 
      
 73 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 74 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
      
 75 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 76 
     | 
    
         
            +
              none: false
         
     | 
| 
      
 77 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 78 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 79 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 80 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
      
 81 
     | 
    
         
            +
                  segments: 
         
     | 
| 
      
 82 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 83 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
       65 
84 
     | 
    
         
             
            requirements: []
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
       66 
86 
     | 
    
         
             
            rubyforge_project: nowarning
         
     | 
| 
       67 
     | 
    
         
            -
            rubygems_version:  
     | 
| 
      
 87 
     | 
    
         
            +
            rubygems_version: 1.4.2
         
     | 
| 
       68 
88 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       69 
89 
     | 
    
         
             
            specification_version: 2
         
     | 
| 
       70 
90 
     | 
    
         
             
            summary: attachment_fu as a gem
         
     | 
| 
       71 
91 
     | 
    
         
             
            test_files: []
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
    
        checksums.yaml
    DELETED
    
    | 
         @@ -1,15 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ---
         
     | 
| 
       2 
     | 
    
         
            -
            !binary "U0hBMQ==":
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                MGEwM2Q5NTZlMjU1NThiZDAwMTBhOTYwNjJhMzVlY2I5ZWY2NDk2YQ==
         
     | 
| 
       5 
     | 
    
         
            -
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                YTc0MmViNzI0ZGRlY2Y0NjAwNWJjYmY0N2ZlNGQwY2Y2NDBlNTQ4ZA==
         
     | 
| 
       7 
     | 
    
         
            -
            SHA512:
         
     | 
| 
       8 
     | 
    
         
            -
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                NTE2YTZjYWZiNzBmYmRkOWI1ZGY5MjYzOGI2OWUyMjY2YzIwOTE0Zjc0YzAw
         
     | 
| 
       10 
     | 
    
         
            -
                MDM5MzljZDA2M2JiYTY3OWQ4YTJiNzliNWJjMjU5YjNmOTIwODMzZTVjNzdi
         
     | 
| 
       11 
     | 
    
         
            -
                M2RjOWMxY2NkODE3ZDlhNGI1OTZhZmViMGQxYjg2M2JiOWQ5YWM=
         
     | 
| 
       12 
     | 
    
         
            -
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                NDY4MWRjYTA4NDVkN2MyMDZmOTQyMjdlNzQxMjI3YWE3NjczMmFiN2ZlYjc1
         
     | 
| 
       14 
     | 
    
         
            -
                OTc0YjU4YTJjMjdlNTJlYWM0YTY5ODQwYTExYzZjMTE2ODhkMDZjZDQ2NGVj
         
     | 
| 
       15 
     | 
    
         
            -
                N2VhNjBiYTFiMjJiOGNjNWIyNTcwOTcyZDRiMTg1ZmM4NjNkY2Q=
         
     |