asset_sync 2.17.0 → 2.18.1
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/CHANGELOG.md +20 -2
- data/README.md +1 -1
- data/lib/asset_sync/config.rb +12 -5
- data/lib/asset_sync/storage.rb +2 -2
- data/lib/asset_sync/version.rb +1 -1
- data/spec/unit/asset_sync_spec.rb +5 -0
- data/spec/unit/google_spec.rb +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb2743cc1cc656c27c392c0a4f6cd5cc07e57ed8dad28fc1ed9f01b268d6d42
|
4
|
+
data.tar.gz: 13067af05b7e16f1a12c62db2583f56ec5e995414d86e193110339efde7f8e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57189c1fb4dbd6edab1f5cc262f6ef420f144631adf69d03fc504218018de8765ce15e9d8e38e19eacf4eb825d3ec46b1311cf492939fc537c30554ba26dbd99
|
7
|
+
data.tar.gz: 56eba25178ac8ee2a51222bfbd46342dc8836e67d52ea255000a710a341b158bee5043969574d111779c589f9223137a2c9a4ed9a1a259adb595ddaa9fd87b40
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
8
8
|
### Added
|
9
9
|
|
10
|
-
-
|
10
|
+
- Nothing
|
11
11
|
|
12
12
|
### Changed
|
13
13
|
|
@@ -18,6 +18,22 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
18
18
|
- Nothing
|
19
19
|
|
20
20
|
|
21
|
+
## [2.18.1] - 2023-08-02
|
22
|
+
|
23
|
+
### Changed
|
24
|
+
|
25
|
+
- Respect explicitly set `Rails.application.config.assets.manifest`
|
26
|
+
(https://github.com/AssetSync/asset_sync/pull/434)
|
27
|
+
|
28
|
+
|
29
|
+
## [2.18.0] - 2023-01-30
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Add `google_auth` configuration option
|
34
|
+
(https://github.com/AssetSync/asset_sync/pull/432)
|
35
|
+
|
36
|
+
|
21
37
|
## [2.17.0] - 2023-01-13
|
22
38
|
|
23
39
|
### Added
|
@@ -1070,7 +1086,9 @@ Changes:
|
|
1070
1086
|
* Merge branch 'sinatra'
|
1071
1087
|
|
1072
1088
|
|
1073
|
-
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.
|
1089
|
+
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.18.1...HEAD
|
1090
|
+
[2.18.1]: https://github.com/AssetSync/asset_sync/compare/v2.18.0...v2.18.1
|
1091
|
+
[2.18.0]: https://github.com/AssetSync/asset_sync/compare/v2.17.0...v2.18.0
|
1074
1092
|
[2.17.0]: https://github.com/AssetSync/asset_sync/compare/v2.16.0...v2.17.0
|
1075
1093
|
[2.16.0]: https://github.com/AssetSync/asset_sync/compare/v2.15.3...v2.16.0
|
1076
1094
|
[2.15.3]: https://github.com/AssetSync/asset_sync/compare/v2.15.2...v2.15.3
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
[](http://badge.fury.io/rb/asset_sync)
|
3
|
-
[](https://github.com/AssetSync/asset_sync/actions/workflows/tests.yaml)
|
4
4
|
[](https://coveralls.io/r/AssetSync/asset_sync)
|
5
5
|
|
6
6
|
|
data/lib/asset_sync/config.rb
CHANGED
@@ -56,6 +56,7 @@ module AssetSync
|
|
56
56
|
attr_accessor :rackspace_username, :rackspace_api_key, :rackspace_auth_url
|
57
57
|
|
58
58
|
# Google Storage
|
59
|
+
attr_accessor :google_auth # when using generic auth (like access tokens)
|
59
60
|
attr_accessor :google_storage_secret_access_key, :google_storage_access_key_id # when using S3 interop
|
60
61
|
attr_accessor :google_json_key_location # when using service accounts
|
61
62
|
attr_accessor :google_json_key_string # when using service accounts
|
@@ -81,7 +82,7 @@ module AssetSync
|
|
81
82
|
validates :rackspace_api_key, :presence => true, :if => :rackspace?
|
82
83
|
validates :google_storage_secret_access_key, :presence => true, :if => :google_interop?
|
83
84
|
validates :google_storage_access_key_id, :presence => true, :if => :google_interop?
|
84
|
-
validates :google_project, :presence => true, :if =>
|
85
|
+
validates :google_project, :presence => true, :if => -> (c) { c.google_auth || c.google_service_account? }
|
85
86
|
validate(:if => :google_service_account?) do
|
86
87
|
unless google_json_key_location.present? || google_json_key_string.present?
|
87
88
|
errors.add(:base, 'must provide either google_json_key_location or google_json_key_string if using Google service account')
|
@@ -116,9 +117,13 @@ module AssetSync
|
|
116
117
|
end
|
117
118
|
|
118
119
|
def manifest_path
|
119
|
-
|
120
|
+
if defined?(ActionView) && ActionView::Base.respond_to?(:assets_manifest)
|
121
|
+
::Rails.application.config.assets.manifest
|
122
|
+
else
|
123
|
+
directory =
|
120
124
|
::Rails.application.config.assets.manifest || default_manifest_directory
|
121
|
-
|
125
|
+
File.join(directory, "manifest.yml")
|
126
|
+
end
|
122
127
|
end
|
123
128
|
|
124
129
|
def gzip?
|
@@ -162,7 +167,7 @@ module AssetSync
|
|
162
167
|
end
|
163
168
|
|
164
169
|
def google_interop?
|
165
|
-
google? && google_json_key_location.nil? && google_json_key_string.nil?
|
170
|
+
google? && google_auth.nil? && google_json_key_location.nil? && google_json_key_string.nil?
|
166
171
|
end
|
167
172
|
|
168
173
|
def google_service_account?
|
@@ -310,7 +315,9 @@ module AssetSync
|
|
310
315
|
options.merge!({ :rackspace_region => fog_region }) if fog_region
|
311
316
|
options.merge!({ :rackspace_auth_url => rackspace_auth_url }) if rackspace_auth_url
|
312
317
|
elsif google?
|
313
|
-
if
|
318
|
+
if google_auth
|
319
|
+
options.merge!({:google_auth => google_auth, :google_project => google_project})
|
320
|
+
elsif google_json_key_location
|
314
321
|
options.merge!({:google_json_key_location => google_json_key_location, :google_project => google_project})
|
315
322
|
elsif google_json_key_string
|
316
323
|
options.merge!({:google_json_key_string => google_json_key_string, :google_project => google_project})
|
data/lib/asset_sync/storage.rb
CHANGED
@@ -59,7 +59,7 @@ module AssetSync
|
|
59
59
|
return [] unless self.config.include_manifest
|
60
60
|
|
61
61
|
if ActionView::Base.respond_to?(:assets_manifest)
|
62
|
-
manifest = Sprockets::Manifest.new(ActionView::Base.assets_manifest.environment, ActionView::Base.assets_manifest.dir)
|
62
|
+
manifest = Sprockets::Manifest.new(ActionView::Base.assets_manifest.environment, ActionView::Base.assets_manifest.dir, self.config.manifest_path)
|
63
63
|
manifest_path = manifest.filename
|
64
64
|
else
|
65
65
|
manifest_path = self.config.manifest_path
|
@@ -139,7 +139,7 @@ module AssetSync
|
|
139
139
|
if self.config.manifest
|
140
140
|
if ActionView::Base.respond_to?(:assets_manifest)
|
141
141
|
log "Using: Rails 4.0 manifest access"
|
142
|
-
manifest = Sprockets::Manifest.new(ActionView::Base.assets_manifest.environment, ActionView::Base.assets_manifest.dir)
|
142
|
+
manifest = Sprockets::Manifest.new(ActionView::Base.assets_manifest.environment, ActionView::Base.assets_manifest.dir, self.config.manifest_path)
|
143
143
|
return manifest.assets.values.map { |f| File.join(self.config.assets_prefix, f) }
|
144
144
|
elsif File.exist?(self.config.manifest_path)
|
145
145
|
log "Using: Manifest #{self.config.manifest_path}"
|
data/lib/asset_sync/version.rb
CHANGED
@@ -258,6 +258,11 @@ describe AssetSync do
|
|
258
258
|
Rails.application.config.assets.prefix = 'custom_assets'
|
259
259
|
expect(AssetSync.config.manifest_path).to match(/public\/custom_assets\/manifest.yml/)
|
260
260
|
end
|
261
|
+
|
262
|
+
it "config.manifest_path should point to explicit path" do
|
263
|
+
Rails.application.config.assets.manifest = 'config/manifest.json'
|
264
|
+
expect(AssetSync.config.manifest_path).to start_with('config/manifest.json')
|
265
|
+
end
|
261
266
|
end
|
262
267
|
|
263
268
|
describe 'with cache_asset_regexps' do
|
data/spec/unit/google_spec.rb
CHANGED
@@ -38,6 +38,30 @@ describe AssetSync do
|
|
38
38
|
expect(AssetSync.config.manifest).to be_falsey
|
39
39
|
end
|
40
40
|
|
41
|
+
describe "when using user-specified google credentials" do
|
42
|
+
before(:each) do
|
43
|
+
AssetSync.configure do |config|
|
44
|
+
config.google_auth = "access-token"
|
45
|
+
config.google_project = 'a-google-project-name'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should configure google_auth" do
|
50
|
+
expect(AssetSync.config.google_auth).to eq("access-token")
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should return the correct fog_options" do
|
54
|
+
expected_fog_options = { google_auth: "access-token",
|
55
|
+
google_project: 'a-google-project-name',
|
56
|
+
provider: "Google"}
|
57
|
+
expect(AssetSync.config.fog_options).to eq(expected_fog_options)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should not require that other parameters be set" do
|
61
|
+
expect(AssetSync.config.valid?).to eq(true)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
41
65
|
describe "when using S3 interop API" do
|
42
66
|
before(:each) do
|
43
67
|
AssetSync.configure do |config|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asset_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Hamilton
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-
|
14
|
+
date: 2023-08-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fog-core
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
rubygems_version: 3.4.
|
291
|
+
rubygems_version: 3.4.17
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Synchronises Assets in a Rails 3 application and Amazon S3/Cloudfront and
|