anaconda 1.0.4 → 1.0.5
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 +4 -4
 - data/README.markdown +4 -1
 - data/lib/anaconda/anaconda.rb +1 -1
 - data/lib/anaconda/anaconda_for.rb +8 -2
 - data/lib/anaconda/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 901f5ceb0f88e31aff2a378a77a43846998338d9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: af0d6a7cc3f4d573422916bc93ccc924ed84b4a8
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 682cbdb2248ab87614384ed94272d51fc63d546bd3c37a42da9b9bec3ae2a773f464f76be9bf4836d830c3e224d1f9aa5ef70a64425d79ad71654ed0a37024e2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5909013183d5bef236972edd7d38d36906cfb3f6cff6e7d3874b526071b98d7546336980915d21f98e8e05e97265b39c116fd99587162062396b97225d739e58
         
     | 
    
        data/README.markdown
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Dead simple direct-to-s3 file uploading for your rails app.
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
            Current Version: 1.0. 
     | 
| 
      
 5 
     | 
    
         
            +
            Current Version: 1.0.4
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            ## Installation
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
         @@ -202,6 +202,9 @@ If you return false to the following events it will prevent the default behavior 
     | 
|
| 
       202 
202 
     | 
    
         
             
            From version 1.0.0 on we have used [Semantic Versioning](http://semver.org/).
         
     | 
| 
       203 
203 
     | 
    
         | 
| 
       204 
204 
     | 
    
         
             
            ## Changelog
         
     | 
| 
      
 205 
     | 
    
         
            +
            * 1.0.5
         
     | 
| 
      
 206 
     | 
    
         
            +
              * Fix bug where we were generating the same base_key for all instances if you didn't define a custom method
         
     | 
| 
      
 207 
     | 
    
         
            +
              
         
     | 
| 
       205 
208 
     | 
    
         
             
            * 1.0.4
         
     | 
| 
       206 
209 
     | 
    
         
             
              * Add `anaconda_form_data_for()` and `anaconda_form_data_for_all_columns` instance methods that return the raw data needed to upload to AWS
         
     | 
| 
       207 
210 
     | 
    
         | 
    
        data/lib/anaconda/anaconda.rb
    CHANGED
    
    
| 
         @@ -36,7 +36,7 @@ module Anaconda 
     | 
|
| 
       36 
36 
     | 
    
         
             
                      acl: "public-read",
         
     | 
| 
       37 
37 
     | 
    
         
             
                      max_file_size: 500.megabytes,
         
     | 
| 
       38 
38 
     | 
    
         
             
                      allowed_file_types: [],
         
     | 
| 
       39 
     | 
    
         
            -
                      base_key: "#{ 
     | 
| 
      
 39 
     | 
    
         
            +
                      base_key: "#{anaconda_column}_anaconda_default_base_key".to_sym,
         
     | 
| 
       40 
40 
     | 
    
         
             
                      host: false,
         
     | 
| 
       41 
41 
     | 
    
         
             
                      protocol: "http",
         
     | 
| 
       42 
42 
     | 
    
         
             
                      remove_previous_s3_files_on_change: true,
         
     | 
| 
         @@ -77,7 +77,9 @@ module Anaconda 
     | 
|
| 
       77 
77 
     | 
    
         
             
                      when :url
         
     | 
| 
       78 
78 
     | 
    
         
             
                        anaconda_url(checking_column, *args)
         
     | 
| 
       79 
79 
     | 
    
         
             
                      when :download_url
         
     | 
| 
       80 
     | 
    
         
            -
                        anaconda_download_url(checking_column) 
     | 
| 
      
 80 
     | 
    
         
            +
                        anaconda_download_url(checking_column)
         
     | 
| 
      
 81 
     | 
    
         
            +
                      when :anaconda_default_base_key
         
     | 
| 
      
 82 
     | 
    
         
            +
                        anaconda_default_base_key_for(checking_column)
         
     | 
| 
       81 
83 
     | 
    
         
             
                      else
         
     | 
| 
       82 
84 
     | 
    
         
             
                        super
         
     | 
| 
       83 
85 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -145,6 +147,10 @@ module Anaconda 
     | 
|
| 
       145 
147 
     | 
    
         
             
                    end
         
     | 
| 
       146 
148 
     | 
    
         
             
                  end
         
     | 
| 
       147 
149 
     | 
    
         | 
| 
      
 150 
     | 
    
         
            +
                  def anaconda_default_base_key_for(column_name)
         
     | 
| 
      
 151 
     | 
    
         
            +
                    "#{self.class.to_s.pluralize.downcase}/#{column_name.to_s.pluralize}/#{(0...32).map{(65+rand(26)).chr}.join.downcase}"
         
     | 
| 
      
 152 
     | 
    
         
            +
                  end
         
     | 
| 
      
 153 
     | 
    
         
            +
                  
         
     | 
| 
       148 
154 
     | 
    
         
             
                  def anaconda_remove_previous_s3_files_on_change_or_destroy
         
     | 
| 
       149 
155 
     | 
    
         | 
| 
       150 
156 
     | 
    
         
             
                    if self.destroyed?
         
     | 
    
        data/lib/anaconda/version.rb
    CHANGED