filestack-rails 5.5.3 → 5.5.4

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: a071e2614a083a0d56ca152abbeec69f3c034cce0c58a6b0bf6b77d0382fa884
4
- data.tar.gz: a0427771d08e55f7ff639b26114c4dff505085e7022974108a7ac4ee1264b7b3
3
+ metadata.gz: edbd5530dcccdbad550f092c4847a34cd3725ce5c56b1a85ac95d9f77381aea3
4
+ data.tar.gz: b3516d62ee5eed53f42852a1d0f5ce69d2ae414b8a382f3c162156c25cca35b6
5
5
  SHA512:
6
- metadata.gz: a4b13e3c374f6f204ce83a057965b7c2bf5351c1d72d5d87baa38ccad6205a736e568e08b0e328985209c9c3f55e577967fc4a7dda59af0a728f3d4c8562f6a4
7
- data.tar.gz: b05da66067e2eda6433c160e65d3736d83eced370d5a98b1efd6a7bdee1de64bcf88ff0df05ecc254f4a274cbc1462c281ff2251b8989e56625347a8d50e8ddb
6
+ metadata.gz: e80e5ac5d67a8af19f4669432f4bde167b39ddfafce395dd5b4cea5b2e3d92778310020e4872711097608d9ac9b5d6f6fe123b858f2469b7ff3dbc035f670189
7
+ data.tar.gz: 58973ec991cc9317f35d80df5d08eab6615ead3aa88dde58d82b1d2017bfd467ee125bd65a856f05d0a8c8b6159cab4233a629ee17867465abbbe2b74a652263
@@ -10,8 +10,21 @@ module FilestackRails
10
10
 
11
11
  def filestack_js_init_tag
12
12
  client_name, apikey = get_client_and_api_key
13
- signature_and_policy = get_policy_and_signature_string
14
- javascript_string = "var #{client_name} = filestack.init('#{apikey}', #{signature_and_policy}, '#{cname}');"
13
+ javascript_string =
14
+ if filestack_js_v3?
15
+ options = { cname: cname }
16
+ policy, signature = get_policy_and_signature
17
+ if policy && signature
18
+ options[:security] = {
19
+ policy: policy,
20
+ signature: signature
21
+ }
22
+ end
23
+ "var #{client_name} = filestack.init('#{apikey}', #{options.to_json});"
24
+ else
25
+ signature_and_policy = get_policy_and_signature_string
26
+ "var #{client_name} = filestack.init('#{apikey}', #{signature_and_policy}, '#{cname}');"
27
+ end
15
28
  javascript_tag javascript_string
16
29
  end
17
30
 
@@ -42,6 +55,10 @@ module FilestackRails
42
55
 
43
56
  private
44
57
 
58
+ def filestack_js_v3?
59
+ get_filestack_js.version.to_s[0] == '3'
60
+ end
61
+
45
62
  def cname
46
63
  ::Rails.application.config.filestack_rails.cname
47
64
  end
@@ -1,3 +1,3 @@
1
1
  module FilestackRails
2
- VERSION = '5.5.3'
2
+ VERSION = '5.5.4'
3
3
  end
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.5.3
4
+ version: 5.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - filestack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-18 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -106,6 +106,20 @@ dependencies:
106
106
  - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: sprockets-rails
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
109
123
  description: Allows easy integraiton of Filestack's File Picker through dynamic button
110
124
  tags and form helpers
111
125
  email:
@@ -144,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
158
  - !ruby/object:Gem::Version
145
159
  version: '0'
146
160
  requirements: []
147
- rubygems_version: 3.1.2
161
+ rubygems_version: 3.5.3
148
162
  signing_key:
149
163
  specification_version: 4
150
164
  summary: Filestack plugin for Rails 4+