resizing 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c8ecf4598b27e0ca9c1642528088309c47c24fc97142e4b9cadf25afbdc2a30
4
- data.tar.gz: 785a077d0131e4ee4539e6dda3ab81721189d27f52b2744e240c8d23a2cf2667
3
+ metadata.gz: eb32d1508fefd67920f7aa1907bc96ee53efc82bedc2229e1e00c403b4754350
4
+ data.tar.gz: 1e0a0064be4addee16b1bf802c8716aa7c28c4a8091f56e459fda5605a2787dd
5
5
  SHA512:
6
- metadata.gz: 388d1e9a3279644e08bdc524194649fbb4b59b432f10808420397a0a8bff97341c59559c4eb77f75f6e0a9b8a4efdf070c19d0e44d821ebd68bd23d993f29623
7
- data.tar.gz: a708c2ade0ecde5812e5232ff064f1704f5e5e79b1d2640fcc1b47b658528e0c19fbb68d4be13fe74b69cf02a95f142fc4e937a8ec6d092da187e3b93a3920c2
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
- case processor.first
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 = processor.first.to_s.gsub(/resize_to_/, '')
115
- { c: name, w: processor.second.first, h: processor.second.second }
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, "#{processor.first} is not supported. #{processor.inspect}"
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resizing
4
- VERSION = '0.1.4'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.4
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-08 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday