mongoid_paperclip_image_dimension 0.1.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.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +82 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/lib/mongoid_paperclip_image_dimension.rb +47 -0
- data/spec/mongoid_paperclip_image_dimension_spec.rb +77 -0
- data/spec/ruby.png +0 -0
- data/spec/spec_helper.rb +21 -0
- metadata +394 -0
    
        data/.document
    ADDED
    
    
    
        data/.rspec
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            --color
         | 
    
        data/Gemfile
    ADDED
    
    | @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            source 'http://rubygems.org'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            gem 'mongoid', '~> 2.0.0.beta.20'
         | 
| 4 | 
            +
            gem "mongoid-paperclip", '~> 0.0.3', :require => "mongoid_paperclip"
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            # Add dependencies to develop your gem here.
         | 
| 7 | 
            +
            # Include everything needed to run rake, tests, features, etc.
         | 
| 8 | 
            +
            group :development do
         | 
| 9 | 
            +
              gem 'database_cleaner'
         | 
| 10 | 
            +
              gem 'bson', '~> 1.2.1'
         | 
| 11 | 
            +
              gem 'bson_ext', '~> 1.2.1'
         | 
| 12 | 
            +
              gem 'rspec', '~> 2.3.0'
         | 
| 13 | 
            +
              gem 'yard', '~> 0.6.0'
         | 
| 14 | 
            +
              gem 'bundler', '~> 1.0.0'
         | 
| 15 | 
            +
              gem 'jeweler', '~> 1.5.2'
         | 
| 16 | 
            +
              gem 'rcov', '>= 0'
         | 
| 17 | 
            +
            end
         | 
    
        data/LICENSE.txt
    ADDED
    
    | @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            Copyright (c) 2011 Aaron Qian
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Permission is hereby granted, free of charge, to any person obtaining
         | 
| 4 | 
            +
            a copy of this software and associated documentation files (the
         | 
| 5 | 
            +
            "Software"), to deal in the Software without restriction, including
         | 
| 6 | 
            +
            without limitation the rights to use, copy, modify, merge, publish,
         | 
| 7 | 
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         | 
| 8 | 
            +
            permit persons to whom the Software is furnished to do so, subject to
         | 
| 9 | 
            +
            the following conditions:
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            The above copyright notice and this permission notice shall be
         | 
| 12 | 
            +
            included in all copies or substantial portions of the Software.
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         | 
| 15 | 
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         | 
| 16 | 
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         | 
| 17 | 
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         | 
| 18 | 
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         | 
| 19 | 
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         | 
| 20 | 
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         | 
    
        data/README.rdoc
    ADDED
    
    | @@ -0,0 +1,82 @@ | |
| 1 | 
            +
            = mongoid_paperclip_image_dimension
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            This is a simple gem to persist image dimensions of originals and thumbnails for mongoid documents.
         | 
| 4 | 
            +
            It works for both s3 and filesystem storages.
         | 
| 5 | 
            +
            This lib is based on this article: http://stackoverflow.com/questions/4065295/paperclip-saving-the-images-dimentions-width-height
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            == Installation
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            You can simply install from rubygems:
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              gem install mongoid_paperclip_image_dimension
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            or in Gemfile:
         | 
| 14 | 
            +
             | 
| 15 | 
            +
              gem 'mongoid_paperclip_image_dimension'
         | 
| 16 | 
            +
              
         | 
| 17 | 
            +
            == Basic Usage
         | 
| 18 | 
            +
             | 
| 19 | 
            +
              class Post
         | 
| 20 | 
            +
                include Mongoid::Document
         | 
| 21 | 
            +
                include Mongoid::Paperclip
         | 
| 22 | 
            +
                include Mongoid::Paperclip::ImageDimension
         | 
| 23 | 
            +
                
         | 
| 24 | 
            +
                has_mongoid_attached_file :image, :styles => {
         | 
| 25 | 
            +
                  :large    =>    ['350x350>',     :jpg],
         | 
| 26 | 
            +
                  :medium   =>    ['150x150>',     :jpg],
         | 
| 27 | 
            +
                  :small    =>    ['30x30>',       :jpg]
         | 
| 28 | 
            +
                }
         | 
| 29 | 
            +
                
         | 
| 30 | 
            +
                has_mongoid_attached_file :some_other_image, :styles => {
         | 
| 31 | 
            +
                  :large    =>    ['350x350>',     :jpg],
         | 
| 32 | 
            +
                  :medium   =>    ['150x150>',     :jpg],
         | 
| 33 | 
            +
                  :small    =>    ['30x30>',       :jpg]
         | 
| 34 | 
            +
                }
         | 
| 35 | 
            +
                
         | 
| 36 | 
            +
                # This will save all dimensions of images and thumbnails for both :image and :another_image
         | 
| 37 | 
            +
                save_image_dimensions_on :image, :another_image
         | 
| 38 | 
            +
              end
         | 
| 39 | 
            +
              
         | 
| 40 | 
            +
              # retrieve image dimensions
         | 
| 41 | 
            +
              p = Post.first
         | 
| 42 | 
            +
              p.image_dimensions    # If the original image has width of 2048 and height of 1024, the output should be:
         | 
| 43 | 
            +
                                    #   {
         | 
| 44 | 
            +
                                    #     'original' => [2048, 1024],
         | 
| 45 | 
            +
                                    #     'large'    => [350, 175],
         | 
| 46 | 
            +
                                    #     'medium'   => [150, 75],
         | 
| 47 | 
            +
                                    #     'small'    => [30, 15]
         | 
| 48 | 
            +
                                    #   }
         | 
| 49 | 
            +
                                    
         | 
| 50 | 
            +
              p.another_image_dimensions    # If the original image has width of 2048 and height of 1024, the output should be:
         | 
| 51 | 
            +
                                            #   {
         | 
| 52 | 
            +
                                            #     'original' => [2048, 1024],
         | 
| 53 | 
            +
                                            #     'large'    => [350, 175],
         | 
| 54 | 
            +
                                            #     'medium'   => [150, 75],
         | 
| 55 | 
            +
                                            #     'small'    => [30, 15]
         | 
| 56 | 
            +
                                            #   }
         | 
| 57 | 
            +
              }
         | 
| 58 | 
            +
              
         | 
| 59 | 
            +
              # some sugar:
         | 
| 60 | 
            +
              p.image_dimension               # [2048, 1024]
         | 
| 61 | 
            +
              p.image_dimension(:original)    # [2048, 1024]
         | 
| 62 | 
            +
              p.image_dimension(:large)       # [350, 175]
         | 
| 63 | 
            +
              
         | 
| 64 | 
            +
              p.image_dimension_str             # "2048x1024"
         | 
| 65 | 
            +
              p.image_dimension_str(:original)  # "2048x1024"
         | 
| 66 | 
            +
              p.image_dimension_str(:large)     # "350x175"
         | 
| 67 | 
            +
             | 
| 68 | 
            +
            == Contributing to mongoid_paperclip_image_dimension
         | 
| 69 | 
            +
             
         | 
| 70 | 
            +
            * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
         | 
| 71 | 
            +
            * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
         | 
| 72 | 
            +
            * Fork the project
         | 
| 73 | 
            +
            * Start a feature/bugfix branch
         | 
| 74 | 
            +
            * Commit and push until you are happy with your contribution
         | 
| 75 | 
            +
            * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
         | 
| 76 | 
            +
            * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
         | 
| 77 | 
            +
             | 
| 78 | 
            +
            == Copyright
         | 
| 79 | 
            +
             | 
| 80 | 
            +
            Copyright (c) 2011 Aaron Qian. See LICENSE.txt for
         | 
| 81 | 
            +
            further details.
         | 
| 82 | 
            +
             | 
    
        data/Rakefile
    ADDED
    
    | @@ -0,0 +1,56 @@ | |
| 1 | 
            +
            require 'rubygems'
         | 
| 2 | 
            +
            require 'bundler'
         | 
| 3 | 
            +
            begin
         | 
| 4 | 
            +
              Bundler.setup(:default, :development)
         | 
| 5 | 
            +
            rescue Bundler::BundlerError => e
         | 
| 6 | 
            +
              $stderr.puts e.message
         | 
| 7 | 
            +
              $stderr.puts "Run `bundle install` to install missing gems"
         | 
| 8 | 
            +
              exit e.status_code
         | 
| 9 | 
            +
            end
         | 
| 10 | 
            +
            require 'rake'
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            require 'jeweler'
         | 
| 13 | 
            +
            Jeweler::Tasks.new do |gem|
         | 
| 14 | 
            +
              # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
         | 
| 15 | 
            +
              gem.name = "mongoid_paperclip_image_dimension"
         | 
| 16 | 
            +
              gem.homepage = "http://github.com/aq1018/mongoid_paperclip_image_dimension"
         | 
| 17 | 
            +
              gem.license = "MIT"
         | 
| 18 | 
            +
              gem.summary = %Q{A simple plugin to persist image dimensions into mongoid document.}
         | 
| 19 | 
            +
              gem.description = %Q{A simple plugin to persist image dimensions into mongoid document.}
         | 
| 20 | 
            +
              gem.email = "aq1018@gmail.com"
         | 
| 21 | 
            +
              gem.authors = ["Aaron Qian"]
         | 
| 22 | 
            +
              
         | 
| 23 | 
            +
              # this directory is generated by running the test, and should be ignored...
         | 
| 24 | 
            +
              gem.files.exclude 'public'
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              gem.add_runtime_dependency 'mongoid', '~> 2.0.0.beta.20'
         | 
| 27 | 
            +
              gem.add_runtime_dependency 'mongoid-paperclip', '~> 0.0.3' 
         | 
| 28 | 
            +
              gem.add_development_dependency 'database_cleaner'
         | 
| 29 | 
            +
              gem.add_development_dependency 'bson', '~> 1.2.1'
         | 
| 30 | 
            +
              gem.add_development_dependency 'bson_ext', '~> 1.2.1'
         | 
| 31 | 
            +
              gem.add_development_dependency 'rspec', '~> 2.3.0'
         | 
| 32 | 
            +
              gem.add_development_dependency 'yard', '~> 0.6.0'
         | 
| 33 | 
            +
              gem.add_development_dependency 'bundler', '~> 1.0.0'
         | 
| 34 | 
            +
              gem.add_development_dependency 'jeweler', '~> 1.5.2'
         | 
| 35 | 
            +
              gem.add_development_dependency 'rcov', '>= 0'
         | 
| 36 | 
            +
            end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            Jeweler::RubygemsDotOrgTasks.new
         | 
| 39 | 
            +
             | 
| 40 | 
            +
            require 'rspec/core'
         | 
| 41 | 
            +
            require 'rspec/core/rake_task'
         | 
| 42 | 
            +
            RSpec::Core::RakeTask.new(:spec) do |spec|
         | 
| 43 | 
            +
              spec.pattern = FileList['spec/**/*_spec.rb']
         | 
| 44 | 
            +
              spec.rspec_opts = "--color --format progress"
         | 
| 45 | 
            +
            end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            RSpec::Core::RakeTask.new(:rcov) do |spec|
         | 
| 48 | 
            +
              spec.pattern = 'spec/**/*_spec.rb'
         | 
| 49 | 
            +
              spec.rcov = true
         | 
| 50 | 
            +
              spec.rcov_opts = "--exclude ~\/.rvm,spec"
         | 
| 51 | 
            +
            end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            task :default => :spec
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            require 'yard'
         | 
| 56 | 
            +
            YARD::Rake::YardocTask.new
         | 
    
        data/VERSION
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            0.1.0
         | 
| @@ -0,0 +1,47 @@ | |
| 1 | 
            +
            require 'active_support/concern'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Mongoid::Paperclip::ImageDimension
         | 
| 4 | 
            +
              extend ActiveSupport::Concern
         | 
| 5 | 
            +
              
         | 
| 6 | 
            +
              included do
         | 
| 7 | 
            +
                class_inheritable_reader :perperclip_image_dimension_fields
         | 
| 8 | 
            +
                write_inheritable_attribute(:perperclip_image_dimension_fields, [])
         | 
| 9 | 
            +
              end
         | 
| 10 | 
            +
              
         | 
| 11 | 
            +
              module ClassMethods
         | 
| 12 | 
            +
                def save_image_dimensions_on(*args)
         | 
| 13 | 
            +
                  args.flatten.each do |attachment_field|
         | 
| 14 | 
            +
                    attachment_field = attachment_field.to_sym
         | 
| 15 | 
            +
                    dimension_field_name = "#{attachment_field}_dimensions".to_sym
         | 
| 16 | 
            +
                    perperclip_image_dimension_fields << attachment_field
         | 
| 17 | 
            +
                    field dimension_field_name, :type => Hash
         | 
| 18 | 
            +
                    
         | 
| 19 | 
            +
                    class_eval <<-END
         | 
| 20 | 
            +
                      def #{attachment_field}_dimension(style=:original)
         | 
| 21 | 
            +
                        #{attachment_field}_dimensions[style.to_s].map(&:to_i)
         | 
| 22 | 
            +
                      end
         | 
| 23 | 
            +
                      
         | 
| 24 | 
            +
                      def #{attachment_field}_dimension_str(style=:original)
         | 
| 25 | 
            +
                        #{attachment_field}_dimension(style).join('x')
         | 
| 26 | 
            +
                      end
         | 
| 27 | 
            +
                      
         | 
| 28 | 
            +
                      after_#{attachment_field}_post_process do
         | 
| 29 | 
            +
                        save_dimensions_for(:"#{attachment_field}")
         | 
| 30 | 
            +
                      end
         | 
| 31 | 
            +
                    END
         | 
| 32 | 
            +
                     
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
              
         | 
| 37 | 
            +
              def save_dimensions_for(attachment_field)
         | 
| 38 | 
            +
                styles = self.class.attachment_definitions[attachment_field][:styles].keys + [:original]
         | 
| 39 | 
            +
                dimension_hash = {}
         | 
| 40 | 
            +
                styles.each do |style|
         | 
| 41 | 
            +
                  attachment = self.send attachment_field
         | 
| 42 | 
            +
                  geo = Paperclip::Geometry.from_file(attachment.queued_for_write[style])
         | 
| 43 | 
            +
                  dimension_hash[style] = [ geo.width.to_i, geo.height.to_i ]
         | 
| 44 | 
            +
                end
         | 
| 45 | 
            +
                self.send "#{attachment_field}_dimensions=", dimension_hash
         | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
            end
         | 
| @@ -0,0 +1,77 @@ | |
| 1 | 
            +
            require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            # mocking Rails.root & Rails.env used in Paperclip::Interploration
         | 
| 4 | 
            +
            module Rails
         | 
| 5 | 
            +
              def self.root
         | 
| 6 | 
            +
                File.dirname(__FILE__) + "/.."
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
              
         | 
| 9 | 
            +
              def self.env
         | 
| 10 | 
            +
                "test"
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
            end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            class Post
         | 
| 15 | 
            +
              include Mongoid::Document
         | 
| 16 | 
            +
              include Mongoid::Paperclip
         | 
| 17 | 
            +
              include Mongoid::Paperclip::ImageDimension
         | 
| 18 | 
            +
              
         | 
| 19 | 
            +
              has_mongoid_attached_file :image, :styles => {
         | 
| 20 | 
            +
                :large    =>    ['350x350>',     :jpg],
         | 
| 21 | 
            +
                :medium   =>    ['150x150>',     :jpg],
         | 
| 22 | 
            +
                :small    =>    ['30x30>',       :jpg]
         | 
| 23 | 
            +
              }
         | 
| 24 | 
            +
              
         | 
| 25 | 
            +
              has_mongoid_attached_file :another_image, :styles => {
         | 
| 26 | 
            +
                :large    =>    ['350x350>',     :jpg],
         | 
| 27 | 
            +
                :medium   =>    ['150x150>',     :jpg],
         | 
| 28 | 
            +
                :small    =>    ['30x30>',       :jpg]
         | 
| 29 | 
            +
              }
         | 
| 30 | 
            +
              
         | 
| 31 | 
            +
              # This will save all dimensions of images and thumbnails for both :image and :another_image
         | 
| 32 | 
            +
              save_image_dimensions_on :image, :another_image
         | 
| 33 | 
            +
            end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            describe Mongoid::Paperclip::ImageDimension do
         | 
| 36 | 
            +
              before(:each) do
         | 
| 37 | 
            +
                @p = Post.create!({
         | 
| 38 | 
            +
                 :image =>File.open(File.dirname(__FILE__) + '/ruby.png'),
         | 
| 39 | 
            +
                 :another_image => File.open(File.dirname(__FILE__) + '/ruby.png')
         | 
| 40 | 
            +
                })
         | 
| 41 | 
            +
                @p.reload
         | 
| 42 | 
            +
              end
         | 
| 43 | 
            +
              
         | 
| 44 | 
            +
              it "should save dimensions" do
         | 
| 45 | 
            +
                @p.image_dimensions.should_not be_nil
         | 
| 46 | 
            +
                @p.another_image_dimensions.should_not be_nil
         | 
| 47 | 
            +
              end
         | 
| 48 | 
            +
              
         | 
| 49 | 
            +
              it "should retreive dimensions correctly" do
         | 
| 50 | 
            +
                @p.image_dimension.should == [995, 996]
         | 
| 51 | 
            +
                @p.image_dimension(:original).should == [995, 996]
         | 
| 52 | 
            +
                @p.image_dimension(:large).should == [350, 350]
         | 
| 53 | 
            +
                @p.image_dimension(:medium).should == [150, 150]
         | 
| 54 | 
            +
                @p.image_dimension(:small).should == [30, 30]
         | 
| 55 | 
            +
                
         | 
| 56 | 
            +
                @p.another_image_dimension.should == [995, 996]
         | 
| 57 | 
            +
                @p.another_image_dimension(:original).should == [995, 996]
         | 
| 58 | 
            +
                @p.another_image_dimension(:large).should == [350, 350]
         | 
| 59 | 
            +
                @p.another_image_dimension(:medium).should == [150, 150]
         | 
| 60 | 
            +
                @p.another_image_dimension(:small).should == [30, 30]
         | 
| 61 | 
            +
              end
         | 
| 62 | 
            +
             | 
| 63 | 
            +
              it "should retreive dimension strings correctly" do
         | 
| 64 | 
            +
                @p.image_dimension_str.should == "995x996"
         | 
| 65 | 
            +
                @p.image_dimension_str(:original).should == "995x996"
         | 
| 66 | 
            +
                @p.image_dimension_str(:large).should == "350x350"
         | 
| 67 | 
            +
                @p.image_dimension_str(:medium).should == "150x150"
         | 
| 68 | 
            +
                @p.image_dimension_str(:small).should == "30x30"
         | 
| 69 | 
            +
                
         | 
| 70 | 
            +
                @p.another_image_dimension_str.should == "995x996"
         | 
| 71 | 
            +
                @p.another_image_dimension_str(:original).should == "995x996"
         | 
| 72 | 
            +
                @p.another_image_dimension_str(:large).should == "350x350"
         | 
| 73 | 
            +
                @p.another_image_dimension_str(:medium).should == "150x150"
         | 
| 74 | 
            +
                @p.another_image_dimension_str(:small).should == "30x30"
         | 
| 75 | 
            +
              end
         | 
| 76 | 
            +
              
         | 
| 77 | 
            +
            end
         | 
    
        data/spec/ruby.png
    ADDED
    
    | Binary file | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
         | 
| 2 | 
            +
            $LOAD_PATH.unshift(File.dirname(__FILE__))
         | 
| 3 | 
            +
            require 'rspec'
         | 
| 4 | 
            +
            require 'mongoid'
         | 
| 5 | 
            +
            require 'mongoid_paperclip'
         | 
| 6 | 
            +
            require 'mongoid_paperclip_image_dimension'
         | 
| 7 | 
            +
            require 'database_cleaner'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            RSpec.configure do |config|
         | 
| 10 | 
            +
              config.before(:suite) do
         | 
| 11 | 
            +
                DatabaseCleaner.strategy = :truncation
         | 
| 12 | 
            +
              end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              config.after(:each) do
         | 
| 15 | 
            +
                DatabaseCleaner.clean
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            Mongoid.configure do |config|
         | 
| 20 | 
            +
              config.master = Mongo::Connection.new.db("mongoid_paperclip_image_dimension_test")
         | 
| 21 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,394 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification 
         | 
| 2 | 
            +
            name: mongoid_paperclip_image_dimension
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            +
              hash: 27
         | 
| 5 | 
            +
              prerelease: 
         | 
| 6 | 
            +
              segments: 
         | 
| 7 | 
            +
              - 0
         | 
| 8 | 
            +
              - 1
         | 
| 9 | 
            +
              - 0
         | 
| 10 | 
            +
              version: 0.1.0
         | 
| 11 | 
            +
            platform: ruby
         | 
| 12 | 
            +
            authors: 
         | 
| 13 | 
            +
            - Aaron Qian
         | 
| 14 | 
            +
            autorequire: 
         | 
| 15 | 
            +
            bindir: bin
         | 
| 16 | 
            +
            cert_chain: []
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            date: 2011-02-13 00:00:00 -08:00
         | 
| 19 | 
            +
            default_executable: 
         | 
| 20 | 
            +
            dependencies: 
         | 
| 21 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 22 | 
            +
              type: :runtime
         | 
| 23 | 
            +
              requirement: &id001 !ruby/object:Gem::Requirement 
         | 
| 24 | 
            +
                none: false
         | 
| 25 | 
            +
                requirements: 
         | 
| 26 | 
            +
                - - ~>
         | 
| 27 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 28 | 
            +
                    hash: 62196427
         | 
| 29 | 
            +
                    segments: 
         | 
| 30 | 
            +
                    - 2
         | 
| 31 | 
            +
                    - 0
         | 
| 32 | 
            +
                    - 0
         | 
| 33 | 
            +
                    - beta
         | 
| 34 | 
            +
                    - 20
         | 
| 35 | 
            +
                    version: 2.0.0.beta.20
         | 
| 36 | 
            +
              name: mongoid
         | 
| 37 | 
            +
              version_requirements: *id001
         | 
| 38 | 
            +
              prerelease: false
         | 
| 39 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 40 | 
            +
              type: :runtime
         | 
| 41 | 
            +
              requirement: &id002 !ruby/object:Gem::Requirement 
         | 
| 42 | 
            +
                none: false
         | 
| 43 | 
            +
                requirements: 
         | 
| 44 | 
            +
                - - ~>
         | 
| 45 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 46 | 
            +
                    hash: 25
         | 
| 47 | 
            +
                    segments: 
         | 
| 48 | 
            +
                    - 0
         | 
| 49 | 
            +
                    - 0
         | 
| 50 | 
            +
                    - 3
         | 
| 51 | 
            +
                    version: 0.0.3
         | 
| 52 | 
            +
              name: mongoid-paperclip
         | 
| 53 | 
            +
              version_requirements: *id002
         | 
| 54 | 
            +
              prerelease: false
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 56 | 
            +
              type: :development
         | 
| 57 | 
            +
              requirement: &id003 !ruby/object:Gem::Requirement 
         | 
| 58 | 
            +
                none: false
         | 
| 59 | 
            +
                requirements: 
         | 
| 60 | 
            +
                - - ">="
         | 
| 61 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 62 | 
            +
                    hash: 3
         | 
| 63 | 
            +
                    segments: 
         | 
| 64 | 
            +
                    - 0
         | 
| 65 | 
            +
                    version: "0"
         | 
| 66 | 
            +
              name: database_cleaner
         | 
| 67 | 
            +
              version_requirements: *id003
         | 
| 68 | 
            +
              prerelease: false
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 70 | 
            +
              type: :development
         | 
| 71 | 
            +
              requirement: &id004 !ruby/object:Gem::Requirement 
         | 
| 72 | 
            +
                none: false
         | 
| 73 | 
            +
                requirements: 
         | 
| 74 | 
            +
                - - ~>
         | 
| 75 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 76 | 
            +
                    hash: 29
         | 
| 77 | 
            +
                    segments: 
         | 
| 78 | 
            +
                    - 1
         | 
| 79 | 
            +
                    - 2
         | 
| 80 | 
            +
                    - 1
         | 
| 81 | 
            +
                    version: 1.2.1
         | 
| 82 | 
            +
              name: bson
         | 
| 83 | 
            +
              version_requirements: *id004
         | 
| 84 | 
            +
              prerelease: false
         | 
| 85 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 86 | 
            +
              type: :development
         | 
| 87 | 
            +
              requirement: &id005 !ruby/object:Gem::Requirement 
         | 
| 88 | 
            +
                none: false
         | 
| 89 | 
            +
                requirements: 
         | 
| 90 | 
            +
                - - ~>
         | 
| 91 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 92 | 
            +
                    hash: 29
         | 
| 93 | 
            +
                    segments: 
         | 
| 94 | 
            +
                    - 1
         | 
| 95 | 
            +
                    - 2
         | 
| 96 | 
            +
                    - 1
         | 
| 97 | 
            +
                    version: 1.2.1
         | 
| 98 | 
            +
              name: bson_ext
         | 
| 99 | 
            +
              version_requirements: *id005
         | 
| 100 | 
            +
              prerelease: false
         | 
| 101 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 102 | 
            +
              type: :development
         | 
| 103 | 
            +
              requirement: &id006 !ruby/object:Gem::Requirement 
         | 
| 104 | 
            +
                none: false
         | 
| 105 | 
            +
                requirements: 
         | 
| 106 | 
            +
                - - ~>
         | 
| 107 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 108 | 
            +
                    hash: 3
         | 
| 109 | 
            +
                    segments: 
         | 
| 110 | 
            +
                    - 2
         | 
| 111 | 
            +
                    - 3
         | 
| 112 | 
            +
                    - 0
         | 
| 113 | 
            +
                    version: 2.3.0
         | 
| 114 | 
            +
              name: rspec
         | 
| 115 | 
            +
              version_requirements: *id006
         | 
| 116 | 
            +
              prerelease: false
         | 
| 117 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 118 | 
            +
              type: :development
         | 
| 119 | 
            +
              requirement: &id007 !ruby/object:Gem::Requirement 
         | 
| 120 | 
            +
                none: false
         | 
| 121 | 
            +
                requirements: 
         | 
| 122 | 
            +
                - - ~>
         | 
| 123 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 124 | 
            +
                    hash: 7
         | 
| 125 | 
            +
                    segments: 
         | 
| 126 | 
            +
                    - 0
         | 
| 127 | 
            +
                    - 6
         | 
| 128 | 
            +
                    - 0
         | 
| 129 | 
            +
                    version: 0.6.0
         | 
| 130 | 
            +
              name: yard
         | 
| 131 | 
            +
              version_requirements: *id007
         | 
| 132 | 
            +
              prerelease: false
         | 
| 133 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 134 | 
            +
              type: :development
         | 
| 135 | 
            +
              requirement: &id008 !ruby/object:Gem::Requirement 
         | 
| 136 | 
            +
                none: false
         | 
| 137 | 
            +
                requirements: 
         | 
| 138 | 
            +
                - - ~>
         | 
| 139 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 140 | 
            +
                    hash: 23
         | 
| 141 | 
            +
                    segments: 
         | 
| 142 | 
            +
                    - 1
         | 
| 143 | 
            +
                    - 0
         | 
| 144 | 
            +
                    - 0
         | 
| 145 | 
            +
                    version: 1.0.0
         | 
| 146 | 
            +
              name: bundler
         | 
| 147 | 
            +
              version_requirements: *id008
         | 
| 148 | 
            +
              prerelease: false
         | 
| 149 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 150 | 
            +
              type: :development
         | 
| 151 | 
            +
              requirement: &id009 !ruby/object:Gem::Requirement 
         | 
| 152 | 
            +
                none: false
         | 
| 153 | 
            +
                requirements: 
         | 
| 154 | 
            +
                - - ~>
         | 
| 155 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 156 | 
            +
                    hash: 7
         | 
| 157 | 
            +
                    segments: 
         | 
| 158 | 
            +
                    - 1
         | 
| 159 | 
            +
                    - 5
         | 
| 160 | 
            +
                    - 2
         | 
| 161 | 
            +
                    version: 1.5.2
         | 
| 162 | 
            +
              name: jeweler
         | 
| 163 | 
            +
              version_requirements: *id009
         | 
| 164 | 
            +
              prerelease: false
         | 
| 165 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 166 | 
            +
              type: :development
         | 
| 167 | 
            +
              requirement: &id010 !ruby/object:Gem::Requirement 
         | 
| 168 | 
            +
                none: false
         | 
| 169 | 
            +
                requirements: 
         | 
| 170 | 
            +
                - - ">="
         | 
| 171 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 172 | 
            +
                    hash: 3
         | 
| 173 | 
            +
                    segments: 
         | 
| 174 | 
            +
                    - 0
         | 
| 175 | 
            +
                    version: "0"
         | 
| 176 | 
            +
              name: rcov
         | 
| 177 | 
            +
              version_requirements: *id010
         | 
| 178 | 
            +
              prerelease: false
         | 
| 179 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 180 | 
            +
              type: :runtime
         | 
| 181 | 
            +
              requirement: &id011 !ruby/object:Gem::Requirement 
         | 
| 182 | 
            +
                none: false
         | 
| 183 | 
            +
                requirements: 
         | 
| 184 | 
            +
                - - ~>
         | 
| 185 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 186 | 
            +
                    hash: 62196427
         | 
| 187 | 
            +
                    segments: 
         | 
| 188 | 
            +
                    - 2
         | 
| 189 | 
            +
                    - 0
         | 
| 190 | 
            +
                    - 0
         | 
| 191 | 
            +
                    - beta
         | 
| 192 | 
            +
                    - 20
         | 
| 193 | 
            +
                    version: 2.0.0.beta.20
         | 
| 194 | 
            +
              name: mongoid
         | 
| 195 | 
            +
              version_requirements: *id011
         | 
| 196 | 
            +
              prerelease: false
         | 
| 197 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 198 | 
            +
              type: :runtime
         | 
| 199 | 
            +
              requirement: &id012 !ruby/object:Gem::Requirement 
         | 
| 200 | 
            +
                none: false
         | 
| 201 | 
            +
                requirements: 
         | 
| 202 | 
            +
                - - ~>
         | 
| 203 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 204 | 
            +
                    hash: 25
         | 
| 205 | 
            +
                    segments: 
         | 
| 206 | 
            +
                    - 0
         | 
| 207 | 
            +
                    - 0
         | 
| 208 | 
            +
                    - 3
         | 
| 209 | 
            +
                    version: 0.0.3
         | 
| 210 | 
            +
              name: mongoid-paperclip
         | 
| 211 | 
            +
              version_requirements: *id012
         | 
| 212 | 
            +
              prerelease: false
         | 
| 213 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 214 | 
            +
              type: :development
         | 
| 215 | 
            +
              requirement: &id013 !ruby/object:Gem::Requirement 
         | 
| 216 | 
            +
                none: false
         | 
| 217 | 
            +
                requirements: 
         | 
| 218 | 
            +
                - - ">="
         | 
| 219 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 220 | 
            +
                    hash: 3
         | 
| 221 | 
            +
                    segments: 
         | 
| 222 | 
            +
                    - 0
         | 
| 223 | 
            +
                    version: "0"
         | 
| 224 | 
            +
              name: database_cleaner
         | 
| 225 | 
            +
              version_requirements: *id013
         | 
| 226 | 
            +
              prerelease: false
         | 
| 227 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 228 | 
            +
              type: :development
         | 
| 229 | 
            +
              requirement: &id014 !ruby/object:Gem::Requirement 
         | 
| 230 | 
            +
                none: false
         | 
| 231 | 
            +
                requirements: 
         | 
| 232 | 
            +
                - - ~>
         | 
| 233 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 234 | 
            +
                    hash: 29
         | 
| 235 | 
            +
                    segments: 
         | 
| 236 | 
            +
                    - 1
         | 
| 237 | 
            +
                    - 2
         | 
| 238 | 
            +
                    - 1
         | 
| 239 | 
            +
                    version: 1.2.1
         | 
| 240 | 
            +
              name: bson
         | 
| 241 | 
            +
              version_requirements: *id014
         | 
| 242 | 
            +
              prerelease: false
         | 
| 243 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 244 | 
            +
              type: :development
         | 
| 245 | 
            +
              requirement: &id015 !ruby/object:Gem::Requirement 
         | 
| 246 | 
            +
                none: false
         | 
| 247 | 
            +
                requirements: 
         | 
| 248 | 
            +
                - - ~>
         | 
| 249 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 250 | 
            +
                    hash: 29
         | 
| 251 | 
            +
                    segments: 
         | 
| 252 | 
            +
                    - 1
         | 
| 253 | 
            +
                    - 2
         | 
| 254 | 
            +
                    - 1
         | 
| 255 | 
            +
                    version: 1.2.1
         | 
| 256 | 
            +
              name: bson_ext
         | 
| 257 | 
            +
              version_requirements: *id015
         | 
| 258 | 
            +
              prerelease: false
         | 
| 259 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 260 | 
            +
              type: :development
         | 
| 261 | 
            +
              requirement: &id016 !ruby/object:Gem::Requirement 
         | 
| 262 | 
            +
                none: false
         | 
| 263 | 
            +
                requirements: 
         | 
| 264 | 
            +
                - - ~>
         | 
| 265 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 266 | 
            +
                    hash: 3
         | 
| 267 | 
            +
                    segments: 
         | 
| 268 | 
            +
                    - 2
         | 
| 269 | 
            +
                    - 3
         | 
| 270 | 
            +
                    - 0
         | 
| 271 | 
            +
                    version: 2.3.0
         | 
| 272 | 
            +
              name: rspec
         | 
| 273 | 
            +
              version_requirements: *id016
         | 
| 274 | 
            +
              prerelease: false
         | 
| 275 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 276 | 
            +
              type: :development
         | 
| 277 | 
            +
              requirement: &id017 !ruby/object:Gem::Requirement 
         | 
| 278 | 
            +
                none: false
         | 
| 279 | 
            +
                requirements: 
         | 
| 280 | 
            +
                - - ~>
         | 
| 281 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 282 | 
            +
                    hash: 7
         | 
| 283 | 
            +
                    segments: 
         | 
| 284 | 
            +
                    - 0
         | 
| 285 | 
            +
                    - 6
         | 
| 286 | 
            +
                    - 0
         | 
| 287 | 
            +
                    version: 0.6.0
         | 
| 288 | 
            +
              name: yard
         | 
| 289 | 
            +
              version_requirements: *id017
         | 
| 290 | 
            +
              prerelease: false
         | 
| 291 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 292 | 
            +
              type: :development
         | 
| 293 | 
            +
              requirement: &id018 !ruby/object:Gem::Requirement 
         | 
| 294 | 
            +
                none: false
         | 
| 295 | 
            +
                requirements: 
         | 
| 296 | 
            +
                - - ~>
         | 
| 297 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 298 | 
            +
                    hash: 23
         | 
| 299 | 
            +
                    segments: 
         | 
| 300 | 
            +
                    - 1
         | 
| 301 | 
            +
                    - 0
         | 
| 302 | 
            +
                    - 0
         | 
| 303 | 
            +
                    version: 1.0.0
         | 
| 304 | 
            +
              name: bundler
         | 
| 305 | 
            +
              version_requirements: *id018
         | 
| 306 | 
            +
              prerelease: false
         | 
| 307 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 308 | 
            +
              type: :development
         | 
| 309 | 
            +
              requirement: &id019 !ruby/object:Gem::Requirement 
         | 
| 310 | 
            +
                none: false
         | 
| 311 | 
            +
                requirements: 
         | 
| 312 | 
            +
                - - ~>
         | 
| 313 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 314 | 
            +
                    hash: 7
         | 
| 315 | 
            +
                    segments: 
         | 
| 316 | 
            +
                    - 1
         | 
| 317 | 
            +
                    - 5
         | 
| 318 | 
            +
                    - 2
         | 
| 319 | 
            +
                    version: 1.5.2
         | 
| 320 | 
            +
              name: jeweler
         | 
| 321 | 
            +
              version_requirements: *id019
         | 
| 322 | 
            +
              prerelease: false
         | 
| 323 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 324 | 
            +
              type: :development
         | 
| 325 | 
            +
              requirement: &id020 !ruby/object:Gem::Requirement 
         | 
| 326 | 
            +
                none: false
         | 
| 327 | 
            +
                requirements: 
         | 
| 328 | 
            +
                - - ">="
         | 
| 329 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 330 | 
            +
                    hash: 3
         | 
| 331 | 
            +
                    segments: 
         | 
| 332 | 
            +
                    - 0
         | 
| 333 | 
            +
                    version: "0"
         | 
| 334 | 
            +
              name: rcov
         | 
| 335 | 
            +
              version_requirements: *id020
         | 
| 336 | 
            +
              prerelease: false
         | 
| 337 | 
            +
            description: A simple plugin to persist image dimensions into mongoid document.
         | 
| 338 | 
            +
            email: aq1018@gmail.com
         | 
| 339 | 
            +
            executables: []
         | 
| 340 | 
            +
             | 
| 341 | 
            +
            extensions: []
         | 
| 342 | 
            +
             | 
| 343 | 
            +
            extra_rdoc_files: 
         | 
| 344 | 
            +
            - LICENSE.txt
         | 
| 345 | 
            +
            - README.rdoc
         | 
| 346 | 
            +
            files: 
         | 
| 347 | 
            +
            - .document
         | 
| 348 | 
            +
            - .rspec
         | 
| 349 | 
            +
            - Gemfile
         | 
| 350 | 
            +
            - LICENSE.txt
         | 
| 351 | 
            +
            - README.rdoc
         | 
| 352 | 
            +
            - Rakefile
         | 
| 353 | 
            +
            - VERSION
         | 
| 354 | 
            +
            - lib/mongoid_paperclip_image_dimension.rb
         | 
| 355 | 
            +
            - spec/mongoid_paperclip_image_dimension_spec.rb
         | 
| 356 | 
            +
            - spec/ruby.png
         | 
| 357 | 
            +
            - spec/spec_helper.rb
         | 
| 358 | 
            +
            has_rdoc: true
         | 
| 359 | 
            +
            homepage: http://github.com/aq1018/mongoid_paperclip_image_dimension
         | 
| 360 | 
            +
            licenses: 
         | 
| 361 | 
            +
            - MIT
         | 
| 362 | 
            +
            post_install_message: 
         | 
| 363 | 
            +
            rdoc_options: []
         | 
| 364 | 
            +
             | 
| 365 | 
            +
            require_paths: 
         | 
| 366 | 
            +
            - lib
         | 
| 367 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         | 
| 368 | 
            +
              none: false
         | 
| 369 | 
            +
              requirements: 
         | 
| 370 | 
            +
              - - ">="
         | 
| 371 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 372 | 
            +
                  hash: 3
         | 
| 373 | 
            +
                  segments: 
         | 
| 374 | 
            +
                  - 0
         | 
| 375 | 
            +
                  version: "0"
         | 
| 376 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 377 | 
            +
              none: false
         | 
| 378 | 
            +
              requirements: 
         | 
| 379 | 
            +
              - - ">="
         | 
| 380 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 381 | 
            +
                  hash: 3
         | 
| 382 | 
            +
                  segments: 
         | 
| 383 | 
            +
                  - 0
         | 
| 384 | 
            +
                  version: "0"
         | 
| 385 | 
            +
            requirements: []
         | 
| 386 | 
            +
             | 
| 387 | 
            +
            rubyforge_project: 
         | 
| 388 | 
            +
            rubygems_version: 1.5.2
         | 
| 389 | 
            +
            signing_key: 
         | 
| 390 | 
            +
            specification_version: 3
         | 
| 391 | 
            +
            summary: A simple plugin to persist image dimensions into mongoid document.
         | 
| 392 | 
            +
            test_files: 
         | 
| 393 | 
            +
            - spec/mongoid_paperclip_image_dimension_spec.rb
         | 
| 394 | 
            +
            - spec/spec_helper.rb
         |