shrine-cloudimage 0.2.0 → 0.3.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: a276745ba3cbba20a4a04c21cd3920ececf68924ce41583a4be2f2968507eaab
4
- data.tar.gz: e3b43a01bfd7013e1469970346536b336dd70c364b0a1e6ae41a5ca63c81a84f
3
+ metadata.gz: 47631c954bd2286f3cbaf52502141bcf48860c87d07fd1dd162b0c33caa73c48
4
+ data.tar.gz: d51da54f1aea08f9d70f1e7f220dce85d0ca7d54d1239161d53ea61e0c937e32
5
5
  SHA512:
6
- metadata.gz: ef40813ee89adbffaab70059e4c98d16fa67994d2841f8352782af10eac6516966b4c78216467ad8aa528864bfb3a45a2ca01f55cc7baa478edeee0bc70a4bef
7
- data.tar.gz: 8b61a11ac7328fa8ad04d04f3d0f0383a2569e87f8c3e84d61c01f9cc9e69830a1ae6527f39a873e1b4c1429207547fe17013db6e3f860170f9f0b2eb8ce4dcf
6
+ metadata.gz: 7be4964fb9700c3fc529b2fff6e38124ff9dc7fdb3d0ca3e73f726269781b6337166abf09030e674426c7cdd9669d35166f0393abe0185974aa0bc7bff6eb146
7
+ data.tar.gz: 8e6825463a1a8b5fde9db550a2cab88442d64fd1160b9c36181cf09648f17903523b10b4e296574bccdf16b3b64068964b0ba9897ae7f314fe262db7aed66d93
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.2.0](https://github.com/janklimo/shrine-cloudimage/tree/v0.2.0) (2020-08-02)
4
+
5
+ [Full Changelog](https://github.com/janklimo/shrine-cloudimage/compare/v0.1.1...v0.2.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Trigger invalidation API when deleting the file [\#4](https://github.com/janklimo/shrine-cloudimage/pull/4) ([janklimo](https://github.com/janklimo))
10
+
11
+ ## [v0.1.1](https://github.com/janklimo/shrine-cloudimage/tree/v0.1.1) (2020-07-19)
12
+
13
+ [Full Changelog](https://github.com/janklimo/shrine-cloudimage/compare/v0.1.0...v0.1.1)
14
+
3
15
  ## [v0.1.0](https://github.com/janklimo/shrine-cloudimage/tree/v0.1.0) (2020-07-12)
4
16
 
5
17
  [Full Changelog](https://github.com/janklimo/shrine-cloudimage/compare/57c0bb934bb097eeb301166b404d1cc94181e396...v0.1.0)
data/README.md CHANGED
@@ -10,6 +10,7 @@ Supports Ruby `2.4` and above, `JRuby`, and `TruffleRuby`.
10
10
  - [Installation](#installation)
11
11
  - [Configuration](#configuration)
12
12
  - [Usage](#usage)
13
+ - [`srcset` generation](#srcset-generation)
13
14
  - [Invalidation API](#invalidation-api)
14
15
  - [Development](#development)
15
16
  - [Contributing](#contributing)
@@ -72,6 +73,15 @@ uri.w(200).h(400).to_url
72
73
  # => "https://token.cloudimg.io/v7/assets/image.png?h=400&w=200"
73
74
  ```
74
75
 
76
+ ### `srcset` generation
77
+
78
+ Generate `srcset` for a `Shrine::UploadedFile` object by calling `#cloudimage_srcset`:
79
+
80
+ ```ruby
81
+ photo.image.cloudimage_srcset(blur: 5)
82
+ # => "https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=100 100w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=170 170w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=280 280w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=470 470w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=780 780w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=1300 1300w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=2170 2170w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=3620 3620w, https://token.cloudimg.io/v7/assets/image.jpg?blur=5&w=5760 5760w"
83
+ ```
84
+
75
85
  ### Invalidation API
76
86
 
77
87
  Set `:invalidate` to `true` if you want images to be automatically
@@ -29,6 +29,10 @@ class Shrine
29
29
  cloudimage_client.path(url).to_url(**options)
30
30
  end
31
31
 
32
+ def cloudimage_srcset(**options)
33
+ cloudimage_client.path(url).to_srcset(**options)
34
+ end
35
+
32
36
  def delete
33
37
  super
34
38
  cloudimage_invalidate if cloudimage_invalidate?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shrine-cloudimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Klimo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-02 00:00:00.000000000 Z
11
+ date: 2020-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cloudimage
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '0.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.3'
26
+ version: '0.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: shrine
29
29
  requirement: !ruby/object:Gem::Requirement