filestack-rails 5.2.2 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +7 -0
- data/app/helpers/filestack_rails/application_helper.rb +11 -10
- data/lib/filestack-rails.rb +2 -0
- data/lib/filestack_rails/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 57781b6e2ebf56ea89b081d980cabb546988db87d5c64a4665119936ce9b961e
|
4
|
+
data.tar.gz: 5fa1201d2a7d62db01233c4ceab7d2e3fba046604258e42c12e8fe35a2571472
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83d3041077e970fc428aed7767b873f8834310149c50070c2a70a6e9c64ca0ad0c93cccfdf0253636c082d2fcb214bae203c2c5a70250ea3b41652812e7cb25b
|
7
|
+
data.tar.gz: da87059aa68c5c4c7daea24185d588b4fe6a33d594bb20c4b6c7faf90ecc7c250f622aaef9520c6934009171a8f054d37db5c254b22cd6f0707761e31ce0de6f
|
data/README.md
CHANGED
@@ -188,6 +188,13 @@ You can also add attributes to `image_tag`, for instance:
|
|
188
188
|
<%= filestack_image @user.filepicker_url, size: "160x100", alt: "Picture" %>
|
189
189
|
```
|
190
190
|
|
191
|
+
### Fetching a converted Filestack image URL with Filestack Transformations:
|
192
|
+
The `filestack_image_url` method accepts the original Filestack image URL and an optional `filestack_transform` chain:
|
193
|
+
|
194
|
+
```erb
|
195
|
+
<%= image_tag @user.filepicker_url, data: { transformed_image_url: filestack_image_url(@user.filepicker_url, filestack_transform.resize(width: 100, height: 100).flip.enhance) } %>
|
196
|
+
```
|
197
|
+
|
191
198
|
## Migrating from 2.x to 3.x
|
192
199
|
Filestack::Rails 3.x is a significant and breaking change. Users wishing to upgrade will need to change their current implementation in order to use the plugin correctly.
|
193
200
|
|
@@ -29,14 +29,15 @@ module FilestackRails
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def filestack_image(url, options = {})
|
32
|
-
transform_object = options
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
transform_object = options.delete(:transform)
|
33
|
+
|
34
|
+
image_tag(filestack_image_url(url, transform_object), options)
|
35
|
+
end
|
36
|
+
|
37
|
+
def filestack_image_url(url, transform_object = nil)
|
38
|
+
return url unless transform_object
|
39
|
+
transform_object.add_external_url(url)
|
40
|
+
transform_object.fs_url
|
40
41
|
end
|
41
42
|
|
42
43
|
private
|
@@ -78,11 +79,11 @@ module FilestackRails
|
|
78
79
|
signature = security.signature
|
79
80
|
policy = security.policy
|
80
81
|
end
|
81
|
-
[
|
82
|
+
[policy, signature]
|
82
83
|
end
|
83
84
|
|
84
85
|
def get_policy_and_signature_string
|
85
|
-
|
86
|
+
policy, signature = get_policy_and_signature
|
86
87
|
|
87
88
|
if policy && signature
|
88
89
|
get_filestack_js.security(signature, policy)
|
data/lib/filestack-rails.rb
CHANGED
@@ -3,6 +3,8 @@ require "filestack_rails/transform"
|
|
3
3
|
require "filestack_rails/engine"
|
4
4
|
require "filestack_rails/version"
|
5
5
|
require "filestack_rails/filestack_js"
|
6
|
+
require_relative "../app/helpers/filestack_rails/application_helper"
|
7
|
+
require_relative "../app/helpers/filestack_rails/form_helper"
|
6
8
|
|
7
9
|
module FilestackRails
|
8
10
|
# Your code goes here...
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filestack-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- filestack
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -123,7 +123,7 @@ homepage: https://www.filestack.com
|
|
123
123
|
licenses:
|
124
124
|
- MIT
|
125
125
|
metadata: {}
|
126
|
-
post_install_message:
|
126
|
+
post_install_message:
|
127
127
|
rdoc_options: []
|
128
128
|
require_paths:
|
129
129
|
- lib
|
@@ -138,9 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
|
-
|
142
|
-
|
143
|
-
signing_key:
|
141
|
+
rubygems_version: 3.0.8
|
142
|
+
signing_key:
|
144
143
|
specification_version: 4
|
145
144
|
summary: Filestack plugin for Rails 4+
|
146
145
|
test_files: []
|