resizing 0.1.4 → 0.2.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.
- checksums.yaml +4 -4
 - data/lib/resizing/carrier_wave.rb +13 -4
 - data/lib/resizing/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: eb32d1508fefd67920f7aa1907bc96ee53efc82bedc2229e1e00c403b4754350
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1e0a0064be4addee16b1bf802c8716aa7c28c4a8091f56e459fda5605a2787dd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 0351e00f90c8373822c2087668df8c39469d2b1fc3b53ce573da0db16e8bbebf4dad806757e3ff61a2f6a6b93d9bbbf45755e0a1aee34d7ed94419134262d180
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 659d6bf48bbffbc6403e4a8550ae1f9b16104b6a72d8b32ecc5769233263cc2931dc4d77c21796d46c1d36e453bba1d23c8e108a0debcb69c8aace9b7cb3504b
         
     | 
| 
         @@ -109,12 +109,21 @@ module Resizing 
     | 
|
| 
       109 
109 
     | 
    
         | 
| 
       110 
110 
     | 
    
         
             
                # rubocop:disable Metrics/AbcSize
         
     | 
| 
       111 
111 
     | 
    
         
             
                def transform_string_from(processor)
         
     | 
| 
       112 
     | 
    
         
            -
                   
     | 
| 
      
 112 
     | 
    
         
            +
                  action = processor.first
         
     | 
| 
      
 113 
     | 
    
         
            +
                  value = processor.second
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                  case action
         
     | 
| 
       113 
116 
     | 
    
         
             
                  when :resize_to_fill, :resize_to_limit, :resize_to_fit
         
     | 
| 
       114 
     | 
    
         
            -
                    name =  
     | 
| 
       115 
     | 
    
         
            -
                    { c: name, w:  
     | 
| 
      
 117 
     | 
    
         
            +
                    name = action.to_s.gsub(/resize_to_/, '')
         
     | 
| 
      
 118 
     | 
    
         
            +
                    { c: name, w: value.first, h: value.second }
         
     | 
| 
      
 119 
     | 
    
         
            +
                  when :transformation
         
     | 
| 
      
 120 
     | 
    
         
            +
                    result = {}
         
     | 
| 
      
 121 
     | 
    
         
            +
                    result[:q] = value[:quality] if value[:quality]
         
     | 
| 
      
 122 
     | 
    
         
            +
                    result[:f] = value[:fetch_format] if value[:fetch_format]
         
     | 
| 
      
 123 
     | 
    
         
            +
                    result[:f] = value[:format] if value[:format]
         
     | 
| 
      
 124 
     | 
    
         
            +
                    result
         
     | 
| 
       116 
125 
     | 
    
         
             
                  else
         
     | 
| 
       117 
     | 
    
         
            -
                    raise NotImplementedError, "#{ 
     | 
| 
      
 126 
     | 
    
         
            +
                    raise NotImplementedError, "#{action} is not supported. #{processor.inspect}"
         
     | 
| 
       118 
127 
     | 
    
         
             
                  end.map do |key, value|
         
     | 
| 
       119 
128 
     | 
    
         
             
                    next nil if value.nil?
         
     | 
| 
       120 
129 
     | 
    
         | 
    
        data/lib/resizing/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: resizing
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Junichiro Kasuya
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2020-08- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-08-12 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: faraday
         
     |